TExcelTAD

Geometric Proofs

A proof is a chain of statements, each justified by a definition, a given fact or an earlier result, that ends at the thing you wanted to show. Geometry is where most people first meet proofs, and the habit carries straight into programming: a proof is to a theorem what a careful argument for correctness is to an algorithm. This lesson writes three classic proofs in the two-column format and shows what code can and cannot do to help.

The two-column format

The left column holds statements, the right column holds the reason for each. Allowed reasons are:

  • Given facts from the problem;
  • definitions (a midpoint splits a segment into two equal parts, a right angle is 90°, …);
  • postulates, facts accepted without proof (through a point not on a line there is exactly one parallel line; angles on a straight line add up to 180°);
  • theorems already proved (vertical angles are equal, SAS congruence, the parallel-line angle rules from Lines and Angles).

A warm-up. Theorem: vertical angles are equal. Lines cross, forming angles 1, 2, 3 around the point, with 1 and 3 opposite.

Statement Reason
1. ∠1+∠2=180∘\angle 1 + \angle 2 = 180^\circ angles on a straight line (linear pair)
2. ∠2+∠3=180∘\angle 2 + \angle 3 = 180^\circ angles on a straight line (linear pair)
3. ∠1+∠2=∠2+∠3\angle 1 + \angle 2 = \angle 2 + \angle 3 both equal 180° (steps 1, 2)
4. ∠1=∠3\angle 1 = \angle 3 subtract ∠2\angle 2 from both sides

Proof 1: the angles of a triangle add up to 180°

Given: △ABC\triangle ABC. Prove: ∠A+∠B+∠C=180∘\angle A + \angle B + \angle C = 180^\circ.

Construction: through CC draw the line ℓ\ell parallel to AB‾\overline{AB}. Call the angles that ℓ\ell makes with CA‾\overline{CA} and CB‾\overline{CB}, on either side of CC, ∠x\angle x (next to CA‾\overline{CA}) and ∠y\angle y (next to CB‾\overline{CB}).

Statement Reason
1. ℓ∥AB‾\ell \parallel \overline{AB} through CC parallel postulate (construction)
2. ∠x=∠A\angle x = \angle A alternate interior angles, transversal AC‾\overline{AC}
3. ∠y=∠B\angle y = \angle B alternate interior angles, transversal BC‾\overline{BC}
4. ∠x+∠C+∠y=180∘\angle x + \angle C + \angle y = 180^\circ the three angles at CC make a straight line along ℓ\ell
5. ∠A+∠C+∠B=180∘\angle A + \angle C + \angle B = 180^\circ substitute steps 2 and 3 into step 4

This proof depends on the parallel postulate. On a sphere, where there are no parallel lines, a triangle's angles add up to more than 180°, which matters for flight paths and the map distances in Map Distances and the Haversine Formula.

Proof 2: the isosceles triangle theorem

Given: △ABC\triangle ABC with AB=ACAB = AC. Prove: ∠B=∠C\angle B = \angle C (the base angles are equal).

Statement Reason
1. AB=ACAB = AC given
2. Let AD‾\overline{AD} bisect ∠A\angle A, with DD on BC‾\overline{BC} every angle has a bisector (construction)
3. ∠BAD=∠CAD\angle BAD = \angle CAD definition of an angle bisector
4. AD=ADAD = AD a segment equals itself (reflexive property)
5. △ABD≅△ACD\triangle ABD \cong \triangle ACD SAS (steps 1, 3, 4)
6. ∠B=∠C\angle B = \angle C corresponding parts of congruent triangles (CPCTC)

The same congruence also gives BD=DCBD = DC and ∠ADB=∠ADC=90∘\angle ADB = \angle ADC = 90^\circ, so the bisector from the apex is also the perpendicular bisector of the base.

Proof 3: Thales' theorem

Given: AB‾\overline{AB} is a diameter of a circle with centre OO, and CC is any other point on the circle. Prove: ∠ACB=90∘\angle ACB = 90^\circ.

Statement Reason
1. OA=OB=OCOA = OB = OC all are radii of the same circle
2. ∠OAC=∠OCA\angle OAC = \angle OCA; call it α\alpha △OAC\triangle OAC is isosceles (step 1), isosceles triangle theorem
3. ∠OBC=∠OCB\angle OBC = \angle OCB; call it β\beta △OBC\triangle OBC is isosceles (step 1), isosceles triangle theorem
4. ∠ACB=α+β\angle ACB = \alpha + \beta ray CO→\overrightarrow{CO} splits ∠ACB\angle ACB into ∠OCA\angle OCA and ∠OCB\angle OCB
5. α+β+(α+β)=180∘\alpha + \beta + (\alpha + \beta) = 180^\circ angle sum of △ABC\triangle ABC (Proof 1), its angles are α\alpha, β\beta and α+β\alpha + \beta
6. α+β=90∘\alpha + \beta = 90^\circ, so ∠ACB=90∘\angle ACB = 90^\circ divide step 5 by 2, then step 4

