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.Curvature.Calculus |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.CurvatureControl.Distance.Calabi |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.CurvatureControl.Distance.Continuity |
| 4 | import PoincareLib.Geometry.Riemannian.Compactness.IntrinsicMetric |
| 5 | import Mathlib.Analysis.Calculus.MeanValue |
| 6 | |
| 7 | /-! |
| 8 | # Additive distance distortion on controlled Ricci-flow regions |
| 9 | |
| 10 | The actual Calabi upper supports, reversed in time, give upper right slopes |
| 11 | for distance. The one-sided comparison theorem integrates these slopes. |
| 12 | Joint distance continuity and the support functions are derived from the |
| 13 | flow, completeness, and Ricci bounds. |
| 14 | |
| 15 | This is the bounded time-shift comparison needed when applying the spatial |
| 16 | selection in Kleiner--Lott (corrected 2013), Proposition 41.13, p. 2678, |
| 17 | to the buffered ancient compactness construction of Corollary 44.1, |
| 18 | pp. 2682--2683. It does not identify a line in the limit. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | set_option backward.isDefEq.respectTransparency false |
| 23 | |
| 24 | open Set Filter |
| 25 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 26 | |
| 27 | namespace Poincare.AncientVolume |
| 28 | |
| 29 | private theorem image_le_add_of_upper_supports |
| 30 | {f : ℝ → ℝ} {a b C : ℝ} (hab : a ≤ b) |
| 31 | (hf : ContinuousOn f (Icc a b)) |
| 32 | (hsupport : ∀ t ∈ Ico a b, ∃ u : ℝ → ℝ, |
| 33 | u t = f t ∧ (∀ s, f s ≤ u s) ∧ DifferentiableAt ℝ u t ∧ deriv u t ≤ C) : |
| 34 | f b ≤ f a + C * (b - a) := by |
| 35 | have hbar (t : ℝ) : HasDerivAt (fun s => f a + C * (s - a)) C t := by |
| 36 | convert! (((hasDerivAt_id t).sub_const a).const_mul C).const_add (f a) using 1 |
| 37 | simp |
| 38 | apply image_le_of_liminf_slope_right_le_deriv_boundary hf |
| 39 | (by simp : f a ≤ f a + C * (a - a)) |
| 40 | (fun t _ => (hbar t).continuousAt.continuousWithinAt) |
| 41 | (fun t _ => (hbar t).hasDerivWithinAt) ?_ ⟨hab, le_rfl⟩ |
| 42 | intro t ht r hr |
| 43 | obtain ⟨u, heq, hupper, hu, hder⟩ := hsupport t ht |
| 44 | have hu' : HasDerivWithinAt u (deriv u t) (Ici t) t := hu.hasDerivAt.hasDerivWithinAt |
| 45 | have hfreq := hu'.liminf_right_slope_le (hder.trans_lt hr) |
| 46 | apply (hfreq.and_eventually self_mem_nhdsWithin).mono |
| 47 | intro s hs |
| 48 | have hts : 0 < s - t := sub_pos.mpr hs.2 |
| 49 | have hsl : slope f t s ≤ slope u t s := by |
| 50 | rw [slope_def_field, slope_def_field, heq] |
| 51 | exact div_le_div_of_nonneg_right (sub_le_sub_right (hupper s) _) hts.le |
| 52 | exact hsl.trans_lt hs.1 |
| 53 | |
| 54 | /-- Smooth upper supports with a uniform derivative lower bound control |
| 55 | backward increments of a continuous real function. -/ |
| 56 | theorem backward_image_le_add_of_upper_supports |
| 57 | {f : ℝ → ℝ} {a b C : ℝ} (hab : a ≤ b) |
| 58 | (hf : ContinuousOn f (Icc a b)) |
| 59 | (hsupport : ∀ t ∈ Ioc a b, ∃ u : ℝ → ℝ, |
| 60 | u t = f t ∧ (∀ s, f s ≤ u s) ∧ DifferentiableAt ℝ u t ∧ -C ≤ deriv u t) : |
| 61 | f a ≤ f b + C * (b - a) := by |
| 62 | have hrev : ContinuousOn (fun t => f (-t)) (Icc (-b) (-a)) := |
| 63 | hf.comp continuous_neg.continuousOn (fun t ht => ⟨by linarith [ht.2], by linarith [ht.1]⟩) |
| 64 | have h := image_le_add_of_upper_supports (neg_le_neg hab) hrev (C := C) (by |
| 65 | intro t ht |
| 66 | obtain ⟨u, heq, hupper, hu, hder⟩ := hsupport (-t) ⟨by linarith [ht.2], by linarith [ht.1]⟩ |
| 67 | have hd : HasDerivAt (fun s => u (-s)) (-deriv u (-t)) t := by |
| 68 | convert! hu.hasDerivAt.comp t (hasDerivAt_neg t) using 1 |
| 69 | simp |
| 70 | exact ⟨fun s => u (-s), heq, fun s => hupper (-s), hd.differentiableAt, |
| 71 | by rw [hd.deriv]; linarith⟩) |
| 72 | simpa only [neg_neg, neg_sub_neg] using h |
| 73 | |
| 74 | end Poincare.AncientVolume |
| 75 | |
| 76 | universe u |
| 77 | |
| 78 | namespace PoincareMT.RicciFlow |
| 79 | |
| 80 | variable {m : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] [ConnectedSpace M] |
| 81 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 1))) M] [IsManifold (𝓡 (m + 1)) ∞ M] |
| 82 | {J : Set ℝ} |
| 83 | |
| 84 | /-- Ricci upper bounds on current metric balls give a length-independent |
| 85 | additive time-distance bound. Distance continuity and its one-sided slope |
| 86 | bound are produced from the actual flow. -/ |
| 87 | theorem toReal_edist_le_add_of_ricci_upper_on_balls_intrinsic |
| 88 | (F : RicciFlow (m + 1) M J) (hm : 0 < m) |
| 89 | {a b Λ scale : ℝ} (hab : a ≤ b) (hJ : Icc a b ⊆ interior J) |
| 90 | (hcomplete : ∀ t ∈ Icc a b, MetricComplete (F.metric t)) |
| 91 | (hRic : ∀ t ∈ Icc a b, ∀ x : M, ∀ v : TangentSpace (𝓡 (m + 1)) x, |
| 92 | 0 ≤ (F.connection t).ricci x v v) |
| 93 | (hΛ : 0 ≤ Λ) (hscale : 0 < scale) (p x : M) |
| 94 | (hlocal : ∀ t ∈ Icc a b, ∃ r : ℝ, x ∈ (F.metric t).ball p r ∧ |
| 95 | ∀ y ∈ (F.metric t).ball p r, ∀ v : TangentSpace (𝓡 (m + 1)) y, |
| 96 | (F.connection t).ricci y v v ≤ Λ * (F.metric t).inner y v v) : |
| 97 | ((F.metric a).edist p x).toReal ≤ ((F.metric b).edist p x).toReal + |
| 98 | (4 * (((m + 1 : ℕ) : ℝ)) * scale + 8 * Λ / scale) * (b - a) := by |
| 99 | by_cases hpx : p = x |
| 100 | · subst x |
| 101 | simp only [RiemannianMetric.edist, Manifold.riemannianEDist_self, ENNReal.toReal_zero, zero_add] |
| 102 | positivity |
| 103 | have hjoint := F.continuousOn_toReal_edist_of_ricci_nonneg_intrinsic hJ |
| 104 | (hcomplete b ⟨hab, le_rfl⟩) hRic p |
| 105 | have hcont : ContinuousOn (fun t => ((F.metric t).edist p x).toReal) (Icc a b) := |
| 106 | hjoint.comp (continuous_id.prodMk continuous_const).continuousOn (fun t ht => ⟨ht, mem_univ x⟩) |
| 107 | apply Poincare.AncientVolume.backward_image_le_add_of_upper_supports hab hcont |
| 108 | intro t ht |
| 109 | obtain ⟨r, hx, hupper⟩ := hlocal t (Ioc_subset_Icc_self ht) |
| 110 | obtain ⟨U, rho, _hU, hxU, _hsmooth, heq, habove, _hgrad, _hlap, hd, hder⟩ := |
| 111 | F.exists_distance_spacetime_upper_support (hJ (Ioc_subset_Icc_self ht)) hm |
| 112 | (hcomplete t (Ioc_subset_Icc_self ht)) (hRic t (Ioc_subset_Icc_self ht)) |
| 113 | hΛ hscale p x hx hpx hupper |
| 114 | exact ⟨fun s => rho s x, heq, fun s => habove s x hxU, hd, hder⟩ |
| 115 | |
| 116 | /-- Compatibility form of the intrinsic additive distance estimate. -/ |
| 117 | theorem toReal_edist_le_add_of_ricci_upper_on_balls |
| 118 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow (m + 1) M J) (hm : 0 < m) |
| 119 | {a b Λ scale : ℝ} (hab : a ≤ b) (hJ : Icc a b ⊆ interior J) |
| 120 | (hcomplete : ∀ t ∈ Icc a b, MetricComplete (F.metric t)) |
| 121 | (hRic : ∀ t ∈ Icc a b, ∀ x : M, ∀ v : TangentSpace (𝓡 (m + 1)) x, |
| 122 | 0 ≤ (F.connection t).ricci x v v) |
| 123 | (hΛ : 0 ≤ Λ) (hscale : 0 < scale) (p x : M) |
| 124 | (hlocal : ∀ t ∈ Icc a b, ∃ r : ℝ, x ∈ (F.metric t).ball p r ∧ |
| 125 | ∀ y ∈ (F.metric t).ball p r, ∀ v : TangentSpace (𝓡 (m + 1)) y, |
| 126 | (F.connection t).ricci y v v ≤ Λ * (F.metric t).inner y v v) : |
| 127 | ((F.metric a).edist p x).toReal ≤ ((F.metric b).edist p x).toReal + |
| 128 | (4 * (((m + 1 : ℕ) : ℝ)) * scale + 8 * Λ / scale) * (b - a) := by |
| 129 | exact F.toReal_edist_le_add_of_ricci_upper_on_balls_intrinsic hm hab hJ |
| 130 | hcomplete hRic hΛ hscale p x hlocal |
| 131 | |
| 132 | /-- A fixed terminal control ball supplies the current balls needed by the |
| 133 | additive comparison. The endpoint radius loses an explicit exponential |
| 134 | factor, while the additive coefficient is independent of that radius. -/ |
| 135 | theorem toReal_edist_le_add_of_ricci_upper_on_terminal_ball_intrinsic |
| 136 | (F : RicciFlow (m + 1) M J) (hm : 0 < m) |
| 137 | {a b Λ scale r R : ℝ} (hab : a ≤ b) (hJ : Icc a b ⊆ interior J) |
| 138 | (hcomplete : ∀ t ∈ Icc a b, MetricComplete (F.metric t)) |
| 139 | (hRic : ∀ t ∈ Icc a b, ∀ x : M, ∀ v : TangentSpace (𝓡 (m + 1)) x, |
| 140 | 0 ≤ (F.connection t).ricci x v v) |
| 141 | (hΛ : 0 ≤ Λ) (hscale : 0 < scale) (hr : 0 < r) |
| 142 | (hmargin : 4 * Real.exp (Λ * (b - a)) * r ≤ R) (O : M) |
| 143 | (hupper : ∀ t ∈ Icc a b, ∀ z ∈ (F.metric b).ball O R, |
| 144 | ∀ v : TangentSpace (𝓡 (m + 1)) z, |
| 145 | (F.connection t).ricci z v v ≤ Λ * (F.metric t).inner z v v) |
| 146 | (x y : M) (hx : x ∈ (F.metric b).ball O r) (hy : y ∈ (F.metric b).ball O r) : |
| 147 | ((F.metric a).edist x y).toReal ≤ ((F.metric b).edist x y).toReal + |
| 148 | (4 * (((m + 1 : ℕ) : ℝ)) * scale + 8 * Λ / scale) * (b - a) := by |
| 149 | let E := Real.exp (Λ * (b - a)) |
| 150 | have hE : 0 < E := Real.exp_pos _ |
| 151 | have hEone : 1 ≤ E := Real.one_le_exp_iff.mpr (mul_nonneg hΛ (sub_nonneg.mpr hab)) |
| 152 | have hthree : 3 * r ≤ R := by nlinarith [mul_le_mul_of_nonneg_right hEone hr.le] |
| 153 | have hxy : ((F.metric b).edist x y).toReal < 2 * r := by |
| 154 | let := (F.metric b).toMetricSpace |
| 155 | have hx' : dist x O < r := by |
| 156 | simpa only [← (F.metric b).toMetricSpace_ball, Metric.mem_ball] using hx |
| 157 | have hy' : dist O y < r := by |
| 158 | simpa only [← (F.metric b).toMetricSpace_ball, Metric.mem_ball, dist_comm] using hy |
| 159 | change dist x y < 2 * r |
| 160 | linarith [dist_triangle x O y] |
| 161 | apply F.toReal_edist_le_add_of_ricci_upper_on_balls_intrinsic hm hab hJ hcomplete hRic hΛ hscale x y |
| 162 | intro t ht |
| 163 | have hb : b ∈ Icc a b := ⟨hab, le_rfl⟩ |
| 164 | have hcompare := F.edist_le_exp_mul_of_ricci_bound (convex_Icc a b) |
| 165 | (hJ.trans interior_subset) O r Λ hr hb ht (fun s hs z hz v => by |
| 166 | rw [abs_of_nonneg (hRic s hs z v)] |
| 167 | exact hupper s hs z (lt_of_lt_of_le hz (ENNReal.ofReal_le_ofReal hthree)) v) hx hy |
| 168 | have hfinite : ENNReal.ofReal (Real.exp (Λ * |t - b|)) * (F.metric b).edist x y ≠ ⊤ := |
| 169 | ENNReal.mul_ne_top ENNReal.ofReal_ne_top ((F.metric b).edist_ne_top x y) |
| 170 | have hdist : ((F.metric t).edist x y).toReal ≤ |
| 171 | Real.exp (Λ * |t - b|) * ((F.metric b).edist x y).toReal := by |
| 172 | simpa only [ENNReal.toReal_mul, ENNReal.toReal_ofReal (Real.exp_nonneg _)] using |
| 173 | ENNReal.toReal_mono hfinite hcompare |
| 174 | have hexp : Real.exp (Λ * |t - b|) ≤ E := by |
| 175 | apply Real.exp_le_exp.mpr |
| 176 | apply mul_le_mul_of_nonneg_left _ hΛ |
| 177 | rw [abs_of_nonpos (sub_nonpos.mpr ht.2)] |
| 178 | linarith [ht.1] |
| 179 | have hdist' : ((F.metric t).edist x y).toReal < 3 * E * r := by |
| 180 | have hle := hdist.trans (mul_le_mul_of_nonneg_right hexp ENNReal.toReal_nonneg) |
| 181 | have hlt := mul_lt_mul_of_pos_left hxy hE |
| 182 | nlinarith |
| 183 | have hrad : 0 < 3 * E * r := by positivity |
| 184 | refine ⟨3 * E * r, ?_, ?_⟩ |
| 185 | · change (F.metric t).edist x y < ENNReal.ofReal (3 * E * r) |
| 186 | rw [← ENNReal.ofReal_toReal ((F.metric t).edist_ne_top x y)] |
| 187 | exact (ENNReal.ofReal_lt_ofReal_iff hrad).mpr hdist' |
| 188 | · intro z hz v |
| 189 | have hzterminal : z ∈ (F.metric b).ball x (3 * E * r) := |
| 190 | F.ball_subset_ball_of_ricci_nonneg hJ x (3 * E * r) ht hb ht.2 |
| 191 | (fun s hs w _ wv => hRic s hs w wv) hz |
| 192 | have hzcontrol : z ∈ (F.metric b).ball O R := by |
| 193 | let := (F.metric b).toMetricSpace |
| 194 | have hx' : dist x O < r := by |
| 195 | simpa only [← (F.metric b).toMetricSpace_ball, Metric.mem_ball] using hx |
| 196 | have hz' : dist z x < 3 * E * r := by |
| 197 | simpa only [← (F.metric b).toMetricSpace_ball, Metric.mem_ball] using hzterminal |
| 198 | rw [← (F.metric b).toMetricSpace_ball, Metric.mem_ball] |
| 199 | have hsmall : r + 3 * E * r ≤ R := by |
| 200 | change 4 * E * r ≤ R at hmargin |
| 201 | nlinarith [mul_le_mul_of_nonneg_right hEone hr.le] |
| 202 | linarith [dist_triangle z x O] |
| 203 | exact hupper t ht z hzcontrol v |
| 204 | |
| 205 | /-- Compatibility form of the intrinsic terminal-ball distance estimate. -/ |
| 206 | theorem toReal_edist_le_add_of_ricci_upper_on_terminal_ball |
| 207 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow (m + 1) M J) (hm : 0 < m) |
| 208 | {a b Λ scale r R : ℝ} (hab : a ≤ b) (hJ : Icc a b ⊆ interior J) |
| 209 | (hcomplete : ∀ t ∈ Icc a b, MetricComplete (F.metric t)) |
| 210 | (hRic : ∀ t ∈ Icc a b, ∀ x : M, ∀ v : TangentSpace (𝓡 (m + 1)) x, |
| 211 | 0 ≤ (F.connection t).ricci x v v) |
| 212 | (hΛ : 0 ≤ Λ) (hscale : 0 < scale) (hr : 0 < r) |
| 213 | (hmargin : 4 * Real.exp (Λ * (b - a)) * r ≤ R) (O : M) |
| 214 | (hupper : ∀ t ∈ Icc a b, ∀ z ∈ (F.metric b).ball O R, |
| 215 | ∀ v : TangentSpace (𝓡 (m + 1)) z, |
| 216 | (F.connection t).ricci z v v ≤ Λ * (F.metric t).inner z v v) |
| 217 | (x y : M) (hx : x ∈ (F.metric b).ball O r) (hy : y ∈ (F.metric b).ball O r) : |
| 218 | ((F.metric a).edist x y).toReal ≤ ((F.metric b).edist x y).toReal + |
| 219 | (4 * (((m + 1 : ℕ) : ℝ)) * scale + 8 * Λ / scale) * (b - a) := by |
| 220 | exact F.toReal_edist_le_add_of_ricci_upper_on_terminal_ball_intrinsic hm hab hJ |
| 221 | hcomplete hRic hΛ hscale hr hmargin O hupper x y hx hy |
| 222 | |
| 223 | end PoincareMT.RicciFlow |