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.Variation.Coordinates.MovingMetric |
| 2 | |
| 3 | /-! |
| 4 | # Scalar chain rule along the actual closed square path |
| 5 | |
| 6 | The prescribed full tangent splits a scalar derivative into its actual |
| 7 | backward-time and horizontal terms, including physical endpoints. |
| 8 | Morgan-Tian equation (6.8), p. 118, and Lemma 6.49, p. 131. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.M14 |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 21 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 22 | |
| 23 | set_option backward.isDefEq.respectTransparency false in |
| 24 | -- Scalar tangent fibers identify the manifold derivative with its real value. |
| 25 | /-- Any actually differentiable scalar field has the backward-clock |
| 26 | chain rule along the closed square path, equation (6.8), p. 118. -/ |
| 27 | theorem squareRoot_scalarField_hasDerivWithinAt (R : M14SquareRootPath G p) |
| 28 | {f : G.Point → ℝ} {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 29 | (hf : MDifferentiableAt (spacetimeModel n) (𝓘(ℝ, ℝ)) f (R.curve s)) : |
| 30 | HasDerivWithinAt (fun r => f (R.curve r)) |
| 31 | (2 * s * M14BackwardTimeDerivative G f (R.curve s) + |
| 32 | mvfderiv (spacetimeModel n) f (R.curve s) (R.horizontal_velocity s).val) |
| 33 | (M14SqrtParameterInterval τ₁ τ₂) s := by |
| 34 | have hR := ((R.smooth.mono R.interval_subset) s hs).mdifferentiableWithinAt (by simp) |
| 35 | have hcomp := hf.hasMFDerivAt.comp_hasMFDerivWithinAt s hR.hasMFDerivWithinAt |
| 36 | have h := hcomp.hasFDerivWithinAt.hasDerivWithinAt |
| 37 | change HasDerivWithinAt (fun r => f (R.curve r)) |
| 38 | (mvfderiv (spacetimeModel n) f (R.curve s) |
| 39 | (mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) R.curve |
| 40 | (M14SqrtParameterInterval τ₁ τ₂) s (1 : ℝ))) _ s at h |
| 41 | rw [R.derivative_eq s hs, map_add, map_smul, smul_eq_mul] at h |
| 42 | convert h using 1 |
| 43 | unfold M14BackwardTimeDerivative |
| 44 | ring |
| 45 | |
| 46 | end PoincareMT.M14 |