Notice how Proof 3 reuses Proofs 1 and 2. Proven theorems are like library functions: once written and tested, you call them.

Evidence is not proof

Code can test a claim on many cases. That builds confidence and finds mistakes, but no finite number of examples proves a statement about all triangles:

python · try it yourself
import numpy as np

def angles(P, Q, R):
    def ang(V, A, B):
        u, w = A - V, B - V
        return np.degrees(np.arccos(np.dot(u, w) / (np.linalg.norm(u) * np.linalg.norm(w))))
    return ang(P, Q, R), ang(Q, R, P), ang(R, P, Q)

rng = np.random.default_rng(7)
worst = 0.0
for _ in range(10_000):
    P, Q, R = rng.uniform(-10, 10, size=(3, 2))
    worst = max(worst, abs(sum(angles(P, Q, R)) - 180))
print("10,000 random triangles, largest error in the angle sum:", f"{worst:.1e}°")
10,000 random triangles, largest error in the angle sum: 4.1e-09°

The tiny errors come from floating-point rounding, largest in nearly flat triangles where arccos is very sensitive. A counterexample, on the other hand, disproves a claim with just one case. Claim: "a quadrilateral with equal diagonals is a rectangle." One isosceles trapezoid sinks it:

python · try it yourself
import math

trap = [(0, 0), (4, 0), (3, 2), (1, 2)]
d1, d2 = math.dist(trap[0], trap[2]), math.dist(trap[1], trap[3])
corner = (trap[1][0] - trap[0][0]) * (trap[3][0] - trap[0][0]) + (trap[1][1] - trap[0][1]) * (trap[3][1] - trap[0][1])
print("diagonals:", d1, d2, " equal?", d1 == d2)
print("dot product at corner A:", corner, "→ right angle?", corner == 0)
diagonals: 3.605551275463989 3.605551275463989  equal? True
dot product at corner A: 4 → right angle? False

Proof by algebra: coordinates and SymPy

A different style of proof places the figure on coordinates and lets algebra do the work. This one is a real proof, because the symbols stand for every case at once. Put the circle at the origin with radius rr, the diameter from (−r,0)(-r, 0) to (r,0)(r, 0), and CC at angle tt. Then ∠ACB=90∘\angle ACB = 90^\circ exactly when CA→⋅CB→=0\overrightarrow{CA} \cdot \overrightarrow{CB} = 0:

python · try it yourself
from sympy import symbols, cos, sin, simplify, Matrix

r, t = symbols("r t", positive=True)
A, B = Matrix([-r, 0]), Matrix([r, 0])
C = Matrix([r * cos(t), r * sin(t)])
CA, CB = A - C, B - C
print("CA · CB =", CA.dot(CB).expand())
print("simplified:", simplify(CA.dot(CB)))
CA · CB = r**2*sin(t)**2 + r**2*cos(t)**2 - r**2
simplified: 0

By hand: CA→⋅CB→=−r2(1−cos⁡2t)+r2sin⁡2t=0\overrightarrow{CA} \cdot \overrightarrow{CB} = -r^2(1 - \cos^2 t) + r^2 \sin^2 t = 0, using sin⁡2t+cos⁡2t=1\sin^2 t + \cos^2 t = 1 (see Trigonometric Identities).

In software

The same reasoning proves programs correct. A loop invariant is a statement that holds before and after every pass of a loop; proving it is an induction proof (Mathematical Induction). Property-based testing tools generate thousands of random inputs, exactly like the random-triangle check above: good at finding counterexamples, not a proof. Formal tools such as Lean and Coq check two-column-style proofs by machine.

Exercises

Exercise 1: The missing reason

In the proof of the triangle angle sum, what is the reason for "∠x=∠A\angle x = \angle A"? What would go wrong if ℓ\ell were not parallel to AB‾\overline{AB}?

Answer

Alternate interior angles formed by a transversal (AC‾\overline{AC}) cutting two parallel lines are equal. Without the parallel, the two angles need not be equal.

Solution

AC‾\overline{AC} crosses the parallel lines ℓ\ell and AB‾\overline{AB}, and ∠x\angle x and ∠A\angle A sit between them on opposite sides of AC‾\overline{AC}: alternate interior angles. The equality holds only because ℓ∥AB‾\ell \parallel \overline{AB}; tilt ℓ\ell by 5° and ∠x\angle x changes while ∠A\angle A does not.

