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.Coordinates.GaugeFirstDerivatives |
| 3 | |
| 4 | /-! |
| 5 | # Geometric index and Euler terms of the coordinate surface formula |
| 6 | |
| 7 | Morgan-Tian Proposition 6.33, pp. 120-121. The actual coefficient |
| 8 | identities combine with covariant Ricci symmetry to give the exact |
| 9 | curvature slots, tensor signs and square-time weights of the frozen |
| 10 | index and Euler expressions. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- Open coordinate vectors are the retained spatial tangent vectors. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 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 | (b : G.gaugeCover.index) |
| 27 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 28 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 29 | (hscalar : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ |
| 30 | (horizontalScalarCurvature G.leafwise)) |
| 31 | (hM04 : RicciFlowCurvatureTheory.{0}) (T : ℝ) {C : Set ℝ} |
| 32 | (hC : UniqueDiffOn ℝ C) |
| 33 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ (G.gaugeCover.interval b).domain) |
| 34 | (x y : G.gaugeCover.spatial b) {s : ℝ} (hs : s ∈ C) (hsN : C ∈ 𝓝 s) |
| 35 | (t : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 36 | (ht : T - s ^ 2 = t.val) |
| 37 | |
| 38 | include hCoordinates hscalar hM04 hC htime hs hsN ht |
| 39 | |
| 40 | /-- The four coordinate index terms give the exact expanded |
| 41 | horizontal index expression, with curvature slots (Y,A,A,Y) and |
| 42 | Ricci-derivative coefficients -4s and 2s, Proposition 6.33, pp. 120-121. -/ |
| 43 | theorem gauge_surfaceIndex_expression (a v d : EuclideanSpace ℝ (Fin n)) : |
| 44 | let m := M08.chartActionMetric W.flow T x |
| 45 | let Γ := M08.closedChartConnection W.flow T x C |
| 46 | let P₀ := fun z => M08.chartActionPotential W.flow T x (s, z) |
| 47 | let q := (G.gaugeCover.cylinder b).toSpacetime (t, y) |
| 48 | let j := (G.gaugeCover.metric b).spatialTangentEquiv t y |
| 49 | m (s, y.val) d d + |
| 50 | m (s, y.val) (M08.coordinateCurvature Γ (s, y.val) v a v) a - |
| 51 | m (s, y.val) (fderiv ℝ Γ (s, y.val) (1, 0) v v) a + |
| 52 | (fderiv ℝ (fderiv ℝ P₀) y.val v v - fderiv ℝ P₀ y.val (Γ (s, y.val) v v)) = |
| 53 | G.spacetime.horizontalMetric.inner q (j d) (j d) + |
| 54 | horizontalRiemann G.leafwise q (j v) (j a) (j a) (j v) + |
| 55 | 2 * s ^ 2 * M14HorizontalHessianPairing G q (j v) (j v) - |
| 56 | 4 * s * M14HorizontalRicciDerivativePairing G q (j v) (j a) (j v) + |
| 57 | 2 * s * M14HorizontalRicciDerivativePairing G q (j a) (j v) (j v) := by |
| 58 | dsimp only |
| 59 | rw [gauge_coordinateCurvature_pair b W hCoordinates hM04 T hC htime x y hs hsN t ht, |
| 60 | gauge_chartConnection_time_pair b W hCoordinates hM04 T hC htime x y hs hsN t ht, |
| 61 | gauge_chartActionPotential_hessian b W hCoordinates hscalar hM04 T hC htime x y hs t ht, |
| 62 | gauge_chartActionMetric b W T x y s t ht] |
| 63 | have hsym := horizontalRicciDerivativePairing_symm |
| 64 | ((G.gaugeCover.cylinder b).toSpacetime (t, y)) |
| 65 | ((G.gaugeCover.metric b).spatialTangentEquiv t y v) |
| 66 | ((G.gaugeCover.metric b).spatialTangentEquiv t y v) |
| 67 | ((G.gaugeCover.metric b).spatialTangentEquiv t y a) |
| 68 | simp only [M14BcalPairing, hsym] |
| 69 | ring |
| 70 | |
| 71 | /-- The coordinate acceleration, potential differential and metric |
| 72 | time derivative give the exact square-time Euler pairing, |
| 73 | Proposition 6.33, pp. 120-121. -/ |
| 74 | theorem gauge_surfaceEuler_expression (a d z : EuclideanSpace ℝ (Fin n)) : |
| 75 | let m := M08.chartActionMetric W.flow T x |
| 76 | let P₀ := fun v => M08.chartActionPotential W.flow T x (s, v) |
| 77 | let q := (G.gaugeCover.cylinder b).toSpacetime (t, y) |
| 78 | let j := (G.gaugeCover.metric b).spatialTangentEquiv t y |
| 79 | m (s, y.val) d z - fderiv ℝ P₀ y.val z + |
| 80 | fderiv ℝ m (s, y.val) (1, 0) a z = |
| 81 | G.spacetime.horizontalMetric.inner q (j d) (j z) - |
| 82 | 2 * s ^ 2 * M14HorizontalScalarDifferential G q (j z).val + |
| 83 | 4 * s * horizontalRicci G.leafwise q (j a) (j z) := by |
| 84 | dsimp only |
| 85 | rw [gauge_chartActionPotential_differential b W hCoordinates hscalar hM04 T htime x y hs t ht, |
| 86 | gauge_chartActionMetric_time_pair b W hCoordinates hM04 T hC htime x y hs hsN t ht, |
| 87 | gauge_chartActionMetric b W T x y s t ht] |
| 88 | |
| 89 | end PoincareMT.M14 |