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/HeatPotentialRegularity.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.Approximation |
| 13 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.Cancellation |
| 14 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.HigherDerivatives |
| 15 | import Mathlib.Analysis.Calculus.ParametricIntegral |
| 16 | import Mathlib.Analysis.Convolution |
| 17 | |
| 18 | |
| 19 | /-! |
| 20 | # Interior heat kernel: PotentialRegularity |
| 21 | |
| 22 | Adapted from Chow--Liao--Qin, HeatPotentialRegularity.lean, revision |
| 23 | 1b535dd102b94cc42b107cca27059687888f08b3. |
| 24 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 25 | See references/ricci-flow/chow-liao-qin-2026/interior-hessian-reuse.md. |
| 26 | The adaptation changes import paths and namespaces. |
| 27 | -/ |
| 28 | |
| 29 | noncomputable section |
| 30 | |
| 31 | set_option maxSynthPendingDepth 3 |
| 32 | |
| 33 | open MeasureTheory Real Set Filter |
| 34 | open scoped RealInnerProductSpace Topology |
| 35 | |
| 36 | namespace Poincare.Parabolic.Interior.Kernel |
| 37 | |
| 38 | variable {V F : Type*} |
| 39 | [NormedAddCommGroup V] [InnerProductSpace Real V] [FiniteDimensional Real V] |
| 40 | [MeasurableSpace V] [BorelSpace V] [Nontrivial V] |
| 41 | [NormedAddCommGroup F] [NormedSpace Real F] [CompleteSpace F] |
| 42 | |
| 43 | def heatD2SmulRightMap (t : Real) (x : V) (f : F) : |
| 44 | V →L[Real] (V →L[Real] F) := |
| 45 | ((ContinuousLinearMap.smulRightL Real V F).flip f).comp |
| 46 | (heatD2CurriedMap t x) |
| 47 | |
| 48 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 49 | @[simp] theorem heatD2SmulRightMap_apply (t : Real) (x w v : V) (f : F) : |
| 50 | heatD2SmulRightMap t x f w v = heatD2 t v w x • f := by |
| 51 | simp [heatD2SmulRightMap] |
| 52 | |
| 53 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 54 | theorem heatD1SmulRight_hasFDerivAt (t : Real) (x : V) (f : F) : |
| 55 | HasFDerivAt (fun y : V => (heatD1Map t y).smulRight f) |
| 56 | (heatD2SmulRightMap t x f) x := by |
| 57 | have h := ((ContinuousLinearMap.smulRightL Real V F).flip f).hasFDerivAt.comp |
| 58 | x (heatD1Map_hasFDeriv t x) |
| 59 | exact h.congr_of_eventuallyEq (Filter.Eventually.of_forall fun _ => rfl) |
| 60 | |
| 61 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 62 | theorem heatD2SmulRightMap_norm_le {t : Real} (ht : 0 < t) (x : V) (f : F) : |
| 63 | ‖heatD2SmulRightMap t x f‖ ≤ heatD2Maj t x * ‖f‖ := by |
| 64 | apply ContinuousLinearMap.opNorm_le_bound (heatD2SmulRightMap t x f) |
| 65 | (mul_nonneg (heatD2Maj_nonneg ht x) (norm_nonneg f)) |
| 66 | intro w |
| 67 | apply ContinuousLinearMap.opNorm_le_bound (heatD2SmulRightMap t x f w) |
| 68 | (mul_nonneg |
| 69 | (mul_nonneg (heatD2Maj_nonneg ht x) (norm_nonneg f)) |
| 70 | (norm_nonneg w)) |
| 71 | intro v |
| 72 | rw [heatD2SmulRightMap_apply, norm_smul] |
| 73 | calc |
| 74 | ‖heatD2 t v w x‖ * ‖f‖ ≤ |
| 75 | (‖v‖ * ‖w‖ * heatD2Maj t x) * ‖f‖ := |
| 76 | mul_le_mul_of_nonneg_right (heatD2_bound ht v w x) (norm_nonneg f) |
| 77 | _ = heatD2Maj t x * ‖f‖ * ‖w‖ * ‖v‖ := by ring |
| 78 | |
| 79 | private def heatD1LocalMajor (t : Real) (x y : V) : Real := |
| 80 | ((heatScale t) ^ Module.finrank Real V)⁻¹ * (heatScale t)⁻¹ * |
| 81 | (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real) * |
| 82 | ((1 + ‖(heatScale t)⁻¹ • (x - y)‖) * |
| 83 | Real.exp (-(1 / 8 : Real) * ‖(heatScale t)⁻¹ • (x - y)‖ ^ 2)) |
| 84 | |
| 85 | private theorem heatD1LocalMajor_int {t : Real} (ht : 0 < t) (x : V) : |
| 86 | Integrable (heatD1LocalMajor (V := V) t x) := by |
| 87 | let g : V → Real := fun z => |
| 88 | (1 + ‖z‖) * Real.exp (-(1 / 8 : Real) * ‖z‖ ^ 2) |
| 89 | have h0 := gaussMoment_int (V := V) 0 |
| 90 | (by norm_num : (0 : Real) < (1 / 8 : Real)) |
| 91 | have h1 := gaussMoment_int (V := V) 1 |
| 92 | (by norm_num : (0 : Real) < (1 / 8 : Real)) |
| 93 | have hg : Integrable g := by |
| 94 | have heq : g = fun z : V => |
| 95 | ‖z‖ ^ 0 * Real.exp (-(1 / 8 : Real) * ‖z‖ ^ 2) + |
| 96 | ‖z‖ ^ 1 * Real.exp (-(1 / 8 : Real) * ‖z‖ ^ 2) := by |
| 97 | funext z |
| 98 | simp only [g, pow_zero, one_mul, pow_one] |
| 99 | ring |
| 100 | rw [heq] |
| 101 | exact h0.add h1 |
| 102 | have hs := (hg.comp_smul (inv_ne_zero (heatScale_pos ht).ne')).comp_sub_left x |
| 103 | exact (hs.const_mul |
| 104 | (((heatScale t) ^ Module.finrank Real V)⁻¹ * (heatScale t)⁻¹ * |
| 105 | (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real))).congr |
| 106 | (Filter.Eventually.of_forall fun _ => rfl) |
| 107 | |
| 108 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 109 | omit [FiniteDimensional ℝ V] in |
| 110 | private theorem heatD1Maj_le_localMajor {t : Real} (ht : 0 < t) |
| 111 | (x₀ y : V) {x : V} (hx : x ∈ Metric.ball x₀ (heatScale t)) : |
| 112 | heatD1Maj t (x - y) ≤ heatD1LocalMajor (V := V) t x₀ y := by |
| 113 | let r : Real := (heatScale t)⁻¹ |
| 114 | let a : V := r • (x₀ - y) |
| 115 | let b : V := r • (x - x₀) |
| 116 | let z : V := r • (x - y) |
| 117 | have hr : 0 < r := inv_pos.mpr (heatScale_pos ht) |
| 118 | have hz : z = a + b := by |
| 119 | unfold z a b |
| 120 | rw [← smul_add] |
| 121 | congr 1 |
| 122 | abel |
| 123 | have hb : ‖b‖ < 1 := by |
| 124 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos hr] |
| 125 | change (heatScale t)⁻¹ * ‖x - x₀‖ < 1 |
| 126 | rw [inv_mul_lt_one₀ (heatScale_pos ht)] |
| 127 | simpa only [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using hx |
| 128 | have hz_le : ‖z‖ ≤ ‖a‖ + 1 := by |
| 129 | rw [hz] |
| 130 | calc |
| 131 | ‖a + b‖ ≤ ‖a‖ + ‖b‖ := norm_add_le a b |
| 132 | _ ≤ ‖a‖ + 1 := by gcongr |
| 133 | have ha_le : ‖a‖ ≤ ‖z‖ + 1 := by |
| 134 | have ha : a = z - b := by rw [hz]; abel |
| 135 | rw [ha] |
| 136 | calc |
| 137 | ‖z - b‖ ≤ ‖z‖ + ‖b‖ := norm_sub_le z b |
| 138 | _ ≤ ‖z‖ + 1 := by gcongr |
| 139 | have ha_sq : ‖a‖ ^ 2 ≤ 2 * ‖z‖ ^ 2 + 2 := by |
| 140 | have hsq : ‖a‖ ^ 2 ≤ (‖z‖ + 1) ^ 2 := by |
| 141 | exact sq_le_sq₀ (norm_nonneg a) (by positivity) |>.2 ha_le |
| 142 | nlinarith [sq_nonneg (‖z‖ - 1)] |
| 143 | have hexpArg : -(1 / 4 : Real) * ‖z‖ ^ 2 ≤ |
| 144 | 1 / 4 - (1 / 8 : Real) * ‖a‖ ^ 2 := by |
| 145 | nlinarith |
| 146 | have hexp : Real.exp (-(1 / 4 : Real) * ‖z‖ ^ 2) ≤ |
| 147 | Real.exp (1 / 4 : Real) * Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2) := by |
| 148 | calc |
| 149 | Real.exp (-(1 / 4 : Real) * ‖z‖ ^ 2) ≤ |
| 150 | Real.exp (1 / 4 - (1 / 8 : Real) * ‖a‖ ^ 2) := |
| 151 | Real.exp_le_exp.mpr hexpArg |
| 152 | _ = Real.exp (1 / 4 : Real) * |
| 153 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2) := by |
| 154 | rw [← Real.exp_add] |
| 155 | congr 1 |
| 156 | ring |
| 157 | have hbase : baseD1Maj z ≤ |
| 158 | (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real) * |
| 159 | ((1 + ‖a‖) * Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2)) := by |
| 160 | have hmass : 0 ≤ (baseHeatMass V)⁻¹ := |
| 161 | inv_nonneg.mpr (baseHeatMass_pos (V := V)).le |
| 162 | have hexpZ : 0 ≤ Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2) := |
| 163 | (Real.exp_pos _).le |
| 164 | have hleft : 0 ≤ (2 : Real)⁻¹ * (‖a‖ + 1) := |
| 165 | mul_nonneg (by positivity) (add_nonneg (norm_nonneg a) zero_le_one) |
| 166 | let Q : Real := (baseHeatMass V)⁻¹ * (‖a‖ + 1) * |
| 167 | (Real.exp (1 / 4 : Real) * |
| 168 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2)) |
| 169 | have hQ : 0 ≤ Q := by |
| 170 | unfold Q |
| 171 | positivity |
| 172 | unfold baseD1Maj baseHeat |
| 173 | calc |
| 174 | (2 : Real)⁻¹ * ‖z‖ * |
| 175 | ((baseHeatMass V)⁻¹ * Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2)) ≤ |
| 176 | (2 : Real)⁻¹ * (‖a‖ + 1) * |
| 177 | ((baseHeatMass V)⁻¹ * Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2)) := by |
| 178 | exact mul_le_mul_of_nonneg_right |
| 179 | (mul_le_mul_of_nonneg_left hz_le (by positivity)) |
| 180 | (mul_nonneg hmass hexpZ) |
| 181 | _ ≤ (2 : Real)⁻¹ * (‖a‖ + 1) * |
| 182 | ((baseHeatMass V)⁻¹ * |
| 183 | (Real.exp (1 / 4 : Real) * |
| 184 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2))) := by |
| 185 | have hexp' : Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2) ≤ |
| 186 | Real.exp (1 / 4 : Real) * |
| 187 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2) := by |
| 188 | simpa only [one_div] using hexp |
| 189 | exact mul_le_mul_of_nonneg_left |
| 190 | (mul_le_mul_of_nonneg_left hexp' hmass) hleft |
| 191 | _ = (2 : Real)⁻¹ * Q := by unfold Q; ring |
| 192 | _ ≤ 1 * Q := mul_le_mul_of_nonneg_right (by norm_num) hQ |
| 193 | _ = (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real) * |
| 194 | ((1 + ‖a‖) * Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2)) := by |
| 195 | unfold Q |
| 196 | ring |
| 197 | have hfront : 0 ≤ |
| 198 | ((heatScale t) ^ Module.finrank Real V)⁻¹ * (heatScale t)⁻¹ := |
| 199 | mul_nonneg |
| 200 | (inv_nonneg.mpr (pow_nonneg (heatScale_pos ht).le _)) |
| 201 | (inv_nonneg.mpr (heatScale_pos ht).le) |
| 202 | unfold heatD1Maj heatD1LocalMajor |
| 203 | change _ * baseD1Maj z ≤ _ |
| 204 | change _ ≤ _ * ((1 + ‖a‖) * _) |
| 205 | simpa only [a, mul_assoc] using mul_le_mul_of_nonneg_left hbase hfront |
| 206 | |
| 207 | private def heatD2LocalMajor (t : Real) (x y : V) : Real := |
| 208 | ((heatScale t) ^ Module.finrank Real V)⁻¹ * (heatScale t)⁻¹ * |
| 209 | (heatScale t)⁻¹ * (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real) * |
| 210 | ((1 + ‖(heatScale t)⁻¹ • (x - y)‖ ^ 2) * |
| 211 | Real.exp (-(1 / 8 : Real) * ‖(heatScale t)⁻¹ • (x - y)‖ ^ 2)) |
| 212 | |
| 213 | private theorem heatD2LocalMajor_int {t : Real} (ht : 0 < t) (x : V) : |
| 214 | Integrable (heatD2LocalMajor (V := V) t x) := by |
| 215 | let g : V → Real := fun z => |
| 216 | (1 + ‖z‖ ^ 2) * Real.exp (-(1 / 8 : Real) * ‖z‖ ^ 2) |
| 217 | have h0 := gaussMoment_int (V := V) 0 |
| 218 | (by norm_num : (0 : Real) < (1 / 8 : Real)) |
| 219 | have h2 := gaussMoment_int (V := V) 2 |
| 220 | (by norm_num : (0 : Real) < (1 / 8 : Real)) |
| 221 | have hg : Integrable g := by |
| 222 | have heq : g = fun z : V => |
| 223 | ‖z‖ ^ 0 * Real.exp (-(1 / 8 : Real) * ‖z‖ ^ 2) + |
| 224 | ‖z‖ ^ 2 * Real.exp (-(1 / 8 : Real) * ‖z‖ ^ 2) := by |
| 225 | funext z |
| 226 | simp only [g, pow_zero, one_mul] |
| 227 | ring |
| 228 | rw [heq] |
| 229 | exact h0.add h2 |
| 230 | have hs := (hg.comp_smul (inv_ne_zero (heatScale_pos ht).ne')).comp_sub_left x |
| 231 | exact (hs.const_mul |
| 232 | (((heatScale t) ^ Module.finrank Real V)⁻¹ * (heatScale t)⁻¹ * |
| 233 | (heatScale t)⁻¹ * (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real))).congr |
| 234 | (Filter.Eventually.of_forall fun _ => rfl) |
| 235 | |
| 236 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 237 | omit [FiniteDimensional ℝ V] in |
| 238 | private theorem heatD2Maj_le_localMajor {t : Real} (ht : 0 < t) |
| 239 | (x₀ y : V) {x : V} (hx : x ∈ Metric.ball x₀ (heatScale t)) : |
| 240 | heatD2Maj t (x - y) ≤ heatD2LocalMajor (V := V) t x₀ y := by |
| 241 | let r : Real := (heatScale t)⁻¹ |
| 242 | let a : V := r • (x₀ - y) |
| 243 | let b : V := r • (x - x₀) |
| 244 | let z : V := r • (x - y) |
| 245 | have hr : 0 < r := inv_pos.mpr (heatScale_pos ht) |
| 246 | have hz : z = a + b := by |
| 247 | unfold z a b |
| 248 | rw [← smul_add] |
| 249 | congr 1 |
| 250 | abel |
| 251 | have hb : ‖b‖ < 1 := by |
| 252 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos hr] |
| 253 | change (heatScale t)⁻¹ * ‖x - x₀‖ < 1 |
| 254 | rw [inv_mul_lt_one₀ (heatScale_pos ht)] |
| 255 | simpa only [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using hx |
| 256 | have hz_le : ‖z‖ ≤ ‖a‖ + 1 := by |
| 257 | rw [hz] |
| 258 | calc |
| 259 | ‖a + b‖ ≤ ‖a‖ + ‖b‖ := norm_add_le a b |
| 260 | _ ≤ ‖a‖ + 1 := by gcongr |
| 261 | have ha_le : ‖a‖ ≤ ‖z‖ + 1 := by |
| 262 | have ha : a = z - b := by rw [hz]; abel |
| 263 | rw [ha] |
| 264 | calc |
| 265 | ‖z - b‖ ≤ ‖z‖ + ‖b‖ := norm_sub_le z b |
| 266 | _ ≤ ‖z‖ + 1 := by gcongr |
| 267 | have hz_sq : ‖z‖ ^ 2 ≤ 2 * ‖a‖ ^ 2 + 2 := by |
| 268 | have hsq : ‖z‖ ^ 2 ≤ (‖a‖ + 1) ^ 2 := |
| 269 | sq_le_sq₀ (norm_nonneg z) (by positivity) |>.2 hz_le |
| 270 | nlinarith [sq_nonneg (‖a‖ - 1)] |
| 271 | have ha_sq : ‖a‖ ^ 2 ≤ 2 * ‖z‖ ^ 2 + 2 := by |
| 272 | have hsq : ‖a‖ ^ 2 ≤ (‖z‖ + 1) ^ 2 := |
| 273 | sq_le_sq₀ (norm_nonneg a) (by positivity) |>.2 ha_le |
| 274 | nlinarith [sq_nonneg (‖z‖ - 1)] |
| 275 | have hpoly : (1 / 4 : Real) * ‖z‖ ^ 2 + 1 / 2 ≤ 1 + ‖a‖ ^ 2 := by |
| 276 | nlinarith |
| 277 | have hexpArg : -(1 / 4 : Real) * ‖z‖ ^ 2 ≤ |
| 278 | 1 / 4 - (1 / 8 : Real) * ‖a‖ ^ 2 := by |
| 279 | nlinarith |
| 280 | have hexp : Real.exp (-(1 / 4 : Real) * ‖z‖ ^ 2) ≤ |
| 281 | Real.exp (1 / 4 : Real) * Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2) := by |
| 282 | calc |
| 283 | Real.exp (-(1 / 4 : Real) * ‖z‖ ^ 2) ≤ |
| 284 | Real.exp (1 / 4 - (1 / 8 : Real) * ‖a‖ ^ 2) := |
| 285 | Real.exp_le_exp.mpr hexpArg |
| 286 | _ = Real.exp (1 / 4 : Real) * |
| 287 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2) := by |
| 288 | rw [← Real.exp_add] |
| 289 | congr 1 |
| 290 | ring |
| 291 | have hbase : baseD2Maj z ≤ |
| 292 | (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real) * |
| 293 | ((1 + ‖a‖ ^ 2) * Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2)) := by |
| 294 | have hmass : 0 ≤ (baseHeatMass V)⁻¹ := |
| 295 | inv_nonneg.mpr (baseHeatMass_pos (V := V)).le |
| 296 | have hexpZ : 0 ≤ Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2) := |
| 297 | (Real.exp_pos _).le |
| 298 | have hpolyNonneg : 0 ≤ 1 + ‖a‖ ^ 2 := by positivity |
| 299 | unfold baseD2Maj baseHeat |
| 300 | calc |
| 301 | ((4 : Real)⁻¹ * ‖z‖ ^ 2 + (2 : Real)⁻¹) * |
| 302 | ((baseHeatMass V)⁻¹ * Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2)) ≤ |
| 303 | (1 + ‖a‖ ^ 2) * |
| 304 | ((baseHeatMass V)⁻¹ * Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2)) := by |
| 305 | exact mul_le_mul_of_nonneg_right |
| 306 | (by simpa only [one_div] using hpoly) |
| 307 | (mul_nonneg hmass hexpZ) |
| 308 | _ ≤ (1 + ‖a‖ ^ 2) * |
| 309 | ((baseHeatMass V)⁻¹ * |
| 310 | (Real.exp (1 / 4 : Real) * |
| 311 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2))) := by |
| 312 | have hexp' : Real.exp (-(4 : Real)⁻¹ * ‖z‖ ^ 2) ≤ |
| 313 | Real.exp (1 / 4 : Real) * |
| 314 | Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2) := by |
| 315 | simpa only [one_div] using hexp |
| 316 | exact mul_le_mul_of_nonneg_left |
| 317 | (mul_le_mul_of_nonneg_left hexp' hmass) hpolyNonneg |
| 318 | _ = (baseHeatMass V)⁻¹ * Real.exp (1 / 4 : Real) * |
| 319 | ((1 + ‖a‖ ^ 2) * Real.exp (-(1 / 8 : Real) * ‖a‖ ^ 2)) := by |
| 320 | ring |
| 321 | have hfront : 0 ≤ |
| 322 | ((heatScale t) ^ Module.finrank Real V)⁻¹ * (heatScale t)⁻¹ * |
| 323 | (heatScale t)⁻¹ := by |
| 324 | exact mul_nonneg |
| 325 | (mul_nonneg |
| 326 | (inv_nonneg.mpr (pow_nonneg (heatScale_pos ht).le _)) |
| 327 | (inv_nonneg.mpr (heatScale_pos ht).le)) |
| 328 | (inv_nonneg.mpr (heatScale_pos ht).le) |
| 329 | unfold heatD2Maj heatD2LocalMajor |
| 330 | change _ * baseD2Maj z ≤ _ |
| 331 | change _ ≤ _ * ((1 + ‖a‖ ^ 2) * _) |
| 332 | simpa only [a, mul_assoc] using mul_le_mul_of_nonneg_left hbase hfront |
| 333 | |
| 334 | def heatSupGradient (t : Real) (u : BoundedContinuousFunction V F) (x : V) : |
| 335 | V →L[Real] F := |
| 336 | ∫ y : V, (heatD1Map t (x - y)).smulRight (u y) |
| 337 | |
| 338 | omit [CompleteSpace F] in |
| 339 | theorem heatSup_hasFDerivAt {t : Real} (ht : 0 < t) |
| 340 | (u : BoundedContinuousFunction V F) (x : V) : |
| 341 | HasFDerivAt (fun z : V => heatSup t u z) (heatSupGradient t u x) x := by |
| 342 | let G : V → V → F := fun z y => heatKernel t (z - y) • u y |
| 343 | let DG : V → V → V →L[Real] F := fun z y => |
| 344 | (heatD1Map t (z - y)).smulRight (u y) |
| 345 | let bound : V → Real := fun y => ‖u‖ * heatD1LocalMajor (V := V) t x y |
| 346 | have hs : Metric.ball x (heatScale t) ∈ 𝓝 x := |
| 347 | Metric.ball_mem_nhds x (heatScale_pos ht) |
| 348 | have hGmeas : ∀ᶠ z in 𝓝 x, |
| 349 | AEStronglyMeasurable (G z) (volume : Measure V) := by |
| 350 | apply Filter.Eventually.of_forall |
| 351 | intro z |
| 352 | apply Continuous.aestronglyMeasurable |
| 353 | unfold G heatKernel baseHeat baseHeatMass heatScale |
| 354 | fun_prop |
| 355 | have hGint : Integrable (G x) := by |
| 356 | refine (((heatKernel_int (V := V) ht).norm.comp_sub_left x).mul_const ‖u‖).mono' ?_ ?_ |
| 357 | · apply Continuous.aestronglyMeasurable |
| 358 | unfold G heatKernel baseHeat baseHeatMass heatScale |
| 359 | fun_prop |
| 360 | filter_upwards with y |
| 361 | rw [norm_smul] |
| 362 | exact mul_le_mul_of_nonneg_left (u.norm_coe_le_norm y) |
| 363 | (norm_nonneg (heatKernel t (x - y))) |
| 364 | have hDGmeas : AEStronglyMeasurable (DG x) (volume : Measure V) := by |
| 365 | apply Continuous.aestronglyMeasurable |
| 366 | unfold DG heatD1Map baseD1Map baseHeat baseHeatMass heatScale |
| 367 | fun_prop |
| 368 | have hbound : ∀ᵐ y ∂(volume : Measure V), ∀ z ∈ Metric.ball x (heatScale t), |
| 369 | ‖DG z y‖ ≤ bound y := by |
| 370 | apply Filter.Eventually.of_forall |
| 371 | intro y z hz |
| 372 | calc |
| 373 | ‖DG z y‖ ≤ ‖heatD1Map t (z - y)‖ * ‖u y‖ := by |
| 374 | unfold DG |
| 375 | rw [ContinuousLinearMap.norm_smulRight_apply] |
| 376 | _ ≤ heatD1Maj t (z - y) * ‖u‖ := by |
| 377 | exact mul_le_mul (heatD1Map_norm_le ht (z - y)) |
| 378 | (u.norm_coe_le_norm y) (norm_nonneg _) (heatD1Maj_nonneg ht _) |
| 379 | _ ≤ ‖u‖ * heatD1LocalMajor (V := V) t x y := by |
| 380 | rw [mul_comm] |
| 381 | exact mul_le_mul_of_nonneg_left |
| 382 | (heatD1Maj_le_localMajor ht x y hz) (norm_nonneg u) |
| 383 | _ = bound y := rfl |
| 384 | have hboundInt : Integrable bound := |
| 385 | (heatD1LocalMajor_int (V := V) ht x).const_mul ‖u‖ |
| 386 | have hdiff : ∀ᵐ y ∂(volume : Measure V), ∀ z ∈ Metric.ball x (heatScale t), |
| 387 | HasFDerivAt (G · y) (DG z y) z := by |
| 388 | apply Filter.Eventually.of_forall |
| 389 | intro y z hz |
| 390 | have hsub : HasFDerivAt (fun q : V => q - y) |
| 391 | (ContinuousLinearMap.id Real V) z := |
| 392 | (hasFDerivAt_id z).sub_const y |
| 393 | unfold G DG |
| 394 | simpa using ((heatKernel_hasFDeriv (z - y)).comp z hsub).smul_const (u y) |
| 395 | have h := hasFDerivAt_integral_of_dominated_of_fderiv_le |
| 396 | (F := G) (F' := DG) (bound := bound) hs hGmeas hGint hDGmeas |
| 397 | hbound hboundInt hdiff |
| 398 | have hfun : (fun z : V => ∫ y : V, G z y) = fun z : V => heatSup t u z := by |
| 399 | funext z |
| 400 | unfold G heatSup supKernel |
| 401 | rw [← MeasureTheory.convolution_lsmul_swap] |
| 402 | rfl |
| 403 | rw [hfun] at h |
| 404 | simpa only [DG, heatSupGradient] using h |
| 405 | |
| 406 | def heatSupHessian (t : Real) (u : BoundedContinuousFunction V F) (x : V) : |
| 407 | V →L[Real] (V →L[Real] F) := |
| 408 | ∫ y : V, heatD2SmulRightMap t (x - y) (u y) |
| 409 | |
| 410 | omit [CompleteSpace F] in |
| 411 | theorem heatSupGradient_hasFDerivAt {t : Real} (ht : 0 < t) |
| 412 | (u : BoundedContinuousFunction V F) (x : V) : |
| 413 | HasFDerivAt (heatSupGradient t u) (heatSupHessian t u x) x := by |
| 414 | let G : V → V → V →L[Real] F := fun z y => |
| 415 | (heatD1Map t (z - y)).smulRight (u y) |
| 416 | let DG : V → V → V →L[Real] (V →L[Real] F) := fun z y => |
| 417 | heatD2SmulRightMap t (z - y) (u y) |
| 418 | let bound : V → Real := fun y => ‖u‖ * heatD2LocalMajor (V := V) t x y |
| 419 | let : SecondCountableTopologyEither V (V →L[Real] (V →L[Real] F)) := |
| 420 | secondCountableTopologyEither_of_left V _ |
| 421 | have hs : Metric.ball x (heatScale t) ∈ 𝓝 x := |
| 422 | Metric.ball_mem_nhds x (heatScale_pos ht) |
| 423 | have hGmeas : ∀ᶠ z in 𝓝 x, |
| 424 | AEStronglyMeasurable (G z) (volume : Measure V) := by |
| 425 | apply Filter.Eventually.of_forall |
| 426 | intro z |
| 427 | apply Continuous.aestronglyMeasurable |
| 428 | unfold G heatD1Map baseD1Map baseHeat baseHeatMass heatScale |
| 429 | fun_prop |
| 430 | have hGint : Integrable (G x) := by |
| 431 | refine (((heatD1Maj_int (V := V) ht).comp_sub_left x).const_mul ‖u‖).mono' |
| 432 | ?_ ?_ |
| 433 | · apply Continuous.aestronglyMeasurable |
| 434 | unfold G heatD1Map baseD1Map baseHeat baseHeatMass heatScale |
| 435 | fun_prop |
| 436 | filter_upwards with y |
| 437 | calc |
| 438 | ‖G x y‖ = ‖heatD1Map t (x - y)‖ * ‖u y‖ := by |
| 439 | unfold G |
| 440 | rw [ContinuousLinearMap.norm_smulRight_apply] |
| 441 | _ ≤ heatD1Maj t (x - y) * ‖u‖ := |
| 442 | mul_le_mul (heatD1Map_norm_le ht (x - y)) |
| 443 | (u.norm_coe_le_norm y) (norm_nonneg _) (heatD1Maj_nonneg ht _) |
| 444 | _ = ‖u‖ * heatD1Maj t (x - y) := by ring |
| 445 | have hDGmeas : AEStronglyMeasurable (DG x) (volume : Measure V) := by |
| 446 | apply Continuous.aestronglyMeasurable |
| 447 | unfold DG heatD2SmulRightMap heatD2CurriedMap baseD2CurriedMap |
| 448 | baseHeat baseHeatMass heatScale |
| 449 | fun_prop |
| 450 | have hbound : ∀ᵐ y ∂(volume : Measure V), ∀ z ∈ Metric.ball x (heatScale t), |
| 451 | ‖DG z y‖ ≤ bound y := by |
| 452 | apply Filter.Eventually.of_forall |
| 453 | intro y z hz |
| 454 | calc |
| 455 | ‖DG z y‖ ≤ heatD2Maj t (z - y) * ‖u y‖ := by |
| 456 | unfold DG |
| 457 | exact heatD2SmulRightMap_norm_le ht (z - y) (u y) |
| 458 | _ ≤ heatD2Maj t (z - y) * ‖u‖ := by |
| 459 | exact mul_le_mul_of_nonneg_left (u.norm_coe_le_norm y) |
| 460 | (heatD2Maj_nonneg ht _) |
| 461 | _ ≤ ‖u‖ * heatD2LocalMajor (V := V) t x y := by |
| 462 | rw [mul_comm] |
| 463 | exact mul_le_mul_of_nonneg_left |
| 464 | (heatD2Maj_le_localMajor ht x y hz) (norm_nonneg u) |
| 465 | _ = bound y := rfl |
| 466 | have hboundInt : Integrable bound := |
| 467 | (heatD2LocalMajor_int (V := V) ht x).const_mul ‖u‖ |
| 468 | have hdiff : ∀ᵐ y ∂(volume : Measure V), ∀ z ∈ Metric.ball x (heatScale t), |
| 469 | HasFDerivAt (G · y) (DG z y) z := by |
| 470 | apply Filter.Eventually.of_forall |
| 471 | intro y z hz |
| 472 | have hsub : HasFDerivAt (fun q : V => q - y) |
| 473 | (ContinuousLinearMap.id Real V) z := |
| 474 | (hasFDerivAt_id z).sub_const y |
| 475 | change HasFDerivAt (fun q : V => (heatD1Map t (q - y)).smulRight (u y)) |
| 476 | (heatD2SmulRightMap t (z - y) (u y)) z |
| 477 | have hcomp := (heatD1SmulRight_hasFDerivAt t (z - y) (u y)).comp z hsub |
| 478 | exact (hcomp.congr_fderiv (by ext; simp)).congr_of_eventuallyEq |
| 479 | (Filter.Eventually.of_forall fun _ => rfl) |
| 480 | have h := hasFDerivAt_integral_of_dominated_of_fderiv_le |
| 481 | (F := G) (F' := DG) (bound := bound) hs hGmeas hGint hDGmeas |
| 482 | hbound hboundInt hdiff |
| 483 | exact h.congr_of_eventuallyEq (Filter.Eventually.of_forall fun _ => rfl) |
| 484 | |
| 485 | omit [CompleteSpace F] in |
| 486 | theorem heatSup_iteratedFDeriv_two_apply {t : Real} (ht : 0 < t) |
| 487 | (u : BoundedContinuousFunction V F) (x : V) (m : Fin 2 → V) : |
| 488 | iteratedFDeriv Real 2 (fun z : V => heatSup t u z) x m = |
| 489 | heatSupHessian t u x (m 0) (m 1) := by |
| 490 | rw [iteratedFDeriv_two_apply] |
| 491 | have hgrad : fderiv Real (fun z : V => heatSup t u z) = heatSupGradient t u := by |
| 492 | funext z |
| 493 | exact (heatSup_hasFDerivAt ht u z).fderiv |
| 494 | rw [hgrad, (heatSupGradient_hasFDerivAt ht u x).fderiv] |
| 495 | |
| 496 | omit [CompleteSpace F] in |
| 497 | theorem heatSupGradient_apply {t : Real} (ht : 0 < t) |
| 498 | (u : BoundedContinuousFunction V F) (x v : V) : |
| 499 | heatSupGradient t u x v = heatD1Sup t v u x := by |
| 500 | have hInt : Integrable |
| 501 | (fun y : V => (heatD1Map t (x - y)).smulRight (u y)) := by |
| 502 | refine (((heatD1Maj_int (V := V) ht).comp_sub_left x).const_mul ‖u‖).mono' |
| 503 | ?_ ?_ |
| 504 | · apply Continuous.aestronglyMeasurable |
| 505 | unfold heatD1Map baseD1Map baseHeat baseHeatMass heatScale |
| 506 | fun_prop |
| 507 | filter_upwards with y |
| 508 | rw [ContinuousLinearMap.norm_smulRight_apply] |
| 509 | calc |
| 510 | ‖heatD1Map t (x - y)‖ * ‖u y‖ ≤ |
| 511 | heatD1Maj t (x - y) * ‖u‖ := |
| 512 | mul_le_mul (heatD1Map_norm_le ht (x - y)) |
| 513 | (u.norm_coe_le_norm y) (norm_nonneg _) (heatD1Maj_nonneg ht _) |
| 514 | _ = ‖u‖ * heatD1Maj t (x - y) := by ring |
| 515 | unfold heatSupGradient heatD1Sup supKernel |
| 516 | rw [ContinuousLinearMap.integral_apply hInt v] |
| 517 | simp only [ContinuousLinearMap.smulRight_apply, heatD1Map_apply] |
| 518 | change (∫ y : V, heatD1 t v (x - y) • u y) = |
| 519 | ∫ y : V, heatD1 t v y • u (x - y) |
| 520 | rw [← MeasureTheory.convolution_lsmul_swap] |
| 521 | rfl |
| 522 | |
| 523 | def heatD2ConvMap (t : Real) (v : V) |
| 524 | (u : BoundedContinuousFunction V F) (x : V) : V →L[Real] F := |
| 525 | ∫ y : V, (heatD2Map t v (x - y)).smulRight (u y) |
| 526 | |
| 527 | omit [CompleteSpace F] in |
| 528 | @[simp] theorem heatD2ConvMap_apply {t : Real} (ht : 0 < t) (v : V) |
| 529 | (u : BoundedContinuousFunction V F) (x w : V) : |
| 530 | heatD2ConvMap t v u x w = heatD2Conv t v w u x := by |
| 531 | have hInt : Integrable |
| 532 | (fun y : V => (heatD2Map t v (x - y)).smulRight (u y)) := by |
| 533 | refine ((((heatD2Maj_int (V := V) ht).comp_sub_left x).const_mul ‖v‖).const_mul |
| 534 | ‖u‖).mono' ?_ ?_ |
| 535 | · apply Continuous.aestronglyMeasurable |
| 536 | unfold heatD2Map baseD2Map baseHeat baseHeatMass heatScale |
| 537 | fun_prop |
| 538 | filter_upwards with y |
| 539 | rw [ContinuousLinearMap.norm_smulRight_apply] |
| 540 | calc |
| 541 | ‖heatD2Map t v (x - y)‖ * ‖u y‖ ≤ |
| 542 | (‖v‖ * heatD2Maj t (x - y)) * ‖u‖ := |
| 543 | mul_le_mul (heatD2Map_norm_le ht v (x - y)) |
| 544 | (u.norm_coe_le_norm y) (norm_nonneg _) |
| 545 | (mul_nonneg (norm_nonneg v) (heatD2Maj_nonneg ht _)) |
| 546 | _ = ‖u‖ * (‖v‖ * heatD2Maj t (x - y)) := by ring |
| 547 | unfold heatD2ConvMap heatD2Conv |
| 548 | rw [ContinuousLinearMap.integral_apply hInt w] |
| 549 | simp only [ContinuousLinearMap.smulRight_apply, heatD2Map_apply] |
| 550 | change (∫ y : V, heatD2 t v w (x - y) • u y) = |
| 551 | ∫ y : V, heatD2 t v w y • u (x - y) |
| 552 | rw [← MeasureTheory.convolution_lsmul_swap] |
| 553 | rfl |
| 554 | |
| 555 | omit [CompleteSpace F] in |
| 556 | theorem heatD1Sup_hasFDerivAt {t : Real} (ht : 0 < t) (v : V) |
| 557 | (u : BoundedContinuousFunction V F) (x : V) : |
| 558 | HasFDerivAt (heatD1Sup t v u) (heatD2ConvMap t v u x) x := by |
| 559 | let G : V → V → F := fun z y => heatD1 t v (z - y) • u y |
| 560 | let DG : V → V → V →L[Real] F := fun z y => |
| 561 | (heatD2Map t v (z - y)).smulRight (u y) |
| 562 | let bound : V → Real := fun y => |
| 563 | ‖v‖ * ‖u‖ * heatD2LocalMajor (V := V) t x y |
| 564 | have hs : Metric.ball x (heatScale t) ∈ 𝓝 x := |
| 565 | Metric.ball_mem_nhds x (heatScale_pos ht) |
| 566 | have hGmeas : ∀ᶠ z in 𝓝 x, |
| 567 | AEStronglyMeasurable (G z) (volume : Measure V) := by |
| 568 | apply Filter.Eventually.of_forall |
| 569 | intro z |
| 570 | apply Continuous.aestronglyMeasurable |
| 571 | unfold G heatD1 baseD1 baseHeat baseHeatMass heatScale |
| 572 | fun_prop |
| 573 | have hGint : Integrable (G x) := by |
| 574 | refine (((heatD1_int (V := V) ht v).norm.comp_sub_left x).mul_const ‖u‖).mono' |
| 575 | ?_ ?_ |
| 576 | · apply Continuous.aestronglyMeasurable |
| 577 | unfold G heatD1 baseD1 baseHeat baseHeatMass heatScale |
| 578 | fun_prop |
| 579 | filter_upwards with y |
| 580 | rw [norm_smul] |
| 581 | exact mul_le_mul_of_nonneg_left (u.norm_coe_le_norm y) |
| 582 | (norm_nonneg (heatD1 t v (x - y))) |
| 583 | have hDGmeas : AEStronglyMeasurable (DG x) (volume : Measure V) := by |
| 584 | apply Continuous.aestronglyMeasurable |
| 585 | unfold DG heatD2Map baseD2Map baseHeat baseHeatMass heatScale |
| 586 | fun_prop |
| 587 | have hbound : ∀ᵐ y ∂(volume : Measure V), ∀ z ∈ Metric.ball x (heatScale t), |
| 588 | ‖DG z y‖ ≤ bound y := by |
| 589 | apply Filter.Eventually.of_forall |
| 590 | intro y z hz |
| 591 | calc |
| 592 | ‖DG z y‖ = ‖heatD2Map t v (z - y)‖ * ‖u y‖ := by |
| 593 | unfold DG |
| 594 | rw [ContinuousLinearMap.norm_smulRight_apply] |
| 595 | _ ≤ (‖v‖ * heatD2Maj t (z - y)) * ‖u‖ := |
| 596 | mul_le_mul (heatD2Map_norm_le ht v (z - y)) |
| 597 | (u.norm_coe_le_norm y) (norm_nonneg _) |
| 598 | (mul_nonneg (norm_nonneg v) (heatD2Maj_nonneg ht _)) |
| 599 | _ = ‖v‖ * ‖u‖ * heatD2Maj t (z - y) := by ring |
| 600 | _ ≤ ‖v‖ * ‖u‖ * heatD2LocalMajor (V := V) t x y := |
| 601 | mul_le_mul_of_nonneg_left (heatD2Maj_le_localMajor ht x y hz) |
| 602 | (mul_nonneg (norm_nonneg v) (norm_nonneg u)) |
| 603 | _ = bound y := rfl |
| 604 | have hboundInt : Integrable bound := |
| 605 | (heatD2LocalMajor_int (V := V) ht x).const_mul (‖v‖ * ‖u‖) |
| 606 | have hdiff : ∀ᵐ y ∂(volume : Measure V), ∀ z ∈ Metric.ball x (heatScale t), |
| 607 | HasFDerivAt (G · y) (DG z y) z := by |
| 608 | apply Filter.Eventually.of_forall |
| 609 | intro y z hz |
| 610 | have hsub : HasFDerivAt (fun q : V => q - y) |
| 611 | (ContinuousLinearMap.id Real V) z := |
| 612 | (hasFDerivAt_id z).sub_const y |
| 613 | unfold G DG |
| 614 | simpa using ((heatD1_hasFDeriv v (z - y)).comp z hsub).smul_const (u y) |
| 615 | have h := hasFDerivAt_integral_of_dominated_of_fderiv_le |
| 616 | (F := G) (F' := DG) (bound := bound) hs hGmeas hGint hDGmeas |
| 617 | hbound hboundInt hdiff |
| 618 | have hfun : (fun z : V => ∫ y : V, G z y) = heatD1Sup t v u := by |
| 619 | funext z |
| 620 | unfold G heatD1Sup supKernel |
| 621 | rw [← MeasureTheory.convolution_lsmul_swap] |
| 622 | rfl |
| 623 | rw [hfun] at h |
| 624 | simpa only [DG, heatD2ConvMap] using h |
| 625 | |
| 626 | omit [CompleteSpace F] in |
| 627 | theorem heatSupHessian_apply {t : Real} (ht : 0 < t) |
| 628 | (u : BoundedContinuousFunction V F) (x w v : V) : |
| 629 | heatSupHessian t u x w v = heatD2Conv t v w u x := by |
| 630 | let L : (V →L[Real] F) →L[Real] F := |
| 631 | (ContinuousLinearMap.apply Real F) v |
| 632 | have heval := L.hasFDerivAt.comp x (heatSupGradient_hasFDerivAt ht u x) |
| 633 | have hfun : (fun z : V => L (heatSupGradient t u z)) = heatD1Sup t v u := by |
| 634 | funext z |
| 635 | exact heatSupGradient_apply ht u z v |
| 636 | have heval' : HasFDerivAt (heatD1Sup t v u) |
| 637 | (L.comp (heatSupHessian t u x)) x := by |
| 638 | rw [← hfun] |
| 639 | exact heval.congr_of_eventuallyEq (Filter.Eventually.of_forall fun _ => rfl) |
| 640 | have hraw := heatD1Sup_hasFDerivAt ht v u x |
| 641 | have hmaps := heval'.unique hraw |
| 642 | have happly := congrArg (fun A : V →L[Real] F => A w) hmaps |
| 643 | simpa only [L, ContinuousLinearMap.comp_apply, ContinuousLinearMap.apply_apply, |
| 644 | heatD2ConvMap_apply ht] using happly |
| 645 | |
| 646 | omit [CompleteSpace F] in |
| 647 | theorem heatSupHessian_eval_eq_heatD2ConvMap {t : Real} (ht : 0 < t) |
| 648 | (u : BoundedContinuousFunction V F) (x v : V) : |
| 649 | ((ContinuousLinearMap.apply Real F) v).comp (heatSupHessian t u x) = |
| 650 | heatD2ConvMap t v u x := by |
| 651 | ext w |
| 652 | rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.apply_apply, |
| 653 | heatSupHessian_apply ht, heatD2ConvMap_apply ht] |
| 654 | |
| 655 | end Poincare.Parabolic.Interior.Kernel |
| 656 | |
| 657 | end |