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.RicciFlow.Generalized.ReducedGeometry.Exponential.Stability.PrefixUniqueness |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential |
| 3 | |
| 4 | /-! |
| 5 | # Unique minimizing prefixes of the selected exponential family |
| 6 | |
| 7 | Morgan-Tian Proposition 6.30, pp. 118-119. Coherence transports the |
| 8 | actual unique minimizing prefix to the frozen selected endpoint. |
| 9 | Order-connected survival supplies the earlier domain membership. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 21 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 22 | {T a b c : ℝ} {x y : G.Point} |
| 23 | |
| 24 | private theorem exists_uniqueMinimizing_prefix |
| 25 | (hM04 : RicciFlowCurvatureTheory.{0}) (hCoordinates : M12MetricPredecessors.{0} n) |
| 26 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 27 | (q : M14BackwardPath G T a b x y) (hq : M14IsMinimizing q) |
| 28 | (hac : a < c) (hcb : c < b) {z : G.Point} (hz : q.curve c = z) : |
| 29 | ∃ p : M14BackwardPath G T a c x z, EqOn p.curve q.curve (Icc a c) ∧ |
| 30 | M14IsMinimizing p ∧ ∀ r : M14BackwardPath G T a c x z, |
| 31 | M14IsMinimizing r → EqOn r.curve p.curve (Icc a c) := by |
| 32 | subst z |
| 33 | refine ⟨prefixPath q c hac hcb.le, fun _ _ => rfl, |
| 34 | isMinimizing_prefixPath hM12 q hq ⟨hac, hcb⟩, ?_⟩ |
| 35 | intro r hr |
| 36 | exact minimizing_prefix_eqOn hM04 hCoordinates hM12 q hq r hr hcb |
| 37 | |
| 38 | /-- A coherent full minimizing extension makes the selected shorter |
| 39 | branch uniquely minimizing in the exact frozen sense, |
| 40 | Proposition 6.30, pp. 118-119. -/ |
| 41 | theorem uniqueMinimizingBranch_of_minimizing_extension |
| 42 | (hM04 : RicciFlowCurvatureTheory.{0}) (hCoordinates : M12MetricPredecessors.{0} n) |
| 43 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (E : M14ExponentialFamily G T x) |
| 44 | (Z : G.Horizontal x) (q : M14BackwardPath G T 0 b x y) (hq : M14IsMinimizing q) |
| 45 | (hc : 0 < c) (hcb : c < b) (hD : (Z, Real.sqrt c) ∈ E.domain) |
| 46 | (hcurve : EqOn q.curve (fun t => E.gamma Z (Real.sqrt t)) (Icc 0 b)) : |
| 47 | M14UniqueMinimizingBranch G T c x E Z := by |
| 48 | obtain ⟨p, hpcurve, hpmin, hpuniq⟩ := exists_uniqueMinimizing_prefix hM04 hCoordinates hM12 |
| 49 | q hq hc hcb (hcurve ⟨hc.le, hcb.le⟩) |
| 50 | refine ⟨hD, p, ?_, hpmin, hpuniq⟩ |
| 51 | intro t ht |
| 52 | exact (hpcurve ht).trans (hcurve ⟨ht.1, ht.2.trans hcb.le⟩) |
| 53 | |
| 54 | /-- Every strictly earlier positive branch of a supplied unique |
| 55 | minimizing branch is uniquely minimizing, Proposition 6.30, pp. 118-119. -/ |
| 56 | theorem uniqueMinimizingBranch_prefix |
| 57 | (hM04 : RicciFlowCurvatureTheory.{0}) (hCoordinates : M12MetricPredecessors.{0} n) |
| 58 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (E : M14ExponentialFamily G T x) |
| 59 | {Z : G.Horizontal x} (hc : 0 < c) (hcb : c < b) |
| 60 | (hbranch : M14UniqueMinimizingBranch G T b x E Z) : |
| 61 | M14UniqueMinimizingBranch G T c x E Z := by |
| 62 | obtain ⟨hDb, q, hcurve, hmin, _⟩ := hbranch |
| 63 | have hDc : (Z, Real.sqrt c) ∈ E.domain := |
| 64 | (E.maximal_lifetime Z).out (E.domain_zero Z) hDb |
| 65 | ⟨Real.sqrt_nonneg c, Real.sqrt_le_sqrt hcb.le⟩ |
| 66 | exact uniqueMinimizingBranch_of_minimizing_extension hM04 hCoordinates hM12 |
| 67 | E Z q hmin hc hcb hDc hcurve |
| 68 | |
| 69 | end PoincareMT.M14 |