Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.Alexandrov.ComparisonAngle |
| 2 | import Mathlib.Topology.MetricSpace.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Finite packing bounds for comparison angles |
| 6 | |
| 7 | The strict separation threshold permits passage of the same bound to metric |
| 8 | limits. Configurations consist of finitely many points distinct from a |
| 9 | chosen center, with their hyperbolic comparison angles measured at that center. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | namespace Poincare.Alexandrov |
| 15 | |
| 16 | /-- A uniform cardinal bound for finite families whose comparison angles at |
| 17 | one center are all strictly greater than `α`. -/ |
| 18 | def ComparisonAnglePackingBound (X : Type*) [MetricSpace X] (α : ℝ) (N : ℕ) : Prop := |
| 19 | ∀ (k : ℕ) (p : X) (q : Fin k → X), |
| 20 | (∀ i, q i ≠ p) → |
| 21 | (∀ i j, i ≠ j → |
| 22 | α < comparisonAngle (dist p (q i)) (dist p (q j)) (dist (q i) (q j))) → |
| 23 | k ≤ N |
| 24 | |
| 25 | /-- Comparison-angle packing bounds restrict along isometric embeddings. -/ |
| 26 | theorem ComparisonAnglePackingBound.of_isometry |
| 27 | {X Y : Type*} [MetricSpace X] [MetricSpace Y] {α : ℝ} {N : ℕ} |
| 28 | (hY : ComparisonAnglePackingBound Y α N) {f : X → Y} (hf : Isometry f) : |
| 29 | ComparisonAnglePackingBound X α N := by |
| 30 | intro k p q hq hangle |
| 31 | apply hY k (f p) (f ∘ q) |
| 32 | · intro i |
| 33 | exact hf.injective.ne (hq i) |
| 34 | · intro i j hij |
| 35 | simpa only [Function.comp_apply, hf.dist_eq] using hangle i j hij |
| 36 | |
| 37 | end Poincare.Alexandrov |