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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.StableSet.Seed.SpatialPath |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Path.ReferenceEnergy |
| 4 | |
| 5 | /-! |
| 6 | # Square-time reparameterization of the actual seed path |
| 7 | |
| 8 | Morgan--Tian Claim 16.27, p. 393. A source path on the unit interval |
| 9 | is traversed in backward time d. In square time its actual tangent |
| 10 | velocity is multiplied by 2s/d. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | namespace PoincareMT.M04 |
| 20 | export PoincareMT.RicciFlowAnalysis (pathSpeed) |
| 21 | end PoincareMT.M04 |
| 22 | namespace PoincareMT.M04 |
| 23 | export PoincareMT.RicciFlowAnalysis (pathSpeed_nonneg) |
| 24 | end PoincareMT.M04 |
| 25 | namespace PoincareMT.M08 |
| 26 | export PoincareMT.LGeometry (referenceSpeedSq) |
| 27 | end PoincareMT.M08 |
| 28 | namespace PoincareMT.M08 |
| 29 | export PoincareMT.LGeometry (referenceSpeedSq_nonneg) |
| 30 | end PoincareMT.M08 |
| 31 | |
| 32 | namespace PoincareMT.Proofs.M46 |
| 33 | |
| 34 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 35 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 36 | |
| 37 | omit [IsManifold (𝓡 n) ∞ M] in |
| 38 | /-- The actual source velocity under the seed square-time clock. -/ |
| 39 | theorem seed_curveVelocity_reparameterization {gamma : ℝ → M} {tau d s : ℝ} |
| 40 | (hgamma : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n) gamma ((s ^ 2 - tau) / d)) : |
| 41 | curveVelocity (n := n) (fun z => gamma ((z ^ 2 - tau) / d)) s = |
| 42 | (2 * s / d) • curveVelocity (n := n) gamma ((s ^ 2 - tau) / d) := by |
| 43 | have hq : HasDerivAt (fun z : ℝ => (z ^ 2 - tau) / d) (2 * s / d) s := by |
| 44 | simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, pow_one] using |
| 45 | ((hasDerivAt_pow 2 s).sub_const tau).div_const d |
| 46 | have hqm : mfderiv 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) (fun z => (z ^ 2 - tau) / d) s 1 = |
| 47 | (2 * s / d) • (1 : ℝ) := by |
| 48 | have h := congrArg (fun L : TangentSpace 𝓘(ℝ, ℝ) s →L[ℝ] |
| 49 | TangentSpace 𝓘(ℝ, ℝ) ((s ^ 2 - tau) / d) => L 1) |
| 50 | hq.hasFDerivAt.hasMFDerivAt.mfderiv |
| 51 | change mfderiv 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) (fun z => (z ^ 2 - tau) / d) s (1 : ℝ) = |
| 52 | (ContinuousLinearMap.toSpanSingleton ℝ (2 * s / d)) (1 : ℝ) at h |
| 53 | simpa only [ContinuousLinearMap.toSpanSingleton_apply, one_smul, smul_eq_mul, |
| 54 | mul_one, one_mul] using h |
| 55 | have hchain := mfderiv_comp_apply s (f := fun z : ℝ => (z ^ 2 - tau) / d) |
| 56 | (g := gamma) hgamma hq.differentiableAt.mdifferentiableAt 1 |
| 57 | rw [hqm, map_smul] at hchain |
| 58 | exact hchain |
| 59 | |
| 60 | /-- Controlled unit speed gives the quantitative actual kinetic cost |
| 61 | after the square-time reparameterization. -/ |
| 62 | theorem seed_referenceSpeedSq_bound (g : RiemannianMetric n M) |
| 63 | {gamma : ℝ → M} (hgamma : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 1 gamma) |
| 64 | {rho tau d s : ℝ} (hrho : 0 ≤ rho) |
| 65 | (hunit : (s ^ 2 - tau) / d ∈ Icc (0 : ℝ) 1) |
| 66 | (hspeed : ∀ z ∈ Icc (0 : ℝ) 1, M04.pathSpeed g gamma z ≤ 2 * rho) : |
| 67 | M08.referenceSpeedSq g (fun z => gamma ((z ^ 2 - tau) / d)) s ≤ |
| 68 | 16 * rho ^ 2 * s ^ 2 / d ^ 2 := by |
| 69 | have hvel := seed_curveVelocity_reparameterization |
| 70 | ((hgamma _).mdifferentiableAt (by simp)) (tau := tau) (d := d) (s := s) |
| 71 | have hnonneg := M08.referenceSpeedSq_nonneg g gamma ((s ^ 2 - tau) / d) |
| 72 | have hnorm : M04.pathSpeed g gamma ((s ^ 2 - tau) / d) ^ 2 = |
| 73 | M08.referenceSpeedSq g gamma ((s ^ 2 - tau) / d) := Real.sq_sqrt hnonneg |
| 74 | have hsource : M08.referenceSpeedSq g gamma ((s ^ 2 - tau) / d) ≤ 4 * rho ^ 2 := by |
| 75 | have h := hspeed _ hunit |
| 76 | have hp := M04.pathSpeed_nonneg g gamma ((s ^ 2 - tau) / d) |
| 77 | nlinarith |
| 78 | have hmul := mul_le_mul_of_nonneg_left hsource (sq_nonneg (2 * s / d)) |
| 79 | dsimp only [M08.referenceSpeedSq] at hmul |
| 80 | unfold M08.referenceSpeedSq |
| 81 | simp only [hvel, map_smul, smul_apply, smul_eq_mul] |
| 82 | change (2 * s / d) * ((2 * s / d) * |
| 83 | g.inner (gamma ((s ^ 2 - tau) / d)) |
| 84 | (curveVelocity (n := n) gamma ((s ^ 2 - tau) / d)) |
| 85 | (curveVelocity (n := n) gamma ((s ^ 2 - tau) / d))) ≤ _ |
| 86 | calc |
| 87 | _ = (2 * s / d) ^ 2 * g.inner (gamma ((s ^ 2 - tau) / d)) |
| 88 | (curveVelocity (n := n) gamma ((s ^ 2 - tau) / d)) |
| 89 | (curveVelocity (n := n) gamma ((s ^ 2 - tau) / d)) := by ring |
| 90 | _ ≤ (2 * s / d) ^ 2 * (4 * rho ^ 2) := hmul |
| 91 | _ = _ := by ring |
| 92 | |
| 93 | end PoincareMT.Proofs.M46 |