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.Tube.CriticalBall.CriticalBallCurvature |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.Ends.SourceTubeCenteredNecks |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Spacetime.StrongNecks.Geometry.StrongNeckDerivativeTransfer |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Spacetime.StrongNecks.SourceGeometry.Geometry.StrongNeckSourceBounds |
| 6 | |
| 7 | /-! |
| 8 | # Pointwise local Shi on the retained tube |
| 9 | |
| 10 | The centered strong-neck producer supplies an original backward cylinder at |
| 11 | each retained tube point. Its terminal derivative estimate is transferred |
| 12 | to the globally normalized tube connection by the exact homothety and open |
| 13 | restriction identities. The threshold is kept explicit because the frozen |
| 14 | `CriticalBallLocalShi` predicate has no field recording it; callers must |
| 15 | provide the threshold selected by the two source producers. |
| 16 | -/ |
| 17 | |
| 18 | noncomputable section |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | set_option linter.style.haveILetI false |
| 22 | |
| 23 | open Set |
| 24 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 25 | |
| 26 | universe u |
| 27 | |
| 28 | namespace PoincareMT.M28.CounterexampleNeckFamily |
| 29 | |
| 30 | variable {epsilon C A : ℝ} |
| 31 | {E : ∀ n : ℕ, SameTimeCounterexample.{u} epsilon C A |
| 32 | ((n : ℝ) + 1) ((n : ℝ) + 1)} |
| 33 | |
| 34 | theorem exists_criticalBallLocalShi_accuracy |
| 35 | (P : RicciFlowCurvatureTheory.{u}) |
| 36 | (H : CounterexampleNeckFamily E) |
| 37 | (T : ∀ k, SourceTubeData (H.segment k)) : |
| 38 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 39 | (epsilon ≤ epsilon₀ → CriticalBallLocalShi H T) := by |
| 40 | obtain ⟨epsilonC, hepsilonC, hCsmall, hcentered⟩ := |
| 41 | exists_source_tube_centered_strong_necks_accuracy P |
| 42 | obtain ⟨epsilonS, hepsilonS, hSsmall, K₀, hK₀, hsource⟩ := |
| 43 | exists_strongNeck_source_bounds_accuracy P.local_derivative_estimates |
| 44 | let epsilon₀ := min epsilonC epsilonS |
| 45 | have hepsilon₀ : 0 < epsilon₀ := lt_min hepsilonC hepsilonS |
| 46 | have hsmall₀ : epsilon₀ ≤ (1 / 200 : ℝ) := |
| 47 | (min_le_right _ _).trans hSsmall |
| 48 | refine ⟨epsilon₀, hepsilon₀, hsmall₀, ?_⟩ |
| 49 | intro hepsilon |
| 50 | have hepsilonC' : epsilon ≤ epsilonC := |
| 51 | hepsilon.trans (min_le_left _ _) |
| 52 | have hepsilonS' : epsilon ≤ epsilonS := |
| 53 | hepsilon.trans (min_le_right _ _) |
| 54 | have hepsilon_pos : 0 < epsilon := by |
| 55 | rw [← (T 0).epsilon_eq] |
| 56 | exact (T 0).tube.epsilon_pos |
| 57 | obtain ⟨B, hB, hsourceB⟩ := hsource epsilon hepsilon_pos hepsilonS' |
| 58 | intro K tau htau l |
| 59 | have hmax : 0 ≤ max K 1 := |
| 60 | le_trans (by norm_num) (le_max_right K 1) |
| 61 | refine ⟨(max K 1) ^ (l + 2) * B l, |
| 62 | mul_nonneg (pow_nonneg hmax _) (hB l).le, ?_⟩ |
| 63 | intro k x hscalar |
| 64 | obtain ⟨J, hJcenter⟩ := hcentered (E (k + H.shift)) (H.segment k) |
| 65 | (H.base_scalar_pos k) hepsilonC' (T k) x x.property |
| 66 | obtain ⟨HJ⟩ := GeneralizedStrongNeck.exists_rescaled_raw_cylinder_flow J |
| 67 | letI : ChartedSpace (EuclideanSpace ℝ (Fin 3)) (strongNeckOpen J).carrier := |
| 68 | TopologicalSpace.Opens.instChartedSpace (strongNeckOpen J) |
| 69 | have hsourceJ := hsourceB (E (k + H.shift)).flow |
| 70 | (E (k + H.shift)).time J HJ |
| 71 | have hcenterball : |
| 72 | strongNeckSourceCenter J ∈ |
| 73 | ((GeneralizedStrongNeck.rescaled_half_flow J HJ).metric 0).ball |
| 74 | (strongNeckSourceCenter J) (epsilon⁻¹ / 16) := by |
| 75 | change ((GeneralizedStrongNeck.rescaled_half_flow J HJ).metric 0).edist |
| 76 | (strongNeckSourceCenter J) (strongNeckSourceCenter J) < |
| 77 | ENNReal.ofReal (epsilon⁻¹ / 16) |
| 78 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_self] using |
| 79 | ENNReal.ofReal_pos.mpr |
| 80 | (div_pos (inv_pos.mpr hepsilon_pos) (by norm_num)) |
| 81 | have hderiv : |
| 82 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 83 | (strongNeckSourceCenter J) ≤ B l := by |
| 84 | simpa only [GeneralizedStrongNeck.rescaled_half_flow_connection] using |
| 85 | hsourceJ.2 l (strongNeckSourceCenter J) hcenterball |
| 86 | let Q : ℝ := |
| 87 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time).scalarCurvature |
| 88 | (E (k + H.shift)).basepoint |
| 89 | have hQ : 0 < Q := by |
| 90 | simpa only [GeneralizedRicciFlowData.scalar] using H.base_scalar_pos k |
| 91 | let D := H.normalizedSliceConnection k |
| 92 | let a : ℝ := Q * J.scale ^ 2 |
| 93 | have ha : 0 < a := by |
| 94 | dsimp [a] |
| 95 | exact mul_pos hQ (sq_pos_of_pos J.scale_pos) |
| 96 | have hnormalized : a * D.scalarCurvature J.center = 1 := by |
| 97 | have hscale : J.scale ^ 2 * |
| 98 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time).scalarCurvature |
| 99 | J.center = 1 := by |
| 100 | rw [J.scale_scalar, ← Real.rpow_mul_natCast |
| 101 | J.scalar_center_pos.le (-1 / 2 : ℝ) 2] |
| 102 | simpa [Real.rpow_neg_one] using |
| 103 | (inv_mul_cancel₀ J.scalar_center_pos.ne') |
| 104 | have hscalarJ : D.scalarCurvature J.center = |
| 105 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time).scalarCurvature |
| 106 | J.center / Q := by |
| 107 | simpa only [D, Q, GeneralizedRicciFlowData.scalar] using |
| 108 | H.normalizedSlice_scalar_eq k J.center |
| 109 | calc |
| 110 | a * D.scalarCurvature J.center = |
| 111 | (Q * J.scale ^ 2) * |
| 112 | (((E (k + H.shift)).flow.connection |
| 113 | (E (k + H.shift)).time).scalarCurvature J.center / Q) := by |
| 114 | dsimp only [a] |
| 115 | rw [hscalarJ] |
| 116 | _ = J.scale ^ 2 * |
| 117 | ((E (k + H.shift)).flow.connection |
| 118 | (E (k + H.shift)).time).scalarCurvature J.center := by |
| 119 | field_simp [hQ.ne'] |
| 120 | _ = 1 := hscale |
| 121 | have hxscalar : D.scalarCurvature x.val ≤ K := by |
| 122 | rw [← H.tube_scalar_eq T k x] |
| 123 | apply hscalar x |
| 124 | change (H.tubeMetric T k).edist x x < ENNReal.ofReal tau |
| 125 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_self] using |
| 126 | ENNReal.ofReal_pos.mpr htau |
| 127 | have hJscalar : D.scalarCurvature J.center ≤ K := by |
| 128 | simpa only [hJcenter] using hxscalar |
| 129 | have hinv := inverse_sqrt_le_of_normalized_scalar ha hnormalized hJscalar |
| 130 | have hinvpow : |
| 131 | (Real.sqrt a)⁻¹ ^ (l + 2) ≤ (max K 1) ^ (l + 2) := by |
| 132 | exact pow_le_pow_left₀ (inv_nonneg.mpr (Real.sqrt_nonneg a)) hinv _ |
| 133 | have hscaled := GeneralizedStrongNeck.scaled_curvatureDerivativeNorm |
| 134 | J HJ Q hQ D l (strongNeckSourceCenter J) |
| 135 | change D.curvatureDerivativeNorm l J.center = |
| 136 | (Real.sqrt (Q * J.scale ^ 2))⁻¹ ^ (l + 2) * |
| 137 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 138 | (strongNeckSourceCenter J) at hscaled |
| 139 | have hglobal : D.curvatureDerivativeNorm l x.val ≤ |
| 140 | (max K 1) ^ (l + 2) * B l := by |
| 141 | have hglobal_center : D.curvatureDerivativeNorm l J.center ≤ |
| 142 | (max K 1) ^ (l + 2) * B l := by |
| 143 | rw [hscaled] |
| 144 | calc |
| 145 | (Real.sqrt a)⁻¹ ^ (l + 2) * |
| 146 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 147 | (strongNeckSourceCenter J) ≤ |
| 148 | (max K 1) ^ (l + 2) * |
| 149 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 150 | (strongNeckSourceCenter J) := |
| 151 | mul_le_mul_of_nonneg_right hinvpow |
| 152 | (by |
| 153 | unfold LeviCivitaData.curvatureDerivativeNorm RiemannianMetric.tensorNorm |
| 154 | exact Real.sqrt_nonneg _) |
| 155 | _ ≤ (max K 1) ^ (l + 2) * B l := |
| 156 | mul_le_mul_of_nonneg_left hderiv (pow_nonneg hmax _) |
| 157 | simpa only [hJcenter] using hglobal_center |
| 158 | simpa only [intrinsicOpenMetric_curvatureDerivativeNorm |
| 159 | (g := H.normalizedSliceMetric k) (V := (T k).carrierOpen) |
| 160 | (DU := H.tubeConnection T k) (D := D) l x] using hglobal |
| 161 | |
| 162 | /-- Pointwise scalar control bounds every curvature derivative on the |
| 163 | actual source tube. The centered original strong neck supplies the whole |
| 164 | backward cylinder used by Shi; see Claim 10.6 and M28 derivation 70. -/ |
| 165 | theorem exists_criticalBallPointwiseShi_uniform_accuracy |
| 166 | (P : RicciFlowCurvatureTheory.{u}) : |
| 167 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 168 | ∀ {epsilon C A : ℝ} |
| 169 | {E : ∀ n : ℕ, SameTimeCounterexample.{u} epsilon C A |
| 170 | ((n : ℝ) + 1) ((n : ℝ) + 1)} |
| 171 | (H : CounterexampleNeckFamily E) |
| 172 | (T : ∀ k, SourceTubeData (H.segment k)), |
| 173 | epsilon ≤ epsilon₀ → |
| 174 | ∀ (K : ℝ) (l : ℕ), ∃ B : ℝ, 0 ≤ B ∧ |
| 175 | ∀ (k : ℕ) (x : (T k).carrierOpen), |
| 176 | (H.tubeConnection T k).scalarCurvature x ≤ K → |
| 177 | (H.tubeConnection T k).curvatureDerivativeNorm l x ≤ B := by |
| 178 | obtain ⟨epsilonC, hepsilonC, hCsmall, hcentered⟩ := |
| 179 | exists_source_tube_centered_strong_necks_accuracy P |
| 180 | obtain ⟨epsilonS, hepsilonS, hSsmall, K₀, hK₀, hsource⟩ := |
| 181 | exists_strongNeck_source_bounds_accuracy P.local_derivative_estimates |
| 182 | let epsilon₀ := min epsilonC epsilonS |
| 183 | have hepsilon₀ : 0 < epsilon₀ := lt_min hepsilonC hepsilonS |
| 184 | have hsmall₀ : epsilon₀ ≤ (1 / 200 : ℝ) := |
| 185 | (min_le_right _ _).trans hSsmall |
| 186 | refine ⟨epsilon₀, hepsilon₀, hsmall₀, ?_⟩ |
| 187 | intro epsilon C A E H T hepsilon |
| 188 | have hepsilonC' : epsilon ≤ epsilonC := |
| 189 | hepsilon.trans (min_le_left _ _) |
| 190 | have hepsilonS' : epsilon ≤ epsilonS := |
| 191 | hepsilon.trans (min_le_right _ _) |
| 192 | have hepsilon_pos : 0 < epsilon := by |
| 193 | rw [← (T 0).epsilon_eq] |
| 194 | exact (T 0).tube.epsilon_pos |
| 195 | obtain ⟨B, hB, hsourceB⟩ := hsource epsilon hepsilon_pos hepsilonS' |
| 196 | intro K l |
| 197 | have hmax : 0 ≤ max K 1 := le_trans (by norm_num) (le_max_right K 1) |
| 198 | refine ⟨(max K 1) ^ (l + 2) * B l, |
| 199 | mul_nonneg (pow_nonneg hmax _) (hB l).le, ?_⟩ |
| 200 | intro k x hscalar |
| 201 | obtain ⟨J, hJcenter⟩ := |
| 202 | (hcentered (E (k + H.shift)) (H.segment k) |
| 203 | (H.base_scalar_pos k) hepsilonC' (T k) x x.property) |
| 204 | obtain ⟨HJ⟩ := GeneralizedStrongNeck.exists_rescaled_raw_cylinder_flow J |
| 205 | letI : ChartedSpace (EuclideanSpace ℝ (Fin 3)) (strongNeckOpen J).carrier := |
| 206 | TopologicalSpace.Opens.instChartedSpace (strongNeckOpen J) |
| 207 | have hsourceJ := hsourceB (E (k + H.shift)).flow |
| 208 | (E (k + H.shift)).time J HJ |
| 209 | have hcenterball : |
| 210 | strongNeckSourceCenter J ∈ |
| 211 | ((GeneralizedStrongNeck.rescaled_half_flow J HJ).metric 0).ball |
| 212 | (strongNeckSourceCenter J) (epsilon⁻¹ / 16) := by |
| 213 | change ((GeneralizedStrongNeck.rescaled_half_flow J HJ).metric 0).edist |
| 214 | (strongNeckSourceCenter J) (strongNeckSourceCenter J) < |
| 215 | ENNReal.ofReal (epsilon⁻¹ / 16) |
| 216 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_self] using |
| 217 | ENNReal.ofReal_pos.mpr |
| 218 | (div_pos (inv_pos.mpr hepsilon_pos) (by norm_num)) |
| 219 | have hderiv : |
| 220 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 221 | (strongNeckSourceCenter J) ≤ B l := by |
| 222 | simpa only [GeneralizedStrongNeck.rescaled_half_flow_connection] using |
| 223 | hsourceJ.2 l (strongNeckSourceCenter J) hcenterball |
| 224 | let Q : ℝ := |
| 225 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time).scalarCurvature |
| 226 | (E (k + H.shift)).basepoint |
| 227 | have hQ : 0 < Q := by |
| 228 | simpa only [GeneralizedRicciFlowData.scalar] using H.base_scalar_pos k |
| 229 | let D := H.normalizedSliceConnection k |
| 230 | let a : ℝ := Q * J.scale ^ 2 |
| 231 | have ha : 0 < a := by |
| 232 | dsimp [a] |
| 233 | exact mul_pos hQ (sq_pos_of_pos J.scale_pos) |
| 234 | have hnormalized : a * D.scalarCurvature J.center = 1 := by |
| 235 | have hscale : J.scale ^ 2 * |
| 236 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time).scalarCurvature |
| 237 | J.center = 1 := by |
| 238 | rw [J.scale_scalar, ← Real.rpow_mul_natCast |
| 239 | J.scalar_center_pos.le (-1 / 2 : ℝ) 2] |
| 240 | simpa [Real.rpow_neg_one] using |
| 241 | (inv_mul_cancel₀ J.scalar_center_pos.ne') |
| 242 | have hscalarJ : D.scalarCurvature J.center = |
| 243 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time).scalarCurvature |
| 244 | J.center / Q := by |
| 245 | simpa only [D, Q, GeneralizedRicciFlowData.scalar] using |
| 246 | H.normalizedSlice_scalar_eq k J.center |
| 247 | calc |
| 248 | a * D.scalarCurvature J.center = |
| 249 | (Q * J.scale ^ 2) * |
| 250 | (((E (k + H.shift)).flow.connection |
| 251 | (E (k + H.shift)).time).scalarCurvature J.center / Q) := by |
| 252 | dsimp only [a] |
| 253 | rw [hscalarJ] |
| 254 | _ = J.scale ^ 2 * |
| 255 | ((E (k + H.shift)).flow.connection |
| 256 | (E (k + H.shift)).time).scalarCurvature J.center := by |
| 257 | field_simp [hQ.ne'] |
| 258 | _ = 1 := hscale |
| 259 | have hxscalar : D.scalarCurvature x.val ≤ K := by |
| 260 | rw [← H.tube_scalar_eq T k x] |
| 261 | exact hscalar |
| 262 | have hJscalar : D.scalarCurvature J.center ≤ K := by |
| 263 | simpa only [hJcenter] using hxscalar |
| 264 | have hinv := inverse_sqrt_le_of_normalized_scalar ha hnormalized hJscalar |
| 265 | have hinvpow : |
| 266 | (Real.sqrt a)⁻¹ ^ (l + 2) ≤ (max K 1) ^ (l + 2) := by |
| 267 | exact pow_le_pow_left₀ (inv_nonneg.mpr (Real.sqrt_nonneg a)) hinv _ |
| 268 | have hscaled := GeneralizedStrongNeck.scaled_curvatureDerivativeNorm |
| 269 | J HJ Q hQ D l (strongNeckSourceCenter J) |
| 270 | change D.curvatureDerivativeNorm l J.center = |
| 271 | (Real.sqrt (Q * J.scale ^ 2))⁻¹ ^ (l + 2) * |
| 272 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 273 | (strongNeckSourceCenter J) at hscaled |
| 274 | have hglobal : D.curvatureDerivativeNorm l x.val ≤ |
| 275 | (max K 1) ^ (l + 2) * B l := by |
| 276 | have hglobal_center : D.curvatureDerivativeNorm l J.center ≤ |
| 277 | (max K 1) ^ (l + 2) * B l := by |
| 278 | rw [hscaled] |
| 279 | calc |
| 280 | (Real.sqrt a)⁻¹ ^ (l + 2) * |
| 281 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 282 | (strongNeckSourceCenter J) ≤ |
| 283 | (max K 1) ^ (l + 2) * |
| 284 | (HJ.rescaling.flow.connection 0).curvatureDerivativeNorm l |
| 285 | (strongNeckSourceCenter J) := |
| 286 | mul_le_mul_of_nonneg_right hinvpow |
| 287 | (by |
| 288 | unfold LeviCivitaData.curvatureDerivativeNorm RiemannianMetric.tensorNorm |
| 289 | exact Real.sqrt_nonneg _) |
| 290 | _ ≤ (max K 1) ^ (l + 2) * B l := |
| 291 | mul_le_mul_of_nonneg_left hderiv (pow_nonneg hmax _) |
| 292 | simpa only [hJcenter] using hglobal_center |
| 293 | simpa only [intrinsicOpenMetric_curvatureDerivativeNorm |
| 294 | (g := H.normalizedSliceMetric k) (V := (T k).carrierOpen) |
| 295 | (DU := H.tubeConnection T k) (D := D) l x] using hglobal |
| 296 | |
| 297 | /-- A uniform version of the local-Shi producer. The threshold is selected |
| 298 | before the counterexample family and the retained tube, as required by the |
| 299 | outer contradiction quantifiers. -/ |
| 300 | theorem exists_criticalBallLocalShi_uniform_accuracy |
| 301 | (P : RicciFlowCurvatureTheory.{u}) : |
| 302 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 303 | ∀ {epsilon C A : ℝ} |
| 304 | {E : ∀ n : ℕ, SameTimeCounterexample.{u} epsilon C A |
| 305 | ((n : ℝ) + 1) ((n : ℝ) + 1)} |
| 306 | (H : CounterexampleNeckFamily E) |
| 307 | (T : ∀ k, SourceTubeData (H.segment k)), |
| 308 | epsilon ≤ epsilon₀ → CriticalBallLocalShi H T := by |
| 309 | obtain ⟨epsilon₀, hpos, hsmall, hpointwise⟩ := |
| 310 | exists_criticalBallPointwiseShi_uniform_accuracy P |
| 311 | refine ⟨epsilon₀, hpos, hsmall, ?_⟩ |
| 312 | intro epsilon C A E H T hepsilon K tau htau l |
| 313 | obtain ⟨B, hB, hbound⟩ := hpointwise H T hepsilon K l |
| 314 | refine ⟨B, hB, ?_⟩ |
| 315 | intro k x hscalar |
| 316 | apply hbound k x |
| 317 | apply hscalar x |
| 318 | change (H.tubeMetric T k).edist x x < ENNReal.ofReal tau |
| 319 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_self] using |
| 320 | ENNReal.ofReal_pos.mpr htau |
| 321 | |
| 322 | end PoincareMT.M28.CounterexampleNeckFamily |