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. | angles on a straight line (linear pair) |
| 2. | angles on a straight line (linear pair) |
| 3. | both equal 180° (steps 1, 2) |
| 4. | subtract from both sides |
Proof 1: the angles of a triangle add up to 180°
Given: . Prove: .
Construction: through draw the line parallel to . Call the angles that makes with and , on either side of , (next to ) and (next to ).
| Statement | Reason |
|---|---|
| 1. through | parallel postulate (construction) |
| 2. | alternate interior angles, transversal |
| 3. | alternate interior angles, transversal |
| 4. | the three angles at make a straight line along |
| 5. | 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: with . Prove: (the base angles are equal).
| Statement | Reason |
|---|---|
| 1. | given |
| 2. Let bisect , with on | every angle has a bisector (construction) |
| 3. | definition of an angle bisector |
| 4. | a segment equals itself (reflexive property) |
| 5. | SAS (steps 1, 3, 4) |
| 6. | corresponding parts of congruent triangles (CPCTC) |
The same congruence also gives and , so the bisector from the apex is also the perpendicular bisector of the base.
Proof 3: Thales' theorem
Given: is a diameter of a circle with centre , and is any other point on the circle. Prove: .
| Statement | Reason |
|---|---|
| 1. | all are radii of the same circle |
| 2. ; call it | is isosceles (step 1), isosceles triangle theorem |
| 3. ; call it | is isosceles (step 1), isosceles triangle theorem |
| 4. | ray splits into and |
| 5. | angle sum of (Proof 1), its angles are , and |
| 6. , so | 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:
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:
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 , the diameter from to , and at angle . Then exactly when :
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: , using (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 ""? What would go wrong if were not parallel to ?
Answer
Alternate interior angles formed by a transversal () cutting two parallel lines are equal. Without the parallel, the two angles need not be equal.
Solution
crosses the parallel lines and , and and sit between them on opposite sides of : alternate interior angles. The equality holds only because ; tilt by 5° and changes while does not.
Exercise 2: The exterior angle theorem
Write a two-column proof: in , extend past to a point . Prove that .
Answer
Both and equal .
Solution
| Statement | Reason |
|---|---|
| 1. | , , lie on a line (linear pair) |
| 2. | angle sum of a triangle |
| 3. | both equal 180° |
| 4. | subtract from both sides |
Exercise 3: A parallelogram's diagonal
is a parallelogram ( and ). Prove that the diagonal splits it into two congruent triangles.
Answer
by ASA.
Solution
| Statement | Reason |
|---|---|
| 1. , | given (definition of a parallelogram) |
| 2. | alternate interior angles, with transversal |
| 3. | alternate interior angles, with transversal |
| 4. | reflexive property |
| 5. | ASA (steps 2, 4, 3) |
As a bonus, CPCTC then gives and : opposite sides of a parallelogram are equal.
Exercise 4: The centre of the hypotenuse
Use SymPy to prove that the midpoint of the hypotenuse of a right triangle with legs on the axes, , , , is the same distance from all three corners.
Answer
All three squared distances equal .
Solution
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 is the centre of a circle through , and , and 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, and both have perimeter 12, but areas 5 and 9.
Solution
One counterexample is enough to show the claim is false.
Test yourself
In the isosceles triangle proof, which congruence test shows ?
- SSS
- ASA
- HL
- SAS
A program checks a geometry claim on one million random shapes and finds no failure. What has it shown?
- The claim is proved
- The claim is probably true, but it is not proved
- The claim is false
- Nothing at all
Which earlier results does the proof of Thales' theorem use?
- The isosceles triangle theorem and the triangle angle sum
- The Pythagorean theorem only
- Pick's theorem
- The SSA test