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.Exponential.FamilySquareRegularization |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.IntrinsicEnergy |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.CurvePhase |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.SquareTimeFields |
| 5 | |
| 6 | /-! |
| 7 | # Smooth energy of the actual square-time curve |
| 8 | |
| 9 | Metric evaluation gives ambient smoothness. The constructed square-family |
| 10 | regularization gives its actual derivative throughout the closed interval. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle |
| 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 regularizedCurveEnergy_contDiffOn {J : Set ℝ} (F : RicciFlow n M J) |
| 28 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 29 | (α : ℝ → M) (U : Set ℝ) (hU : IsOpen U) |
| 30 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 31 | (htime : U ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) : |
| 32 | ContDiffOn ℝ ∞ (regularizedCurveEnergy F T α) U := by |
| 33 | have hbase := contMDiffOn_id.prodMk hα |
| 34 | have hg := (squareTime_metric_smooth F T b hb hwindow).comp hbase |
| 35 | (fun s hs ↦ ⟨htime hs, Set.mem_univ _⟩) |
| 36 | have hphase := curvePhase_contMDiffOn α U hU hα |
| 37 | have heval : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓘(ℝ, ℝ))) ∞ |
| 38 | (fun s : ℝ ↦ (⟨α s, regularizedCurveEnergy F T α s⟩ : |
| 39 | Bundle.TotalSpace ℝ (Bundle.Trivial M ℝ))) U := |
| 40 | hg.clm_bundle_apply₂ hphase hphase |
| 41 | have henergy : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ (regularizedCurveEnergy F T α) U := by |
| 42 | intro s hs |
| 43 | exact (Bundle.contMDiffWithinAt_totalSpace.mp (heval s hs)).2 |
| 44 | exact henergy.contDiffOn |
| 45 | |
| 46 | theorem lExponentialFamily_squareEnergy_hasDerivAt {J : Set ℝ} {F : RicciFlow n M J} |
| 47 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τmax : ℝ} |
| 48 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 49 | {p : M} (A : LExponentialFamily F T τmax p) |
| 50 | (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 51 | (s : ℝ) (hs : s ∈ Set.Icc 0 (Real.sqrt b)) : |
| 52 | HasDerivAt (regularizedCurveEnergy F T (A.squareFamily Z)) |
| 53 | (4 * s ^ 2 * mvfderiv (𝓡 n) (F.connection (T - s ^ 2)).scalarCurvature |
| 54 | (A.squareFamily Z s) (curveVelocity (A.squareFamily Z) s) - |
| 55 | 4 * s * (F.connection (T - s ^ 2)).ricci (A.squareFamily Z s) |
| 56 | (curveVelocity (A.squareFamily Z) s) (curveVelocity (A.squareFamily Z) s)) s := by |
| 57 | let R := lExponentialFamily_squareRegularization hM04 hτmax hwindow A Z b hb hmax |
| 58 | have hsK : s ∈ sqrtParameterInterval 0 b := by |
| 59 | simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs |
| 60 | have hK : UniqueDiffOn ℝ (sqrtParameterInterval 0 b) := |
| 61 | uniqueDiffOn_Icc (Real.sqrt_lt_sqrt (by norm_num) hb) |
| 62 | have htime : s ∈ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) := |
| 63 | ⟨(neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs.1, |
| 64 | hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 65 | exact regularizedCurveEnergy_hasDerivAt F hM04 T τmax hτmax hwindow |
| 66 | R.path.curve R.path.domain (sqrtParameterInterval 0 b) R.path.open_domain |
| 67 | R.path.interval_subset hK R.path.smooth R.velocity_extension s hsK htime (R.equation s hsK) |
| 68 | |
| 69 | end PoincareMT.ReducedLength |