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.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceSpeed |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceNormalization |
| 4 | import Mathlib.Analysis.Calculus.ParametricIntervalIntegral |
| 5 | import Mathlib.Analysis.SpecialFunctions.Integrals.Basic |
| 6 | |
| 7 | /-! |
| 8 | # Initial control of the actual normal-speed gradient |
| 9 | |
| 10 | Differentiate the actual log-speed time integral under the integrable |
| 11 | intrinsic first-jet bound. This proves an initial spatial-gradient |
| 12 | modulus without assuming a spatial second-jet trace. MT2007 Claim 19.1, |
| 13 | p. 437; corrected Lemmas 0.1-0.2, MT2015Correction pp. 3-6; see |
| 14 | `2026-09-22-c2-normal-speed-gradient.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set MeasureTheory Filter |
| 20 | open scoped Manifold ContDiff Bundle intervalIntegral Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M63 |
| 25 | |
| 26 | open M62 |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | {a b : ℝ} |
| 31 | |
| 32 | /-- Differentiate the actual logarithmic speed integral using an |
| 33 | integrable intrinsic first-jet bound. Only strict interior times need |
| 34 | differentiation witnesses. MT2007 Claim 19.1, p. 437; normal-speed |
| 35 | gradient derivation, statement 1. -/ |
| 36 | theorem curveSpeed_spatial_derivative_integral [T2Space M] |
| 37 | (F : RicciFlow n M (Icc a b)) (c : ℝ → ℝ → M) |
| 38 | (hc : M62ShrinkingCurve F c) {K R J v0 : ℝ} |
| 39 | (hK : 0 ≤ K) (hR : 0 ≤ R) (hJ : 0 ≤ J) (hv0 : 0 < v0) |
| 40 | (hBounds : CurveEvolutionAmbientBounds F K K K) |
| 41 | (hInitial : ∀ y, curveSpeed F c a y = v0) |
| 42 | (hCurv : ∀ r ∈ Ioo a b, ∀ y, m62CurvatureSquared F c r y ≤ R) |
| 43 | (hJet : ∀ r ∈ Ioo a b, ∀ y, |
| 44 | (F.metric r).tangentNorm (c y r) (m63CurvatureJet F c 1 r y) ≤ |
| 45 | J / Real.sqrt (r - a)) |
| 46 | {t : ℝ} (ht : t ∈ Icc a b) (x : ℝ) : |
| 47 | deriv (curveSpeed F c t) x = -curveSpeed F c t x * |
| 48 | ∫ r in a..t, |
| 49 | deriv (fun y => m62TangentRicci F c r y + m62CurvatureSquared F c r y) x := by |
| 50 | let V := v0 * Real.exp ((K + R) * (b - a)) |
| 51 | let A : ℝ × ℝ → ℝ := fun z => |
| 52 | m62TangentRicci F c z.2 z.1 + m62CurvatureSquared F c z.2 z.1 |
| 53 | let Ax : ℝ × ℝ → ℝ := M08.coordinatePartialS A |
| 54 | let B : ℝ → ℝ := fun r => V * (K + 2 * K * Real.sqrt R) + |
| 55 | (2 * V * Real.sqrt R * J) * (r - a) ^ (-(1 / 2 : ℝ)) |
| 56 | have ha : a ∈ Icc a b := ⟨le_rfl, ht.1.trans ht.2⟩ |
| 57 | have hV (r : ℝ) (hr : r ∈ Icc a b) (y : ℝ) : curveSpeed F c r y ≤ V := by |
| 58 | have h := (curveSpeed_exp_bounds F c hc hBounds y |
| 59 | (fun s hs => hCurv s hs y) ha hr hr.1).2 |
| 60 | rw [hInitial] at h |
| 61 | exact h.trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr |
| 62 | (mul_le_mul_of_nonneg_left (sub_le_sub_right hr.2 a) (add_nonneg hK hR))) hv0.le) |
| 63 | have hopen : IsOpen (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := isOpen_univ.prod isOpen_Ioo |
| 64 | have hA : ContDiffOn ℝ ∞ A (univ ×ˢ Ioo a b) := |
| 65 | normalization_coefficient_contDiffOn F c hc |
| 66 | have hAx : ContDiffOn ℝ ∞ Ax (univ ×ˢ Ioo a b) := |
| 67 | M08.coordinatePartialS_contDiffOn hopen A hA |
| 68 | have hdiff (r : ℝ) (hr : r ∈ Ioo a b) (y : ℝ) : |
| 69 | HasDerivAt (fun y => A (y, r)) (Ax (y, r)) y := by |
| 70 | have hmem : (y, r) ∈ (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := ⟨mem_univ _, hr⟩ |
| 71 | have hd : DifferentiableAt ℝ A (y, r) := |
| 72 | (hA.contDiffAt (hopen.mem_nhds hmem)).differentiableAt (by simp) |
| 73 | exact M08.coordinateSlice_fst_hasDerivAt A (p := (y, r)) hd |
| 74 | have hbound (r : ℝ) (hr : r ∈ Ioo a b) (y : ℝ) : ‖Ax (y, r)‖ ≤ B r := by |
| 75 | have hk0 := curvature_nonneg F c r y |
| 76 | have hk : m62Curvature F c r y ≤ Real.sqrt R := by |
| 77 | nlinarith only [curvature_sq F c r y, hCurv r hr y, |
| 78 | Real.sq_sqrt hR, Real.sqrt_nonneg R] |
| 79 | have hu : 0 ≤ J / Real.sqrt (r - a) := div_nonneg hJ (Real.sqrt_nonneg _) |
| 80 | have hco : K + 2 * K * m62Curvature F c r y + |
| 81 | 2 * m62Curvature F c r y * |
| 82 | (F.metric r).tangentNorm (c y r) (m63CurvatureJet F c 1 r y) ≤ |
| 83 | K + 2 * K * Real.sqrt R + 2 * Real.sqrt R * (J / Real.sqrt (r - a)) := by |
| 84 | apply add_le_add |
| 85 | · exact add_le_add le_rfl (mul_le_mul_of_nonneg_left hk |
| 86 | (show 0 ≤ 2 * K by positivity)) |
| 87 | · exact (mul_le_mul_of_nonneg_left (hJet r hr y) (by positivity)).trans |
| 88 | (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hk (by norm_num)) hu) |
| 89 | have hco0 : 0 ≤ K + 2 * K * Real.sqrt R + |
| 90 | 2 * Real.sqrt R * (J / Real.sqrt (r - a)) := by positivity |
| 91 | have hp : (r - a) ^ (-(1 / 2 : ℝ)) = (Real.sqrt (r - a))⁻¹ := by |
| 92 | rw [Real.rpow_neg (sub_nonneg.mpr hr.1.le), ← Real.sqrt_eq_rpow] |
| 93 | rw [Real.norm_eq_abs, ← (hdiff r hr y).deriv] |
| 94 | calc |
| 95 | _ ≤ curveSpeed F c r y * |
| 96 | (K + 2 * K * m62Curvature F c r y + 2 * m62Curvature F c r y * |
| 97 | (F.metric r).tangentNorm (c y r) (m63CurvatureJet F c 1 r y)) := |
| 98 | normalizationCoefficient_spatial_abs_bound F c hc hBounds hr y |
| 99 | _ ≤ curveSpeed F c r y * |
| 100 | (K + 2 * K * Real.sqrt R + 2 * Real.sqrt R * (J / Real.sqrt (r - a))) := |
| 101 | mul_le_mul_of_nonneg_left hco (speed_nonneg F c r y) |
| 102 | _ ≤ V * (K + 2 * K * Real.sqrt R + |
| 103 | 2 * Real.sqrt R * (J / Real.sqrt (r - a))) := |
| 104 | mul_le_mul_of_nonneg_right (hV r (Ioo_subset_Icc_self hr) y) hco0 |
| 105 | _ = B r := by dsimp only [B]; rw [hp]; ring |
| 106 | have hpow : IntervalIntegrable (fun r : ℝ => (r - a) ^ (-(1 / 2 : ℝ))) volume a t := by |
| 107 | simpa only [zero_add, sub_add_cancel] using |
| 108 | (intervalIntegral.intervalIntegrable_rpow' (a := 0) (b := t - a) |
| 109 | (r := -(1 / 2 : ℝ)) (by norm_num)).comp_sub_right a |
| 110 | have hB : IntervalIntegrable B volume a t := |
| 111 | intervalIntegrable_const.add (hpow.const_mul _) |
| 112 | have hAint (y : ℝ) : IntervalIntegrable (fun r => A (y, r)) volume a t := |
| 113 | normalizationCoefficient_intervalIntegrable F c hc hBounds y |
| 114 | (fun r hr => hCurv r hr y) ha ht ht.1 |
| 115 | have hAxmeas : AEStronglyMeasurable (fun r => Ax (x, r)) |
| 116 | (volume.restrict (uIoc a t)) := by |
| 117 | rw [uIoc_of_le ht.1, ← restrict_Ioo_eq_restrict_Ioc] |
| 118 | have hslice : Continuous (fun r : ℝ => (x, r)) := continuous_const.prodMk continuous_id |
| 119 | have hmaps : MapsTo (fun r : ℝ => (x, r)) (Ioo a t) (univ ×ˢ Ioo a b) := by |
| 120 | intro r hr |
| 121 | exact ⟨mem_univ _, hr.1, hr.2.trans_le ht.2⟩ |
| 122 | have hcont : ContinuousOn (fun r => Ax (x, r)) (Ioo a t) := by |
| 123 | simpa only [Function.comp_def] using hAx.continuousOn.comp hslice.continuousOn hmaps |
| 124 | exact hcont.aestronglyMeasurable measurableSet_Ioo |
| 125 | have hderiv := intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le |
| 126 | (F := fun y r => A (y, r)) (F' := fun y r => Ax (y, r)) |
| 127 | (x₀ := x) (s := univ) (bound := B) (a := a) (b := t) |
| 128 | (by simp) (Eventually.of_forall fun y => (hAint y).def'.aestronglyMeasurable) |
| 129 | (hAint x) hAxmeas (by |
| 130 | filter_upwards [volume.ae_ne t] with r hrt |
| 131 | intro hr y _ |
| 132 | rw [uIoc_of_le ht.1] at hr |
| 133 | exact hbound r ⟨hr.1, (lt_of_le_of_ne hr.2 hrt).trans_le ht.2⟩ y) |
| 134 | hB (by |
| 135 | filter_upwards [volume.ae_ne t] with r hrt |
| 136 | intro hr y _ |
| 137 | rw [uIoc_of_le ht.1] at hr |
| 138 | exact hdiff r ⟨hr.1, (lt_of_le_of_ne hr.2 hrt).trans_le ht.2⟩ y) |
| 139 | have heq (y : ℝ) : Real.log (curveSpeed F c t y) = |
| 140 | Real.log v0 - ∫ r in a..t, A (y, r) := by |
| 141 | rw [curveSpeed_log_eq_integral F c hc hBounds y |
| 142 | (fun r hr => hCurv r hr y) ha ht ht.1, hInitial] |
| 143 | have hlog := ((speed_contDiff F c hc ht).differentiable (by norm_num) x).hasDerivAt.log |
| 144 | (speed_pos F c hc ht x).ne' |
| 145 | have hlog' := (hderiv.2.const_sub (Real.log v0)).congr_of_eventuallyEq |
| 146 | (Eventually.of_forall heq) |
| 147 | have hI : (∫ r in a..t, Ax (x, r)) = |
| 148 | ∫ r in a..t, |
| 149 | deriv (fun y => m62TangentRicci F c r y + m62CurvatureSquared F c r y) x := by |
| 150 | apply intervalIntegral.integral_congr_ae |
| 151 | filter_upwards [volume.ae_ne t] with r hrt |
| 152 | intro hr |
| 153 | rw [uIoc_of_le ht.1] at hr |
| 154 | exact (hdiff r ⟨hr.1, (lt_of_le_of_ne hr.2 hrt).trans_le ht.2⟩ x).deriv.symm |
| 155 | have hid := hlog.unique hlog' |
| 156 | rw [hI] at hid |
| 157 | exact (div_eq_iff (speed_pos F c hc ht x).ne').mp hid |>.trans (by ring) |
| 158 | |
| 159 | /-- The actual normal-speed gradient has an explicit initial modulus |
| 160 | independent of higher initial jets. The constant initial speed v0 is |
| 161 | retained after fixed-period normalization. MT2007 Claim 19.1, p. 437; |
| 162 | normal-speed gradient derivation, statement 2. -/ |
| 163 | theorem curveSpeed_spatial_abs_bound [T2Space M] |
| 164 | (F : RicciFlow n M (Icc a b)) (c : ℝ → ℝ → M) |
| 165 | (hc : M62ShrinkingCurve F c) {K R J v0 : ℝ} |
| 166 | (hK : 0 ≤ K) (hR : 0 ≤ R) (hJ : 0 ≤ J) (hv0 : 0 < v0) |
| 167 | (hBounds : CurveEvolutionAmbientBounds F K K K) |
| 168 | (hInitial : ∀ y, curveSpeed F c a y = v0) |
| 169 | (hCurv : ∀ r ∈ Ioo a b, ∀ y, m62CurvatureSquared F c r y ≤ R) |
| 170 | (hJet : ∀ r ∈ Ioo a b, ∀ y, |
| 171 | (F.metric r).tangentNorm (c y r) (m63CurvatureJet F c 1 r y) ≤ |
| 172 | J / Real.sqrt (r - a)) |
| 173 | {t : ℝ} (ht : t ∈ Icc a b) (x : ℝ) : |
| 174 | |deriv (curveSpeed F c t) x| ≤ (v0 * Real.exp ((K + R) * (b - a))) ^ 2 * |
| 175 | ((K + 2 * K * Real.sqrt R) * (t - a) + |
| 176 | 4 * Real.sqrt R * J * Real.sqrt (t - a)) := by |
| 177 | let V := v0 * Real.exp ((K + R) * (b - a)) |
| 178 | let B : ℝ → ℝ := fun r => V * (K + 2 * K * Real.sqrt R) + |
| 179 | (2 * V * Real.sqrt R * J) * (r - a) ^ (-(1 / 2 : ℝ)) |
| 180 | have ha : a ∈ Icc a b := ⟨le_rfl, ht.1.trans ht.2⟩ |
| 181 | have hV0 : 0 ≤ V := (mul_pos hv0 (Real.exp_pos _)).le |
| 182 | have hV (r : ℝ) (hr : r ∈ Icc a b) (y : ℝ) : curveSpeed F c r y ≤ V := by |
| 183 | have h := (curveSpeed_exp_bounds F c hc hBounds y |
| 184 | (fun s hs => hCurv s hs y) ha hr hr.1).2 |
| 185 | rw [hInitial] at h |
| 186 | exact h.trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr |
| 187 | (mul_le_mul_of_nonneg_left (sub_le_sub_right hr.2 a) (add_nonneg hK hR))) hv0.le) |
| 188 | have hbound (r : ℝ) (hr : r ∈ Ioo a b) : |
| 189 | ‖deriv (fun y => m62TangentRicci F c r y + m62CurvatureSquared F c r y) x‖ ≤ B r := by |
| 190 | have hk0 := curvature_nonneg F c r x |
| 191 | have hk : m62Curvature F c r x ≤ Real.sqrt R := by |
| 192 | nlinarith only [curvature_sq F c r x, hCurv r hr x, |
| 193 | Real.sq_sqrt hR, Real.sqrt_nonneg R] |
| 194 | have hu : 0 ≤ J / Real.sqrt (r - a) := div_nonneg hJ (Real.sqrt_nonneg _) |
| 195 | have hco : K + 2 * K * m62Curvature F c r x + |
| 196 | 2 * m62Curvature F c r x * |
| 197 | (F.metric r).tangentNorm (c x r) (m63CurvatureJet F c 1 r x) ≤ |
| 198 | K + 2 * K * Real.sqrt R + 2 * Real.sqrt R * (J / Real.sqrt (r - a)) := by |
| 199 | apply add_le_add |
| 200 | · exact add_le_add le_rfl (mul_le_mul_of_nonneg_left hk |
| 201 | (show 0 ≤ 2 * K by positivity)) |
| 202 | · exact (mul_le_mul_of_nonneg_left (hJet r hr x) (by positivity)).trans |
| 203 | (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hk (by norm_num)) hu) |
| 204 | have hco0 : 0 ≤ K + 2 * K * Real.sqrt R + |
| 205 | 2 * Real.sqrt R * (J / Real.sqrt (r - a)) := by positivity |
| 206 | have hp : (r - a) ^ (-(1 / 2 : ℝ)) = (Real.sqrt (r - a))⁻¹ := by |
| 207 | rw [Real.rpow_neg (sub_nonneg.mpr hr.1.le), ← Real.sqrt_eq_rpow] |
| 208 | rw [Real.norm_eq_abs] |
| 209 | calc |
| 210 | _ ≤ curveSpeed F c r x * |
| 211 | (K + 2 * K * m62Curvature F c r x + 2 * m62Curvature F c r x * |
| 212 | (F.metric r).tangentNorm (c x r) (m63CurvatureJet F c 1 r x)) := |
| 213 | normalizationCoefficient_spatial_abs_bound F c hc hBounds hr x |
| 214 | _ ≤ curveSpeed F c r x * |
| 215 | (K + 2 * K * Real.sqrt R + 2 * Real.sqrt R * (J / Real.sqrt (r - a))) := |
| 216 | mul_le_mul_of_nonneg_left hco (speed_nonneg F c r x) |
| 217 | _ ≤ V * (K + 2 * K * Real.sqrt R + |
| 218 | 2 * Real.sqrt R * (J / Real.sqrt (r - a))) := |
| 219 | mul_le_mul_of_nonneg_right (hV r (Ioo_subset_Icc_self hr) x) hco0 |
| 220 | _ = B r := by dsimp only [B]; rw [hp]; ring |
| 221 | have hpow : IntervalIntegrable (fun r : ℝ => (r - a) ^ (-(1 / 2 : ℝ))) volume a t := by |
| 222 | simpa only [zero_add, sub_add_cancel] using |
| 223 | (intervalIntegral.intervalIntegrable_rpow' (a := 0) (b := t - a) |
| 224 | (r := -(1 / 2 : ℝ)) (by norm_num)).comp_sub_right a |
| 225 | have hB : IntervalIntegrable B volume a t := |
| 226 | intervalIntegrable_const.add (hpow.const_mul _) |
| 227 | have hpowI : (∫ r in a..t, (r - a) ^ (-(1 / 2 : ℝ))) = 2 * Real.sqrt (t - a) := by |
| 228 | rw [intervalIntegral.integral_comp_sub_right |
| 229 | (f := fun r : ℝ => r ^ (-(1 / 2 : ℝ))) a, sub_self, |
| 230 | integral_rpow (Or.inl (by norm_num))] |
| 231 | norm_num [← Real.sqrt_eq_rpow] |
| 232 | ring |
| 233 | have hBI : (∫ r in a..t, B r) = V * |
| 234 | ((K + 2 * K * Real.sqrt R) * (t - a) + |
| 235 | 4 * Real.sqrt R * J * Real.sqrt (t - a)) := by |
| 236 | dsimp only [B] |
| 237 | rw [intervalIntegral.integral_add intervalIntegrable_const (hpow.const_mul _), |
| 238 | intervalIntegral.integral_const, intervalIntegral.integral_const_mul, hpowI] |
| 239 | simp only [smul_eq_mul] |
| 240 | ring |
| 241 | have hI := intervalIntegral.norm_integral_le_of_norm_le (f := fun r => |
| 242 | deriv (fun y => m62TangentRicci F c r y + m62CurvatureSquared F c r y) x) |
| 243 | ht.1 (by |
| 244 | filter_upwards [volume.ae_ne t] with r hrt |
| 245 | intro hr |
| 246 | exact hbound r ⟨hr.1, (lt_of_le_of_ne hr.2 hrt).trans_le ht.2⟩) hB |
| 247 | rw [hBI, Real.norm_eq_abs] at hI |
| 248 | rw [curveSpeed_spatial_derivative_integral F c hc hK hR hJ hv0 |
| 249 | hBounds hInitial hCurv hJet ht x, abs_mul, abs_neg, |
| 250 | abs_of_pos (speed_pos F c hc ht x)] |
| 251 | calc |
| 252 | _ ≤ V * |∫ r in a..t, |
| 253 | deriv (fun y => m62TangentRicci F c r y + m62CurvatureSquared F c r y) x| := |
| 254 | mul_le_mul_of_nonneg_right (hV t ht x) (abs_nonneg _) |
| 255 | _ ≤ V * (V * ((K + 2 * K * Real.sqrt R) * (t - a) + |
| 256 | 4 * Real.sqrt R * J * Real.sqrt (t - a))) := |
| 257 | mul_le_mul_of_nonneg_left hI hV0 |
| 258 | _ = _ := by dsimp only [V]; ring |
| 259 | |
| 260 | end PoincareMT.M63 |