Why prove what you can see?
A carpenter in Nairobi is building a door frame. She has cut the two long sides to the same length, and the two short sides to the same length, and joined them. Is the frame a true rectangle, with four right angles? She does not reach for a protractor. She measures the two diagonals with a tape. If they are equal, the frame is "square". Builders all over the world use this trick. But why does it work? Could a frame have equal diagonals and still be skewed?
Here is a second puzzle. A famous "proof" that every triangle is isosceles goes like this. Take any triangle . Let the bisector of the angle at meet the perpendicular bisector of at a point , drawn inside the triangle. Drop perpendiculars from to and . A few pairs of congruent triangles later, the argument concludes that . Every step seems to follow from the picture — and the conclusion is plainly false, since a triangle with sides , , is not isosceles.
The error is not in any calculation. It is in the picture: when , the point is never actually inside the triangle (we will see where it really is). This is why mathematicians prove geometric facts from stated assumptions, not from how a diagram looks. Euclid of Alexandria organised geometry this way around 300 BCE, and his Elements became the model of proof for two thousand years. In this lesson we will build up the main theorems about triangles and circles from a few axioms, see exactly where each axiom is used, and find out what happens when one of them is dropped.
The rules of the game
A proof in geometry is a chain of statements, each justified by an axiom, a definition or an earlier theorem. The diagram helps us think; it is never a reason.
Euclid began with five postulates. In modern words:
- Any two points can be joined by a straight line segment.
- A segment can be extended indefinitely.
- A circle can be drawn with any centre and any radius.
- All right angles are equal.
- If a line crossing two other lines makes the interior angles on one side add up to less than two right angles, then the two lines, extended far enough, meet on that side.
The fifth, the parallel postulate, is longer and less obvious than the others. For two thousand years mathematicians tried to prove it from the first four. They all failed, and in the 19th century it became clear why: it cannot be proved from them. We will come back to this.
Euclid's own list had gaps. He sometimes used facts that he never stated, such as "a line that enters a triangle through one side must leave through another". In 1899 David Hilbert gave a complete list of axioms for plane geometry, which fills those gaps. We will not list all of Hilbert's axioms. Instead we take as known the basic facts about points, lines, betweenness, lengths and angle measure that you have used for years, together with three things we state explicitly:
- Angles on a straight line add up to , and vertically opposite angles are equal.
- The SAS axiom (below). Euclid "proved" it by picking one triangle up and laying it on the other. That is really an assumption about rigid motions (see rigid motions, congruence and similarity), so Hilbert made it an axiom.
- The parallel postulate, in the form of Playfair's axiom.
Definitions
Definition— congruent triangles
Triangles and are congruent, written , if corresponding sides and corresponding angles are equal: , , , , and . The order of the letters records which vertex corresponds to which.
Definition— the SAS axiom
If , and the included angles are equal, , then .
From SAS one can prove two more congruence criteria (Euclid, Elements Book I, Propositions 8 and 26):
- ASA: two angles and the side between them determine the triangle;
- SSS: three sides determine the triangle.
From ASA and the angle sum of a triangle (proved below) follows AAS. But two famous combinations are not criteria: AAA only gives similar triangles (the same shape, perhaps a different size), and SSA fails, as we will see.
Definition— parallel lines
Two lines in a plane are parallel if they do not meet, however far they are extended.
Definition— Playfair's axiom (the parallel postulate)
Through a point not on a given line there is exactly one line parallel to the given line.
Playfair's axiom (popularised by John Playfair in 1795, though it was known much earlier) is equivalent to Euclid's fifth postulate, given the other axioms, and is easier to use.
When a line , a transversal, crosses two lines and , it makes eight angles. Two angles on opposite sides of and between and are called alternate angles.
Definition— circle words
A circle with centre and radius is the set of points at distance from . A chord joins two points of the circle; a diameter is a chord through . For a chord :
- the central angle is ;
- an inscribed angle is where is another point of the circle. Its vertex is on the circle and its sides are chords. We say it subtends the arc that does not contain .
Definition— perpendicular bisector and circumcentre
The perpendicular bisector of a segment is the line through the midpoint of perpendicular to . A circle through all three vertices of a triangle is its circumcircle, and its centre is the circumcentre.
Proofs with congruent triangles
The best way to learn to write geometric proofs is to read and write short ones. In each proof below, every step names its reason.
Example— The isosceles triangle theorem
Claim. If in triangle , then .
Proof. Compare triangle with itself, read in a different order: triangle . We have and (given), and the included angles and are the same angle. By SAS, . Corresponding angles are equal, so .
This elegant proof is credited to Pappus of Alexandria (4th century CE). Euclid's own proof (Book I, Proposition 5) uses a more complicated figure, and medieval students nicknamed it the pons asinorum, the "bridge of donkeys".
Example— Opposite sides of a parallelogram
A parallelogram is a quadrilateral with and .
Claim. In a parallelogram, and .
Proof. Draw the diagonal . Since and is a transversal, the alternate angles are equal: . Since , also . The side is shared. By ASA, , so and .
The step "alternate angles are equal" uses the parallel postulate; see the next section.
Example— The carpenter's diagonal test
Claim. If a parallelogram has equal diagonals, , then it is a rectangle.
Proof. Compare triangles and . They share the side , (opposite sides of a parallelogram, just proved) and (given). By SSS, , so . But , so these two angles are co-interior angles on the transversal and add up to . Two equal angles with sum are each . The opposite angles of a parallelogram are equal (by the congruence above), so all four angles are right angles.
So the carpenter is right, provided her frame is a parallelogram — which it is, because she made opposite sides equal. (A quadrilateral that does not cross itself and has both pairs of opposite sides equal is a parallelogram: draw the diagonal , use SSS to get , and then the equal alternate angles give by Proposition I.27 below.)
Example— A non-example: SSA
Two sides and an angle that is not between them do not determine a triangle. Put , , and . Then
- in both triangles and ;
- and ;
- the angle at is the same, because and lie on the same ray from .
But and , so the triangles are not congruent.
When exactly does this happen? Let the angle at be acute, let and , and let be the foot of the perpendicular from to the line through and , with . A point of that line has exactly when , by Pythagoras. So there is no such point if , one (namely , giving a right angle at ) if , and two, one on each side of , if . Both lie on the ray from exactly when , that is, when . So SSA gives two different triangles exactly when . If the angle at is right or obtuse, at most one point lies on the ray, so SSA does determine the triangle — a fact sometimes called the hypotenuse–leg (or RHS) criterion when the angle is right.
Parallel lines and the angle sum
The next theorem is proved without the parallel postulate. It rests on the exterior angle inequality (Euclid I.16): an exterior angle of a triangle is greater than each of the two interior angles not next to it. Euclid's proof of I.16 uses SAS and vertical angles, not the parallel postulate; we take it as known.
Theorem— Proposition (Euclid I.27)
If a transversal makes equal alternate angles with two lines, the lines are parallel.
Proof
Suppose the transversal crosses at and at , with equal alternate angles, and suppose and meet at a point . Then , , form a triangle. One of the two alternate angles is an interior angle of this triangle, and the other is an exterior angle at the other end of . By the exterior angle inequality, the exterior angle is greater than that interior angle — but they are equal. This contradiction shows that and do not meet.
∎
Theorem— Theorem (alternate angles)
If two parallel lines are crossed by a transversal, then alternate angles are equal.
Proof
Let , and let the transversal cross them at and . Through draw the line that makes an alternate angle with equal to the one at . By Proposition I.27, is parallel to . Now and are both lines through parallel to . By Playfair's axiom, there is only one, so , and the alternate angles made by are equal.
∎
Theorem— Theorem (angle sum of a triangle)
The angles of every triangle add up to .
Proof
Let the triangle be , with angles at , at and at . Through draw the line parallel to (it exists, and is unique, by Playfair's axiom). The line is a transversal of the parallel lines and , so the angle between and on the side of equals (alternate angles). In the same way, the angle between and on the other side equals . These two angles and fill the straight angle at along , so .
∎
Theorem— Corollaries
- Exterior angle theorem. An exterior angle of a triangle equals the sum of the two interior angles not next to it.
- Polygons. The interior angles of a convex polygon with sides add up to .
Proof
- The exterior angle at and lie on a straight line, so the exterior angle is .
- The diagonals from one vertex cut the polygon into triangles, whose angles together make up exactly the angles of the polygon. Each triangle contributes .
∎
Note
The exterior angle inequality (I.16) holds without the parallel postulate; the exterior angle theorem (an equality) needs it. On a sphere, where lines are great circles and there are no parallels at all, the angles of a triangle add up to more than . In the hyperbolic plane, where there are infinitely many parallels through a point, they add up to less. In fact, given the other axioms (including Archimedes' axiom about lengths), "every triangle has angle sum " is equivalent to the parallel postulate.
Circles: the inscribed angle theorem
Theorem— Inscribed angle theorem
An inscribed angle is half the central angle subtending the same arc: if , , lie on a circle with centre , and lies on the same side of the line as (or lies on ), then .
Proof
Case 1: the centre lies on a side of the inscribed angle, say on , so is a diameter. The triangle is isosceles, since (both are radii). By the isosceles triangle theorem, , say. The angle is an exterior angle of triangle (because , , lie on a line), so by the exterior angle theorem .
Case 2: the centre lies inside the angle . Draw the diameter through . It splits both angles: and . By Case 1, applied twice, and . Adding gives .
Case 3: the centre lies outside the angle (but on the same side of as ). Again draw the diameter . Now one angle is the difference of two, say and . Subtracting the two instances of Case 1 gives the result.
∎
If is on the other side of from , the same argument shows that is half the reflex central angle, . Three corollaries follow at once.
Theorem— Corollaries
- Thales' theorem. An angle inscribed in a semicircle is a right angle: if is a diameter and is on the circle, then .
- Angles in the same segment. Inscribed angles subtending the same arc are equal.
- Cyclic quadrilaterals. If the four vertices of a quadrilateral lie on a circle (in this order), its opposite angles add up to .
Proof
- The central angle is the straight angle , so .
- Each is half of the same central angle.
- and subtend the two arcs into which and cut the circle. Their central angles add up to , so the inscribed angles add up to .
∎
The circumcentre
Theorem— Lemma (the perpendicular bisector as a locus)
A point is equidistant from and if and only if lies on the perpendicular bisector of .
Proof
Let be the midpoint of . If there is nothing to prove, so let .
If is on the perpendicular bisector, then triangles and have , a common side , and right angles at . By SAS they are congruent, so .
Conversely, if , then triangles and have three equal sides, so by SSS they are congruent. Hence . These two angles lie on a straight line, so each is , and is the perpendicular bisector.
∎
Theorem— Theorem (circumcentre)
The three perpendicular bisectors of the sides of a triangle meet in a single point , and the circle with centre through passes through and .
Proof
First, the perpendicular bisectors of and meet. Suppose instead that they were parallel. The line is perpendicular to the first bisector, so it crosses it, and therefore (by Playfair's axiom) it also crosses the second; by the alternate angles theorem it is perpendicular to the second bisector as well. So and would both be perpendicular to the second bisector. Two lines perpendicular to the same line are parallel or equal (Proposition I.27), and and share the point , so they would be the same line: , , would be collinear, which is not a triangle. This step uses the parallel postulate.
Let be the meeting point. By the lemma, (as is on the bisector of ) and (as is on the bisector of ). So , and by the lemma again lies on the perpendicular bisector of . All three bisectors pass through , and is the radius of a circle through all three vertices.
∎
The parallel postulate really is needed here. In the hyperbolic plane there are triangles whose perpendicular bisectors never meet, so they have no circumcircle; in fact, given Hilbert's other axioms, "every triangle has a circumcircle" is equivalent to the parallel postulate. Farkas Bolyai, the father of János Bolyai, gave an attempted proof of the parallel postulate that relied, without noticing, on this equivalent statement.
Note
The isosceles "proof", resolved. The bisector of the angle at and the perpendicular bisector of do meet — but, unless , they meet on the circumcircle, at the midpoint of the arc that does not contain . That point is outside the triangle. When the figure is drawn correctly, one of the two feet of the perpendiculars from lands on a side and the other on an extended side, and the final step of the "proof" (adding equal pieces on one side, but subtracting them on the other) no longer gives . A careful proof would have had to justify where lies, and it cannot.
Euclid in Lean
Mathlib, Lean's mathematical library, does not start from Euclid's axioms. It builds the plane out of vectors: points can be subtracted to give displacement vectors, and an inner product (dot product) on the vectors gives lengths and angles. In this model Euclid's axioms are theorems. Here is Playfair's axiom, proved in Lean. (In Mathlib a line counts as parallel to itself, which is why the statement does not need .)
/-- **Playfair's axiom holds in the model.** Through a point `p` there is exactly one affine
subspace parallel to a given non-empty one `s` (for a line `s`: exactly one line through `p`
parallel to `s`). Mathlib's `s ∥ t` means that `t` is a translate of `s`, so a line counts as
parallel to itself. Existence: the translate of `s` through `p`, `mk' p s.direction`.
Uniqueness: a parallel `t` has the same direction as `s`, and an affine subspace is determined
by its direction and one of its points (`AffineSubspace.mk'_eq`). In Hilbert's axioms this is
an *axiom*; in the vector model it is a *theorem*. -/
theorem playfair (s : AffineSubspace ℝ P) (hs : s ≠ ⊥) (p : P) :
∃! t : AffineSubspace ℝ P, p ∈ t ∧ t ∥ s := by
have hne : AffineSubspace.mk' p s.direction ≠ ⊥ :=
(AffineSubspace.nonempty_iff_ne_bot _).1 ⟨p, AffineSubspace.self_mem_mk' p s.direction⟩
refine ⟨AffineSubspace.mk' p s.direction, ⟨AffineSubspace.self_mem_mk' p s.direction, ?_⟩, ?_⟩
· rw [AffineSubspace.parallel_iff_direction_eq_and_eq_bot_iff_eq_bot]
exact ⟨AffineSubspace.direction_mk' p s.direction, ⟨fun h => absurd h hne, fun h => absurd h hs⟩⟩
· rintro t ⟨hpt, hts⟩
rw [← hts.direction_eq]
exact (AffineSubspace.mk'_eq hpt).symmSo the angle sum theorem holds in the model. Mathlib proves it with vectors, not with Euclid's parallel line:
/-- **The angles of a triangle add up to `π` (180°).** This applies Mathlib's
`EuclideanGeometry.angle_add_angle_add_angle_eq_pi`. Mathlib proves it with vectors rather than
with Euclid's parallel line, but the parallel postulate is built into the vector model: it is
exactly what makes `playfair` above true. -/
theorem angle_sum (A B C : P) (hAB : B ≠ A) : ∠ A B C + ∠ B C A + ∠ C A B = π :=
angle_add_angle_add_angle_eq_pi C hABThe congruence criteria SAS and SSS are in Mathlib. The symbol ≅ means that the two lists of three points have all corresponding distances equal:
/-- **SAS.** Two sides and the included angle determine a triangle up to congruence. Applies
Mathlib's `EuclideanGeometry.side_angle_side` (proved there with the law of cosines). The
conclusion `![A, B, C] ≅ ![A', B', C']` says that *all* corresponding distances agree. -/
theorem sas {A B C A' B' C' : P} (hB : ∠ A B C = ∠ A' B' C') (hAB : dist A B = dist A' B')
(hBC : dist B C = dist B' C') : ![A, B, C] ≅ ![A', B', C'] :=
side_angle_side hB hAB hBC/-- **SSS.** Three sides determine a triangle up to congruence. Applies Mathlib's
`EuclideanGeometry.side_side_side`. -/
theorem sss {A B C A' B' C' : P} (hAB : dist A B = dist A' B') (hBC : dist B C = dist B' C')
(hCA : dist C A = dist C' A') : ![A, B, C] ≅ ![A', B', C'] :=
side_side_side hAB hBC hCAAnd SSA is genuinely false. The statement below is the negation of the would-be SSA criterion, proved with the coordinates of our example:
/-- **SSA is not a congruence criterion.** The would-be theorem "two sides and a *non-included*
angle determine the triangle" is false. Counterexample in the coordinate plane: `A = (0, 0)`,
`B = (4, 3)`, `C = (3, 0)`, `C' = (5, 0)`. Both triangles `ABC` and `ABC'` have `AB = 5`,
`BC = BC' = √10` and the same angle at `A` (since `C'` lies on the ray `AC`), but `AC = 3` and
`AC' = 5`. -/
theorem ssa_fails : ¬ ∀ A B C A' B' C' : EuclideanSpace ℝ (Fin 2),
∠ B A C = ∠ B' A' C' → dist A B = dist A' B' → dist B C = dist B' C' →
![A, B, C] ≅ ![A', B', C'] := by
intro h
set A : EuclideanSpace ℝ (Fin 2) := !₂[0, 0]
set B : EuclideanSpace ℝ (Fin 2) := !₂[4, 3]
set C : EuclideanSpace ℝ (Fin 2) := !₂[3, 0]
set C' : EuclideanSpace ℝ (Fin 2) := !₂[5, 0]
-- `C' - A` is a positive multiple of `C - A`, so the angles at `A` agree.
have hray : C' -ᵥ A = (5 / 3 : ℝ) • (C -ᵥ A) := by
ext i; fin_cases i <;> simp [A, C, C']
have hangle : ∠ B A C = ∠ B A C' := by
unfold EuclideanGeometry.angle
rw [hray, InnerProductGeometry.angle_smul_right_of_pos _ _ (by norm_num)]
have hBC : dist B C = dist B C' := by
simp [B, C, C', EuclideanSpace.dist_eq, Fin.sum_univ_two, Real.dist_eq]
norm_num
have hcong := h A B C A B C' hangle rfl hBC
-- Congruent triangles have equal third sides: `dist A C = dist A C'`.
have h13 := hcong.dist_eq 0 2
simp [A, C, C', EuclideanSpace.dist_eq, Fin.sum_univ_two, Real.dist_eq] at h13Now the inscribed angle theorem. First the isosceles triangle theorem from Mathlib, then Case 1 of our proof, step by step:
/-- **The isosceles triangle theorem** (*pons asinorum*): if `OA = OB` then the base angles at
`A` and `B` are equal. Applies Mathlib's `EuclideanGeometry.angle_eq_angle_of_dist_eq`. -/
theorem isosceles {O A B : P} (h : dist O A = dist O B) : ∠ O A B = ∠ O B A :=
angle_eq_angle_of_dist_eq h/-- **The inscribed angle theorem, when one side of the inscribed angle is a diameter.**
`O` is the centre of a circle, `BC` is a diameter (so `O` is the midpoint of `BC`) and `A` is
another point of the circle (`OA = OB`). Then the central angle `∠ A O C` is twice the inscribed
angle `∠ A B C`. This is the classical proof, step by step:
1. `∠ A B C = ∠ A B O`, because `O` lies on the segment `BC`;
2. `∠ O A B = ∠ O B A`, because triangle `OAB` is isosceles (`OA = OB`);
3. `∠ A O B + ∠ O B A + ∠ B A O = π` (angle sum in triangle `AOB`);
4. `∠ A O B + ∠ A O C = π`, because `B, O, C` lie on a line (angles on a straight line);
5. so `∠ A O C = ∠ O B A + ∠ B A O = 2 ∠ A B C`. -/
theorem inscribed_angle_diameter {O A B C : P} (hBC : B ≠ C) (hO : O = midpoint ℝ B C)
(hA : dist O A = dist O B) (hAO : A ≠ O) : ∠ A O C = 2 * ∠ A B C := by
have hstraight : ∠ B O C = π := by
rw [hO]; exact (sbtw_midpoint_of_ne ℝ hBC).angle₁₂₃_eq_pi
-- Step 1: the inscribed angle at `B` can be measured along `BO` instead of `BC`.
have h1 : ∠ A B C = ∠ A B O := (angle_eq_angle_of_angle_eq_pi A hstraight).symm
-- Step 2: base angles of the isosceles triangle `OAB`.
have h2 : ∠ O A B = ∠ O B A := angle_eq_angle_of_dist_eq hA
-- Step 3: the angle sum in triangle `AOB`.
have h3 : ∠ A O B + ∠ O B A + ∠ B A O = π := angle_add_angle_add_angle_eq_pi B hAO.symm
-- Step 4: angles on the straight line `BOC`.
have h4 : ∠ A O B + ∠ A O C = π := angle_add_angle_eq_pi_of_angle_eq_pi A hstraight
-- Step 5: put the pieces together.
rw [h1, angle_comm A B O]
rw [angle_comm B A O] at h3
linarithThe general theorem is in Mathlib. It is proved with oriented angles, which handle all three cases at once. The hypothesis 2 * ∠ A B C ≤ π says the inscribed angle is at most a right angle, which (for a non-degenerate configuration) is the same as saying that is not on the other side of from :
/-- **The inscribed angle theorem** in general, in a plane (`finrank ℝ V = 2`). If `A`, `B`, `C`
lie on a circle `s` and the inscribed angle `∠ A B C` is at most a right angle, the central
angle `∠ A O C` (with `O = s.center`) is twice `∠ A B C`. Applies Mathlib's
`EuclideanGeometry.Sphere.angle_center_eq_two_mul_angle_of_two_mul_angle_le_pi`, which is proved
with *oriented* angles so that all positions of `B` are handled at once. (If `∠ A B C` is
obtuse, the central angle on the other side is `2π − 2∠ A B C`.) -/
theorem inscribed_angle [Fact (Module.finrank ℝ V = 2)] {s : Sphere P} {A B C : P}
(hA : A ∈ s) (hB : B ∈ s) (hC : C ∈ s) (hBA : B ≠ A) (hBC : B ≠ C)
(hacute : 2 * ∠ A B C ≤ π) : ∠ A s.center C = 2 * ∠ A B C :=
Sphere.angle_center_eq_two_mul_angle_of_two_mul_angle_le_pi hA hB hC hBA hBC hacuteThales' theorem has a three-line proof with vectors. Put the centre at the origin, so a diameter runs from to , and is on the circle when . The dot product of the two sides of the angle at is :
/-- **Thales' theorem**, in vectors. Put the centre of the circle at the origin. A diameter runs
from `a` to `-a`, and `c` is on the circle when `‖c‖ = ‖a‖`. Then the sides `a - c` and `-a - c`
of the triangle are perpendicular: their inner (dot) product is `‖c‖² - ‖a‖² = 0`. So the angle
in a semicircle is a right angle. -/
theorem thales (a c : V) (h : ‖c‖ = ‖a‖) : ⟪a - c, -a - c⟫ = 0 := by
have key : ⟪a - c, -a - c⟫ = ‖c‖ ^ 2 - ‖a‖ ^ 2 := by
rw [inner_sub_left, inner_sub_right, inner_sub_right, inner_neg_right, inner_neg_right,
real_inner_self_eq_norm_sq, real_inner_self_eq_norm_sq, real_inner_comm a c]
ring
rw [key, h, sub_self]Finally, the circumcentre. The first theorem is the vector form of our lemma about the perpendicular bisector; the second is the step " and give "; the third gives the existence of the circumcentre from Mathlib:
/-- **The perpendicular bisector is the set of equidistant points.** With `m = (a + b)/2` the
midpoint of `ab`, a point `p` is as far from `a` as from `b` exactly when `p - m` is
perpendicular to `b - a`. The key identity is `‖p - a‖² - ‖p - b‖² = 2 ⟪p - m, b - a⟫`. -/
theorem equidistant_iff_perp (a b p : V) :
‖p - a‖ = ‖p - b‖ ↔ ⟪p - (1 / 2 : ℝ) • (a + b), b - a⟫ = 0 := by
have key : ‖p - a‖ ^ 2 - ‖p - b‖ ^ 2 = 2 * ⟪p - (1 / 2 : ℝ) • (a + b), b - a⟫ := by
rw [← real_inner_self_eq_norm_sq, ← real_inner_self_eq_norm_sq]
simp only [inner_sub_left, inner_sub_right, inner_add_left, inner_smul_left, real_inner_comm a b, real_inner_comm a p, real_inner_comm b p]
simp only [RCLike.conj_to_real]
ring
constructor
· intro h
have : ‖p - a‖ ^ 2 - ‖p - b‖ ^ 2 = 0 := by rw [h, sub_self]
linarith
· intro h
have h2 : ‖p - a‖ ^ 2 = ‖p - b‖ ^ 2 := by linarith
exact (pow_left_inj₀ (norm_nonneg _) (norm_nonneg _) two_ne_zero).1 h2/-- **The third perpendicular bisector passes through the meeting point of the other two.**
If `O` lies on the perpendicular bisectors of `AB` and of `BC`, then `OA = OB = OC`, so `O` also
lies on the perpendicular bisector of `CA`. Uses Mathlib's description of
`AffineSubspace.perpBisector` as the set of equidistant points. -/
theorem perp_bisectors_concurrent {A B C O : P} (hAB : O ∈ AffineSubspace.perpBisector A B)
(hBC : O ∈ AffineSubspace.perpBisector B C) : O ∈ AffineSubspace.perpBisector C A := by
rw [AffineSubspace.mem_perpBisector_iff_dist_eq] at *
rw [← hBC, hAB]/-- **Every triangle has a circumcentre**: if `A`, `B`, `C` are not collinear (affinely
independent), some point `O` is equidistant from all three, so the circle with centre `O`
through `A` passes through `B` and `C`. Applies Mathlib's `Affine.Simplex.circumcenter` and
`Affine.Simplex.dist_circumcenter_eq_circumradius`. -/
theorem circumcentre_exists {A B C : P} (h : AffineIndependent ℝ ![A, B, C]) :
∃ O : P, dist O A = dist O B ∧ dist O B = dist O C := by
let t : Affine.Triangle ℝ P := ⟨![A, B, C], h⟩
exact ⟨t.circumcenter,
(t.dist_circumcenter_eq_circumradius' 0).trans (t.dist_circumcenter_eq_circumradius' 1).symm,
(t.dist_circumcenter_eq_circumradius' 1).trans (t.dist_circumcenter_eq_circumradius' 2).symm⟩What is not formalised here: Hilbert's axiom system itself, and the independence of the parallel postulate. To prove independence in Lean one would build a model of the other axioms, such as the hyperbolic plane, in which Playfair's axiom fails.
Measuring angles, counting triangles
"""Measure inscribed angles on a circle and compare them with the theorem.
The inscribed angle theorem predicts that every point P on the major arc of a
chord AB sees AB under half the central angle, and every point on the minor
arc under 180 degrees minus that. We place thousands of seeded random points
on each arc, measure the angle APB in floating point and report the largest
deviation from the prediction. Points inside or outside the circle see the
chord under a larger or smaller angle, which illustrates the converse.
This is numerical evidence for finitely many points, not a proof.
"""
import math
import random
def point_on_circle(degrees, radius=1.0):
"""The point at the given angle (degrees) on the circle about the origin."""
t = math.radians(degrees)
return (radius * math.cos(t), radius * math.sin(t))
def angle_at(p, q, r):
"""The angle PQR at the vertex q, in degrees, between 0 and 180.
Uses atan2(|cross|, dot), which stays accurate for angles near 0 and 180.
"""
ux, uy = p[0] - q[0], p[1] - q[1]
vx, vy = r[0] - q[0], r[1] - q[1]
if (ux, uy) == (0, 0) or (vx, vy) == (0, 0):
raise ValueError("the vertex must differ from both other points")
cross = ux * vy - uy * vx
dot = ux * vx + uy * vy
return math.degrees(math.atan2(abs(cross), dot))
def arc_samples(start, end, count, rng):
"""`count` random angles (degrees) strictly between start and end."""
return [rng.uniform(start, end) for _ in range(count)]
def max_deviation(a, b, angles, predicted, radius=1.0):
"""Largest |angle APB - predicted| for P at the given angles."""
worst = 0.0
for t in angles:
p = point_on_circle(t, radius)
worst = max(worst, abs(angle_at(a, p, b) - predicted))
return worst
def main():
rng = random.Random(2024)
a, b = point_on_circle(200), point_on_circle(340)
central = angle_at(a, (0.0, 0.0), b)
print(f"Chord AB of the unit circle; central angle AOB = {central:.10f} deg")
print(f"Prediction: {central / 2:.6f} deg on the major arc, "
f"{180 - central / 2:.6f} deg on the minor arc")
major = arc_samples(-20 + 0.01, 200 - 0.01, 2000, rng)
minor = arc_samples(200 + 0.01, 340 - 0.01, 2000, rng)
print(f" 2000 points P on the major arc: max |APB - {central / 2:.0f}|"
f" = {max_deviation(a, b, major, central / 2):.1e} deg")
print(f" 2000 points P on the minor arc: max |APB - "
f"{180 - central / 2:.0f}| = "
f"{max_deviation(a, b, minor, 180 - central / 2):.1e} deg")
d1, d2 = point_on_circle(90), point_on_circle(270)
thales = arc_samples(-90 + 0.01, 90 - 0.01, 2000, rng)
print(f"Thales (AB a diameter): max |APB - 90| = "
f"{max_deviation(d1, d2, thales, 90):.1e} deg")
print("Off the circle, on the ray from O at 90 deg:")
for radius in (0.5, 0.9, 1.0, 1.1, 2.0):
p = point_on_circle(90, radius)
print(f" |OP| = {radius:3.1f}: angle APB = {angle_at(a, p, b):8.4f} deg")
print("Inside the circle the chord looks bigger, outside smaller: on this")
print("ray only the point on the circle sees AB at exactly 70 deg.")
print()
print("Epistemic status: numerical evidence. Each angle is computed in")
print("floating point, so agreement is up to rounding (about 1e-11 deg),")
print("and only 6,000 points were tried. The inscribed angle theorem,")
print("proved in the lesson, covers every point of every circle.")
if __name__ == "__main__":
main()Every point on the arc gives the predicted angle, up to rounding errors of about degrees. This is numerical evidence for six thousand points; the theorem covers infinitely many. Notice what the last lines show: points inside the circle see the chord under a larger angle and points outside under a smaller one. This illustrates the converse of "angles in the same segment": on that side of the chord, the points that see under exactly are precisely the points of the arc. (The converse can be proved with the exterior angle theorem; the experiment only illustrates it along one ray.)
Next, SSA. With exact fractions, the computer counts how many triangles fit given SSA data, over a grid of four thousand cases:
"""Why SSA is not a congruence criterion: counting the triangles it allows.
Fix the angle at A by a ray from A = (0, 0) through a lattice point (p, q)
with p^2 + q^2 = r^2 a perfect square (so all coordinates stay rational),
put B on that ray with AB = c, and look for C on the positive x-axis with
BC = a. Then C = (t, 0) with (t - cp/r)^2 = a^2 - (cq/r)^2, a quadratic in t
with zero, one or two positive roots. We count them with exact rational
arithmetic (comparing squares, never square roots) and check the classical
rule for the "ambiguous case" on every case of a finite grid.
"""
import math
from fractions import Fraction
#: Rays from A through (p, q) with p^2 + q^2 a perfect square, q > 0.
DIRECTIONS = [(4, 3), (3, 4), (12, 5), (5, 12), (15, 8), (8, 15), (0, 1),
(-3, 4), (-4, 3), (-12, 5)]
def count_triangles(a_sq, c, p, q):
"""Number of points C = (t, 0), t > 0, with BC^2 = a_sq, B = c(p, q)/r.
Exact: u = cp/r is the foot of the perpendicular from B, h = cq/r its
height, and t = u +- sqrt(D) with D = a_sq - h^2.
"""
r = math.isqrt(p * p + q * q)
if r * r != p * p + q * q or q <= 0 or c <= 0 or a_sq <= 0:
raise ValueError("need q > 0, c > 0, a_sq > 0 and p^2 + q^2 square")
u, h = Fraction(c * p, r), Fraction(c * q, r)
d = a_sq - h * h
if d < 0:
return 0
if d == 0:
return 1 if u > 0 else 0
larger_positive = u >= 0 or u * u < d # u + sqrt(d) > 0
smaller_positive = u > 0 and u * u > d # u - sqrt(d) > 0
return int(larger_positive) + int(smaller_positive)
def predicted_count(a_sq, c, p, q):
"""The classical rule, written with the height h = c sin A."""
r = math.isqrt(p * p + q * q)
h_sq = Fraction(c * q, r) ** 2
if p > 0: # angle A is acute
if a_sq < h_sq:
return 0
if a_sq == h_sq or a_sq >= c * c:
return 1
return 2
return 1 if a_sq > c * c else 0 # A is right or obtuse
def third_sides(a_sq, c, p, q):
"""The possible lengths AC = t, as floats (for display only)."""
r = math.isqrt(p * p + q * q)
u, d = c * p / r, a_sq - (c * q / r) ** 2
roots = sorted({u - math.sqrt(max(d, 0)), u + math.sqrt(max(d, 0))})
return [t for t in roots if t > 1e-12] if d >= 0 else []
def main():
print("Example: A = (0, 0), B = (4, 3), so AB = 5; we want BC^2 = 10.")
print(f" triangles: {count_triangles(10, 5, 4, 3)}, AC = "
f"{third_sides(10, 5, 4, 3)} (C = (3, 0) or C = (5, 0))")
print("Same angle A (ray through (4, 3)), AB = c = 10, height h = 6:")
for a in range(5, 12):
n = count_triangles(a * a, 10, 4, 3)
sides = ", ".join(f"{t:.3f}" for t in third_sides(a * a, 10, 4, 3))
print(f" BC = {a:2d}: {n} triangle(s) AC = {sides or '-'}")
cases, twos, mismatches = 0, 0, []
for p, q in DIRECTIONS:
for c in range(1, 21):
for a in range(1, 21):
got = count_triangles(a * a, c, p, q)
cases += 1
twos += got == 2
if got != predicted_count(a * a, c, p, q):
mismatches.append((a, c, p, q))
print(f"Grid: a, c in 1..20, {len(DIRECTIONS)} directions: {cases} cases")
print(f" cases with two different triangles: {twos}")
print(f" disagreements with the classical rule (0, 1 or 2 triangles): "
f"{len(mismatches)}")
print()
print("Epistemic status: the counts are exact (rational arithmetic, no")
print("square roots are compared), so the example is a genuine")
print("counterexample to 'SSA implies congruence'. The agreement with the")
print("rule is an exhaustive check of 4,000 cases only; the proof that the")
print("rule always holds is the circle-meets-line argument in the lesson.")
if __name__ == "__main__":
main()The first lines are a genuine counterexample: two different triangles with the same SSA data, found with exact arithmetic. The grid check of the rule "two triangles exactly when " is exhaustive for the cases tried but, again, finite; the circle-meets-line argument in the SSA example is what proves it.
Explore: what the parallel postulate decides
Drag the vertices of the triangle in the flat plane. The angle sum stays at — that is the theorem. Now switch to the sphere, where "straight lines" are great circles (like the equator and the lines of longitude) and any two of them meet: there are no parallels. Then try the hyperbolic plane, where through a point outside a line there are infinitely many parallels. (On the sphere a few other axioms change too: for instance, two opposite points lie on infinitely many great circles. The hyperbolic plane satisfies all of Hilbert's axioms except the parallel postulate.)
Triangles on curved surfaces
Change the parallel postulate, and the angle sum changes.
Drag a corner, or focus it and use the arrow keys.
- ∠A50.5°
- ∠B58.0°
- ∠C71.5°
∠A + ∠B + ∠C = 180.0°
In the flat plane the three angles always add up to exactly 180°, whatever the shape of the triangle.
∠A + ∠B + ∠C − π = K · Area
| Flat plane | K = 0 | ∠A+∠B+∠C = 180° |
|---|---|---|
| Sphere | K = 1/R² | ∠A+∠B+∠C > 180° |
| Hyperbolic plane | K = −1 | ∠A+∠B+∠C < 180° |
This is a first glimpse of the Gauss–Bonnet theorem: for a triangle whose sides are geodesics (shortest paths), the angle sum minus π equals the total curvature inside it. Here the curvature K is the same everywhere; on other surfaces you add up (integrate) K over the area.
Things to try:
- On the sphere, start at the North Pole, go down to the equator, turn and walk a quarter of the way round, and go back up. All three angles are right angles: in total!
- On the sphere and in the hyperbolic plane, make a very small triangle. Its angle sum is very close to . On a small patch, both geometries look almost Euclidean — which is why the parallel postulate is so hard to test by measuring.
- The widget also measures the area. The "excess" (angle sum minus , in radians) is proportional to the area. This is Girard's theorem, a first case of the Gauss–Bonnet theorem.
The polygon angle sum comes from cutting into triangles:
Shape explorer
Pick a shape and switch on its features: sides, corners, angles, symmetry and diagonals.
Regular heptagon
From vertex A, 4 diagonals cut the heptagon into 5 triangles.
The angles of each triangle add up to 180°, and together they make up exactly the angles of the polygon. So the angle sum is
(7 − 2) × 180° = 900°
Each angle of the regular heptagon: 900° ÷ 7 ≈ 128.6°
This works for every convex polygon, regular or not: try Irregular.
Exercises
1. Euclidean geometry and proof
Warm-upHumanTwo angles of a triangle measure and . How many degrees is the third angle?
2. Euclidean geometry and proof
Warm-upHumanIn triangle , and . The side is extended beyond to a point . How many degrees is the exterior angle ?
3. Euclidean geometry and proof
CoreHumanWhich of these always guarantee that two triangles are congruent? (Choose all that apply.)
4. Euclidean geometry and proof
CoreHumanIn the proof that the angles of a triangle sum to , we draw the line through parallel to and say that the angle it makes with equals . Which assumption is essential for that step?
5. Euclidean geometry and proof
CoreHumanPoints , , lie on a circle with centre , and is on the same side of as . The central angle is . How many degrees is the inscribed angle ?
6. Euclidean geometry and proof
CoreHumanThe vertices of quadrilateral lie on a circle, in this order, and . How many degrees is ?
7. Euclidean geometry and proof
CoreHumanHow many degrees is each interior angle of a regular polygon with sides?
8. Euclidean geometry and proof
StretchHumanThe fallacious proof that every triangle is isosceles lets the bisector of the angle at meet the perpendicular bisector of at a point , and draws inside the triangle. Where does really lie when ?
9. Euclidean geometry and proof
StretchFormalWhich Lean statement correctly says that SSA is not a congruence criterion? (Here ≅ means the triangles are congruent.)
10. Euclidean geometry and proof
StretchComputationalWrite circumcentre(a, b, c) for points given as pairs of integers. It should return the circumcentre as a pair of Fractions, or None if the points are collinear. Use the lemma: is equidistant from and exactly when . Two such linear equations (for and ) determine .
Common misconceptions
Misconception
Arguing from the diagram. "It looks like is inside the triangle", "it looks like a right angle", "those lines look parallel". A diagram is a guide to thinking, not evidence. The "every triangle is isosceles" fallacy shows how a slightly wrong picture leads to a false theorem. Every step of a proof must follow from what is given and what has been proved.
Misconception
"SSA is a congruence criterion." It is not: the angle must be included between the two sides. The example , , , gives two different triangles with the same two sides and the same non-included angle. (When the given angle is right or obtuse, SSA does pin down the triangle.)
Misconception
"AAA is a congruence criterion." Equal angles give the same shape, not the same size: a triangle with sides and one with sides have the same angles. AAA is a criterion for similarity.
Misconception
"Someone eventually proved the parallel postulate from Euclid's other axioms." Nobody did, and nobody can: it is independent of them. The hyperbolic plane satisfies all the other axioms and violates it, so no proof from the other axioms can exist. Many historical "proofs" quietly assumed an equivalent statement, such as "the angle sum is " or "every triangle has a circumcircle".
Misconception
"An inscribed angle is always half the central angle ." Only when and are on the same side of the chord . On the other side, the inscribed angle is half the reflex angle , which is why opposite angles of a cyclic quadrilateral add up to .
Many ways of seeing
Logic— Independence, models and a decidable theory
A statement is independent of a set of axioms when neither it nor its negation can be proved from them. The standard way to show this is to build models: a structure satisfying all the axioms and the statement, and another satisfying all the axioms and its negation. The Euclidean plane is a model of Hilbert's axioms with the parallel postulate; Eugenio Beltrami (1868) and later Felix Klein and Henri Poincaré built models of the hyperbolic plane inside Euclidean geometry, satisfying the other axioms but not the parallel postulate. So hyperbolic geometry is consistent if Euclidean geometry is.
Logic says something even stronger about elementary geometry. Alfred Tarski showed (published 1948–1951) that the first-order theory of the Euclidean plane is complete and decidable: there is an algorithm that decides, for any statement in its language, whether it is a theorem. This does not contradict Gödel's incompleteness theorems, because elementary geometry cannot define the natural numbers. See first-order logic and Gödel's incompleteness theorems.
Geometry— Geometry is the study of what rigid motions preserve
In 1872 Felix Klein proposed that a geometry is described by a group of transformations, and its theorems are the properties those transformations preserve (the Erlangen programme). For Euclidean geometry the group is the group of rigid motions (translations, rotations, reflections and their composites). Two triangles are congruent exactly when a rigid motion carries one onto the other, and SAS, ASA and SSS say which measurements are enough to determine a triangle up to rigid motion. Allowing dilations as well gives similarity geometry, in which AAA is a criterion. Spherical and hyperbolic geometry have their own groups of motions. See transformation geometry and non-Euclidean geometry.
On a sphere of radius , a triangle with angles (in radians) has area (Girard's theorem). The angle sum measures how curved the surface is — the first case of the Gauss–Bonnet theorem of differential geometry.
Algebra— Coordinates turn geometry into algebra
With René Descartes's coordinates, every point is a pair of numbers, a line is a linear equation, and a circle is a quadratic equation. The circumcentre is the solution of two linear equations (one for each perpendicular bisector), and "the bisectors meet" becomes "the determinant is not zero", which fails exactly when , , are collinear. Lean's Mathlib uses precisely this algebraic model.
Algebra also answers questions that defeated the Greek geometers. A length constructible with straightedge and compass from a unit length satisfies a polynomial equation built from repeated square roots. Pierre Wantzel used this in 1837 to prove that a general angle cannot be trisected and a cube cannot be doubled with these tools. See fields and Galois theory.
Physics— Is space Euclidean?
Euclidean geometry describes the space of everyday measurement superbly: surveyors, engineers and architects rely on it every day. But whether physical space obeys the parallel postulate is a question about the world, not about logic. In Einstein's general theory of relativity, mass curves space-time, and light passing near the Sun is deflected (first measured during the solar eclipse of 1919). Over the distances of a building or a city, the deviation from Euclidean geometry is far too small to detect with rulers. On the largest scales, measurements of the cosmic microwave background show that space is very nearly flat, as far as current precision can tell. See the geometry of space-time.
Set-theoretic connection
Geometric figures are sets of points. A circle is the set , and the perpendicular bisector of is the set — that is exactly what our lemma says. Such a set described by a property is traditionally called a locus. Concurrency is a statement about intersections: the circumcentre theorem says that the intersection of the three perpendicular bisectors is a single point, . Two lines are parallel when, as sets, they are disjoint (or, in Mathlib's convention, one is a translate of the other).
History and global context
- Before Euclid. Builders and scribes in Egypt, Mesopotamia, India and China used geometric facts long before anyone proved them. The Indian Śulba-sūtras (first millennium BCE) give constructions for fire altars, including the relation between the sides and diagonal of a rectangle. Greek tradition credits Thales of Miletus (6th century BCE) with the theorem on the angle in a semicircle.
- Euclid's Elements (Alexandria, about 300 BCE) arranged geometry as a chain of propositions deduced from definitions, postulates and common notions. It was translated into Arabic around 800 CE by al-Ḥajjāj ibn Yūsuf ibn Maṭar, and later revised by Isḥāq ibn Ḥunayn and Thābit ibn Qurra; Latin versions made from the Arabic spread through Europe. In 1607 Xu Guangqi and Matteo Ricci translated the first six books into Chinese (Jihe yuanben); the Chinese word for geometry, jihe, comes from this translation.
- In China, Liu Hui (3rd century CE) justified the geometry in The Nine Chapters on the Mathematical Art by cutting and rearranging figures.
- The parallel postulate. Proclus (5th century CE) already doubted that it should be a postulate. Ibn al-Haytham (around 1000), ʿUmar al-Khayyām (around 1077) and Naṣīr al-Dīn al-Ṭūsī (13th century) each tried to prove it, and in doing so proved theorems about quadrilaterals that reappeared in the work of Giovanni Saccheri (1733) and Johann Heinrich Lambert (written 1766).
- Non-Euclidean geometry. Carl Friedrich Gauss explored the consequences of denying the postulate but did not publish. Nikolai Lobachevsky (from 1829, in Kazan) and János Bolyai (1832) independently published a consistent geometry in which the postulate fails. Beltrami's models (1868) showed that it is exactly as consistent as Euclid's.
- Modern foundations. David Hilbert's Grundlagen der Geometrie (1899) gave a complete axiom system; Tarski proved the decidability of elementary geometry. Today, proof assistants such as Lean check geometric proofs line by line.
Further reading
- Euclid, Elements, Book I (the translation and commentary by T. L. Heath, 1908, is the classic English edition).
- A. P. Kiselev, Kiselev's Geometry, Book I: Planimetry, adapted from the Russian by Alexander Givental (2006) — a school geometry course built on proof.
- H. S. M. Coxeter and S. L. Greitzer, Geometry Revisited (1967) — beautiful theorems about triangles and circles, for strong school students.
- Marvin Jay Greenberg, Euclidean and Non-Euclidean Geometries: Development and History (1974; 4th edition 2008) — the story of the parallel postulate, with proofs.
- Robin Hartshorne, Geometry: Euclid and Beyond (2000) — Hilbert's axioms, constructions and non-Euclidean geometry, at university level.