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.Minimum.Variation.Geometry.CoordinateCurvature |
| 2 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Hessian.Chart |
| 3 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Scaling |
| 4 | |
| 5 | /-!+# The potential term in the intrinsic second variation |
| 6 | |
| 7 | The coordinate Hessian of the square-time scalar potential, after subtracting |
| 8 | the retained connection term, is twice square time times the scalar Hessian. |
| 9 | This is the potential term in Morgan--Tian, Proposition 6.33, pp. 120-121. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter Topology |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 19 | |
| 20 | open ReducedLengthMinimum.Variational ReducedLengthMinimum.Variation.Frame |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | /-- The actual scalar potential has the intrinsic Hessian required by the |
| 26 | second variation, without a curvature-theory assumption. -/ |
| 27 | theorem chartActionPotential_hessian {J : Set ℝ} (F : RicciFlow n M J) |
| 28 | (T s : ℝ) {x y : M} |
| 29 | (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 30 | (ht : T - s ^ 2 ∈ interior J) (v w : EuclideanSpace ℝ (Fin n)) : |
| 31 | fderiv ℝ (fderiv ℝ (fun q => chartActionPotential F T x (s, q))) |
| 32 | (extChartAt (𝓡 n) x y) v w - |
| 33 | fderiv ℝ (fun q => chartActionPotential F T x (s, q)) (extChartAt (𝓡 n) x y) |
| 34 | (chartConnection (chartActionMetric F T x) (s, extChartAt (𝓡 n) x y) v w) = |
| 35 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).hessian |
| 36 | (F.connection (T - s ^ 2)).scalarCurvature y (chartFrame x v y) (chartFrame x w y) := by |
| 37 | let e := extChartAt (𝓡 n) x |
| 38 | let D := F.connection (T - s ^ 2) |
| 39 | let f : M → ℝ := fun z => 2 * s ^ 2 * D.scalarCurvature z |
| 40 | have hy' : y ∈ e.source := by simpa only [e, extChartAt_source] using hy |
| 41 | have hq : e y ∈ e.target := e.map_source hy' |
| 42 | have hf : ContMDiffAt (𝓡 n) 𝓘(ℝ, ℝ) ∞ f (e.symm (e y)) := by |
| 43 | rw [e.left_inv hy'] |
| 44 | exact contMDiffAt_const.mul D.contMDiff_scalarCurvature.contMDiffAt |
| 45 | have h := D.hessian_in_chart x hq hf v w |
| 46 | dsimp only [e] at h |
| 47 | rw [← chartFrame_inverse_derivative hy v, |
| 48 | ← chartFrame_inverse_derivative hy w, (extChartAt (𝓡 n) x).left_inv hy'] at h |
| 49 | have hpotential : (fun q => chartActionPotential F T x (s, q)) = f ∘ e.symm := rfl |
| 50 | rw [hpotential, chartConnection_eq_coordinateChristoffel F T s x ht hq] |
| 51 | rw [← CoordinateExponential.christoffelBilinear_apply, ← h] |
| 52 | exact D.hessian_const_mul (2 * s ^ 2) D.scalarCurvature y _ _ |
| 53 | |
| 54 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |