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.Paths.SquareRoot.Action.SquareCurvePath |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootAction |
| 3 | |
| 4 | /-! |
| 5 | # Actual actions of restricted square curves |
| 6 | |
| 7 | Morgan-Tian equation (6.2) and Proposition 6.30, pp. 106, 118-119. |
| 8 | Restricting the closed time interval preserves the actual within |
| 9 | velocity. The square substitution identifies each restricted density |
| 10 | integral with the action of its genuine admissible backward path. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | |
| 25 | /-- Restriction to a uniquely differentiable subset preserves the |
| 26 | actual square density, including its closed endpoints, equation (6.2) |
| 27 | and the prefix restriction in Proposition 6.30, pp. 106, 118-119. -/ |
| 28 | theorem squareCurveDensity_restrict {α : ℝ → G.Point} {C D : Set ℝ} |
| 29 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α C) |
| 30 | (hDC : D ⊆ C) {s : ℝ} (hs : s ∈ D) (hD : UniqueDiffWithinAt ℝ D s) : |
| 31 | squareCurveDensity G α D s = squareCurveDensity G α C s := by |
| 32 | unfold squareCurveDensity projectedCurveVelocityWithin |
| 33 | rw [mfderivWithin_subset hDC hD.uniqueMDiffWithinAt |
| 34 | ((hα s (hDC hs)).mdifferentiableWithinAt (by simp))] |
| 35 | |
| 36 | /-- The integral of the retained square density is the actual action |
| 37 | of the restricted admissible path, also for zero initial time, |
| 38 | equation (6.2) and Proposition 6.30, pp. 106, 118-119. -/ |
| 39 | theorem integral_squareCurveDensity_eq_action |
| 40 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) {T a b : ℝ} (ha : 0 ≤ a) (hab : a < b) |
| 41 | (α : ℝ → G.Point) {C : Set ℝ} |
| 42 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α C) |
| 43 | (hsub : M14SqrtParameterInterval a b ⊆ C) |
| 44 | (hclock : ∀ s ∈ M14SqrtParameterInterval a b, |
| 45 | G.spacetime.timeFunction (α s) = T - s ^ 2) : |
| 46 | (∫ s in Real.sqrt a..Real.sqrt b, squareCurveDensity G α C s) = |
| 47 | M14BackwardLAction G (backwardPathOfSquareCurve hM12 ha hab α (hα.mono hsub) hclock) := by |
| 48 | rw [backwardLAction_eq_transformed] |
| 49 | apply intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_le_sqrt hab.le) |
| 50 | intro s hs |
| 51 | rw [← squareCurveDensity_restrict hα hsub (Ioo_subset_Icc_self hs) |
| 52 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt ha hab) s (Ioo_subset_Icc_self hs))] |
| 53 | exact squareCurveDensity_eq_transformed ha (hα.mono hsub) hs |
| 54 | |
| 55 | end PoincareMT.M14 |