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.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.SourceNames |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Spheres.RoundComponent |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Spheres.RoundComponentJets |
| 5 | import PoincareLib.Geometry.Riemannian.Homothety.Curvature.Contractions |
| 6 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryInvariants |
| 7 | import PoincareLib.Geometry.RicciFlow.Compactness.Coordinates.SpacetimeBounds.Ricci.Equation |
| 8 | import PoincareLib.Geometry.RicciFlow.Compactness.Coordinates.SpacetimeBounds.Ricci.Operator |
| 9 | import PoincareLib.Geometry.Riemannian.Curvature.Euclidean |
| 10 | |
| 11 | /-! |
| 12 | # Finite metric-two-jet curvature producer for round components |
| 13 | |
| 14 | The frozen round certificate supplies finite covariant metric-jet errors. The |
| 15 | remaining transfer is a continuity statement for the coordinate curvature |
| 16 | operator on positive metric two-jets. This file records that producer using |
| 17 | the lower M07 operator, rather than assuming a cylinder-specific bound or a |
| 18 | scalar-ratio conclusion. A later geometric bridge must still compare the |
| 19 | certificate's covariant jets with these ordinary coordinate two-jets uniformly |
| 20 | over the selected round models. |
| 21 | -/ |
| 22 | |
| 23 | set_option autoImplicit false |
| 24 | set_option backward.isDefEq.respectTransparency false |
| 25 | set_option maxSynthPendingDepth 12 |
| 26 | |
| 27 | open Set |
| 28 | open scoped Manifold ContDiff Bundle BigOperators Topology Uniformity |
| 29 | |
| 30 | universe u |
| 31 | |
| 32 | namespace PoincareMT.M28.tube |
| 33 | |
| 34 | variable {M : Type u} [TopologicalSpace M] |
| 35 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 36 | [IsManifold (𝓡 3) ∞ M] |
| 37 | |
| 38 | open PoincareMT.SpacetimeBounds |
| 39 | |
| 40 | /-- One retained covariant metric-jet norm from a round component. -/ |
| 41 | noncomputable def roundMetricJetNorm |
| 42 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 43 | (N : SingularRoundComponent g epsilon) (j : ℕ) |
| 44 | (x : N.model.carrier) : ℝ := |
| 45 | N.model_metric.tensorNorm |
| 46 | (N.model_connection.iteratedCovariantTensorDerivative |
| 47 | (fun y v => N.scale * singularMetricPullback g N.forward y v - |
| 48 | N.model_metric.inner y (v 0) (v 1)) j) x |
| 49 | |
| 50 | /-- The round comparison bounds every retained low-order metric jet by the |
| 51 | same epsilon. The order hypothesis is exposed because the frozen definition |
| 52 | only retains orders through `floor (epsilon⁻¹)`. |
| 53 | -/ |
| 54 | theorem roundMetricJetNorm_lt |
| 55 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 56 | (N : SingularRoundComponent g epsilon) |
| 57 | (horder : 2 ≤ ⌊epsilon⁻¹⌋₊) |
| 58 | (x : N.model.carrier) (j : ℕ) (hj : j ≤ 2) : |
| 59 | roundMetricJetNorm N j x < epsilon := by |
| 60 | obtain ⟨bound, hbound, hmetric⟩ := N.metric_comparison |
| 61 | simpa [roundMetricJetNorm] using |
| 62 | (singularMetricJetNorm_lt_of_error_lt N.model_metric N.model_connection |
| 63 | (fun y v => N.scale * singularMetricPullback g N.forward y v) |
| 64 | ⌊epsilon⁻¹⌋₊ j x (hj.trans horder) N.epsilon_pos (hmetric x) hbound) |
| 65 | |
| 66 | /-- The scalar trace of the lower M07 coordinate two-jet operator. It is the |
| 67 | metric inverse contraction of the retained coordinate Ricci values. |
| 68 | -/ |
| 69 | noncomputable def jetScalarCurvature (J : MetricTwoJet 3) : ℝ := |
| 70 | ∑ i : Fin 3, ∑ j : Fin 3, |
| 71 | EuclideanSpace.proj j (J.1.inverse (EuclideanSpace.proj i)) * |
| 72 | jetRicci J (EuclideanSpace.basisFun (Fin 3) ℝ i) |
| 73 | (EuclideanSpace.basisFun (Fin 3) ℝ j) |
| 74 | |
| 75 | /-- Positivity of the metric coefficient makes the scalar two-jet operator |
| 76 | smooth at the given jet. This is the finite curvature-from-metric-jet |
| 77 | continuity producer used by the round transfer, with no model-specific |
| 78 | coordinates or scalar ratio in its hypotheses. |
| 79 | -/ |
| 80 | theorem contDiffAt_jetScalarCurvature |
| 81 | {J : MetricTwoJet 3} (hJ : J.1.IsInvertible) : |
| 82 | ContDiffAt ℝ ∞ jetScalarCurvature J := by |
| 83 | unfold jetScalarCurvature |
| 84 | have hI : ContDiffAt ℝ ∞ |
| 85 | (fun K : MetricTwoJet 3 => K.1.inverse) J := |
| 86 | hJ.contDiffAt_map_inverse.comp J contDiffAt_fst |
| 87 | apply ContDiffAt.sum |
| 88 | intro i _ |
| 89 | apply ContDiffAt.sum |
| 90 | intro j _ |
| 91 | have hentry : ContDiffAt ℝ ∞ |
| 92 | (fun K : MetricTwoJet 3 => |
| 93 | EuclideanSpace.proj j (K.1.inverse (EuclideanSpace.proj i))) J := by |
| 94 | exact (EuclideanSpace.proj (𝕜 := ℝ) j).contDiff.contDiffAt.comp J |
| 95 | (hI.clm_apply contDiffAt_const) |
| 96 | exact hentry.mul (contDiffAt_jetRicci hJ |
| 97 | (EuclideanSpace.basisFun (Fin 3) ℝ i) |
| 98 | (EuclideanSpace.basisFun (Fin 3) ℝ j)) |
| 99 | |
| 100 | /-- The finite operator has an explicit local continuity modulus at every |
| 101 | positive metric two-jet. This is the quantitative form of M07's |
| 102 | curvature-from-two-metric-jets continuity; the radius depends only on the |
| 103 | displayed base jet and requested scalar tolerance, before any flow or model |
| 104 | point is selected. |
| 105 | -/ |
| 106 | theorem exists_jetScalarCurvature_modulus |
| 107 | {J : MetricTwoJet 3} (hJ : J.1.IsInvertible) |
| 108 | {delta : ℝ} (hdelta : 0 < delta) : |
| 109 | ∃ eta : ℝ, 0 < eta ∧ |
| 110 | ∀ K : MetricTwoJet 3, dist K J < eta → |
| 111 | |jetScalarCurvature K - jetScalarCurvature J| < delta := by |
| 112 | have hcont : ContinuousAt jetScalarCurvature J := |
| 113 | (contDiffAt_jetScalarCurvature hJ).continuousAt |
| 114 | obtain ⟨eta, heta, hK⟩ := (Metric.continuousAt_iff.mp hcont) delta hdelta |
| 115 | refine ⟨eta, heta, ?_⟩ |
| 116 | intro K hdist |
| 117 | have hdist' := hK hdist |
| 118 | simpa [Real.dist_eq] using hdist' |
| 119 | |
| 120 | /-! Compact families of positive metric jets admit one modulus, and the |
| 121 | nearby jet in the conclusion need not itself be a member of the family. This |
| 122 | is the form used when a source jet is compared with a compact family of model |
| 123 | jets in one common chart. -/ |
| 124 | |
| 125 | theorem exists_jetScalarCurvature_uniform_modulus |
| 126 | {K : Set (MetricTwoJet 3)} (hK : IsCompact K) |
| 127 | (hInvertible : ∀ J ∈ K, J.1.IsInvertible) |
| 128 | {delta : ℝ} (hdelta : 0 < delta) : |
| 129 | ∃ eta : ℝ, 0 < eta ∧ |
| 130 | ∀ J ∈ K, ∀ L : MetricTwoJet 3, dist L J < eta → |
| 131 | |jetScalarCurvature L - jetScalarCurvature J| < delta := by |
| 132 | have hcontinuous : ∀ J ∈ K, ContinuousAt jetScalarCurvature J := by |
| 133 | intro J hJ |
| 134 | exact (contDiffAt_jetScalarCurvature (hInvertible J hJ)).continuousAt |
| 135 | have huniform : |
| 136 | {p : MetricTwoJet 3 × MetricTwoJet 3 | |
| 137 | p.1 ∈ K → dist (jetScalarCurvature p.1) |
| 138 | (jetScalarCurvature p.2) < delta} ∈ |
| 139 | 𝓤 (MetricTwoJet 3) := by |
| 140 | exact hK.uniformContinuousAt_of_continuousAt jetScalarCurvature |
| 141 | hcontinuous (Metric.dist_mem_uniformity hdelta) |
| 142 | obtain ⟨eta, heta, hnear⟩ := Metric.mem_uniformity_dist.mp huniform |
| 143 | refine ⟨eta, heta, ?_⟩ |
| 144 | intro J hJ L hLJ |
| 145 | have hp : ((J, L) : MetricTwoJet 3 × MetricTwoJet 3) ∈ |
| 146 | {p : MetricTwoJet 3 × MetricTwoJet 3 | |
| 147 | p.1 ∈ K → dist (jetScalarCurvature p.1) |
| 148 | (jetScalarCurvature p.2) < delta} := by |
| 149 | exact hnear (by simpa [dist_comm] using hLJ) |
| 150 | simpa [Real.dist_eq, abs_sub_comm] using hp hJ |
| 151 | |
| 152 | /-! The scalar estimate is normalized by the same positive scale at every |
| 153 | point of a round component. The following small bridge turns that normalized |
| 154 | estimate into the uniform ratio consumed by the tube alternatives. -/ |
| 155 | |
| 156 | theorem round_scalar_ratio_of_normalized_close |
| 157 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 158 | (N : SingularRoundComponent g epsilon) |
| 159 | (D : LeviCivitaData g) |
| 160 | {delta : ℝ} (_hdelta : 0 < delta) (hdelta_one : delta < 1) |
| 161 | (hclose : ∀ x ∈ N.carrier, |
| 162 | |D.scalarCurvature x / N.scale - 6| < delta) : |
| 163 | ∀ x ∈ N.carrier, |
| 164 | ∀ y ∈ N.carrier, D.scalarCurvature x ≤ 2 * D.scalarCurvature y := by |
| 165 | intro x hx y hy |
| 166 | have hxclose := abs_lt.mp (hclose x hx) |
| 167 | have hyclose := abs_lt.mp (hclose y hy) |
| 168 | have hscale : 0 < N.scale := N.scale_pos |
| 169 | have hxupper : D.scalarCurvature x / N.scale < 7 := by |
| 170 | linarith |
| 171 | have hylower : 5 < D.scalarCurvature y / N.scale := by |
| 172 | linarith |
| 173 | have hxupper' : D.scalarCurvature x < 7 * N.scale := by |
| 174 | exact (div_lt_iff₀ hscale).mp hxupper |
| 175 | have hylower' : 5 * N.scale < D.scalarCurvature y := by |
| 176 | exact (lt_div_iff₀ hscale).mp hylower |
| 177 | linarith |
| 178 | |
| 179 | /-- At a genuine metric two-jet, the lower coordinate Ricci operator agrees |
| 180 | with the retained Levi-Civita Ricci evaluation in every fixed vector pair. |
| 181 | This is the bridge used before taking the metric trace. -/ |
| 182 | theorem jetRicci_metricTwoJet_eq |
| 183 | {g : RiemannianMetric 3 (EuclideanSpace ℝ (Fin 3))} |
| 184 | (D : LeviCivitaData g) (x u v : EuclideanSpace ℝ (Fin 3)) : |
| 185 | jetRicci (metricTwoJet g.euclideanCoefficients x) u v = D.ricci x u v := by |
| 186 | exact jetRicci_metricTwoJet D x u v |
| 187 | |
| 188 | /-! The lower coordinate operator contracts against the inverse Gram matrix |
| 189 | of the displayed coordinate basis. This is the scalar readout needed to |
| 190 | identify a genuine model jet with the intrinsic scalar curvature; it is |
| 191 | proved here from M05's finite-basis contraction and M13's Ricci trace. -/ |
| 192 | theorem LeviCivitaData.scalarCurvature_eq_inverse_gram_m28 |
| 193 | {n : ℕ} {X : Type u} [TopologicalSpace X] |
| 194 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) X] |
| 195 | [IsManifold (𝓡 n) ∞ X] [T2Space X] |
| 196 | {g : RiemannianMetric n X} (D : LeviCivitaData g) (x : X) |
| 197 | {ι : Type*} [Fintype ι] [DecidableEq ι] |
| 198 | (b : Module.Basis ι ℝ (TangentSpace (𝓡 n) x)) : |
| 199 | D.scalarCurvature x = ∑ i, ∑ j, |
| 200 | (Matrix.of (fun i j => g.inner x (b i) (b j)))⁻¹ i j * |
| 201 | D.ricci x (b i) (b j) := by |
| 202 | let : Bundle.RiemannianBundle |
| 203 | (TangentSpace (𝓡 n) : X → Type _) := |
| 204 | ⟨g.toRiemannianMetric⟩ |
| 205 | exact bilinear_sum_basis_eq_inverse_gram (M13.ricciLinear D x) b |
| 206 | (g.orthonormalBasis x) |
| 207 | |
| 208 | theorem RiemannianMetric.inverseCoefficients_eq_inverse_gram_m28 {n : ℕ} |
| 209 | (g : RiemannianMetric n (EuclideanSpace ℝ (Fin n))) |
| 210 | (x : EuclideanSpace ℝ (Fin n)) (i j : Fin n) : |
| 211 | g.inverseCoefficients x i j = |
| 212 | (Matrix.of (fun a b => g.inner x |
| 213 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 214 | (EuclideanSpace.basisFun (Fin n) ℝ b)))⁻¹ i j := by |
| 215 | let : Bundle.RiemannianBundle |
| 216 | (TangentSpace (𝓡 n) : EuclideanSpace ℝ (Fin n) → Type _) := |
| 217 | ⟨g.toRiemannianMetric⟩ |
| 218 | have h := congrArg (fun v : TangentSpace (𝓡 n) x => |
| 219 | EuclideanSpace.proj j v) |
| 220 | ((g.orthonormalBasis x).sum_repr' |
| 221 | ((g.inner x).inverse (EuclideanSpace.proj i))) |
| 222 | have hp (k : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 223 | inner ℝ (g.orthonormalBasis x k) |
| 224 | ((g.inner x).inverse (EuclideanSpace.proj i)) = |
| 225 | EuclideanSpace.proj i (g.orthonormalBasis x k) := by |
| 226 | change g.inner x (g.orthonormalBasis x k) |
| 227 | ((g.inner x).inverse (EuclideanSpace.proj i)) = _ |
| 228 | rw [g.symm, (g.inner_isInvertible x).self_apply_inverse] |
| 229 | rfl |
| 230 | have hexp : g.inverseCoefficients x i j = |
| 231 | ∑ k, EuclideanSpace.proj i (g.orthonormalBasis x k) * |
| 232 | EuclideanSpace.proj j (g.orthonormalBasis x k) := by |
| 233 | simpa only [OrthonormalBasis.repr_apply_apply, hp, map_sum, map_smul, |
| 234 | smul_eq_mul, RiemannianMetric.inverseCoefficients] using h.symm |
| 235 | rw [hexp] |
| 236 | convert! sum_basis_repr_mul_eq_inverse_gram |
| 237 | (show Module.Basis (Fin n) ℝ (TangentSpace (𝓡 n) x) from |
| 238 | (EuclideanSpace.basisFun (Fin n) ℝ).toBasis) |
| 239 | (g.orthonormalBasis x) i j using 1 |
| 240 | |
| 241 | theorem jetScalarCurvature_metricTwoJet_eq |
| 242 | {g : RiemannianMetric 3 (EuclideanSpace ℝ (Fin 3))} |
| 243 | (D : LeviCivitaData g) (x : EuclideanSpace ℝ (Fin 3)) : |
| 244 | jetScalarCurvature (metricTwoJet g.euclideanCoefficients x) = |
| 245 | D.scalarCurvature x := by |
| 246 | rw [LeviCivitaData.scalarCurvature_eq_inverse_gram_m28 D x |
| 247 | (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis] |
| 248 | simp only [jetScalarCurvature, jetRicci_metricTwoJet D] |
| 249 | apply Finset.sum_congr rfl |
| 250 | intro i _ |
| 251 | apply Finset.sum_congr rfl |
| 252 | intro j _ |
| 253 | congr 1 |
| 254 | exact RiemannianMetric.inverseCoefficients_eq_inverse_gram_m28 g x i j |
| 255 | |
| 256 | /-! The same scalar readout is valid for an arbitrary smooth local pullback. |
| 257 | The Euclidean realization is only used to expose the already-proved genuine |
| 258 | metric identity; the chart map and its inverse derivative remain explicit in |
| 259 | the local-isometry step. -/ |
| 260 | theorem jetScalarCurvature_metricTwoJet_pullback |
| 261 | {M : Type u} [TopologicalSpace M] |
| 262 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 263 | [IsManifold (𝓡 3) ∞ M] |
| 264 | {g : RiemannianMetric 3 M} (D : LeviCivitaData g) |
| 265 | {U : Set (EuclideanSpace ℝ (Fin 3))} (hU : IsOpen U) |
| 266 | {e : EuclideanSpace ℝ (Fin 3) → M} |
| 267 | (he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e U) |
| 268 | (hi : ∀ y ∈ U, |
| 269 | (mfderiv (𝓡 3) (𝓡 3) e y).IsInvertible) |
| 270 | {x : EuclideanSpace ℝ (Fin 3)} (hx : x ∈ U) : |
| 271 | jetScalarCurvature (metricTwoJet (g.pullbackCoefficients e) x) = |
| 272 | D.scalarCurvature (e x) := by |
| 273 | have hcoeff : ContDiffOn ℝ ∞ (g.pullbackCoefficients e) U := fun y hy => |
| 274 | (g.contDiffAt_pullbackCoefficients |
| 275 | (he.contMDiffAt (hU.mem_nhds hy))).contDiffWithinAt |
| 276 | obtain ⟨gE, DE, V, hV, hxV, hVU, heq⟩ := |
| 277 | RiemannianMetric.exists_local_realization hU hx |
| 278 | (g.pullbackCoefficients e) hcoeff |
| 279 | (fun y _ u v => g.symm (e y) _ _) |
| 280 | (fun y hy w hw => by |
| 281 | apply g.pos (e y) |
| 282 | intro hz |
| 283 | apply hw |
| 284 | apply (hi y hy).injective |
| 285 | rw [map_zero] |
| 286 | convert! hz using 1) |
| 287 | have hmetric (y : EuclideanSpace ℝ (Fin 3)) (hy : y ∈ V) |
| 288 | (u v : EuclideanSpace ℝ (Fin 3)) : |
| 289 | gE.inner y u v = g.inner (e y) |
| 290 | (mfderiv (𝓡 3) (𝓡 3) e y u) |
| 291 | (mfderiv (𝓡 3) (𝓡 3) e y v) := |
| 292 | congrArg (fun B => B u v) (heq y hy) |
| 293 | have hB : gE.euclideanCoefficients =ᶠ[𝓝 x] |
| 294 | g.pullbackCoefficients e := by |
| 295 | filter_upwards [hV.mem_nhds hxV] with y hy |
| 296 | exact heq y hy |
| 297 | rw [← SpacetimeBounds.metricTwoJet_congr_of_eventuallyEq hB, |
| 298 | jetScalarCurvature_metricTwoJet_eq DE] |
| 299 | exact DE.scalarCurvature_eq_of_local_isometry D hV (he.mono hVU) |
| 300 | hmetric hxV |
| 301 | |
| 302 | end PoincareMT.M28.tube |