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.SqrtActionIntegrability |
| 2 | |
| 3 | /-! |
| 4 | # The exact square-time action integral |
| 5 | |
| 6 | The monotone square substitution and the positive-time velocity identity |
| 7 | give the formula; equality at the zero endpoint is neither used nor true |
| 8 | in general for the transformed integrands. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.ReducedLength |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | theorem backwardLLength_comp_sqrt_eq {J : Set ℝ} (F : RicciFlow n M J) |
| 24 | (T c : ℝ) (hc : 0 < c) (α : ℝ → M) |
| 25 | (hα : ∀ s ∈ Set.Ioo 0 (Real.sqrt c), MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 26 | backwardLLength F T 0 c (fun τ ↦ α (Real.sqrt τ)) = |
| 27 | ∫ s in 0..Real.sqrt c, |
| 28 | (2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (α s) + |
| 29 | (1 / 2 : ℝ) * regularizedCurveEnergy F T α s) := by |
| 30 | have hsq : ∀ s ∈ Set.Ioo (min 0 (Real.sqrt c)) (max 0 (Real.sqrt c)), |
| 31 | HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 32 | intro s _ |
| 33 | simpa using hasDerivAt_pow 2 s |
| 34 | have hpos : ∀ s ∈ Set.Ioo (min 0 (Real.sqrt c)) (max 0 (Real.sqrt c)), 0 ≤ 2 * s := by |
| 35 | intro s hs |
| 36 | have hs' : 0 < s := by simpa only [min_eq_left (Real.sqrt_nonneg c)] using hs.1 |
| 37 | positivity |
| 38 | have h := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg |
| 39 | (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) |
| 40 | (g := backwardLIntegrand F T (fun τ ↦ α (Real.sqrt τ))) |
| 41 | (continuous_pow 2).continuousOn hsq hpos |
| 42 | simp only [zero_pow two_ne_zero, Real.sq_sqrt hc.le] at h |
| 43 | unfold backwardLLength |
| 44 | rw [← h] |
| 45 | apply intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_nonneg c) |
| 46 | intro s hs |
| 47 | exact backwardLIntegrand_comp_square F T α s hs.1 (hα s hs) |
| 48 | |
| 49 | end PoincareMT.ReducedLength |