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.Compactness.Convergence.Terminal.SpatialJets |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.CurvatureControl.Cylinders.Derivatives |
| 3 | import PoincareLib.Geometry.RicciFlow.MetricComparison |
| 4 | |
| 5 | /-! |
| 6 | # Spatial jet control up to the terminal slice of expanding cylinders |
| 7 | |
| 8 | Local scalar control on a fixed terminal ball supplies quantitative time |
| 9 | control in the same spatial coordinates, with constants independent of the |
| 10 | backward buffer. No convergence at the terminal slice is required. |
| 11 | |
| 12 | References: Morgan--Tian, Proposition 5.14, pp. 90--91, and the fixed-slice |
| 13 | blow-up argument in Corollary 9.53, p. 217; Kleiner--Lott, Appendix D, |
| 14 | Theorem D.1, p. 2847, and Appendix E, pp. 2848--2849. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | set_option maxSynthPendingDepth 8 |
| 20 | set_option synthInstance.maxHeartbeats 100000 |
| 21 | set_option maxHeartbeats 800000 |
| 22 | |
| 23 | open Set Filter |
| 24 | open scoped Manifold ContDiff Topology Bundle ENNReal |
| 25 | |
| 26 | universe u |
| 27 | namespace PoincareMT.RicciFlow |
| 28 | |
| 29 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.measurableSpace |
| 30 | FlowCarrier.borelSpace FlowCarrier.chartedSpace FlowCarrier.isManifold |
| 31 | FlowCarrier.t2Space FlowCarrier.t3Space FlowCarrier.secondCountable |
| 32 | |
| 33 | private theorem exists_terminal_spatial_curvature_bounds |
| 34 | {m : ℕ} (hC : RicciFlowCurvatureTheory.{u}) (hm : 0 < m) : |
| 35 | ∃ K : ℕ → ℝ, (∀ j, 0 ≤ K j) ∧ |
| 36 | ∀ (M : Type u) [TopologicalSpace M] [T3Space M] [SecondCountableTopology M] |
| 37 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 1))) M] |
| 38 | [IsManifold (𝓡 (m + 1)) ∞ M] |
| 39 | (J : Set ℝ) (F : RicciFlow (m + 1) M J), |
| 40 | Icc (-2 : ℝ) 0 ⊆ interior J → |
| 41 | (∀ t ∈ Icc (-2 : ℝ) 0, MetricComplete (F.metric t)) → |
| 42 | (∀ t ∈ Icc (-2 : ℝ) 0, ∀ y : M, |
| 43 | (F.connection t).NonnegativeCurvatureOperator y) → |
| 44 | ∀ p : M, |
| 45 | (∀ t ∈ Icc (-2 : ℝ) 0, |
| 46 | ∀ y ∈ (F.metric 0).ball p (64 * (((m + 1 : ℕ) : ℝ) + 8)), |
| 47 | (F.connection t).scalarCurvature y ≤ 4) → |
| 48 | ∀ j, ∀ t ∈ Icc (-1 : ℝ) 0, ∀ y : M, |
| 49 | (F.metric 0).edist p y ≤ ENNReal.ofReal (16 * (((m + 1 : ℕ) : ℝ) + 8)) → |
| 50 | (F.connection t).curvatureDerivativeNorm j y ≤ K j := by |
| 51 | let n : ℝ := ((m + 1 : ℕ) : ℝ) |
| 52 | have hn : 0 < n := by dsimp [n]; positivity |
| 53 | choose K hK hbound using fun j => exists_terminal_cylinder_derivative_constant hC hm j |
| 54 | (S := 4) (A := 8 * n ^ 2) (r := 64 * (n + 8)) (scale := 1) |
| 55 | (by norm_num) (by positivity) (by positivity) (by norm_num) |
| 56 | refine ⟨K, fun j => (hK j).le, ?_⟩ |
| 57 | intro M _ _ _ _ _ J F hJ hcomplete hoperator p hscalar j t ht y hy |
| 58 | have htime : (0 : ℝ) - (-2) ≤ (8 * n ^ 2) / (n ^ 2 * 4) := by |
| 59 | apply (le_div_iff₀ (by positivity)).mpr |
| 60 | ring_nf |
| 61 | rfl |
| 62 | have hgap : 64 * (n + 8) / 4 + (4 * n * 1 + 8 * 4 / 1) * (0 - (-2)) < |
| 63 | 64 * (n + 8) / 2 := by linarith |
| 64 | have hy' : (F.metric 0).edist p y ≤ ENNReal.ofReal (64 * (n + 8) / 4) := by |
| 65 | convert hy using 1 |
| 66 | congr 1 |
| 67 | dsimp [n] |
| 68 | ring |
| 69 | have h := hbound j M J F (-2) 0 (by norm_num) hJ hcomplete hoperator p |
| 70 | htime hgap hscalar t ⟨by linarith [ht.1], ht.2⟩ y hy' |
| 71 | have hden : (1 : ℝ) ≤ (t - (-2)) ^ ((j : ℝ) / 2) := |
| 72 | Real.one_le_rpow (by linarith [ht.1]) (by positivity) |
| 73 | exact h.trans ((div_le_iff₀ (zero_lt_one.trans_le hden)).mpr (by nlinarith [hK j])) |
| 74 | |
| 75 | private theorem terminal_pullback_ellipticity |
| 76 | {m : ℕ} (hC : RicciFlowCurvatureTheory.{u}) |
| 77 | {M : Type u} [TopologicalSpace M] [T2Space M] |
| 78 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 1))) M] |
| 79 | [IsManifold (𝓡 (m + 1)) ∞ M] |
| 80 | {J : Set ℝ} (F : RicciFlow (m + 1) M J) |
| 81 | (hJ : Icc (-2 : ℝ) 0 ⊆ J) |
| 82 | (hoperator : ∀ t ∈ Icc (-2 : ℝ) 0, ∀ y : M, |
| 83 | (F.connection t).NonnegativeCurvatureOperator y) |
| 84 | (p : M) |
| 85 | (hscalar : ∀ t ∈ Icc (-2 : ℝ) 0, |
| 86 | ∀ y ∈ (F.metric 0).ball p (64 * (((m + 1 : ℕ) : ℝ) + 8)), |
| 87 | (F.connection t).scalarCurvature y ≤ 4) |
| 88 | {δ : ℝ} (hδ : 0 < δ) (hδone : δ ≤ 1) |
| 89 | (e : EuclideanSpace ℝ (Fin (m + 1)) → M) (x : EuclideanSpace ℝ (Fin (m + 1))) |
| 90 | (hx : (F.metric 0).edist p (e x) ≤ |
| 91 | ENNReal.ofReal (16 * (((m + 1 : ℕ) : ℝ) + 8))) |
| 92 | {a b : ℝ} |
| 93 | (hinit : ∀ v, a * ‖v‖ ^ 2 ≤ (F.metric (-δ)).pullbackCoefficients e x v v ∧ |
| 94 | (F.metric (-δ)).pullbackCoefficients e x v v ≤ b * ‖v‖ ^ 2) |
| 95 | {t : ℝ} (ht : t ∈ Icc (-δ) 0) (v : EuclideanSpace ℝ (Fin (m + 1))) : |
| 96 | (Real.exp (-8) * a) * ‖v‖ ^ 2 ≤ (F.metric t).pullbackCoefficients e x v v ∧ |
| 97 | (F.metric t).pullbackCoefficients e x v v ≤ (Real.exp 8 * b) * ‖v‖ ^ 2 := by |
| 98 | have hsub : Icc (-δ) 0 ⊆ Icc (-2 : ℝ) 0 := Icc_subset_Icc (by linarith) le_rfl |
| 99 | have hxball : e x ∈ (F.metric 0).ball p (64 * (((m + 1 : ℕ) : ℝ) + 8)) := |
| 100 | hx.trans_lt (ENNReal.ofReal_lt_ofReal_iff_of_nonneg (by positivity) |>.mpr (by |
| 101 | have hdim : (0 : ℝ) ≤ ((m + 1 : ℕ) : ℝ) := by positivity |
| 102 | linarith)) |
| 103 | let w := mfderiv (𝓡 (m + 1)) (𝓡 (m + 1)) e x v |
| 104 | have hn (s : ℝ) : 0 ≤ (F.metric s).inner (e x) w w := by |
| 105 | by_cases hw : w = 0 |
| 106 | · simp [hw] |
| 107 | · exact ((F.metric s).pos _ _ hw).le |
| 108 | have hRic (s : ℝ) (hs : s ∈ Icc (-δ) 0) : |
| 109 | |(F.connection s).ricci (e x) w w| ≤ 4 * (F.metric s).inner (e x) w w := by |
| 110 | have h := (F.connection s).ricci_bounds_of_nonnegative_curvatureOperator |
| 111 | (hC.tensor_calculus (m + 1) M (F.metric s) (F.connection s)) (e x) |
| 112 | (hoperator s (hsub hs) (e x)) w |
| 113 | rw [abs_of_nonneg h.1] |
| 114 | exact h.2.trans (mul_le_mul_of_nonneg_right (hscalar s (hsub hs) (e x) hxball) (hn s)) |
| 115 | have hcomp := F.metric_inner_self_exp_bounds (convex_Icc (-δ) 0) |
| 116 | (fun _ hs => hJ (hsub hs)) (e x) w 4 hRic ⟨le_rfl, by linarith⟩ ht |
| 117 | have htime : |t - (-δ)| ≤ 1 := by rw [abs_le]; constructor <;> linarith [ht.1, ht.2] |
| 118 | have hl : Real.exp (-8) ≤ Real.exp (-(2 * 4) * |t - (-δ)|) := |
| 119 | Real.exp_le_exp.mpr (by linarith) |
| 120 | have hu : Real.exp ((2 * 4) * |t - (-δ)|) ≤ Real.exp 8 := |
| 121 | Real.exp_le_exp.mpr (by linarith) |
| 122 | constructor |
| 123 | · calc |
| 124 | _ = Real.exp (-8) * (a * ‖v‖ ^ 2) := by ring |
| 125 | _ ≤ Real.exp (-8) * (F.metric (-δ)).inner (e x) w w := |
| 126 | mul_le_mul_of_nonneg_left (hinit v).1 (Real.exp_nonneg _) |
| 127 | _ ≤ Real.exp (-(2 * 4) * |t - (-δ)|) * (F.metric (-δ)).inner (e x) w w := |
| 128 | mul_le_mul_of_nonneg_right hl (hn (-δ)) |
| 129 | _ ≤ _ := hcomp.1 |
| 130 | · calc |
| 131 | _ ≤ Real.exp ((2 * 4) * |t - (-δ)|) * (F.metric (-δ)).inner (e x) w w := hcomp.2 |
| 132 | _ ≤ Real.exp 8 * (F.metric (-δ)).inner (e x) w w := |
| 133 | mul_le_mul_of_nonneg_right hu (hn (-δ)) |
| 134 | _ ≤ Real.exp 8 * (b * ‖v‖ ^ 2) := |
| 135 | mul_le_mul_of_nonneg_left (hinit v).2 (Real.exp_nonneg _) |
| 136 | _ = _ := by ring |
| 137 | |
| 138 | /-- A scalar-controlled terminal cylinder gives spatial jet time control |
| 139 | uniformly in the backward buffer, using the original fixed spatial maps. -/ |
| 140 | theorem exists_terminal_cylinder_spatialJet_time_constant |
| 141 | {m : ℕ} (hC : RicciFlowCurvatureTheory.{u}) (hm : 0 < m) |
| 142 | (d : ℕ) (Z : ℕ → ℝ) {a b : ℝ} (ha : 0 < a) (hb : 0 ≤ b) : |
| 143 | ∃ B : ℝ, 0 ≤ B ∧ |
| 144 | ∀ (M : Type u) [TopologicalSpace M] [T3Space M] [SecondCountableTopology M] |
| 145 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 1))) M] |
| 146 | [IsManifold (𝓡 (m + 1)) ∞ M] |
| 147 | (J : Set ℝ), IsOpen J → ∀ F : RicciFlow (m + 1) M J, |
| 148 | Icc (-2 : ℝ) 0 ⊆ J → |
| 149 | (∀ t ∈ Icc (-2 : ℝ) 0, MetricComplete (F.metric t)) → |
| 150 | (∀ t ∈ Icc (-2 : ℝ) 0, ∀ y : M, |
| 151 | (F.connection t).NonnegativeCurvatureOperator y) → |
| 152 | ∀ p : M, |
| 153 | (∀ t ∈ Icc (-2 : ℝ) 0, |
| 154 | ∀ y ∈ (F.metric 0).ball p (64 * (((m + 1 : ℕ) : ℝ) + 8)), |
| 155 | (F.connection t).scalarCurvature y ≤ 4) → |
| 156 | ∀ {δ : ℝ}, 0 < δ → δ ≤ 1 → |
| 157 | ∀ {U : Set (EuclideanSpace ℝ (Fin (m + 1)))}, IsOpen U → |
| 158 | ∀ {e : EuclideanSpace ℝ (Fin (m + 1)) → M}, |
| 159 | ContMDiffOn (𝓡 (m + 1)) (𝓡 (m + 1)) ∞ e U → |
| 160 | (∀ y ∈ U, (mfderiv (𝓡 (m + 1)) (𝓡 (m + 1)) e y).IsInvertible) → |
| 161 | ∀ {x : EuclideanSpace ℝ (Fin (m + 1))}, x ∈ U → |
| 162 | (F.metric 0).edist p (e x) ≤ |
| 163 | ENNReal.ofReal (16 * (((m + 1 : ℕ) : ℝ) + 8)) → |
| 164 | (∀ v, a * ‖v‖ ^ 2 ≤ (F.metric (-δ)).pullbackCoefficients e x v v ∧ |
| 165 | (F.metric (-δ)).pullbackCoefficients e x v v ≤ b * ‖v‖ ^ 2) → |
| 166 | (∀ j ≤ d, |
| 167 | ‖iteratedFDeriv ℝ j ((F.metric (-δ)).pullbackCoefficients e) x‖ ≤ Z j) → |
| 168 | ∀ j ≤ d, ∀ s ∈ Icc (-δ) 0, ∀ t ∈ Icc (-δ) 0, |
| 169 | ‖iteratedFDeriv ℝ j ((F.metric t).pullbackCoefficients e) x - |
| 170 | iteratedFDeriv ℝ j ((F.metric s).pullbackCoefficients e) x‖ ≤ B * |t - s| := by |
| 171 | obtain ⟨K, hK, hcurvature⟩ := exists_terminal_spatial_curvature_bounds hC hm |
| 172 | obtain ⟨B, hB, htime⟩ := SpacetimeBounds.exists_spatialJet_time_lipschitz_constant |
| 173 | (m + 1) d K Z hK (a := Real.exp (-8) * a) (b := Real.exp 8 * b) |
| 174 | (by positivity) (by positivity) |
| 175 | refine ⟨B, hB, ?_⟩ |
| 176 | intro M _ _ _ _ _ J hJ F hsub hcomplete hoperator p hscalar δ hδ hδone U hU e he hi x hx hdist hell hinit j hj s hs t ht |
| 177 | have hsubδ : Icc (-δ) 0 ⊆ Icc (-2 : ℝ) 0 := Icc_subset_Icc (by linarith) le_rfl |
| 178 | have hcurv := hcurvature M J F (by simpa only [hJ.interior_eq] using hsub) |
| 179 | hcomplete hoperator p hscalar |
| 180 | have h := htime F hJ hU he hi (fun _ hu => hsub (hsubδ hu)) |
| 181 | (by linarith : (0 : ℝ) - (-δ) ≤ 1) (show -δ ∈ Icc (-δ) 0 by constructor <;> linarith) |
| 182 | hx (fun u hu v => terminal_pullback_ellipticity hC F hsub hoperator p hscalar |
| 183 | hδ hδone e x hdist hell hu v) |
| 184 | (fun k _ u hu => hcurv k u ⟨by linarith [hu.1], hu.2⟩ (e x) hdist) hinit |
| 185 | exact (h j hj).2 s hs t ht |
| 186 | |
| 187 | /-- On actual expanding scalar-controlled cylinders, a single constant |
| 188 | compares buffered and terminal spatial jets on every fixed bounded region. |
| 189 | The eventual tail is independent of the buffer and the spatial maps. -/ |
| 190 | theorem eventually_terminal_spatialJet_control_of_expanding_cylinders |
| 191 | {m : ℕ} (hC : RicciFlowCurvatureTheory.{u}) (hm : 0 < m) |
| 192 | (C : ℕ → FlowCarrier.{u} (m + 1)) (J : ℕ → Set ℝ) |
| 193 | (F : ∀ k, RicciFlow (m + 1) (C k).carrier (J k)) |
| 194 | (p : ∀ k, (C k).carrier) (A L : ℕ → ℝ) |
| 195 | (hA : Tendsto A atTop atTop) (hL : Tendsto L atTop atTop) |
| 196 | (hopen : ∀ k, IsOpen (J k)) |
| 197 | (hJ : ∀ k, Icc (-A k) 0 ⊆ interior (J k)) |
| 198 | (hcomplete : ∀ k, ∀ t ∈ Icc (-A k) 0, MetricComplete ((F k).metric t)) |
| 199 | (hoperator : ∀ k, ∀ t ∈ Icc (-A k) 0, ∀ y : (C k).carrier, |
| 200 | ((F k).connection t).NonnegativeCurvatureOperator y) |
| 201 | (hscalar : ∀ k, ∀ t ∈ Icc (-A k) 0, |
| 202 | ∀ y ∈ ((F k).metric 0).ball (p k) (L k), |
| 203 | ((F k).connection t).scalarCurvature y ≤ 4) |
| 204 | (d : ℕ) (Z : ℕ → ℝ) {a b : ℝ} (ha : 0 < a) (hb : 0 ≤ b) : |
| 205 | ∃ B : ℝ, 0 ≤ B ∧ ∀ R : ℝ, 0 ≤ R → ∀ᶠ k in atTop, |
| 206 | ∀ {δ : ℝ}, 0 < δ → δ ≤ 1 → |
| 207 | ∀ {U : Set (EuclideanSpace ℝ (Fin (m + 1)))}, IsOpen U → |
| 208 | ∀ {e : EuclideanSpace ℝ (Fin (m + 1)) → (C k).carrier}, |
| 209 | ContMDiffOn (𝓡 (m + 1)) (𝓡 (m + 1)) ∞ e U → |
| 210 | (∀ y ∈ U, (mfderiv (𝓡 (m + 1)) (𝓡 (m + 1)) e y).IsInvertible) → |
| 211 | ∀ {x : EuclideanSpace ℝ (Fin (m + 1))}, x ∈ U → |
| 212 | ((F k).metric 0).edist (p k) (e x) ≤ ENNReal.ofReal R → |
| 213 | (∀ v, a * ‖v‖ ^ 2 ≤ ((F k).metric (-δ)).pullbackCoefficients e x v v ∧ |
| 214 | ((F k).metric (-δ)).pullbackCoefficients e x v v ≤ b * ‖v‖ ^ 2) → |
| 215 | (∀ j ≤ d, |
| 216 | ‖iteratedFDeriv ℝ j (((F k).metric (-δ)).pullbackCoefficients e) x‖ ≤ Z j) → |
| 217 | ∀ j ≤ d, |
| 218 | ‖iteratedFDeriv ℝ j (((F k).metric 0).pullbackCoefficients e) x - |
| 219 | iteratedFDeriv ℝ j (((F k).metric (-δ)).pullbackCoefficients e) x‖ ≤ B * δ := by |
| 220 | obtain ⟨B, hB, hbound⟩ := exists_terminal_cylinder_spatialJet_time_constant hC hm d Z ha hb |
| 221 | refine ⟨B, hB, ?_⟩ |
| 222 | intro R hR |
| 223 | let r : ℝ := 64 * (((m + 1 : ℕ) : ℝ) + 8) |
| 224 | have hr : 0 < r := by dsimp [r]; positivity |
| 225 | filter_upwards [hA.eventually_ge_atTop 2, hL.eventually_ge_atTop (R + r + 1)] with k hkA hkL |
| 226 | intro δ hδ hδone U hU e he hi x hx hdist hell hinit j hj |
| 227 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 (m + 1)) : (C k).carrier → Type _) := |
| 228 | ⟨((F k).metric 0).toRiemannianMetric⟩ |
| 229 | have hsub : Icc (-2 : ℝ) 0 ⊆ Icc (-A k) 0 := Icc_subset_Icc (by linarith) le_rfl |
| 230 | have hlocal : ∀ t ∈ Icc (-2 : ℝ) 0, ∀ y ∈ ((F k).metric 0).ball (e x) r, |
| 231 | ((F k).connection t).scalarCurvature y ≤ 4 := by |
| 232 | intro t ht y hy |
| 233 | apply hscalar k t (hsub ht) y |
| 234 | have htri : ((F k).metric 0).edist (p k) y ≤ |
| 235 | ((F k).metric 0).edist (p k) (e x) + ((F k).metric 0).edist (e x) y := |
| 236 | Manifold.riemannianEDist_triangle |
| 237 | have hsum : ((F k).metric 0).edist (p k) y ≤ ENNReal.ofReal (R + r) := by |
| 238 | rw [ENNReal.ofReal_add hR hr.le] |
| 239 | exact htri.trans (add_le_add hdist hy.le) |
| 240 | have hgap : ENNReal.ofReal (R + r) < ENNReal.ofReal (R + r + 1) := |
| 241 | ENNReal.ofReal_lt_ofReal_iff_of_nonneg (by positivity) |>.mpr (by linarith) |
| 242 | exact (hsum.trans_lt hgap).trans_le (ENNReal.ofReal_le_ofReal hkL) |
| 243 | have h := hbound (C k).carrier (J k) (hopen k) (F k) |
| 244 | (fun _ ht => interior_subset (hJ k (hsub ht))) |
| 245 | (fun t ht => hcomplete k t (hsub ht)) |
| 246 | (fun t ht => hoperator k t (hsub ht)) (e x) hlocal hδ hδone hU he hi hx |
| 247 | (by change Manifold.riemannianEDist (𝓡 (m + 1)) (e x) (e x) ≤ _ |
| 248 | rw [Manifold.riemannianEDist_self]; exact bot_le) hell hinit j hj |
| 249 | (-δ) ⟨le_rfl, by linarith⟩ 0 ⟨by linarith, le_rfl⟩ |
| 250 | simpa only [zero_sub, neg_neg, abs_of_pos hδ] using h |
| 251 | |
| 252 | end PoincareMT.RicciFlow |