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.JacobiGaugeFields |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCoefficients |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiPair |
| 5 | |
| 6 | /-! |
| 7 | # The exact Jacobi residual in a closed compatible gauge |
| 8 | |
| 9 | Morgan-Tian Lemmas 6.10 and 6.12, pp. 109-110. The actual square |
| 10 | velocity and closed coefficient identities identify the first-order |
| 11 | horizontal Jacobi equation with M08's metric, weighted potential and |
| 12 | metric-time expression. No Euler or minimality assumption is used. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- Equal base points identify the actual horizontal tangent fibers. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 27 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 28 | |
| 29 | private theorem horizontal_five_eval_heq |
| 30 | (F : ∀ q, G.Horizontal q → G.Horizontal q → G.Horizontal q → |
| 31 | G.Horizontal q → G.Horizontal q → ℝ) |
| 32 | {q r : G.Point} (h : q = r) |
| 33 | {A Y P DP Z : G.Horizontal q} {A' Y' P' DP' Z' : G.Horizontal r} |
| 34 | (hA : HEq A A') (hY : HEq Y Y') (hP : HEq P P') (hDP : HEq DP DP') (hZ : HEq Z Z') : |
| 35 | F q A Y P DP Z = F r A' Y' P' DP' Z' := by |
| 36 | cases h |
| 37 | cases hA |
| 38 | cases hY |
| 39 | cases hP |
| 40 | cases hDP |
| 41 | cases hZ |
| 42 | rfl |
| 43 | |
| 44 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 45 | (R : M14SquareRootPath G p) (b : G.gaugeCover.index) |
| 46 | |
| 47 | /-- The frozen first-order horizontal residual is the actual closed |
| 48 | coordinate Jacobi expression, with all signs and curvature slots |
| 49 | retained, Lemmas 6.10 and 6.12, pp. 109-110. -/ |
| 50 | theorem horizontalJacobiPairResidual_gauge |
| 51 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 52 | (hscalar : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ |
| 53 | (horizontalScalarCurvature G.leafwise)) |
| 54 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 55 | (hM04 : RicciFlowCurvatureTheory.{0}) (x₀ : G.gaugeCover.spatial b) |
| 56 | {a c : ℝ} (hac : a < c) (hsub : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 57 | {β : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 58 | G.gaugeCover.spatial b} |
| 59 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (Icc a c)) |
| 60 | (hrec : ∀ s ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β s) = R.curve s) |
| 61 | (hclock : ∀ s ∈ Icc a c, (β s).1.val = T - s ^ 2) |
| 62 | {s : ℝ} (hs : s ∈ Icc a c) {Y P DP Z : G.Horizontal (R.curve s)} |
| 63 | (v f d w : EuclideanSpace ℝ (Fin n)) |
| 64 | (hY : HEq Y ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 v)) |
| 65 | (hP : HEq P ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 f)) |
| 66 | (hDP : HEq DP ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 d)) |
| 67 | (hZ : HEq Z ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 w)) : |
| 68 | horizontalJacobiPairResidual R s Y P DP Z = |
| 69 | M08.chartActionMetric W.flow T x₀ (s, (β s).2.val) d w - |
| 70 | M08.closedChartJacobiPotential W.flow T x₀ (Icc a c) (s, (β s).2.val) |
| 71 | (derivWithin (fun r => (β r).2.val) (Icc a c) s) v w + |
| 72 | M08.timeWithinFDeriv (Icc a c) (extChartAt (𝓡 n) x₀).target |
| 73 | (M08.chartActionMetric W.flow T x₀) (s, (β s).2.val) f w := by |
| 74 | have htime (r : ℝ) (hr : r ∈ Icc a c) : T - r ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 75 | rw [← hclock r hr] |
| 76 | exact (β r).1.property |
| 77 | let A := derivWithin (fun r => (β r).2.val) (Icc a c) s |
| 78 | have hA := squareRootVelocity_gauge_subset b R hsub hβ hrec hs (uniqueDiffOn_Icc hac s hs) |
| 79 | let φ := fun (q : G.Point) (A Y P DP Z : G.Horizontal q) => |
| 80 | G.spacetime.horizontalMetric.inner q DP Z + horizontalRiemann G.leafwise q Y A Z A - |
| 81 | 2 * s * M14BcalPairing G q A Y Z - 2 * s ^ 2 * M14HorizontalHessianPairing G q Y Z + |
| 82 | 4 * s * M14HorizontalRicciDerivativePairing G q Y A Z + |
| 83 | 4 * s * horizontalRicci G.leafwise q P Z |
| 84 | have hgeom := horizontal_five_eval_heq φ (hrec s hs).symm hA hY hP hDP hZ |
| 85 | change φ (R.curve s) (R.horizontal_velocity s) Y P DP Z = _ |
| 86 | rw [hgeom] |
| 87 | rw [gauge_chartActionMetric b W T x₀ (β s).2 s (β s).1 (hclock s hs).symm, |
| 88 | gauge_closedJacobiPotential b hCoordinates W hM04 T hac htime x₀ (β s).2 hs (β s).1 |
| 89 | (hclock s hs).symm hscalar, |
| 90 | gauge_chartActionMetric_timeWithin_pair b hCoordinates W hM04 T hac htime x₀ (β s).2 hs |
| 91 | (β s).1 (hclock s hs).symm] |
| 92 | dsimp only [φ] |
| 93 | ring |
| 94 | |
| 95 | end PoincareMT.M14 |