Exercise 2: The exterior angle theorem

Write a two-column proof: in △ABC\triangle ABC, extend BC‾\overline{BC} past CC to a point DD. Prove that ∠ACD=∠A+∠B\angle ACD = \angle A + \angle B.

Answer

Both ∠ACD\angle ACD and ∠A+∠B\angle A + \angle B equal 180∘−∠ACB180^\circ - \angle ACB.

Solution
Statement Reason
1. ∠ACB+∠ACD=180∘\angle ACB + \angle ACD = 180^\circ BB, CC, DD lie on a line (linear pair)
2. ∠A+∠B+∠ACB=180∘\angle A + \angle B + \angle ACB = 180^\circ angle sum of a triangle
3. ∠ACB+∠ACD=∠A+∠B+∠ACB\angle ACB + \angle ACD = \angle A + \angle B + \angle ACB both equal 180°
4. ∠ACD=∠A+∠B\angle ACD = \angle A + \angle B subtract ∠ACB\angle ACB from both sides

Exercise 3: A parallelogram's diagonal

ABCDABCD is a parallelogram (AB‾∥DC‾\overline{AB} \parallel \overline{DC} and AD‾∥BC‾\overline{AD} \parallel \overline{BC}). Prove that the diagonal AC‾\overline{AC} splits it into two congruent triangles.

Answer

△ABC≅△CDA\triangle ABC \cong \triangle CDA by ASA.

Solution
Statement Reason
1. AB‾∥DC‾\overline{AB} \parallel \overline{DC}, AD‾∥BC‾\overline{AD} \parallel \overline{BC} given (definition of a parallelogram)
2. ∠BAC=∠DCA\angle BAC = \angle DCA alternate interior angles, AB‾∥DC‾\overline{AB} \parallel \overline{DC} with transversal AC‾\overline{AC}
3. ∠BCA=∠DAC\angle BCA = \angle DAC alternate interior angles, AD‾∥BC‾\overline{AD} \parallel \overline{BC} with transversal AC‾\overline{AC}
4. AC=CAAC = CA reflexive property
5. △ABC≅△CDA\triangle ABC \cong \triangle CDA ASA (steps 2, 4, 3)

As a bonus, CPCTC then gives AB=CDAB = CD and BC=DABC = DA: opposite sides of a parallelogram are equal.

Exercise 4: The centre of the hypotenuse

Use SymPy to prove that the midpoint MM of the hypotenuse of a right triangle with legs on the axes, A=(a,0)A = (a, 0), B=(0,b)B = (0, b), C=(0,0)C = (0, 0), is the same distance from all three corners.

Answer

All three squared distances equal (a2+b2)/4(a^2 + b^2)/4.

Solution
python · try it yourself
from sympy import symbols, Point, simplify

a, b = symbols("a b", positive=True)
A, B, C = Point(a, 0), Point(0, b), Point(0, 0)
M = A.midpoint(B)
print([simplify(M.distance(P) ** 2) for P in (A, B, C)])
[a**2/4 + b**2/4, a**2/4 + b**2/4, a**2/4 + b**2/4]

So MM is the centre of a circle through AA, BB and CC, and AB‾\overline{AB} is its diameter: the converse of Thales' theorem.

Exercise 5: Find a counterexample

Disprove: "Two rectangles with the same perimeter have the same area."

Answer

For example, 1×51 \times 5 and 3×33 \times 3 both have perimeter 12, but areas 5 and 9.

Solution
1×5:P=2(1+5)=12,A=53×3:P=2(3+3)=12,A=9\begin{aligned} 1 \times 5{:} &\quad P = 2(1 + 5) = 12, \quad A = 5 \\ 3 \times 3{:} &\quad P = 2(3 + 3) = 12, \quad A = 9 \end{aligned}

One counterexample is enough to show the claim is false.

Test yourself

In the isosceles triangle proof, which congruence test shows △ABD≅△ACD\triangle ABD \cong \triangle ACD?

  1. SSS
  2. ASA
  3. HL
  4. SAS

A program checks a geometry claim on one million random shapes and finds no failure. What has it shown?

  1. The claim is proved
  2. The claim is probably true, but it is not proved
  3. The claim is false
  4. Nothing at all

Which earlier results does the proof of Thales' theorem use?

  1. The isosceles triangle theorem and the triangle angle sum
  2. The Pythagorean theorem only
  3. Pick's theorem
  4. The SSA test