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.Riemannian.Distance.MinimizingGeodesic |
| 2 | import Mathlib.Analysis.ODE.PicardLindelof |
| 3 | |
| 4 | /-! |
| 5 | # Smoothness of the actual radial geodesic |
| 6 | |
| 7 | The local coordinate phase already stored by IsGeodesicOn solves the |
| 8 | smooth metric geodesic equation. ODE regularity upgrades that same phase |
| 9 | to smoothness, retaining its actual curve and parameter interval. |
| 10 | Source: Chapter 1, Section 3.1, pp. 10-11, and Definition 1.22, p. 14. |
| 11 | See `proof-work/tasks/M47/derivations/joint-seed-ball.md`, Stage E4. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace PoincareMT.M47 |
| 20 | |
| 21 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | /-- The actual local phase equation makes every affine metric geodesic |
| 25 | smooth in an ambient parameter neighborhood; Chapter 1, Section 3.1. -/ |
| 26 | theorem jointSeed_geodesic_contMDiffAt |
| 27 | {g : RiemannianMetric n M} {gamma : ℝ → M} {S : Set ℝ} |
| 28 | (hgamma : g.IsGeodesicOn gamma S) {t : ℝ} (ht : t ∈ S) : |
| 29 | ContMDiffAt (𝓘(ℝ, ℝ)) (𝓡 n) ∞ gamma t := by |
| 30 | obtain ⟨p, q, w, hlocal⟩ := hgamma t ht |
| 31 | obtain ⟨a, b, _htab, hnbhd, hab⟩ := exists_Icc_mem_subset_of_mem_nhds hlocal |
| 32 | let B := g.pullbackCoefficients (extChartAt (𝓡 n) p).symm |
| 33 | let U := (extChartAt (𝓡 n) p).target ×ˢ (univ : Set (EuclideanSpace ℝ (Fin n))) |
| 34 | have hfield : ContDiffOn ℝ ∞ |
| 35 | (fun z : ℝ × (EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) => |
| 36 | coordinateGeodesicField B z.2) (Icc a b ×ˢ U) := by |
| 37 | intro z hz |
| 38 | have hzsrc : z.2.1 ∈ (extChartAt (𝓡 n) p).target := hz.2.1 |
| 39 | have hB : ContDiffAt ℝ ∞ B z.2.1 := |
| 40 | (g.contDiffOn_chartCoefficients p z.2.1 hzsrc).contDiffAt |
| 41 | ((isOpen_extChartAt_target (I := 𝓡 n) p).mem_nhds hzsrc) |
| 42 | exact ((contDiffAt_coordinateGeodesicField hB |
| 43 | (g.isInvertible_chartCoefficients p hzsrc)).comp z contDiffAt_snd).contDiffWithinAt |
| 44 | have hphase (s : ℝ) (hs : s ∈ Icc a b) : |
| 45 | HasDerivWithinAt (fun s => (q s, w s)) |
| 46 | (coordinateGeodesicField B (q s, w s)) (Icc a b) s := by |
| 47 | exact ((hab hs).2.2.1.prodMk (hab hs).2.2.2).hasDerivWithinAt |
| 48 | have hmem : MapsTo (fun s => (q s, w s)) (Icc a b) U := |
| 49 | fun s hs => ⟨(hab hs).2.1, mem_univ _⟩ |
| 50 | have hphaseSmooth := ODE.contDiffOn_enat_Icc_of_hasDerivWithinAt (n := ⊤) |
| 51 | (f := fun _ z => coordinateGeodesicField B z) hfield hphase hmem |
| 52 | have hcurve : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ |
| 53 | (fun s => (extChartAt (𝓡 n) p).symm (q s)) (Icc a b) := |
| 54 | (contMDiffOn_extChartAt_symm (I := 𝓡 n) (n := ∞) p).comp |
| 55 | (contMDiffOn_iff_contDiffOn.mpr hphaseSmooth.fst) (fun s hs => (hab hs).2.1) |
| 56 | exact (hcurve.contMDiffAt hnbhd).congr_of_eventuallyEq |
| 57 | (hlocal.mono fun s hs => hs.1) |
| 58 | |
| 59 | /-- Smoothness holds on the literal geodesic parameter set, with no |
| 60 | completeness or endpoint extension assumption. -/ |
| 61 | theorem jointSeed_geodesic_contMDiffOn |
| 62 | {g : RiemannianMetric n M} {gamma : ℝ → M} {S : Set ℝ} |
| 63 | (hgamma : g.IsGeodesicOn gamma S) : |
| 64 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ gamma S := |
| 65 | fun _ ht => (jointSeed_geodesic_contMDiffAt hgamma ht).contMDiffWithinAt |
| 66 | |
| 67 | end PoincareMT.M47 |