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.Surgery.CanonicalInduction.Joint.JointSeedGeodesicSmooth |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Joint.JointSeedRadialExtension |
| 3 | import PoincareLib.Geometry.Riemannian.Distance.CompactConfinement |
| 4 | |
| 5 | /-! |
| 6 | # The actual confined radial path with controlled birth speed |
| 7 | |
| 8 | A minimizing geodesic in the precompact birth ball has constant speed |
| 9 | equal to its endpoint distance. The global spatial extension preserves |
| 10 | the whole unit-interval germ and hence that same speed and image. |
| 11 | Source: Chapter 1, Section 3.1, pp. 10-11, and Definition 1.22, p. 14. |
| 12 | See `proof-work/tasks/M47/derivations/joint-seed-ball.md`, Stage E4. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 19 | |
| 20 | namespace PoincareMT.M47 |
| 21 | |
| 22 | /-- Every point of the actual precompact birth ball has a global |
| 23 | smooth spatial radial curve confined to that ball on [0,1], whose |
| 24 | birth speed is strictly less than the ball radius, including q=y. -/ |
| 25 | theorem exists_jointSeed_radial_path |
| 26 | {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | (g : RiemannianMetric n M) (q y : M) {r : ℝ} (hr : 0 < r) |
| 29 | (hcompact : IsCompact (closure (g.ball q r))) (hy : y ∈ g.ball q r) : |
| 30 | ∃ beta : ℝ → M, ContMDiff (𝓘(ℝ, ℝ)) (𝓡 n) ∞ beta ∧ |
| 31 | beta 0 = q ∧ beta 1 = y ∧ MapsTo beta (Icc (0 : ℝ) 1) (g.ball q r) ∧ |
| 32 | ∀ s ∈ Icc (0 : ℝ) 1, |
| 33 | g.tangentNorm (beta s) (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) beta s 1) < r := by |
| 34 | obtain ⟨epsilon, hepsilon, gamma, hgeo, hzero, hone, hsegment⟩ := |
| 35 | g.exists_minimizing_geodesic_of_precompact_ball q y hr hcompact hy |
| 36 | have hI : Icc (0 : ℝ) 1 ⊆ Ioo (-epsilon) (1 + epsilon) := by |
| 37 | intro s hs |
| 38 | constructor <;> linarith [hs.1, hs.2] |
| 39 | obtain ⟨k, hk⟩ := hgeo.exists_constant_tangentNorm (by linarith) |
| 40 | have hlength := hgeo.pathELength_eq_of_edist_segment hepsilon hzero hsegment |
| 41 | have hkdist : ENNReal.ofReal (k : ℝ) = g.edist q y := by |
| 42 | have h := g.pathELength_eq_of_tangentNorm_eq |
| 43 | (fun s (hs : s ∈ Icc (0 : ℝ) 1) => hk s (hI hs)) |
| 44 | simp only [sub_zero, ENNReal.ofReal_one, mul_one] at h |
| 45 | exact h.symm.trans hlength |
| 46 | have hkr : (k : ℝ) < r := (ENNReal.ofReal_lt_ofReal_iff hr).1 (hkdist.trans_lt hy) |
| 47 | have hmap : MapsTo gamma (Icc (0 : ℝ) 1) (g.ball q r) := by |
| 48 | have h := g.mapsTo_ball_of_pathELength_lt (hgeo.contMDiffOn.mono hI) |
| 49 | (hlength.trans_lt hy) |
| 50 | simpa only [hzero] using h |
| 51 | obtain ⟨beta, hsmooth, hgerm⟩ := exists_jointSeed_global_radial_extension |
| 52 | hepsilon gamma (jointSeed_geodesic_contMDiffOn hgeo) |
| 53 | refine ⟨beta, hsmooth, |
| 54 | ((hgerm 0 (by simp)).self_of_nhds).trans hzero, |
| 55 | ((hgerm 1 (by simp)).self_of_nhds).trans hone, ?_, ?_⟩ |
| 56 | · intro s hs |
| 57 | simpa only [(hgerm s hs).self_of_nhds] using hmap hs |
| 58 | · intro s hs |
| 59 | rw [(hgerm s hs).mfderiv_eq, (hgerm s hs).self_of_nhds, hk s (hI hs)] |
| 60 | exact hkr |
| 61 | |
| 62 | end PoincareMT.M47 |