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.Evolution.Flow |
| 2 | import PoincareLib.Geometry.CurveShortening.Evolution.Theory |
| 3 | import PoincareLib.Geometry.CurveShortening.Evolution.CovariantTheory |
| 4 | |
| 5 | /-! |
| 6 | # M62 exact curve evolution and uniform estimates |
| 7 | |
| 8 | The scalar and spatial expressions refer directly to the supplied curve and |
| 9 | ambient flow. The 2015 correction's regularization is retained at curvature |
| 10 | zeros, and its total-curvature conclusion is integrated before taking limits. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {a b : ℝ} |
| 24 | |
| 25 | /-- Exact spatial form of the corrected equation, with all connection-variation terms. -/ |
| 26 | noncomputable def m62SpatialEvolutionRhs (F : RicciFlow n M (Set.Icc a b)) |
| 27 | (c : ℝ → ℝ → M) (t x : ℝ) : ℝ := |
| 28 | let H := m62CurvatureVector F c t x |
| 29 | let S := spatialUnitTangent F c t x |
| 30 | let P := m62SpatialNormalDerivative F c t x |
| 31 | let D := F.connection t |
| 32 | let k2 := m62CurvatureSquared F c t x |
| 33 | m62ArcSecondDerivative F c t (m62CurvatureSquared F c t) x - |
| 34 | 2 * (F.metric t).inner (c x t) P P + 2 * k2 ^ 2 - |
| 35 | 2 * D.ricci (c x t) H H + 4 * k2 * D.ricci (c x t) S S + |
| 36 | 2 * D.curvatureTensor (c x t) H S H S + |
| 37 | 2 * D.covariantTensorDerivative D.ricciEvaluation (c x t) ![H, S, S] - |
| 38 | 4 * D.covariantTensorDerivative D.ricciEvaluation (c x t) ![S, S, H] |
| 39 | |
| 40 | /-- Speed, the parameter-domain commutator, and the exact spatial equation. -/ |
| 41 | structure M62SpatialEvolution (F : RicciFlow n M (Set.Icc a b)) |
| 42 | (c : ℝ → ℝ → M) : Prop where |
| 43 | speed_positive : ∀ t ∈ Set.Icc a b, ∀ x, 0 < curveSpeed F c t x |
| 44 | speed_squared : ∀ t ∈ Set.Ioo a b, ∀ x, |
| 45 | HasDerivAt (fun s ↦ (curveSpeed F c s x) ^ 2) |
| 46 | (-2 * (m62TangentRicci F c t x + m62CurvatureSquared F c t x) * |
| 47 | (curveSpeed F c t x) ^ 2) t |
| 48 | speed_derivative : ∀ t ∈ Set.Ioo a b, ∀ x, |
| 49 | HasDerivAt (fun s ↦ curveSpeed F c s x) |
| 50 | (-(m62TangentRicci F c t x + m62CurvatureSquared F c t x) * |
| 51 | curveSpeed F c t x) t |
| 52 | commutator : ∀ f : ℝ × ℝ → ℝ, |
| 53 | ContDiffOn ℝ 2 f (Set.univ ×ˢ Set.Ioo a b) → ∀ t ∈ Set.Ioo a b, ∀ x, |
| 54 | deriv (fun s ↦ m62ArcDerivative F c s (fun y ↦ f (y, s)) x) t - |
| 55 | m62ArcDerivative F c t (fun y ↦ deriv (fun s ↦ f (y, s)) t) x = |
| 56 | (m62CurvatureSquared F c t x + m62TangentRicci F c t x) * |
| 57 | m62ArcDerivative F c t (fun y ↦ f (y, t)) x |
| 58 | curvature_squared_smooth : ContDiffOn ℝ ∞ |
| 59 | (fun z : ℝ × ℝ ↦ m62CurvatureSquared F c z.2 z.1) |
| 60 | (Set.univ ×ˢ Set.Ioo a b) |
| 61 | exact_curvature : ∀ t ∈ Set.Ioo a b, ∀ x, |
| 62 | HasDerivAt (fun s ↦ m62CurvatureSquared F c s x) |
| 63 | (m62SpatialEvolutionRhs F c t x) t |
| 64 | |
| 65 | /-- Quantitative consequences with constants fixed by the three ambient bounds. -/ |
| 66 | structure M62CurveEstimates (F : RicciFlow n M (Set.Icc a b)) |
| 67 | (c : ℝ → ℝ → M) (K0 K1 K2 : ℝ) : Prop where |
| 68 | spatial_squared_bound : ∀ t ∈ Set.Ioo a b, ∀ x, |
| 69 | let P := m62SpatialNormalDerivative F c t x |
| 70 | let k2 := m62CurvatureSquared F c t x |
| 71 | deriv (fun s ↦ m62CurvatureSquared F c s x) t ≤ |
| 72 | m62ArcSecondDerivative F c t (m62CurvatureSquared F c t) x - |
| 73 | 2 * (F.metric t).inner (c x t) P P + 2 * k2 ^ 2 + |
| 74 | m62C0 K0 K1 K2 * (k2 + m62Curvature F c t x) |
| 75 | regularized_positive : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Icc a b, ∀ x, |
| 76 | 0 < m62RegularizedCurvature F c ε t x |
| 77 | regularized_smooth : ∀ ε : ℝ, 0 < ε → ContDiffOn ℝ ∞ |
| 78 | (fun z : ℝ × ℝ ↦ m62RegularizedCurvature F c ε z.2 z.1) |
| 79 | (Set.univ ×ˢ Set.Ioo a b) |
| 80 | regularized_gradient : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Ioo a b, ∀ x, |
| 81 | let P := m62SpatialNormalDerivative F c t x |
| 82 | (m62ArcDerivative F c t (m62RegularizedCurvature F c ε t) x) ^ 2 ≤ |
| 83 | (F.metric t).inner (c x t) P P |
| 84 | regularized_bound : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Ioo a b, ∀ x, |
| 85 | deriv (fun s ↦ m62RegularizedCurvature F c ε s x) t ≤ |
| 86 | m62ArcSecondDerivative F c t (m62RegularizedCurvature F c ε t) x + |
| 87 | (m62Curvature F c t x) ^ 3 + |
| 88 | m62C1 K0 K1 K2 * (m62RegularizedCurvature F c ε t x + 1) |
| 89 | length_integrable : ∀ t ∈ Set.Icc a b, |
| 90 | IntervalIntegrable (curveSpeed F c t) MeasureTheory.volume 0 curvePeriod |
| 91 | total_curvature_integrable : ∀ t ∈ Set.Icc a b, IntervalIntegrable |
| 92 | (fun x ↦ m62Curvature F c t x * curveSpeed F c t x) |
| 93 | MeasureTheory.volume 0 curvePeriod |
| 94 | regularized_integrable : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Icc a b, |
| 95 | IntervalIntegrable (fun x ↦ m62RegularizedCurvature F c ε t x * curveSpeed F c t x) |
| 96 | MeasureTheory.volume 0 curvePeriod |
| 97 | length_continuous : ContinuousOn (m62Length F c) (Set.Icc a b) |
| 98 | total_curvature_continuous : ContinuousOn (m62TotalCurvature F c) (Set.Icc a b) |
| 99 | regularized_continuous : ∀ ε : ℝ, 0 < ε → |
| 100 | ContinuousOn (m62RegularizedTotalCurvature F c ε) (Set.Icc a b) |
| 101 | length_derivative : ∀ t ∈ Set.Ioo a b, |
| 102 | HasDerivAt (m62Length F c) |
| 103 | (-(∫ x in (0 : ℝ)..curvePeriod, |
| 104 | (m62CurvatureSquared F c t x + m62TangentRicci F c t x) * |
| 105 | curveSpeed F c t x)) t |
| 106 | length_bound : ∀ t ∈ Set.Ioo a b, |
| 107 | deriv (m62Length F c) t ≤ ∫ x in (0 : ℝ)..curvePeriod, |
| 108 | (K2 - m62CurvatureSquared F c t x) * curveSpeed F c t x |
| 109 | length_scalar_bound : ∀ t ∈ Set.Ioo a b, |
| 110 | deriv (m62Length F c) t ≤ K2 * m62Length F c t |
| 111 | regularized_differentiable : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Ioo a b, |
| 112 | DifferentiableAt ℝ (m62RegularizedTotalCurvature F c ε) t |
| 113 | regularized_total_bound : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Ioo a b, |
| 114 | deriv (m62RegularizedTotalCurvature F c ε) t ≤ |
| 115 | (m62C1 K0 K1 K2 + K2) * m62RegularizedTotalCurvature F c ε t + |
| 116 | m62C1 K0 K1 K2 * m62Length F c t |
| 117 | regularization_error : ∀ ε : ℝ, 0 < ε → ∀ t ∈ Set.Icc a b, |
| 118 | 0 ≤ m62RegularizedTotalCurvature F c ε t - m62TotalCurvature F c t ∧ |
| 119 | m62RegularizedTotalCurvature F c ε t - m62TotalCurvature F c t ≤ |
| 120 | ε * m62Length F c t |
| 121 | total_curvature_integral : ∀ s t : ℝ, |
| 122 | s ∈ Set.Icc a b → t ∈ Set.Icc a b → s ≤ t → |
| 123 | m62TotalCurvature F c t - m62TotalCurvature F c s ≤ |
| 124 | ∫ r in s..t, (m62C1 K0 K1 K2 + K2) * m62TotalCurvature F c r + |
| 125 | m62C1 K0 K1 K2 * m62Length F c r |
| 126 | total_curvature_forward : ∀ t ∈ Set.Ico a b, ∀ ε : ℝ, 0 < ε → |
| 127 | ∃ δ : ℝ, 0 < δ ∧ ∀ h : ℝ, 0 < h → h < δ → t + h ∈ Set.Icc a b → |
| 128 | (m62TotalCurvature F c (t + h) - m62TotalCurvature F c t) / h ≤ |
| 129 | (m62C1 K0 K1 K2 + K2) * m62TotalCurvature F c t + |
| 130 | m62C1 K0 K1 K2 * m62Length F c t + ε |
| 131 | |
| 132 | /-- The horizontal lift of the actual curvature vector to the open spacetime. -/ |
| 133 | noncomputable def m62LiftedCurvature {F : RicciFlow n M (Set.Icc a b)} |
| 134 | (G : M62.SpacetimeData F) (c : ℝ → ℝ → M) (t : M62.OpenTime a b) (x : ℝ) : |
| 135 | TangentSpace (𝓡 (n + 1)) (G.liftCurve c (x, t)) := |
| 136 | G.charts.horizontal (G.liftCurve c (x, t)) (m62CurvatureVector F c t x) |
| 137 | |
| 138 | noncomputable def m62LiftedUnitTangent {F : RicciFlow n M (Set.Icc a b)} |
| 139 | (G : M62.SpacetimeData F) (c : ℝ → ℝ → M) (t : M62.OpenTime a b) (x : ℝ) : |
| 140 | TangentSpace (𝓡 (n + 1)) (G.liftCurve c (x, t)) := |
| 141 | G.charts.horizontal (G.liftCurve c (x, t)) (spatialUnitTangent F c t x) |
| 142 | |
| 143 | /-- The full spacetime normal derivative, including its vertical component. -/ |
| 144 | noncomputable def m62SpacetimeNormalDerivative {F : RicciFlow n M (Set.Icc a b)} |
| 145 | (G : M62.SpacetimeData F) (c : ℝ → ℝ → M) (t : M62.OpenTime a b) (x : ℝ) : |
| 146 | TangentSpace (𝓡 (n + 1)) (G.liftCurve c (x, t)) := |
| 147 | let A := (curveSpeed F c t x)⁻¹ • |
| 148 | G.covariantAlong (fun y ↦ G.liftCurve c (y, t)) (m62LiftedCurvature G c t) x |
| 149 | let S := m62LiftedUnitTangent G c t x |
| 150 | A - G.metric.inner (G.liftCurve c (x, t)) A S • S |
| 151 | |
| 152 | /-- Every term of corrected Lemma 0.2, using the actual spacetime curvature. -/ |
| 153 | noncomputable def m62SpacetimeEvolutionRhs {F : RicciFlow n M (Set.Icc a b)} |
| 154 | (G : M62.SpacetimeData F) (c : ℝ → ℝ → M) (t : M62.OpenTime a b) (x : ℝ) : ℝ := |
| 155 | let H := m62CurvatureVector F c t x |
| 156 | let S := spatialUnitTangent F c t x |
| 157 | let P := m62SpacetimeNormalDerivative G c t x |
| 158 | let D := F.connection t |
| 159 | let k2 := m62CurvatureSquared F c t x |
| 160 | m62ArcSecondDerivative F c t (m62CurvatureSquared F c t) x - |
| 161 | 2 * G.metric.inner (G.liftCurve c (x, t)) P P + 2 * k2 ^ 2 - |
| 162 | 2 * D.ricci (c x t) H H + 4 * k2 * D.ricci (c x t) S S + |
| 163 | 2 * G.connection.curvatureTensor (G.liftCurve c (x, t)) |
| 164 | (G.liftedTimeVelocity c (x, t)) (m62LiftedUnitTangent G c t x) |
| 165 | (m62LiftedCurvature G c t x) (m62LiftedUnitTangent G c t x) + |
| 166 | 2 * D.ricci (c x t) S S * D.ricci (c x t) H H - |
| 167 | 2 * D.covariantTensorDerivative D.ricciEvaluation (c x t) ![S, S, H] |
| 168 | |
| 169 | /-- Exact laws for the same curve in the constructed spacetime. -/ |
| 170 | structure M62CurveLaws {F : RicciFlow n M (Set.Icc a b)} |
| 171 | (G : M62.SpacetimeData F) (c : ℝ → ℝ → M) : Prop where |
| 172 | spatial : M62SpatialEvolution F c |
| 173 | lifted_time : ∀ (t : M62.OpenTime a b) (x : ℝ), |
| 174 | G.liftedTimeVelocity c (x, t) = |
| 175 | m62LiftedCurvature G c t x + G.charts.timeVector (G.liftCurve c (x, t)) |
| 176 | normal_norm : ∀ (t : M62.OpenTime a b) (x : ℝ), |
| 177 | let P := m62SpacetimeNormalDerivative G c t x |
| 178 | let Pg := m62SpatialNormalDerivative F c t x |
| 179 | G.metric.inner (G.liftCurve c (x, t)) P P = |
| 180 | (F.metric t).inner (c x t) Pg Pg + |
| 181 | ((F.connection t).ricci (c x t) (spatialUnitTangent F c t x) |
| 182 | (m62CurvatureVector F c t x)) ^ 2 |
| 183 | exact_curvature : ∀ (t : M62.OpenTime a b) (x : ℝ), |
| 184 | HasDerivAt (fun s ↦ m62CurvatureSquared F c s x) |
| 185 | (m62SpacetimeEvolutionRhs G c t x) t |
| 186 | regularized_gradient : ∀ ε : ℝ, 0 < ε → ∀ (t : M62.OpenTime a b) (x : ℝ), |
| 187 | let P := m62SpacetimeNormalDerivative G c t x |
| 188 | (m62ArcDerivative F c t (m62RegularizedCurvature F c ε t) x) ^ 2 ≤ |
| 189 | G.metric.inner (G.liftCurve c (x, t)) P P |
| 190 | |
| 191 | /-- The full-normal upper bound before discarding the negative time component. -/ |
| 192 | def M62SpacetimeEstimate {F : RicciFlow n M (Set.Icc a b)} |
| 193 | (G : M62.SpacetimeData F) (c : ℝ → ℝ → M) (K0 K1 K2 : ℝ) : Prop := |
| 194 | ∀ (t : M62.OpenTime a b) (x : ℝ), |
| 195 | let P := m62SpacetimeNormalDerivative G c t x |
| 196 | let k2 := m62CurvatureSquared F c t x |
| 197 | deriv (fun s ↦ m62CurvatureSquared F c s x) t ≤ |
| 198 | m62ArcSecondDerivative F c t (m62CurvatureSquared F c t) x - |
| 199 | 2 * G.metric.inner (G.liftCurve c (x, t)) P P + 2 * k2 ^ 2 + |
| 200 | m62C0 K0 K1 K2 * (k2 + m62Curvature F c t x) |
| 201 | |
| 202 | /-- Curve geometry and estimates on one specified ambient flow. -/ |
| 203 | structure M62CurveTheory (F : RicciFlow n M (Set.Icc a b)) where |
| 204 | spacetime : M62.SpacetimeData F |
| 205 | spacetime_identities : M62.SpacetimeIdentities spacetime |
| 206 | curves : ∀ c : ℝ → ℝ → M, M62ShrinkingCurve F c → M62CurveLaws spacetime c |
| 207 | estimates : ∀ K0 K1 K2 : ℝ, 0 ≤ K0 → 0 ≤ K1 → 0 ≤ K2 → |
| 208 | CurveEvolutionAmbientBounds F K0 K1 K2 → |
| 209 | ∀ c : ℝ → ℝ → M, M62ShrinkingCurve F c → |
| 210 | M62CurveEstimates F c K0 K1 K2 ∧ M62SpacetimeEstimate spacetime c K0 K1 K2 |
| 211 | |
| 212 | /-- The pairing with the actual fixed positive circle field. -/ |
| 213 | noncomputable def m62Slope {F : RicciFlow n M (Set.Icc a b)} {circumference : ℝ} |
| 214 | (P : M62.CircleProductData F circumference) (c : ℝ → ℝ → P.charts.Point) |
| 215 | (t x : ℝ) : ℝ := |
| 216 | (P.flow.metric t).inner (c x t) (spatialUnitTangent P.flow c t x) |
| 217 | (P.charts.circleUnit (c x t)) |
| 218 | |
| 219 | /-- Claim 19.11's exact equation and its sign-guarded lower inequality. -/ |
| 220 | structure M62SlopeLaws {F : RicciFlow n M (Set.Icc a b)} {circumference : ℝ} |
| 221 | (P : M62.CircleProductData F circumference) (c : ℝ → ℝ → P.charts.Point) |
| 222 | (K2 : ℝ) : Prop where |
| 223 | abs_le_one : ∀ t ∈ Set.Icc a b, ∀ x, |m62Slope P c t x| ≤ 1 |
| 224 | evolution : ∀ t ∈ Set.Ioo a b, ∀ x, |
| 225 | HasDerivAt (fun s ↦ m62Slope P c s x) |
| 226 | (m62ArcSecondDerivative P.flow c t (m62Slope P c t) x + |
| 227 | (m62CurvatureSquared P.flow c t x + m62TangentRicci P.flow c t x) * |
| 228 | m62Slope P c t x) t |
| 229 | lower_bound : ∀ t ∈ Set.Ioo a b, ∀ x, 0 ≤ m62Slope P c t x → |
| 230 | m62ArcSecondDerivative P.flow c t (m62Slope P c t) x - K2 * m62Slope P c t x ≤ |
| 231 | deriv (fun s ↦ m62Slope P c s x) t |
| 232 | |
| 233 | /-- An actual circle product, retaining the base flow's three numeric bounds. -/ |
| 234 | structure M62CircleConclusion (F : RicciFlow n M (Set.Icc a b)) |
| 235 | (circumference K0 K1 K2 : ℝ) where |
| 236 | product : M62.CircleProductData F circumference |
| 237 | product_identities : M62.CircleProductIdentities product |
| 238 | bounds : CurveEvolutionAmbientBounds product.flow K0 K1 K2 |
| 239 | curve_theory : M62CurveTheory product.flow |
| 240 | spacetime_parallel : M62.CircleUnitSpacetimeParallel product curve_theory.spacetime |
| 241 | slope : ∀ c : ℝ → ℝ → product.charts.Point, |
| 242 | M62ShrinkingCurve product.flow c → M62SlopeLaws product c K2 |
| 243 | |
| 244 | /-- Ambient constants precede all curves and circle circumferences. -/ |
| 245 | structure M62FlowConclusion (F : RicciFlow n M (Set.Icc a b)) where |
| 246 | K0 : ℝ |
| 247 | K1 : ℝ |
| 248 | K2 : ℝ |
| 249 | nonnegative : 0 ≤ K0 ∧ 0 ≤ K1 ∧ 0 ≤ K2 |
| 250 | bounds : CurveEvolutionAmbientBounds F K0 K1 K2 |
| 251 | curve_theory : M62CurveTheory F |
| 252 | circle_products : ∀ circumference : ℝ, 0 < circumference → |
| 253 | Nonempty (M62CircleConclusion F circumference K0 K1 K2) |
| 254 | |
| 255 | /-- Only the universal curvature-calculus field of M04 is needed. -/ |
| 256 | def M62CurvatureService : Prop := |
| 257 | ∀ (n : ℕ) (M : Type u) [TopologicalSpace M] |
| 258 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 259 | (g : RiemannianMetric n M) (D : LeviCivitaData g), D.CurvatureTensorCalculus |
| 260 | |
| 261 | /-- Complete M62 construction on every source-admissible compact ambient flow. -/ |
| 262 | def M62CurveEvolutionTheory : Prop := |
| 263 | ∀ (n : ℕ) (M : Type u) [TopologicalSpace M] |
| 264 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 265 | [T2Space M] [SecondCountableTopology M] (a b : ℝ) |
| 266 | (F : RicciFlow n M (Set.Icc a b)), |
| 267 | IsCompact (Set.univ : Set M) → Nonempty (M62FlowConclusion F) |
| 268 | |
| 269 | end PoincareMT |