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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeResidual |
| 3 | |
| 4 | /-! |
| 5 | # The actual second-order Jacobi residual in a closed gauge window |
| 6 | |
| 7 | Morgan-Tian Lemmas 6.10 and 6.19, pp. 109-110, 114. Restriction |
| 8 | retains both actual covariant derivatives of the supplied field. |
| 9 | The two Christoffel formulas turn its frozen geometric residual |
| 10 | into the corrected closed coordinate expression. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- The gauge spatial tangent fibers retain the Euclidean coordinate model. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 27 | (R : M14SquareRootPath G p) (b : G.gaugeCover.index) |
| 28 | |
| 29 | /-- The frozen Jacobi residual of any supplied actual two-derivative |
| 30 | field equals its second-order closed gauge residual. Both extension |
| 31 | records and both closed derivatives are retained, Lemmas 6.10 and |
| 32 | 6.19, pp. 109-110, 114. -/ |
| 33 | theorem jacobiResidual_gauge_secondOrder |
| 34 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 35 | (hscalar : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ |
| 36 | (horizontalScalarCurvature G.leafwise)) |
| 37 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 38 | (hM04 : RicciFlowCurvatureTheory.{0}) (x₀ : G.gaugeCover.spatial b) |
| 39 | {a c : ℝ} (hac : a < c) (hsub : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 40 | {β : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 41 | G.gaugeCover.spatial b} |
| 42 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (Icc a c)) |
| 43 | (hrec : ∀ r ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β r) = R.curve r) |
| 44 | (hclock : ∀ r ∈ Icc a c, (β r).1.val = T - r ^ 2) |
| 45 | (Q : M14JacobiFieldData G R.curve (M14SqrtParameterInterval τ₁ τ₂)) |
| 46 | (f : ℝ → EuclideanSpace ℝ (Fin n)) |
| 47 | (hfield : ∀ r ∈ Icc a c, HEq (Q.field r) |
| 48 | ((G.gaugeCover.metric b).spatialTangentEquiv (β r).1 (β r).2 (f r))) |
| 49 | {s : ℝ} (hs : s ∈ Icc a c) {Z : G.Horizontal (R.curve s)} |
| 50 | (w : EuclideanSpace ℝ (Fin n)) |
| 51 | (hZ : HEq Z ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 w)) : |
| 52 | let q := fun r => (β r).2.val |
| 53 | let A := derivWithin q (Icc a c) |
| 54 | let d := fun r => derivWithin f (Icc a c) r + |
| 55 | M08.closedChartConnection W.flow T x₀ (Icc a c) (r, q r) (A r) (f r) |
| 56 | M14JacobiResidual G R Q s Z = |
| 57 | M08.chartActionMetric W.flow T x₀ (s, q s) |
| 58 | (derivWithin d (Icc a c) s + |
| 59 | M08.closedChartConnection W.flow T x₀ (Icc a c) (s, q s) (A s) (d s)) w - |
| 60 | M08.closedChartJacobiPotential W.flow T x₀ (Icc a c) (s, q s) (A s) (f s) w + |
| 61 | M08.timeWithinFDeriv (Icc a c) (extChartAt (𝓡 n) x₀).target |
| 62 | (M08.chartActionMetric W.flow T x₀) (s, q s) (d s) w := by |
| 63 | let q := fun r => (β r).2.val |
| 64 | let A := derivWithin q (Icc a c) |
| 65 | let d := fun r => derivWithin f (Icc a c) r + |
| 66 | M08.closedChartConnection W.flow T x₀ (Icc a c) (r, q r) (A r) (f r) |
| 67 | have hC := uniqueDiffOn_Icc hac |
| 68 | have hR := R.smooth.mono R.interval_subset |
| 69 | have hd (r : ℝ) (hr : r ∈ Icc a c) : HEq (M14JacobiFirstDerivative Q r) |
| 70 | ((G.gaugeCover.metric b).spatialTangentEquiv (β r).1 (β r).2 (d r)) := by |
| 71 | have hres := horizontalCovariantDerivative_restrict_subset Q.extension hsub (hC r hr) |
| 72 | ((hR r (hsub hr)).mdifferentiableWithinAt (by simp)) |
| 73 | exact (heq_of_eq hres).trans |
| 74 | (horizontalCovariantDerivative_lifted_gauge b hCoordinates W T x₀ hβ hrec hclock |
| 75 | (pullbackExtensionRestrict Q.extension hsub) f hfield hr (hC r hr)) |
| 76 | have hdd : HEq (M14JacobiSecondDerivative Q s) |
| 77 | ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 |
| 78 | (derivWithin d (Icc a c) s + |
| 79 | M08.closedChartConnection W.flow T x₀ (Icc a c) (s, q s) (A s) (d s))) := by |
| 80 | have hres := horizontalCovariantDerivative_restrict_subset Q.derivative_extension hsub |
| 81 | (hC s hs) ((hR s (hsub hs)).mdifferentiableWithinAt (by simp)) |
| 82 | exact (heq_of_eq hres).trans |
| 83 | (horizontalCovariantDerivative_lifted_gauge b hCoordinates W T x₀ hβ hrec hclock |
| 84 | (pullbackExtensionRestrict Q.derivative_extension hsub) d hd hs (hC s hs)) |
| 85 | exact horizontalJacobiPairResidual_gauge R b hCoordinates hscalar W hM04 x₀ hac hsub |
| 86 | hβ hrec hclock hs (f s) (d s) |
| 87 | (derivWithin d (Icc a c) s + |
| 88 | M08.closedChartConnection W.flow T x₀ (Icc a c) (s, q s) (A s) (d s)) w |
| 89 | (hfield s hs) (hd s hs) hdd hZ |
| 90 | |
| 91 | end PoincareMT.M14 |