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.ReducedGeometry.ReducedLength.Action.IntrinsicEnergy |
| 2 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts |
| 5 | |
| 6 | /-! |
| 7 | # Square-root reparameterization of the action |
| 8 | |
| 9 | The actual velocity gives the transformed scalar-plus-energy integrand |
| 10 | at positive square times. Its continuous extension proves integrability; |
| 11 | no derivative at backward time zero is asserted. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | set_option backward.isDefEq.respectTransparency false in |
| 27 | theorem curveVelocity_comp_sqrt (α : ℝ → M) (t : ℝ) (ht : 0 < t) |
| 28 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α (Real.sqrt t)) : |
| 29 | curveVelocity (n := n) (fun r ↦ α (Real.sqrt r)) t = |
| 30 | (1 / (2 * Real.sqrt t)) • curveVelocity (n := n) α (Real.sqrt t) := by |
| 31 | have hsqrt := (Real.hasDerivAt_sqrt ht.ne').hasFDerivAt.hasMFDerivAt |
| 32 | have hsqrtValue : (mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) Real.sqrt t) 1 = |
| 33 | 1 / (2 * Real.sqrt t) := by |
| 34 | exact (congrArg (fun A : ℝ →L[ℝ] ℝ ↦ A 1) |
| 35 | (mfderiv_eq_fderiv (f := Real.sqrt) (x := t))).trans |
| 36 | ((congrArg (fun A : ℝ →L[ℝ] ℝ ↦ A 1) |
| 37 | (Real.hasDerivAt_sqrt ht.ne').hasFDerivAt.fderiv).trans |
| 38 | (ContinuousLinearMap.toSpanSingleton_apply_one ℝ (1 / (2 * Real.sqrt t)))) |
| 39 | let L : ℝ →L[ℝ] TangentSpace (𝓡 n) (α (Real.sqrt t)) := |
| 40 | mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) α (Real.sqrt t) |
| 41 | have hcomp := congrArg |
| 42 | (fun A : ℝ →L[ℝ] TangentSpace (𝓡 n) (α (Real.sqrt t)) ↦ A 1) |
| 43 | (mfderiv_comp t hα hsqrt.mdifferentiableAt) |
| 44 | have hlin : L (1 / (2 * Real.sqrt t)) = (1 / (2 * Real.sqrt t)) • L 1 := by |
| 45 | simpa only [smul_eq_mul, mul_one] using L.map_smul (1 / (2 * Real.sqrt t)) (1 : ℝ) |
| 46 | exact hcomp.trans ((congrArg L hsqrtValue).trans hlin) |
| 47 | |
| 48 | set_option backward.isDefEq.respectTransparency false in |
| 49 | theorem backwardLIntegrand_comp_square {J : Set ℝ} (F : RicciFlow n M J) |
| 50 | (T : ℝ) (α : ℝ → M) (s : ℝ) (hs : 0 < s) |
| 51 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 52 | backwardLIntegrand F T (fun r ↦ α (Real.sqrt r)) (s ^ 2) * (2 * s) = |
| 53 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (α s) + |
| 54 | (1 / 2 : ℝ) * regularizedCurveEnergy F T α s := by |
| 55 | have hd : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α (Real.sqrt (s ^ 2)) := by |
| 56 | simpa only [Real.sqrt_sq hs.le] using hα |
| 57 | have henergy := congrArg (fun r : ℝ ↦ (F.metric (T - s ^ 2)).inner (α r) |
| 58 | (curveVelocity (n := n) α r) (curveVelocity (n := n) α r)) (Real.sqrt_sq hs.le) |
| 59 | unfold backwardLIntegrand regularizedCurveEnergy |
| 60 | rw [curveVelocity_comp_sqrt α (s ^ 2) (sq_pos_of_pos hs) hd] |
| 61 | simp only [Real.sqrt_sq hs.le, map_smul, ContinuousLinearMap.smul_apply, smul_eq_mul] |
| 62 | field_simp [hs.ne'] |
| 63 | <;> nlinarith [henergy] |
| 64 | |
| 65 | theorem intervalIntegrable_backwardLIntegrand_comp_sqrt {J : Set ℝ} |
| 66 | (F : RicciFlow n M J) (T b : ℝ) (hb : 0 < b) (α : ℝ → M) |
| 67 | (hα : ∀ s ∈ Set.Ioo 0 (Real.sqrt b), MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) |
| 68 | (hR : ContinuousOn (fun s ↦ (F.connection (T - s ^ 2)).scalarCurvature (α s)) |
| 69 | (Set.Icc 0 (Real.sqrt b))) |
| 70 | (hE : ContinuousOn (regularizedCurveEnergy F T α) (Set.Icc 0 (Real.sqrt b))) : |
| 71 | IntervalIntegrable (backwardLIntegrand F T (fun r ↦ α (Real.sqrt r))) |
| 72 | MeasureTheory.volume 0 b := by |
| 73 | let H : ℝ → ℝ := fun s ↦ |
| 74 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (α s) + |
| 75 | (1 / 2 : ℝ) * regularizedCurveEnergy F T α s |
| 76 | have hH : ContinuousOn H (Set.Icc 0 (Real.sqrt b)) := |
| 77 | ((continuousOn_const.mul (continuousOn_id.pow 2)).mul hR).add (continuousOn_const.mul hE) |
| 78 | have hi : IntervalIntegrable |
| 79 | (fun s ↦ backwardLIntegrand F T (fun r ↦ α (Real.sqrt r)) (s ^ 2) * (2 * s)) |
| 80 | MeasureTheory.volume 0 (Real.sqrt b) := by |
| 81 | apply (hH.intervalIntegrable_of_Icc (Real.sqrt_nonneg b)).congr_uIoo |
| 82 | intro s hs |
| 83 | have hs' : s ∈ Set.Ioo 0 (Real.sqrt b) := by |
| 84 | simpa only [Set.uIoo_of_le (Real.sqrt_nonneg b)] using hs |
| 85 | exact (backwardLIntegrand_comp_square F T α s hs'.1 (hα s hs')).symm |
| 86 | have hsq : ∀ s ∈ Set.Ioo (min 0 (Real.sqrt b)) (max 0 (Real.sqrt b)), |
| 87 | HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 88 | intro s _ |
| 89 | simpa using hasDerivAt_pow 2 s |
| 90 | have hpos : ∀ s ∈ Set.Ioo (min 0 (Real.sqrt b)) (max 0 (Real.sqrt b)), 0 ≤ 2 * s := by |
| 91 | intro s hs |
| 92 | have hs' : 0 < s := by simpa only [min_eq_left (Real.sqrt_nonneg b)] using hs.1 |
| 93 | positivity |
| 94 | have h := (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 95 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) |
| 96 | (g := backwardLIntegrand F T (fun r ↦ α (Real.sqrt r))) |
| 97 | (continuous_pow 2).continuousOn hsq hpos).mp hi |
| 98 | simpa only [zero_pow two_ne_zero, Real.sq_sqrt hb.le] using h |
| 99 | |
| 100 | end PoincareMT.ReducedLength |