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.Spacetime.Horizontal.Basic |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Moving |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Cover |
| 4 | |
| 5 | /-! Ported from Mapher06/Poincare-MorganTian, `PoincareMT/Definitions/M12GeneralizedEquation.lean`, |
| 6 | revision `b2c3c64781fee22edfd683a224d4f8d280e2e9ce`. Declaration bodies are unchanged; |
| 7 | only imports and module placement differ. See |
| 8 | `references/ricci-flow/mapher/spacetime-port.json`. -/ |
| 9 | |
| 10 | /-! |
| 11 | # Intrinsic and ordinary Ricci equations |
| 12 | |
| 13 | Morgan-Tian Definitions 3.1-3.2 and 3.36-3.38, pp. 35 and 60-61. |
| 14 | The ordinary PDE is imposed on a supplied metric and connection family, |
| 15 | before an ordinary flow witness is constructed. Every moving drift is |
| 16 | determined by its actual gauge map. All included times use within derivatives. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle Topology |
| 22 | |
| 23 | universe u v |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | section Ordinary |
| 28 | |
| 29 | variable {n : ℕ} {C : Type v} [TopologicalSpace C] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 31 | |
| 32 | /-- A retained connection for every member of one total metric family. -/ |
| 33 | abbrev MetricLeviCivitaFamily (g : ℝ → RiemannianMetric n C) := |
| 34 | (t : ℝ) → LeviCivitaData (g t) |
| 35 | |
| 36 | /-- The actual ordinary equation, without assuming an existing RicciFlow. -/ |
| 37 | def OrdinaryMetricRicciPDE (g : ℝ → RiemannianMetric n C) |
| 38 | (D : MetricLeviCivitaFamily g) (I : SpacetimeInterval) : Prop := |
| 39 | ∀ t ∈ I.domain, ∀ x : C, ∀ u v : TangentSpace (𝓡 n) x, |
| 40 | HasDerivWithinAt (fun s ↦ (g s).inner x u v) |
| 41 | (-2 * (D t).ricci x u v) I.domain t |
| 42 | |
| 43 | /-- The spatial metric Lie expression through its actual compatible connection. -/ |
| 44 | noncomputable def ordinaryMetricLieDerivative (g : RiemannianMetric n C) |
| 45 | (D : LeviCivitaData g) (V : (x : C) → TangentSpace (𝓡 n) x) |
| 46 | (x : C) (u v : TangentSpace (𝓡 n) x) : ℝ := |
| 47 | g.inner x (D.connection V x u) v + g.inner x u (D.connection V x v) |
| 48 | |
| 49 | end Ordinary |
| 50 | |
| 51 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 52 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 53 | {S : ∀ t : ℝ, SpacetimeSliceGeometry F t} |
| 54 | |
| 55 | /-- The intrinsic equation restricted to an actual subset of spacetime. -/ |
| 56 | def IntrinsicGeneralizedRicciEquationOn (D : LeafwiseLeviCivitaFamily F S) |
| 57 | (U : Set F.Point) : Prop := |
| 58 | ∀ p ∈ U, ∀ u v : F.Horizontal p, |
| 59 | horizontalMetricLieDerivative F p u v = -2 * horizontalRicci D p u v |
| 60 | |
| 61 | /-- Generalized Ricci-flow data retain actual slice connections and the intrinsic PDE. -/ |
| 62 | structure IntrinsicRicciFlow (F : GeneralizedFlowSpacetime n X time I) |
| 63 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) where |
| 64 | leafwiseConnection : LeafwiseLeviCivitaFamily F S |
| 65 | equation : IntrinsicGeneralizedRicciEquation leafwiseConnection |
| 66 | |
| 67 | variable {T : SmoothSpacetimeInterval K} {C : Type v} [TopologicalSpace C] |
| 68 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 69 | |
| 70 | /-- The moving-gauge equation with the actual drift and the corrected minus sign. -/ |
| 71 | def MovingGaugeRicciPDE {e : MovingSpacetimeGauge F T C} |
| 72 | (G : MovingSpacetimeGaugeGeometry e) (D : MetricLeviCivitaFamily G.metric) : Prop := |
| 73 | ∀ t (ht : t ∈ K.domain), ∀ x : C, ∀ u v : TangentSpace (𝓡 n) x, |
| 74 | HasDerivWithinAt (fun s ↦ (G.metric s).inner x u v) |
| 75 | (-2 * (D t).ricci x u v - ordinaryMetricLieDerivative (G.metric t) (D t) |
| 76 | (movingGaugeDrift G ⟨t, ht⟩) x u v) K.domain t |
| 77 | |
| 78 | /-- An actual ordinary flow on the supplied compatible cylinder, with the |
| 79 | same metric representative and actual horizontal metric/Ricci pullbacks. -/ |
| 80 | structure OrdinaryGaugeWitness (D : LeafwiseLeviCivitaFamily F S) |
| 81 | (e : CompatibleSpacetimeCylinder F T C) (G : SpacetimeCylinderMetric e) where |
| 82 | flow : RicciFlow n C K.domain |
| 83 | metric_eq : flow.metric = G.metric |
| 84 | metric_pullback : ∀ t : T.Point, ∀ x u v, |
| 85 | (flow.metric t.val).inner x u v = |
| 86 | F.horizontalMetric.inner (e.toSpacetime (t, x)) |
| 87 | (G.spatialTangentEquiv t x u) (G.spatialTangentEquiv t x v) |
| 88 | ricci_pullback : ∀ t : T.Point, ∀ x u v, |
| 89 | (flow.connection t.val).ricci x u v = |
| 90 | horizontalRicci D (e.toSpacetime (t, x)) |
| 91 | (G.spatialTangentEquiv t x u) (G.spatialTangentEquiv t x v) |
| 92 | |
| 93 | end PoincareMT |