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.CurveShortening.Comparison.IntrinsicComparison.Geodesic.SideNeighborhood |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Boundary.MetricSegment |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.AncientVolume.ScalarRatio.Cone.ZeroRatio.MetricArc |
| 4 | |
| 5 | /-! |
| 6 | # Constrained minimizers are ambient geodesics at a geodesic side |
| 7 | |
| 8 | The frontier connectors and ambient metric-segment neighborhood are |
| 9 | constructed from the actual embedded side. No regularity or finite number |
| 10 | of contacts of the constrained minimizer is assumed. |
| 11 | Source: MT Claim 19.40, pp. 470-471; the geodesic-side derivation. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Topology ENNReal Manifold ContDiff |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | /-- At an interior contact with an actual embedded geodesic side, a unit-speed constrained |
| 24 | minimizer is smooth and solves the ambient geodesic equation on a two-sided parameter |
| 25 | neighborhood. Other frontier pieces are compact and avoid this point; their shapes are |
| 26 | unrestricted. Source: MT Claim 19.40, pp. 470-471; |
| 27 | `proof-work/tasks/M64/derivations/2026-09-27-minimal-contact-regularity.md`, Sections 4-5. -/ |
| 28 | theorem m64Intrinsic_constrained_minimizer_geodesic_side |
| 29 | (G : RiemannianMetric 2 AnnulusCoordinates) {K C : Set AnnulusCoordinates} |
| 30 | (hK : IsClosed K) (hC : IsCompact C) |
| 31 | {alpha : ℝ → AnnulusCoordinates} {a b p : ℝ} |
| 32 | (hc : ContinuousOn alpha (Icc a b)) (hinj : InjOn alpha (Icc a b)) |
| 33 | (hgeo : G.IsGeodesicOn alpha (Ioo a b)) (hp : p ∈ Ioo a b) |
| 34 | (hfront : frontier K ⊆ alpha '' Icc a b ∪ C) |
| 35 | (hside : MapsTo alpha (Icc a b) K) (hpC : alpha p ∉ C) |
| 36 | {gamma : ℝ → AnnulusCoordinates} {L : ℝ} |
| 37 | (hconf : MapsTo gamma (Icc 0 L) K) |
| 38 | (hlip : ∀ s ∈ Icc 0 L, ∀ t ∈ Icc 0 L, |
| 39 | G.edist (gamma s) (gamma t) ≤ ENNReal.ofReal |s - t|) |
| 40 | (hmin : ∀ c ∈ Icc 0 L, ∀ d ∈ Icc 0 L, c ≤ d → |
| 41 | ∀ tau : ℝ → AnnulusCoordinates, ContinuousOn tau (Icc 0 1) → |
| 42 | tau 0 = gamma c → tau 1 = gamma d → MapsTo tau (Icc 0 1) K → |
| 43 | ENNReal.ofReal (d - c) ≤ m64IntrinsicCurveVariation G tau 0 1) |
| 44 | {u : ℝ} (hu : u ∈ Ioo 0 L) (hpoint : gamma u = alpha p) : |
| 45 | ∃ epsilon : ℝ, 0 < epsilon ∧ Icc (u - epsilon) (u + epsilon) ⊆ Icc 0 L ∧ |
| 46 | G.IsGeodesicOn gamma (Ioo (u - epsilon) (u + epsilon)) ∧ |
| 47 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 2) ∞ gamma (Ioo (u - epsilon) (u + epsilon)) := by |
| 48 | obtain ⟨O, hO, hpO, hconnect⟩ := |
| 49 | m64Intrinsic_exists_geodesic_side_frontier_connectors G hc hinj hgeo hp |
| 50 | hfront hside hC hpC |
| 51 | obtain ⟨epsilon, hepsilon, hJ, hmetric⟩ := |
| 52 | m64Intrinsic_constrained_minimizer_metric_segment_of_frontier_connectors |
| 53 | G hK hconf hlip hmin hu (by rw [hpoint]; exact hO.mem_nhds hpO) hconnect |
| 54 | obtain ⟨hgamma, hsmooth⟩ := G.isGeodesicOn_and_contMDiffOn_of_edist_affine_segment |
| 55 | (γ := gamma) (a := u - epsilon) (b := u + epsilon) (c := 1) zero_le_one (by |
| 56 | intro s hs t ht |
| 57 | simpa only [one_mul] using hmetric s (Ioo_subset_Icc_self hs) t (Ioo_subset_Icc_self ht)) |
| 58 | exact ⟨epsilon, hepsilon, hJ, hgamma, hsmooth⟩ |
| 59 | |
| 60 | end PoincareMT |