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 | /- |
| 2 | Provenance and modification notice (recorded 2026-09-29). |
| 3 | Source: https://github.com/qinz1yang/differential-geometry |
| 4 | DifferentialGeometry/Analysis/Parabolic/Euclidean/HeatKernelCancel.lean |
| 5 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 6 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. |
| 7 | License: Apache-2.0. Source licenses and notices are retained under |
| 8 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 9 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 10 | -/ |
| 11 | |
| 12 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.Gaussian |
| 13 | import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts |
| 14 | import Mathlib.Topology.MetricSpace.HolderNorm |
| 15 | |
| 16 | /-! |
| 17 | # Cancellation estimates for interior heat equations |
| 18 | |
| 19 | Adapted from Chow--Liao--Qin, HeatKernelCancel.lean, revision |
| 20 | 1b535dd102b94cc42b107cca27059687888f08b3. |
| 21 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 22 | See references/ricci-flow/chow-liao-qin-2026/interior-hessian-reuse.md. |
| 23 | The adaptation changes import paths and namespaces. |
| 24 | -/ |
| 25 | |
| 26 | noncomputable section |
| 27 | |
| 28 | open MeasureTheory Real |
| 29 | open scoped ENNReal RealInnerProductSpace NNReal |
| 30 | |
| 31 | namespace Poincare.Parabolic.Interior.Kernel |
| 32 | |
| 33 | section ZeroMean |
| 34 | |
| 35 | variable {V : Type*} |
| 36 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] |
| 37 | [MeasurableSpace V] [BorelSpace V] |
| 38 | [Nontrivial V] |
| 39 | |
| 40 | theorem integral_heatD2_zero {t : ℝ} (ht : 0 < t) (v w : V) : |
| 41 | ∫ x : V, heatD2 t v w x = 0 := by |
| 42 | have hder : ∀ x : V, |
| 43 | fderiv ℝ (heatD1 t v) x w = heatD2 t v w x := by |
| 44 | intro x |
| 45 | rw [(heatD1_hasFDeriv v x).fderiv, heatD2Map_apply] |
| 46 | have hparts := |
| 47 | integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable |
| 48 | (μ := (volume : Measure V)) |
| 49 | (f := fun _ : V => (1 : ℝ)) (g := heatD1 t v) (v := w) |
| 50 | (by |
| 51 | have hzero : |
| 52 | (fun x : V => (fderiv ℝ (fun _ : V => (1 : ℝ)) x) w * |
| 53 | heatD1 t v x) = 0 := by |
| 54 | funext x |
| 55 | rw [fderiv_const_apply, zero_apply, zero_mul] |
| 56 | rfl |
| 57 | rw [hzero] |
| 58 | exact integrable_zero V ℝ (volume : Measure V)) |
| 59 | (by simpa only [one_mul, hder] using heatD2_int ht v w) |
| 60 | (by simpa only [one_mul] using heatD1_int ht v) |
| 61 | (fun x _ => differentiableAt_const (𝕜 := ℝ) (x := x) (1 : ℝ)) |
| 62 | (fun x _ => (heatD1_hasFDeriv v x).differentiableAt) |
| 63 | simpa only [one_mul, hder, fderiv_const_apply, zero_apply, |
| 64 | zero_mul, integral_zero, neg_zero] using hparts |
| 65 | |
| 66 | end ZeroMean |
| 67 | |
| 68 | section HalfMoment |
| 69 | |
| 70 | variable {V : Type*} |
| 71 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] |
| 72 | [MeasurableSpace V] [BorelSpace V] |
| 73 | [Nontrivial V] |
| 74 | |
| 75 | def baseD2Half (x : V) : ℝ := |
| 76 | Real.sqrt ‖x‖ * baseD2Maj x |
| 77 | |
| 78 | omit [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] [Nontrivial V] in |
| 79 | theorem baseD2Half_nonneg (x : V) : 0 ≤ baseD2Half x := by |
| 80 | unfold baseD2Half |
| 81 | exact mul_nonneg (Real.sqrt_nonneg _) (baseD2Maj_nonneg x) |
| 82 | |
| 83 | private theorem baseD2First_int : |
| 84 | Integrable (fun x : V => ‖x‖ * baseD2Maj x) := by |
| 85 | have h3 := (gaussMoment_int (V := V) 3 |
| 86 | (by positivity : (0 : ℝ) < (4 : ℝ)⁻¹)).const_mul |
| 87 | ((4 : ℝ)⁻¹ * (baseHeatMass V)⁻¹) |
| 88 | have h1 := (gaussMoment_int (V := V) 1 |
| 89 | (by positivity : (0 : ℝ) < (4 : ℝ)⁻¹)).const_mul |
| 90 | ((2 : ℝ)⁻¹ * (baseHeatMass V)⁻¹) |
| 91 | have heq : (fun x : V => ‖x‖ * baseD2Maj x) = fun x : V => |
| 92 | ((4 : ℝ)⁻¹ * (baseHeatMass V)⁻¹) * |
| 93 | (‖x‖ ^ 3 * Real.exp (-(4 : ℝ)⁻¹ * ‖x‖ ^ 2)) + |
| 94 | ((2 : ℝ)⁻¹ * (baseHeatMass V)⁻¹) * |
| 95 | (‖x‖ ^ 1 * Real.exp (-(4 : ℝ)⁻¹ * ‖x‖ ^ 2)) := by |
| 96 | funext x |
| 97 | unfold baseD2Maj baseHeat |
| 98 | ring |
| 99 | rw [heq] |
| 100 | exact h3.add h1 |
| 101 | |
| 102 | theorem baseD2Half_int : Integrable (baseD2Half : V → ℝ) := by |
| 103 | have hmajor : Integrable (fun x : V => (1 + ‖x‖) * baseD2Maj x) := by |
| 104 | have h := (baseD2Maj_int (V := V)).add (baseD2First_int (V := V)) |
| 105 | have heq : (fun x : V => (1 + ‖x‖) * baseD2Maj x) = |
| 106 | fun x : V => baseD2Maj x + ‖x‖ * baseD2Maj x := by |
| 107 | funext x |
| 108 | ring |
| 109 | rw [heq] |
| 110 | exact h |
| 111 | refine hmajor.mono' ?_ ?_ |
| 112 | · apply Continuous.aestronglyMeasurable |
| 113 | unfold baseD2Half baseD2Maj baseHeat baseHeatMass |
| 114 | fun_prop |
| 115 | filter_upwards with x |
| 116 | rw [Real.norm_eq_abs, abs_of_nonneg (baseD2Half_nonneg x)] |
| 117 | have hsqrt : Real.sqrt ‖x‖ ≤ 1 + ‖x‖ := by |
| 118 | rw [Real.sqrt_le_iff] |
| 119 | constructor |
| 120 | · positivity |
| 121 | · nlinarith [norm_nonneg x] |
| 122 | exact mul_le_mul_of_nonneg_right hsqrt (baseD2Maj_nonneg x) |
| 123 | |
| 124 | def heatC2Half (V : Type*) [NormedAddCommGroup V] [InnerProductSpace ℝ V] |
| 125 | [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] : ℝ := |
| 126 | ∫ x : V, baseD2Half x |
| 127 | |
| 128 | omit [Nontrivial V] in |
| 129 | theorem heatC2Half_nonneg : 0 ≤ heatC2Half V := |
| 130 | integral_nonneg baseD2Half_nonneg |
| 131 | |
| 132 | def heatD2Half (t : ℝ) (x : V) : ℝ := |
| 133 | ((heatScale t) ^ Module.finrank ℝ V)⁻¹ * t⁻¹ * |
| 134 | Real.sqrt (heatScale t) * baseD2Half ((heatScale t)⁻¹ • x) |
| 135 | |
| 136 | omit [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] [Nontrivial V] in |
| 137 | theorem heatD2Half_nonneg {t : ℝ} (ht : 0 < t) (x : V) : |
| 138 | 0 ≤ heatD2Half t x := by |
| 139 | unfold heatD2Half |
| 140 | exact mul_nonneg |
| 141 | (mul_nonneg |
| 142 | (mul_nonneg (inv_nonneg.mpr (pow_nonneg (heatScale_pos ht).le _)) |
| 143 | (inv_nonneg.mpr ht.le)) |
| 144 | (Real.sqrt_nonneg _)) |
| 145 | (baseD2Half_nonneg _) |
| 146 | |
| 147 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] in |
| 148 | omit [FiniteDimensional ℝ V] in |
| 149 | theorem heatD2Half_eq {t : ℝ} (ht : 0 < t) (x : V) : |
| 150 | heatD2Half t x = Real.sqrt ‖x‖ * heatD2Maj t x := by |
| 151 | have hr : 0 < heatScale t := heatScale_pos ht |
| 152 | have hx : x = heatScale t • ((heatScale t)⁻¹ • x) := by |
| 153 | simp [hr.ne'] |
| 154 | have hsqrt : Real.sqrt ‖x‖ = |
| 155 | Real.sqrt (heatScale t) * Real.sqrt ‖(heatScale t)⁻¹ • x‖ := by |
| 156 | calc |
| 157 | Real.sqrt ‖x‖ = Real.sqrt ‖heatScale t • ((heatScale t)⁻¹ • x)‖ := |
| 158 | congrArg (fun z : V => Real.sqrt ‖z‖) hx |
| 159 | _ = Real.sqrt (heatScale t * ‖(heatScale t)⁻¹ • x‖) := by |
| 160 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos hr] |
| 161 | _ = Real.sqrt (heatScale t) * Real.sqrt ‖(heatScale t)⁻¹ • x‖ := |
| 162 | Real.sqrt_mul hr.le _ |
| 163 | unfold heatD2Half heatD2Maj baseD2Half |
| 164 | have hsquare : heatScale t ^ 2 = t := by |
| 165 | simpa [heatScale] using Real.sq_sqrt ht.le |
| 166 | have hscale : t⁻¹ = (heatScale t)⁻¹ * (heatScale t)⁻¹ := by |
| 167 | field_simp [hr.ne', ht.ne'] |
| 168 | nlinarith [hsquare] |
| 169 | rw [hsqrt, hscale] |
| 170 | ring |
| 171 | |
| 172 | theorem heatD2Half_int {t : ℝ} (ht : 0 < t) : |
| 173 | Integrable (heatD2Half t : V → ℝ) := by |
| 174 | unfold heatD2Half |
| 175 | exact (baseD2Half_int (V := V)).comp_smul |
| 176 | (inv_ne_zero (heatScale_pos ht).ne') |>.const_mul _ |
| 177 | |
| 178 | omit [Nontrivial V] in |
| 179 | theorem integral_heatD2Half {t : ℝ} (ht : 0 < t) : |
| 180 | ∫ x : V, heatD2Half t x = |
| 181 | t⁻¹ * Real.sqrt (heatScale t) * heatC2Half V := by |
| 182 | have hr : 0 < heatScale t := heatScale_pos ht |
| 183 | unfold heatD2Half heatC2Half |
| 184 | rw [integral_const_mul, |
| 185 | Measure.integral_comp_inv_smul_of_nonneg (volume : Measure V) baseD2Half hr.le] |
| 186 | simp only [smul_eq_mul] |
| 187 | field_simp [hr.ne'] |
| 188 | |
| 189 | def heatScale34 (t : ℝ) : ℝ := |
| 190 | t ^ (-(3 : ℝ) / 4) |
| 191 | |
| 192 | theorem heatScale34_eq {t : ℝ} (ht : 0 < t) : |
| 193 | t⁻¹ * Real.sqrt (heatScale t) = heatScale34 t := by |
| 194 | unfold heatScale34 heatScale |
| 195 | rw [Real.sqrt_eq_rpow, Real.sqrt_eq_rpow, ← Real.rpow_neg_one, |
| 196 | ← Real.rpow_mul ht.le, ← Real.rpow_add ht] |
| 197 | congr 1 |
| 198 | ring |
| 199 | |
| 200 | omit [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] [Nontrivial V] in |
| 201 | theorem heatD2_half_bound {t : ℝ} (ht : 0 < t) (v w x : V) : |
| 202 | ‖heatD2 t v w x‖ * Real.sqrt ‖x‖ ≤ |
| 203 | ‖v‖ * ‖w‖ * heatD2Half t x := by |
| 204 | rw [heatD2Half_eq ht] |
| 205 | calc |
| 206 | ‖heatD2 t v w x‖ * Real.sqrt ‖x‖ |
| 207 | ≤ (‖v‖ * ‖w‖ * heatD2Maj t x) * Real.sqrt ‖x‖ := |
| 208 | mul_le_mul_of_nonneg_right (heatD2_bound ht v w x) (Real.sqrt_nonneg _) |
| 209 | _ = ‖v‖ * ‖w‖ * (Real.sqrt ‖x‖ * heatD2Maj t x) := by ring |
| 210 | |
| 211 | theorem integral_halfD2 {t : ℝ} (ht : 0 < t) (v w : V) : |
| 212 | (∫ x : V, ‖heatD2 t v w x‖ * Real.sqrt ‖x‖) ≤ |
| 213 | ‖v‖ * ‖w‖ * heatScale34 t * heatC2Half V := by |
| 214 | have hmajor : Integrable |
| 215 | (fun x : V => (‖v‖ * ‖w‖) * heatD2Half t x) := |
| 216 | (heatD2Half_int (V := V) ht).const_mul _ |
| 217 | have hleft : Integrable |
| 218 | (fun x : V => ‖heatD2 t v w x‖ * Real.sqrt ‖x‖) := by |
| 219 | refine hmajor.mono' ?_ ?_ |
| 220 | · apply Continuous.aestronglyMeasurable |
| 221 | unfold heatD2 baseD2 baseHeat baseHeatMass heatScale |
| 222 | fun_prop |
| 223 | filter_upwards with x |
| 224 | rw [Real.norm_eq_abs, abs_of_nonneg |
| 225 | (mul_nonneg (norm_nonneg _) (Real.sqrt_nonneg _))] |
| 226 | exact heatD2_half_bound ht v w x |
| 227 | calc |
| 228 | (∫ x : V, ‖heatD2 t v w x‖ * Real.sqrt ‖x‖) |
| 229 | ≤ ∫ x : V, (‖v‖ * ‖w‖) * heatD2Half t x := |
| 230 | integral_mono hleft hmajor (fun x => heatD2_half_bound ht v w x) |
| 231 | _ = (‖v‖ * ‖w‖) * |
| 232 | (t⁻¹ * Real.sqrt (heatScale t) * heatC2Half V) := by |
| 233 | rw [integral_const_mul, integral_heatD2Half ht] |
| 234 | _ = ‖v‖ * ‖w‖ * heatScale34 t * heatC2Half V := by |
| 235 | rw [heatScale34_eq ht] |
| 236 | ring |
| 237 | |
| 238 | end HalfMoment |
| 239 | |
| 240 | section CancelOperator |
| 241 | |
| 242 | variable {V F : Type*} |
| 243 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] |
| 244 | [MeasurableSpace V] [BorelSpace V] |
| 245 | [Nontrivial V] |
| 246 | [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] |
| 247 | |
| 248 | def heatD2Cancel (t : ℝ) (v w : V) (f : V → F) (x : V) : F := |
| 249 | ∫ y : V, heatD2 t v w y • (f (x - y) - f x) |
| 250 | |
| 251 | def heatD2Conv (t : ℝ) (v w : V) (f : V → F) (x : V) : F := |
| 252 | ∫ y : V, heatD2 t v w y • f (x - y) |
| 253 | |
| 254 | omit [Nontrivial V] [CompleteSpace F] in |
| 255 | theorem heatD2Conv_comm (t : ℝ) (v w : V) (f : V → F) (x : V) : |
| 256 | heatD2Conv t v w f x = heatD2Conv t w v f x := by |
| 257 | unfold heatD2Conv |
| 258 | apply integral_congr_ae |
| 259 | filter_upwards with y |
| 260 | rw [heatD2_comm] |
| 261 | |
| 262 | omit [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] [MeasurableSpace V] |
| 263 | [BorelSpace V] [Nontrivial V] [NormedSpace ℝ F] [CompleteSpace F] in |
| 264 | private theorem holder_half_bound {K : ℝ≥0} {f : V → F} |
| 265 | (hf : HolderWith K (1 / 2 : ℝ≥0) f) (x y : V) : |
| 266 | ‖f (x - y) - f x‖ ≤ (K : ℝ) * Real.sqrt ‖y‖ := by |
| 267 | have hxy : dist (x - y) x = ‖y‖ := by |
| 268 | rw [dist_eq_norm] |
| 269 | have : (x - y) - x = -y := by abel |
| 270 | rw [this, norm_neg] |
| 271 | have h := hf.dist_le (x - y) x |
| 272 | rw [dist_eq_norm, hxy] at h |
| 273 | simpa [Real.sqrt_eq_rpow] using h |
| 274 | |
| 275 | omit [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 276 | private theorem cancel_bound {t : ℝ} (ht : 0 < t) {K : ℝ≥0} |
| 277 | {f : V → F} (hf : HolderWith K (1 / 2 : ℝ≥0) f) |
| 278 | (v w x y : V) : |
| 279 | ‖heatD2 t v w y • (f (x - y) - f x)‖ ≤ |
| 280 | (‖v‖ * ‖w‖ * (K : ℝ)) * heatD2Half t y := by |
| 281 | calc |
| 282 | ‖heatD2 t v w y • (f (x - y) - f x)‖ |
| 283 | = ‖heatD2 t v w y‖ * ‖f (x - y) - f x‖ := by |
| 284 | rw [norm_smul, Real.norm_eq_abs] |
| 285 | _ ≤ ‖heatD2 t v w y‖ * ((K : ℝ) * Real.sqrt ‖y‖) := |
| 286 | mul_le_mul_of_nonneg_left (holder_half_bound hf x y) (norm_nonneg _) |
| 287 | _ ≤ (‖v‖ * ‖w‖ * heatD2Maj t y) * |
| 288 | ((K : ℝ) * Real.sqrt ‖y‖) := by |
| 289 | gcongr |
| 290 | exact heatD2_bound ht v w y |
| 291 | _ = (‖v‖ * ‖w‖ * (K : ℝ)) * heatD2Half t y := by |
| 292 | rw [heatD2Half_eq ht] |
| 293 | ring |
| 294 | |
| 295 | omit [CompleteSpace F] in |
| 296 | theorem heatD2Cancel_int {t : ℝ} (ht : 0 < t) {K : ℝ≥0} |
| 297 | {f : V → F} (hf : HolderWith K (1 / 2 : ℝ≥0) f) |
| 298 | (v w x : V) : |
| 299 | Integrable (fun y : V => heatD2 t v w y • (f (x - y) - f x)) := by |
| 300 | have hfcont : Continuous f := hf.continuous (by norm_num) |
| 301 | have hmajor : Integrable |
| 302 | (fun y : V => (‖v‖ * ‖w‖ * (K : ℝ)) * heatD2Half t y) := |
| 303 | (heatD2Half_int (V := V) ht).const_mul _ |
| 304 | refine hmajor.mono' ?_ ?_ |
| 305 | · apply Continuous.aestronglyMeasurable |
| 306 | unfold heatD2 baseD2 baseHeat baseHeatMass heatScale |
| 307 | fun_prop |
| 308 | · filter_upwards with y |
| 309 | exact cancel_bound ht hf v w x y |
| 310 | |
| 311 | omit [CompleteSpace F] in |
| 312 | theorem heatD2Conv_int {t : ℝ} (ht : 0 < t) {K : ℝ≥0} |
| 313 | {f : V → F} (hf : HolderWith K (1 / 2 : ℝ≥0) f) |
| 314 | (v w x : V) : |
| 315 | Integrable (fun y : V => heatD2 t v w y • f (x - y)) := by |
| 316 | have hcancel := heatD2Cancel_int ht hf v w x |
| 317 | have hconst := (heatD2_int ht v w).smul_const (f x) |
| 318 | refine (hcancel.add hconst).congr (Filter.Eventually.of_forall fun y => ?_) |
| 319 | simp only [Pi.add_apply, smul_sub, sub_add_cancel] |
| 320 | |
| 321 | theorem heatD2Conv_eq_cancel {t : ℝ} (ht : 0 < t) {K : ℝ≥0} |
| 322 | {f : V → F} (hf : HolderWith K (1 / 2 : ℝ≥0) f) |
| 323 | (v w x : V) : |
| 324 | heatD2Conv t v w f x = heatD2Cancel t v w f x := by |
| 325 | have hcancel := heatD2Cancel_int ht hf v w x |
| 326 | have hconst := (heatD2_int ht v w).smul_const (f x) |
| 327 | unfold heatD2Conv heatD2Cancel |
| 328 | calc |
| 329 | (∫ y : V, heatD2 t v w y • f (x - y)) = |
| 330 | ∫ y : V, heatD2 t v w y • (f (x - y) - f x) + |
| 331 | heatD2 t v w y • f x := by |
| 332 | apply integral_congr_ae |
| 333 | filter_upwards with y |
| 334 | simp only [smul_sub, sub_add_cancel] |
| 335 | _ = (∫ y : V, heatD2 t v w y • (f (x - y) - f x)) + |
| 336 | ∫ y : V, heatD2 t v w y • f x := integral_add hcancel hconst |
| 337 | _ = ∫ y : V, heatD2 t v w y • (f (x - y) - f x) := by |
| 338 | rw [integral_smul_const, integral_heatD2_zero ht, zero_smul, add_zero] |
| 339 | |
| 340 | omit [CompleteSpace F] in |
| 341 | theorem heatD2Cancel_norm {t : ℝ} (ht : 0 < t) {K : ℝ≥0} |
| 342 | {f : V → F} (hf : HolderWith K (1 / 2 : ℝ≥0) f) |
| 343 | (v w x : V) : |
| 344 | ‖heatD2Cancel t v w f x‖ ≤ |
| 345 | ‖v‖ * ‖w‖ * (K : ℝ) * heatScale34 t * heatC2Half V := by |
| 346 | unfold heatD2Cancel |
| 347 | calc |
| 348 | ‖∫ y : V, heatD2 t v w y • (f (x - y) - f x)‖ |
| 349 | ≤ ∫ y : V, (‖v‖ * ‖w‖ * (K : ℝ)) * heatD2Half t y := |
| 350 | norm_integral_le_of_norm_le |
| 351 | ((heatD2Half_int (V := V) ht).const_mul _) |
| 352 | (Filter.Eventually.of_forall fun y => cancel_bound ht hf v w x y) |
| 353 | _ = (‖v‖ * ‖w‖ * (K : ℝ)) * |
| 354 | (t⁻¹ * Real.sqrt (heatScale t) * heatC2Half V) := by |
| 355 | rw [integral_const_mul, integral_heatD2Half ht] |
| 356 | _ = ‖v‖ * ‖w‖ * (K : ℝ) * heatScale34 t * heatC2Half V := by |
| 357 | rw [heatScale34_eq ht] |
| 358 | ring |
| 359 | |
| 360 | end CancelOperator |
| 361 | |
| 362 | end Poincare.Parabolic.Interior.Kernel |