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.CurveShortening.Ramp.Geometry |
| 2 | import Mathlib.Topology.Instances.AddCircle.Real |
| 3 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 4 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 5 | |
| 6 | /-! |
| 7 | # Actual spacetime and circle geometry for M62 |
| 8 | |
| 9 | Morgan--Tian pp. 441-446 and the 2015 Section 19.2 correction, pp. 2-6. |
| 10 | The carriers, metric forms and tangent maps are primitive construction data. |
| 11 | M62 supplies their existence; connection and curvature identities are stated |
| 12 | separately in Statements/M62Geometry. |
| 13 | The spacetime is restricted to the open time interval; no smooth extension |
| 14 | of the original Ricci flow outside its domain is requested. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M62 |
| 24 | |
| 25 | def OpenTime (a b : ℝ) : TopologicalSpace.Opens ℝ := |
| 26 | ⟨Set.Ioo a b, isOpen_Ioo⟩ |
| 27 | |
| 28 | abbrev SpacetimeCarrier (M : Type u) (a b : ℝ) := M × OpenTime a b |
| 29 | |
| 30 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 32 | {a b : ℝ} |
| 33 | |
| 34 | /-- Standard-dimensional charts compatible with the actual open product. |
| 35 | The split is the actual differential of spatial projection and the clock. -/ |
| 36 | structure SpacetimeCharts (n : ℕ) (M : Type u) [TopologicalSpace M] |
| 37 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 38 | (a b : ℝ) where |
| 39 | chartedSpace : ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) |
| 40 | (SpacetimeCarrier M a b) |
| 41 | isManifold : IsManifold (𝓡 (n + 1)) ∞ (SpacetimeCarrier M a b) |
| 42 | from_product_smooth : ContMDiff ((𝓡 n).prod 𝓘(ℝ, ℝ)) (𝓡 (n + 1)) ∞ |
| 43 | (id : SpacetimeCarrier M a b → SpacetimeCarrier M a b) |
| 44 | to_product_smooth : ContMDiff (𝓡 (n + 1)) ((𝓡 n).prod 𝓘(ℝ, ℝ)) ∞ |
| 45 | (id : SpacetimeCarrier M a b → SpacetimeCarrier M a b) |
| 46 | split : ∀ q : SpacetimeCarrier M a b, |
| 47 | TangentSpace (𝓡 (n + 1)) q ≃L[ℝ] TangentSpace (𝓡 n) q.1 × ℝ |
| 48 | split_space : ∀ q V, |
| 49 | (split q V).1 = mfderiv (𝓡 (n + 1)) (𝓡 n) |
| 50 | (Prod.fst : SpacetimeCarrier M a b → M) q V |
| 51 | split_time : ∀ q V, |
| 52 | (split q V).2 = mfderiv (𝓡 (n + 1)) 𝓘(ℝ, ℝ) |
| 53 | (fun p : SpacetimeCarrier M a b => (p.2 : ℝ)) q V |
| 54 | |
| 55 | namespace SpacetimeCharts |
| 56 | |
| 57 | abbrev Point (_C : SpacetimeCharts n M a b) := SpacetimeCarrier M a b |
| 58 | |
| 59 | instance (C : SpacetimeCharts n M a b) : |
| 60 | ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) C.Point := C.chartedSpace |
| 61 | |
| 62 | instance (C : SpacetimeCharts n M a b) : |
| 63 | IsManifold (𝓡 (n + 1)) ∞ C.Point := C.isManifold |
| 64 | |
| 65 | noncomputable def horizontal (C : SpacetimeCharts n M a b) (q : C.Point) |
| 66 | (V : TangentSpace (𝓡 n) q.1) : TangentSpace (𝓡 (n + 1)) q := |
| 67 | (C.split q).symm (V, 0) |
| 68 | |
| 69 | noncomputable def timeVector (C : SpacetimeCharts n M a b) (q : C.Point) : |
| 70 | TangentSpace (𝓡 (n + 1)) q := (C.split q).symm (0, 1) |
| 71 | |
| 72 | noncomputable def liftSpatialField (C : SpacetimeCharts n M a b) |
| 73 | (B : ℝ → (p : M) → TangentSpace (𝓡 n) p) (q : C.Point) : |
| 74 | TangentSpace (𝓡 (n + 1)) q := C.horizontal q (B q.2 q.1) |
| 75 | |
| 76 | def IsSmoothField (C : SpacetimeCharts n M a b) |
| 77 | (V : (q : C.Point) → TangentSpace (𝓡 (n + 1)) q) : Prop := |
| 78 | ContMDiff (𝓡 (n + 1)) |
| 79 | ((𝓡 (n + 1)).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin (n + 1)))) ∞ |
| 80 | (fun q : C.Point => (⟨q, V q⟩ : TangentBundle (𝓡 (n + 1)) C.Point)) |
| 81 | |
| 82 | end SpacetimeCharts |
| 83 | |
| 84 | /-- Constructed full metric and its actual compatible torsion-free connection. -/ |
| 85 | structure SpacetimeData (F : RicciFlow n M (Set.Icc a b)) where |
| 86 | charts : SpacetimeCharts n M a b |
| 87 | metric : RiemannianMetric (n + 1) charts.Point |
| 88 | connection : LeviCivitaData metric |
| 89 | metric_eq : ∀ (q : charts.Point) (V W : TangentSpace (𝓡 (n + 1)) q), |
| 90 | metric.inner q V W = |
| 91 | (F.metric q.2).inner q.1 (charts.split q V).1 (charts.split q W).1 + |
| 92 | (charts.split q V).2 * (charts.split q W).2 |
| 93 | |
| 94 | /-- Ordinary time differentiation in one fixed spatial tangent fiber. |
| 95 | The trivialization is fixed at p before time varies. -/ |
| 96 | noncomputable def fixedPointTimeDerivative |
| 97 | (B : ℝ → (p : M) → TangentSpace (𝓡 n) p) (p : M) (t : ℝ) : |
| 98 | TangentSpace (𝓡 n) p := |
| 99 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 100 | (TangentSpace (𝓡 n) : M → Type _) p |
| 101 | e.symmL ℝ p (deriv (fun r => (e ⟨p, B r p⟩).2) t) |
| 102 | |
| 103 | namespace SpacetimeData |
| 104 | |
| 105 | variable {F : RicciFlow n M (Set.Icc a b)} |
| 106 | |
| 107 | /-- Along-parameter differentiation; no extension over the image of gamma. -/ |
| 108 | noncomputable def covariantAlong (G : SpacetimeData F) |
| 109 | (gamma : ℝ → G.charts.Point) |
| 110 | (Y : (s : ℝ) → TangentSpace (𝓡 (n + 1)) (gamma s)) (s : ℝ) : |
| 111 | TangentSpace (𝓡 (n + 1)) (gamma s) := |
| 112 | rampHorizontalCovariantDerivative G.connection gamma Y s |
| 113 | |
| 114 | /-- The actual spacetime lift on the actual open parameter cylinder. -/ |
| 115 | def liftCurve (G : SpacetimeData F) (c : ℝ → ℝ → M) : |
| 116 | ℝ × OpenTime a b → G.charts.Point := fun z => (c z.1 z.2, z.2) |
| 117 | |
| 118 | /-- Its genuine time differential, prior to using the shrinking equation. -/ |
| 119 | noncomputable def liftedTimeVelocity (G : SpacetimeData F) |
| 120 | (c : ℝ → ℝ → M) (z : ℝ × OpenTime a b) : |
| 121 | TangentSpace (𝓡 (n + 1)) (G.liftCurve c z) := |
| 122 | mfderiv ((𝓘(ℝ, ℝ)).prod 𝓘(ℝ, ℝ)) (𝓡 (n + 1)) |
| 123 | (G.liftCurve c) z (0, 1) |
| 124 | |
| 125 | end SpacetimeData |
| 126 | |
| 127 | /-- The genuine quotient circle with arc-length metric and fixed positive frame. |
| 128 | Its charts can be built from AddCircle.openPartialHomeomorphCoe. -/ |
| 129 | structure CircleGeometry (circumference : ℝ) where |
| 130 | positive : 0 < circumference |
| 131 | chartedSpace : ChartedSpace (EuclideanSpace ℝ (Fin 1)) (AddCircle circumference) |
| 132 | isManifold : IsManifold (𝓡 1) ∞ (AddCircle circumference) |
| 133 | quotient_smooth : ContMDiff 𝓘(ℝ, ℝ) (𝓡 1) ∞ |
| 134 | (fun s : ℝ => (s : AddCircle circumference)) |
| 135 | quotient_local_diffeomorph : IsLocalDiffeomorph 𝓘(ℝ, ℝ) (𝓡 1) ∞ |
| 136 | (fun s : ℝ => (s : AddCircle circumference)) |
| 137 | metric : RiemannianMetric 1 (AddCircle circumference) |
| 138 | connection : LeviCivitaData metric |
| 139 | metric_quotient : ∀ (s v w : ℝ), |
| 140 | metric.inner (s : AddCircle circumference) |
| 141 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 1) (fun r : ℝ => (r : AddCircle circumference)) s v) |
| 142 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 1) (fun r : ℝ => (r : AddCircle circumference)) s w) = v * w |
| 143 | frame : ∀ q : AddCircle circumference, TangentSpace (𝓡 1) q |
| 144 | frame_quotient : ∀ s : ℝ, |
| 145 | frame (s : AddCircle circumference) = |
| 146 | mfderiv 𝓘(ℝ, ℝ) (𝓡 1) (fun r : ℝ => (r : AddCircle circumference)) s 1 |
| 147 | |
| 148 | namespace CircleGeometry |
| 149 | |
| 150 | variable {circumference : ℝ} |
| 151 | |
| 152 | abbrev Point (_C : CircleGeometry circumference) := AddCircle circumference |
| 153 | |
| 154 | instance (C : CircleGeometry circumference) : |
| 155 | ChartedSpace (EuclideanSpace ℝ (Fin 1)) C.Point := C.chartedSpace |
| 156 | |
| 157 | instance (C : CircleGeometry circumference) : IsManifold (𝓡 1) ∞ C.Point := C.isManifold |
| 158 | |
| 159 | def quotient (C : CircleGeometry circumference) : ℝ → C.Point := fun s => (s : AddCircle _) |
| 160 | |
| 161 | abbrev metricOnPoints (C : CircleGeometry circumference) : RiemannianMetric 1 C.Point := C.metric |
| 162 | |
| 163 | abbrev connectionOnPoints (C : CircleGeometry circumference) : LeviCivitaData C.metricOnPoints := |
| 164 | C.connection |
| 165 | |
| 166 | end CircleGeometry |
| 167 | |
| 168 | /-- One fixed standard-dimensional realization of the genuine spatial product. -/ |
| 169 | structure CircleProductCharts {circumference : ℝ} (C : CircleGeometry circumference) |
| 170 | (n : ℕ) (M : Type u) [TopologicalSpace M] |
| 171 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] where |
| 172 | chartedSpace : ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) (M × C.Point) |
| 173 | isManifold : IsManifold (𝓡 (n + 1)) ∞ (M × C.Point) |
| 174 | from_product_smooth : ContMDiff ((𝓡 n).prod (𝓡 1)) (𝓡 (n + 1)) ∞ |
| 175 | (id : M × C.Point → M × C.Point) |
| 176 | to_product_smooth : ContMDiff (𝓡 (n + 1)) ((𝓡 n).prod (𝓡 1)) ∞ |
| 177 | (id : M × C.Point → M × C.Point) |
| 178 | split : ∀ q : M × C.Point, TangentSpace (𝓡 (n + 1)) q ≃L[ℝ] |
| 179 | TangentSpace (𝓡 n) q.1 × TangentSpace (𝓡 1) q.2 |
| 180 | split_space : ∀ q V, |
| 181 | (split q V).1 = mfderiv (𝓡 (n + 1)) (𝓡 n) (Prod.fst : M × C.Point → M) q V |
| 182 | split_circle : ∀ q V, |
| 183 | (split q V).2 = mfderiv (𝓡 (n + 1)) (𝓡 1) (Prod.snd : M × C.Point → C.Point) q V |
| 184 | |
| 185 | namespace CircleProductCharts |
| 186 | |
| 187 | variable {circumference : ℝ} {C : CircleGeometry circumference} |
| 188 | |
| 189 | abbrev Point (_P : CircleProductCharts C n M) := M × C.Point |
| 190 | |
| 191 | instance (P : CircleProductCharts C n M) : |
| 192 | ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) P.Point := P.chartedSpace |
| 193 | |
| 194 | instance (P : CircleProductCharts C n M) : IsManifold (𝓡 (n + 1)) ∞ P.Point := P.isManifold |
| 195 | |
| 196 | /-- The fixed positive circle field, independent of flow time. -/ |
| 197 | noncomputable def circleUnit (P : CircleProductCharts C n M) (q : P.Point) : |
| 198 | TangentSpace (𝓡 (n + 1)) q := (P.split q).symm (0, C.frame q.2) |
| 199 | |
| 200 | end CircleProductCharts |
| 201 | |
| 202 | /-- The actual product Ricci flow, including its genuine retained connection. -/ |
| 203 | structure CircleProductData (F : RicciFlow n M (Set.Icc a b)) (circumference : ℝ) where |
| 204 | circle : CircleGeometry circumference |
| 205 | charts : CircleProductCharts circle n M |
| 206 | flow : RicciFlow (n + 1) charts.Point (Set.Icc a b) |
| 207 | metric_eq : ∀ (t : ℝ) (q : charts.Point) (V W : TangentSpace (𝓡 (n + 1)) q), |
| 208 | (flow.metric t).inner q V W = |
| 209 | (F.metric t).inner q.1 (charts.split q V).1 (charts.split q W).1 + |
| 210 | circle.metricOnPoints.inner q.2 (charts.split q V).2 (charts.split q W).2 |
| 211 | |
| 212 | end PoincareMT.M62 |