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.Regularity.Formulas.GradientIdentity |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Mul |
| 3 | |
| 4 | /-! |
| 5 | # The actual tangential reduced-length derivative |
| 6 | |
| 7 | The selected action derivative and integrated Harnack identity give |
| 8 | the derivative along a fixed initial vector. It is a within derivative |
| 9 | on the full survival slice, including physical time endpoints. |
| 10 | Morgan-Tian Lemma 6.53 and Corollary 6.54, pp. 132-133. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 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 | {T : ℝ} {x : G.Point} |
| 25 | |
| 26 | /-- Along a fixed initial vector the actual reduced length has the |
| 27 | square-time derivative minus K divided by s squared, including |
| 28 | physical boundary times, Corollary 6.54, p. 133. -/ |
| 29 | theorem exponential_reducedLength_hasDerivWithinAt |
| 30 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (E : M14ExponentialFamily G T x) |
| 31 | {Z : G.Horizontal x} {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) : |
| 32 | HasDerivWithinAt (E.reduced_length Z) |
| 33 | (-M14GeneralizedKIntegral G (E.path Z s hs hpos) |
| 34 | (fun t => M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 35 | ((E.path Z s hs hpos).curve t)) / s ^ 2) {r | (Z, r) ∈ E.domain} s := by |
| 36 | let D := {r | (Z, r) ∈ E.domain} |
| 37 | have hden : HasDerivWithinAt (fun r : ℝ => 2 * r) 2 D s := by |
| 38 | simpa only [id_eq, mul_one] using (hasDerivWithinAt_id s D).const_mul 2 |
| 39 | have hquot := (E.action_time_derivative Z s hs hpos).div hden |
| 40 | (mul_pos zero_lt_two hpos).ne' |
| 41 | have heq : E.reduced_length Z =ᶠ[𝓝[D] s] (fun r => E.action Z r / (2 * r)) := by |
| 42 | filter_upwards [self_mem_nhdsWithin, mem_nhdsWithin_of_mem_nhds (Ioi_mem_nhds hpos)] |
| 43 | with r hr hr0 |
| 44 | exact E.reduced_length_eq Z r hr hr0 |
| 45 | apply (hquot.congr_of_eventuallyEq_of_mem heq hs).congr_deriv |
| 46 | rw [exponential_harnackIntegral_eq hM12 E hs hpos] |
| 47 | field_simp [hpos.ne'] |
| 48 | ring |
| 49 | |
| 50 | end PoincareMT.M14 |