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.Gauge.Pullback.Geometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Connections |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Differential |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.EquationBridge |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.ProductCover |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.CalculusAssembly |
| 7 | import PoincareLib.Geometry.Spacetime.Horizontal.Choice |
| 8 | import PoincareLib.Geometry.Spacetime.Horizontal.Regularity |
| 9 | |
| 10 | /-! |
| 11 | # Assembly of gauge equations and ordinary-product geometry |
| 12 | |
| 13 | These assembly lemmas consume the moving calculus for the retained connections. |
| 14 | The moving metric and the ordinary-product cover are constructed geometrically. |
| 15 | |
| 16 | Source: Morgan-Tian, Definition 3.36 and Remark 3.37, pp. 60-61. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle Topology |
| 22 | open Set |
| 23 | |
| 24 | universe u v |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | noncomputable section |
| 29 | |
| 30 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 31 | {I : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 32 | {S : ∀ t : ℝ, SpacetimeSliceGeometry F t} |
| 33 | |
| 34 | def CompatibleSpacetimeCylinder.pullbackMetricGeometry |
| 35 | {K : SpacetimeInterval} {T : SmoothSpacetimeInterval K} |
| 36 | {C : Type v} [TopologicalSpace C] |
| 37 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 38 | (e : CompatibleSpacetimeCylinder F T C) : SpacetimeCylinderMetric e where |
| 39 | metric := e.toMovingSpacetimeGauge.geometry.metric |
| 40 | smooth := e.toMovingSpacetimeGauge.geometry.smooth |
| 41 | spatialTangentEquiv := e.toMovingSpacetimeGauge.geometry.spatialTangentEquiv |
| 42 | spatialTangentEquiv_eq := e.toMovingSpacetimeGauge.geometry.spatialTangentEquiv_eq |
| 43 | metric_eq := e.toMovingSpacetimeGauge.geometry.metric_eq |
| 44 | |
| 45 | theorem spacetimeGaugeTheory_of_moving_calculus |
| 46 | (hMetric : M12MetricPredecessors.{v} n) |
| 47 | (D : LeafwiseLeviCivitaFamily F S) (T : SpacetimeIntervalSystem) |
| 48 | (hCalc : ∀ (C : Type v) [TopologicalSpace C] |
| 49 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 50 | (K : SpacetimeInterval) (e : MovingSpacetimeGauge F (T.interval K) C) |
| 51 | (G : MovingSpacetimeGaugeGeometry e) (c : MetricLeviCivitaFamily G.metric), |
| 52 | MovingGaugeCalculus D G c) : SpacetimeGaugeTheory.{u, v} D T := by |
| 53 | refine |
| 54 | { moving_geometry := fun _ _ _ _ _ e => ⟨e.geometry⟩ |
| 55 | moving_connections := fun _ _ _ _ _ _ G => hMetric.exists_gaugeMetricLeviCivitaFamily G |
| 56 | moving_calculus := hCalc |
| 57 | compatible_zero_drift := fun _ _ _ _ _ e G => compatibleMovingGaugeDrift_zero e G |
| 58 | compatible_equivalence := ?_ |
| 59 | compatible_ordinary := ?_ |
| 60 | compatible_realization := ?_ |
| 61 | cover_converse := ?_ } |
| 62 | · intro C _ _ _ K e G c |
| 63 | exact compatible_equivalence_of_calculus_zero_drift D e G c |
| 64 | (hCalc C K e.toMovingSpacetimeGauge G.toMovingSpacetimeGaugeGeometry c) |
| 65 | (compatibleMovingGaugeDrift_zero e G) |
| 66 | · intro C _ _ _ K e G h |
| 67 | obtain ⟨c⟩ := hMetric.exists_gaugeMetricLeviCivitaFamily G.toMovingSpacetimeGaugeGeometry |
| 68 | exact compatible_ordinary_of_calculus_zero_drift D e G c |
| 69 | (hCalc C K e.toMovingSpacetimeGauge G.toMovingSpacetimeGaugeGeometry c) |
| 70 | (compatibleMovingGaugeDrift_zero e G) h |
| 71 | · intro h C _ _ _ K e |
| 72 | let G := e.pullbackMetricGeometry |
| 73 | obtain ⟨c⟩ := hMetric.exists_gaugeMetricLeviCivitaFamily G.toMovingSpacetimeGaugeGeometry |
| 74 | refine ⟨G, compatible_ordinary_of_calculus_zero_drift D e G c |
| 75 | (hCalc C K e.toMovingSpacetimeGauge G.toMovingSpacetimeGaugeGeometry c) |
| 76 | (compatibleMovingGaugeDrift_zero e G) ?_⟩ |
| 77 | exact fun p _ u v => h p u v |
| 78 | · intro B C _ _ _ K e G c hc hp |
| 79 | exact cover_converse_of_calculus_zero_drift D T B C K e G c |
| 80 | (fun b => hCalc (C b) (K b) (e b).toMovingSpacetimeGauge |
| 81 | (G b).toMovingSpacetimeGaugeGeometry (c b)) |
| 82 | (fun b => compatibleMovingGaugeDrift_zero (e b) (G b)) hc hp |
| 83 | |
| 84 | /-- Construct the gauge theory from the metric predecessors at the source |
| 85 | carrier universe. No horizontal regularity hypothesis is needed. -/ |
| 86 | theorem spacetimeGaugeTheory |
| 87 | (hMetric : M12MetricPredecessors.{v} n) |
| 88 | (D : LeafwiseLeviCivitaFamily F S) (T : SpacetimeIntervalSystem) : |
| 89 | SpacetimeGaugeTheory.{u, v} D T := by |
| 90 | apply spacetimeGaugeTheory_of_moving_calculus hMetric D T |
| 91 | intro C _ _ _ K e G c |
| 92 | exact movingGaugeCalculus D G c |
| 93 | |
| 94 | theorem SpacetimeGaugeTheory.adapted_equation_iff |
| 95 | {D : LeafwiseLeviCivitaFamily F S} {T : SpacetimeIntervalSystem} |
| 96 | (h : SpacetimeGaugeTheory.{u, 0} D T) (cover : SpacetimeGaugeCover F T) : |
| 97 | IntrinsicGeneralizedRicciEquation D ↔ |
| 98 | ∀ b, ∀ c : MetricLeviCivitaFamily (cover.metric b).metric, |
| 99 | OrdinaryMetricRicciPDE (cover.metric b).metric c (cover.interval b) := by |
| 100 | constructor |
| 101 | · intro he b c |
| 102 | apply (h.compatible_equivalence (cover.spatial b) (cover.interval b) |
| 103 | (cover.cylinder b) (cover.metric b) c).mp |
| 104 | exact fun p _ u v => he p u v |
| 105 | · intro he |
| 106 | let c : ∀ b, MetricLeviCivitaFamily (cover.metric b).metric := fun b => |
| 107 | (h.moving_connections (cover.spatial b) (cover.interval b) |
| 108 | (cover.cylinder b).toMovingSpacetimeGauge |
| 109 | (cover.metric b).toMovingSpacetimeGaugeGeometry).some |
| 110 | exact h.cover_converse cover.index (fun b => cover.spatial b) cover.interval |
| 111 | cover.cylinder cover.metric c cover.covers (fun b => he b (c b)) |
| 112 | |
| 113 | namespace OrdinaryProductSpacetimeConclusion |
| 114 | |
| 115 | variable {M : Type u} [TopologicalSpace M] |
| 116 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 117 | {g : ℝ → RiemannianMetric n M} |
| 118 | |
| 119 | theorem intrinsicEquation_iff_on_productCylinder (P : OrdinaryProductSpacetimeConclusion g I) |
| 120 | (D : LeafwiseLeviCivitaFamily P.spacetime P.slices) : |
| 121 | IntrinsicGeneralizedRicciEquation D ↔ |
| 122 | IntrinsicGeneralizedRicciEquationOn D (range P.productCylinder.toSpacetime) := by |
| 123 | constructor |
| 124 | · exact fun h p _ u v => h p u v |
| 125 | · intro h p u v |
| 126 | exact h p ⟨p, P.productCylinder_eq p⟩ u v |
| 127 | |
| 128 | def ricciGeometry (P : OrdinaryProductSpacetimeConclusion g I) |
| 129 | (D : LeafwiseLeviCivitaFamily P.spacetime P.slices) |
| 130 | (hGauge : SpacetimeGaugeTheory.{u, u} D P.timeIntervals) : OrdinaryProductRicciGeometry g I where |
| 131 | product := P |
| 132 | cover := P.gaugeCover |
| 133 | leafwiseConnection := D |
| 134 | equation_iff := by |
| 135 | intro c |
| 136 | rw [P.intrinsicEquation_iff_on_productCylinder D] |
| 137 | have h := hGauge.compatible_equivalence M I P.productCylinder P.productMetric |
| 138 | rw [P.productMetric_eq] at h |
| 139 | exact h c |
| 140 | ordinary_from_equation := fun h => hGauge.compatible_ordinary M I |
| 141 | P.productCylinder P.productMetric ((P.intrinsicEquation_iff_on_productCylinder D).mp h) |
| 142 | |
| 143 | end OrdinaryProductSpacetimeConclusion |
| 144 | |
| 145 | /-- The ordinary-product clause of M12 follows directly from its supplied |
| 146 | geometry and metric predecessors. -/ |
| 147 | theorem exists_ordinaryProductRicciGeometry |
| 148 | (hGeometry : GeneralizedSpacetimeGeometryTheory.{u} n) |
| 149 | (hMetric : M12MetricPredecessors.{u} n) |
| 150 | (M : Type u) [TopologicalSpace M] |
| 151 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 152 | [T2Space M] [SecondCountableTopology M] [Nonempty M] |
| 153 | (g : ℝ → RiemannianMetric n M) (I : SpacetimeInterval) |
| 154 | (hg : RiemannianMetric.IsSmoothFamilyOn g I.domain) : |
| 155 | Nonempty (OrdinaryProductRicciGeometry g I) := by |
| 156 | obtain ⟨P⟩ := hGeometry.ordinary_product M g I hg |
| 157 | obtain ⟨D⟩ := hMetric.exists_leafwiseLeviCivitaFamily P.slices |
| 158 | exact ⟨P.ricciGeometry D (spacetimeGaugeTheory hMetric D P.timeIntervals)⟩ |
| 159 | |
| 160 | /-- Assemble the frozen conclusion once its horizontal and moving calculus |
| 161 | producers have been supplied at the two required carrier universes. -/ |
| 162 | theorem generalizedRicciGaugeTheory_of_calculus |
| 163 | (hGeometry : GeneralizedSpacetimeGeometryTheory.{u} n) |
| 164 | (hMetric : M12MetricPredecessors.{u} n) |
| 165 | (hHorizontal : ∀ (X : Type u) [TopologicalSpace X] (time : X → ℝ) |
| 166 | (I : SpacetimeInterval) (F : GeneralizedFlowSpacetime n X time I) |
| 167 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) (T : SpacetimeIntervalSystem) |
| 168 | (_cover : SpacetimeGaugeCover F T) (D : LeafwiseLeviCivitaFamily F S), |
| 169 | HorizontalRicciCalculus D) |
| 170 | (hGauges : ∀ (X : Type u) [TopologicalSpace X] (time : X → ℝ) |
| 171 | (I : SpacetimeInterval) (F : GeneralizedFlowSpacetime n X time I) |
| 172 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) (T : SpacetimeIntervalSystem) |
| 173 | (_cover : SpacetimeGaugeCover F T) (D : LeafwiseLeviCivitaFamily F S), |
| 174 | SpacetimeGaugeTheory.{u, u} D T) |
| 175 | (hCoordinates : ∀ (X : Type u) [TopologicalSpace X] (time : X → ℝ) |
| 176 | (I : SpacetimeInterval) (F : GeneralizedFlowSpacetime n X time I) |
| 177 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) (T : SpacetimeIntervalSystem) |
| 178 | (_cover : SpacetimeGaugeCover F T) (D : LeafwiseLeviCivitaFamily F S), |
| 179 | SpacetimeGaugeTheory.{u, 0} D T) : GeneralizedRicciGaugeTheory.{u} n := by |
| 180 | refine |
| 181 | { leafwise_calculus := ?_ |
| 182 | gauges := hGauges |
| 183 | coordinate_gauges := hCoordinates |
| 184 | adapted_equation := ?_ |
| 185 | ordinary_product := ?_ } |
| 186 | · intro X _ time I F S T cover |
| 187 | exact ⟨hMetric.exists_leafwiseLeviCivitaFamily S, |
| 188 | hHorizontal X time I F S T cover⟩ |
| 189 | · intro X _ time I F S T cover D |
| 190 | exact (hCoordinates X time I F S T cover D).adapted_equation_iff cover |
| 191 | · intro M _ _ _ _ _ _ g I hg |
| 192 | obtain ⟨P⟩ := hGeometry.ordinary_product M g I hg |
| 193 | obtain ⟨D⟩ := hMetric.exists_leafwiseLeviCivitaFamily P.slices |
| 194 | exact ⟨P.ricciGeometry D |
| 195 | (hGauges (I.domain × M) (fun p => p.1.val) I P.spacetime |
| 196 | P.slices P.timeIntervals P.gaugeCover D)⟩ |
| 197 | |
| 198 | /-- The remaining input to M12 is joint horizontal calculus. The moving-gauge |
| 199 | and ordinary-product clauses use the proved calculus at both universes. -/ |
| 200 | theorem generalizedRicciGaugeTheory_of_horizontal_calculus |
| 201 | (hGeometry : GeneralizedSpacetimeGeometryTheory.{u} n) |
| 202 | (hMetric : M12MetricPredecessors.{u} n) |
| 203 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 204 | (hHorizontal : ∀ (X : Type u) [TopologicalSpace X] (time : X → ℝ) |
| 205 | (I : SpacetimeInterval) (F : GeneralizedFlowSpacetime n X time I) |
| 206 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) (T : SpacetimeIntervalSystem) |
| 207 | (_cover : SpacetimeGaugeCover F T) (D : LeafwiseLeviCivitaFamily F S), |
| 208 | HorizontalRicciCalculus D) : GeneralizedRicciGaugeTheory.{u} n := by |
| 209 | apply generalizedRicciGaugeTheory_of_calculus hGeometry hMetric hHorizontal |
| 210 | · intro X _ time I F S T cover D |
| 211 | exact spacetimeGaugeTheory hMetric D T |
| 212 | · intro X _ time I F S T cover D |
| 213 | exact spacetimeGaugeTheory hCoordinates D T |
| 214 | |
| 215 | /-- The complete frozen M12 conclusion from the supplied M11 geometry and |
| 216 | M03/M04 metric predecessors, at both required carrier universes. -/ |
| 217 | theorem generalizedRicciGaugeGeometry (n : ℕ) |
| 218 | (hGeometry : GeneralizedSpacetimeGeometryTheory.{u} n) |
| 219 | (hMetric : M12MetricPredecessors.{u} n) |
| 220 | (hCoordinates : M12MetricPredecessors.{0} n) : |
| 221 | GeneralizedRicciGaugeTheory.{u} n := by |
| 222 | apply generalizedRicciGaugeTheory_of_horizontal_calculus hGeometry hMetric hCoordinates |
| 223 | intro X _ time I F S T cover D |
| 224 | exact horizontalRicciCalculus_of_adapted_cover hMetric hCoordinates D T cover |
| 225 | |
| 226 | end |
| 227 | |
| 228 | end PoincareMT |