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/Sobolev/Nirenberg/TestFunction/Defs.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.Elliptic.Regularity.EnergyEstimate.Coefficients |
| 13 | |
| 14 | /-! |
| 15 | # Local elliptic energy estimates |
| 16 | |
| 17 | Adapted from Chow--Liao--Qin, `Analysis/Sobolev/Nirenberg/TestFunction/Defs.lean`, |
| 18 | revision `1b535dd102b94cc42b107cca27059687888f08b3`. |
| 19 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 20 | The adaptation changes imports and namespaces and uses smooth cutoffs. |
| 21 | -/ |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | open MeasureTheory Metric Filter Topology Set Function |
| 26 | open scoped ENNReal NNReal Convolution Pointwise BigOperators |
| 27 | |
| 28 | namespace Poincare.Analysis.Sobolev.NirenbergTestFunction |
| 29 | |
| 30 | variable {d : ℕ} [NeZero d] |
| 31 | |
| 32 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 33 | |
| 34 | omit [NeZero d] in |
| 35 | theorem contDiff_diffQuot_of_contDiff |
| 36 | {v : E → ℝ} (hv : ContDiff ℝ (⊤ : ℕ∞) v) (k : Fin d) {h : ℝ} (hh : h ≠ 0) : |
| 37 | ContDiff ℝ (⊤ : ℕ∞) |
| 38 | (Poincare.Analysis.Sobolev.diffQuot k h v) := by |
| 39 | have h_translate : |
| 40 | ContDiff ℝ (⊤ : ℕ∞) (fun y : E => y + h • EuclideanSpace.single k 1) := |
| 41 | contDiff_id.add contDiff_const |
| 42 | have h_comp : |
| 43 | ContDiff ℝ (⊤ : ℕ∞) (fun y : E => v (y + h • EuclideanSpace.single k 1)) := |
| 44 | hv.comp h_translate |
| 45 | have h_sub : |
| 46 | ContDiff ℝ (⊤ : ℕ∞) |
| 47 | (fun y : E => v (y + h • EuclideanSpace.single k 1) - v y) := |
| 48 | h_comp.sub hv |
| 49 | have h_div : |
| 50 | ContDiff ℝ (⊤ : ℕ∞) |
| 51 | (fun y : E => (v (y + h • EuclideanSpace.single k 1) - v y) / h) := by |
| 52 | have heq : |
| 53 | (fun y : E => (v (y + h • EuclideanSpace.single k 1) - v y) / h) = |
| 54 | fun y : E => |
| 55 | h⁻¹ • (v (y + h • EuclideanSpace.single k 1) - v y) := by |
| 56 | funext y |
| 57 | rw [div_eq_inv_mul, smul_eq_mul] |
| 58 | rw [heq] |
| 59 | exact h_sub.const_smul h⁻¹ |
| 60 | have heq_fun : |
| 61 | (Poincare.Analysis.Sobolev.diffQuot k h v) = |
| 62 | fun y : E => (v (y + h • EuclideanSpace.single k 1) - v y) / h := by |
| 63 | funext y |
| 64 | exact Poincare.Analysis.Sobolev.diffQuot_apply_of_ne |
| 65 | (d := d) k hh v y |
| 66 | rw [heq_fun] |
| 67 | exact h_div |
| 68 | |
| 69 | omit [NeZero d] in |
| 70 | theorem contDiff_nirenbergTestFunction_aux |
| 71 | {η u : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 72 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) : |
| 73 | ContDiff ℝ (⊤ : ℕ∞) |
| 74 | (Poincare.Analysis.Sobolev.diffQuot k (-h) |
| 75 | (fun y : E => η y ^ 2 * |
| 76 | Poincare.Analysis.Sobolev.diffQuot k h u y)) := by |
| 77 | have hnh : (-h) ≠ 0 := neg_ne_zero.mpr hh |
| 78 | have h_eta_sq : ContDiff ℝ (⊤ : ℕ∞) (fun y : E => η y ^ 2) := hη.pow 2 |
| 79 | have h_diffQuot_u : |
| 80 | ContDiff ℝ (⊤ : ℕ∞) |
| 81 | (Poincare.Analysis.Sobolev.diffQuot k h u) := |
| 82 | contDiff_diffQuot_of_contDiff (d := d) hu k hh |
| 83 | have h_prod : |
| 84 | ContDiff ℝ (⊤ : ℕ∞) |
| 85 | (fun y : E => η y ^ 2 * |
| 86 | Poincare.Analysis.Sobolev.diffQuot k h u y) := |
| 87 | h_eta_sq.mul h_diffQuot_u |
| 88 | exact contDiff_diffQuot_of_contDiff (d := d) h_prod k hnh |
| 89 | |
| 90 | omit [NeZero d] in |
| 91 | theorem hasCompactSupport_translate_of_hasCompactSupport |
| 92 | {v : E → ℝ} (hv : HasCompactSupport v) (k : Fin d) (h : ℝ) : |
| 93 | HasCompactSupport |
| 94 | (Poincare.Analysis.Sobolev.translate k h v) := by |
| 95 | let φ : E ≃ₜ E := Homeomorph.addRight (h • EuclideanSpace.single k 1) |
| 96 | have heq : |
| 97 | Poincare.Analysis.Sobolev.translate k h v = v ∘ φ := by |
| 98 | funext x |
| 99 | rfl |
| 100 | rw [heq] |
| 101 | exact hv.comp_homeomorph φ |
| 102 | |
| 103 | omit [NeZero d] in |
| 104 | theorem hasCompactSupport_diffQuot_of_hasCompactSupport |
| 105 | {v : E → ℝ} (hv : HasCompactSupport v) (k : Fin d) (h : ℝ) : |
| 106 | HasCompactSupport |
| 107 | (Poincare.Analysis.Sobolev.diffQuot k h v) := by |
| 108 | by_cases hh : h = 0 |
| 109 | · subst hh |
| 110 | rw [Poincare.Analysis.Sobolev.diffQuot_zero_h] |
| 111 | exact HasCompactSupport.zero |
| 112 | · have heq : |
| 113 | Poincare.Analysis.Sobolev.diffQuot k h v = |
| 114 | (h⁻¹ : ℝ) • |
| 115 | (Poincare.Analysis.Sobolev.translate k h v - v) := by |
| 116 | funext x |
| 117 | rw [Poincare.Analysis.Sobolev.diffQuot_apply_of_ne |
| 118 | (d := d) k hh v x] |
| 119 | change (v (x + h • EuclideanSpace.single k 1) - v x) / h = |
| 120 | h⁻¹ • (v (x + h • EuclideanSpace.single k 1) - v x) |
| 121 | rw [div_eq_inv_mul, smul_eq_mul] |
| 122 | rw [heq] |
| 123 | have h_translate : |
| 124 | HasCompactSupport |
| 125 | (Poincare.Analysis.Sobolev.translate k h v) := |
| 126 | hasCompactSupport_translate_of_hasCompactSupport (d := d) hv k h |
| 127 | have h_diff : |
| 128 | HasCompactSupport |
| 129 | (Poincare.Analysis.Sobolev.translate k h v - v) := |
| 130 | h_translate.sub hv |
| 131 | exact h_diff.smul_left |
| 132 | |
| 133 | noncomputable def nirenbergTestFunction |
| 134 | (k : Fin d) (h : ℝ) (η u : E → ℝ) : E → ℝ := |
| 135 | Poincare.Analysis.Sobolev.diffQuot k (-h) |
| 136 | (fun y : E => η y ^ 2 * |
| 137 | Poincare.Analysis.Sobolev.diffQuot k h u y) |
| 138 | |
| 139 | omit [NeZero d] in |
| 140 | theorem contDiff_nirenbergTestFunction |
| 141 | {η u : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 142 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) : |
| 143 | ContDiff ℝ (⊤ : ℕ∞) (nirenbergTestFunction k h η u) := by |
| 144 | unfold nirenbergTestFunction |
| 145 | exact contDiff_nirenbergTestFunction_aux (d := d) hη hu k hh |
| 146 | |
| 147 | omit [NeZero d] in |
| 148 | theorem hasCompactSupport_nirenbergTestFunction |
| 149 | {η u : E → ℝ} (hη_supp : HasCompactSupport η) |
| 150 | (k : Fin d) (h : ℝ) : |
| 151 | HasCompactSupport (nirenbergTestFunction k h η u) := by |
| 152 | unfold nirenbergTestFunction |
| 153 | have h_eta_sq_supp : HasCompactSupport (fun y : E => η y ^ 2) := by |
| 154 | have heq : (fun y : E => η y ^ 2) = (fun y : E => η y * η y) := by |
| 155 | funext y |
| 156 | ring |
| 157 | rw [heq] |
| 158 | exact hη_supp.mul_right |
| 159 | have h_prod_supp : |
| 160 | HasCompactSupport |
| 161 | (fun y : E => η y ^ 2 * |
| 162 | Poincare.Analysis.Sobolev.diffQuot k h u y) := |
| 163 | h_eta_sq_supp.mul_right |
| 164 | exact hasCompactSupport_diffQuot_of_hasCompactSupport |
| 165 | (d := d) h_prod_supp k (-h) |
| 166 | |
| 167 | omit [NeZero d] in |
| 168 | private lemma support_eta_sq_subset |
| 169 | (η : E → ℝ) : |
| 170 | Function.support (fun y : E => η y ^ 2) ⊆ Function.support η := by |
| 171 | intro y hy |
| 172 | by_contra hyη |
| 173 | rw [Function.notMem_support] at hyη |
| 174 | apply hy |
| 175 | change η y ^ 2 = 0 |
| 176 | rw [hyη] |
| 177 | simp |
| 178 | |
| 179 | omit [NeZero d] in |
| 180 | private lemma support_eta_sq_diffQuot_subset |
| 181 | (η u : E → ℝ) (k : Fin d) (h : ℝ) : |
| 182 | Function.support |
| 183 | (fun y : E => η y ^ 2 * |
| 184 | Poincare.Analysis.Sobolev.diffQuot k h u y) ⊆ |
| 185 | Function.support η := by |
| 186 | intro y hy |
| 187 | have hsq_ne : η y ^ 2 ≠ 0 := by |
| 188 | intro hsq |
| 189 | apply hy |
| 190 | change η y ^ 2 * |
| 191 | Poincare.Analysis.Sobolev.diffQuot k h u y = 0 |
| 192 | rw [hsq, zero_mul] |
| 193 | intro hyη |
| 194 | apply hsq_ne |
| 195 | rw [hyη] |
| 196 | simp |
| 197 | |
| 198 | omit [NeZero d] in |
| 199 | private lemma tsupport_eta_sq_diffQuot_subset |
| 200 | (η u : E → ℝ) (k : Fin d) (h : ℝ) : |
| 201 | tsupport |
| 202 | (fun y : E => η y ^ 2 * |
| 203 | Poincare.Analysis.Sobolev.diffQuot k h u y) ⊆ |
| 204 | tsupport η := by |
| 205 | exact closure_mono (support_eta_sq_diffQuot_subset (d := d) η u k h) |
| 206 | |
| 207 | omit [NeZero d] in |
| 208 | theorem tsupport_nirenbergTestFunction_subset |
| 209 | (η u : E → ℝ) (k : Fin d) (h : ℝ) : |
| 210 | tsupport (nirenbergTestFunction k h η u) ⊆ |
| 211 | Metric.cthickening |h| (tsupport η) := by |
| 212 | unfold nirenbergTestFunction |
| 213 | set g : E → ℝ := fun y : E => η y ^ 2 * |
| 214 | Poincare.Analysis.Sobolev.diffQuot k h u y with hg_def |
| 215 | have h_thick_closed : IsClosed (Metric.cthickening |h| (tsupport η)) := |
| 216 | isClosed_cthickening |
| 217 | have h_self_subset_thick : tsupport η ⊆ Metric.cthickening |h| (tsupport η) := |
| 218 | self_subset_cthickening _ |
| 219 | have h_shift_in_thick : |
| 220 | ∀ y₀ ∈ tsupport η, |
| 221 | y₀ - (-h) • EuclideanSpace.single k 1 ∈ |
| 222 | Metric.cthickening |h| (tsupport η) := by |
| 223 | intro y₀ hy₀ |
| 224 | refine Metric.mem_cthickening_of_dist_le _ y₀ |h| (tsupport η) hy₀ ?_ |
| 225 | have hsing_norm : |
| 226 | ‖(EuclideanSpace.single k (1 : ℝ) : E)‖ = 1 := by simp |
| 227 | have hdist_eq : |
| 228 | dist (y₀ - (-h) • EuclideanSpace.single k 1) y₀ = |
| 229 | ‖(-h) • EuclideanSpace.single k (1 : ℝ)‖ := by |
| 230 | rw [dist_eq_norm] |
| 231 | have : |
| 232 | (y₀ - (-h) • EuclideanSpace.single k 1) - y₀ = |
| 233 | -((-h) • EuclideanSpace.single k 1) := by |
| 234 | rw [sub_right_comm, sub_self, zero_sub] |
| 235 | rw [this, norm_neg] |
| 236 | rw [hdist_eq] |
| 237 | rw [norm_smul, hsing_norm, mul_one, Real.norm_eq_abs, abs_neg] |
| 238 | have h_supp_subset : |
| 239 | Function.support |
| 240 | (Poincare.Analysis.Sobolev.diffQuot k (-h) g) ⊆ |
| 241 | Metric.cthickening |h| (tsupport η) := by |
| 242 | intro x hx |
| 243 | have hx_ne : Poincare.Analysis.Sobolev.diffQuot k (-h) g x ≠ 0 := |
| 244 | hx |
| 245 | by_cases hh : h = 0 |
| 246 | · subst hh |
| 247 | exfalso |
| 248 | apply hx_ne |
| 249 | have hzeroNeg : (-(0 : ℝ)) = 0 := neg_zero |
| 250 | rw [hzeroNeg] |
| 251 | change Poincare.Analysis.Sobolev.diffQuot k 0 g x = 0 |
| 252 | rw [Poincare.Analysis.Sobolev.diffQuot_zero_h] |
| 253 | rfl |
| 254 | · have hnh : (-h) ≠ 0 := neg_ne_zero.mpr hh |
| 255 | rw [Poincare.Analysis.Sobolev.diffQuot_apply_of_ne |
| 256 | (d := d) k hnh g x] at hx_ne |
| 257 | have hnum_ne : g (x + (-h) • EuclideanSpace.single k 1) - g x ≠ 0 := by |
| 258 | intro hnum |
| 259 | apply hx_ne |
| 260 | rw [hnum, zero_div] |
| 261 | have h_or : |
| 262 | g (x + (-h) • EuclideanSpace.single k 1) ≠ 0 ∨ g x ≠ 0 := by |
| 263 | by_contra hboth |
| 264 | rw [not_or] at hboth |
| 265 | obtain ⟨hb1, hb2⟩ := hboth |
| 266 | have hb1' : g (x + (-h) • EuclideanSpace.single k 1) = 0 := |
| 267 | not_not.mp hb1 |
| 268 | have hb2' : g x = 0 := not_not.mp hb2 |
| 269 | apply hnum_ne |
| 270 | rw [hb1', hb2', sub_zero] |
| 271 | cases h_or with |
| 272 | | inl h1 => |
| 273 | have h_in_supp_g : |
| 274 | x + (-h) • EuclideanSpace.single k 1 ∈ Function.support g := |
| 275 | h1 |
| 276 | have h_in_supp_η : |
| 277 | x + (-h) • EuclideanSpace.single k 1 ∈ Function.support η := |
| 278 | support_eta_sq_diffQuot_subset (d := d) η u k h h_in_supp_g |
| 279 | have h_in_tsupp_η : |
| 280 | x + (-h) • EuclideanSpace.single k 1 ∈ tsupport η := |
| 281 | subset_closure h_in_supp_η |
| 282 | have h_x_eq : |
| 283 | x = |
| 284 | (x + (-h) • EuclideanSpace.single k 1) - |
| 285 | (-h) • EuclideanSpace.single k 1 := by |
| 286 | rw [add_sub_cancel_right] |
| 287 | rw [h_x_eq] |
| 288 | exact h_shift_in_thick _ h_in_tsupp_η |
| 289 | | inr h2 => |
| 290 | have h_in_supp_g : x ∈ Function.support g := h2 |
| 291 | have h_in_supp_η : x ∈ Function.support η := |
| 292 | support_eta_sq_diffQuot_subset (d := d) η u k h h_in_supp_g |
| 293 | have h_in_tsupp_η : x ∈ tsupport η := subset_closure h_in_supp_η |
| 294 | exact h_self_subset_thick h_in_tsupp_η |
| 295 | exact (closure_minimal h_supp_subset h_thick_closed) |
| 296 | |
| 297 | omit [NeZero d] in |
| 298 | private lemma hasFDerivAt_translate (k : Fin d) (h : ℝ) (x : E) : |
| 299 | HasFDerivAt |
| 300 | (fun y : E => y + h • EuclideanSpace.single k 1) |
| 301 | (ContinuousLinearMap.id ℝ E) x := by |
| 302 | exact (hasFDerivAt_id x).add_const _ |
| 303 | |
| 304 | omit [NeZero d] in |
| 305 | theorem fderiv_diffQuot_apply_eq_diffQuot_partial |
| 306 | {g : E → ℝ} (hg : ContDiff ℝ (⊤ : ℕ∞) g) |
| 307 | (k j : Fin d) {h : ℝ} (hh : h ≠ 0) (x : E) : |
| 308 | (fderiv ℝ |
| 309 | (Poincare.Analysis.Sobolev.diffQuot k h g) x) |
| 310 | (EuclideanSpace.single j 1) = |
| 311 | Poincare.Analysis.Sobolev.diffQuot k h |
| 312 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) x := by |
| 313 | have hg_diff : Differentiable ℝ g := hg.differentiable (by simp) |
| 314 | have hg_at : ∀ y : E, HasFDerivAt g (fderiv ℝ g y) y := |
| 315 | fun y => (hg_diff y).hasFDerivAt |
| 316 | have h_translate_at : ∀ y : E, |
| 317 | HasFDerivAt |
| 318 | (fun z : E => z + h • EuclideanSpace.single k 1) |
| 319 | (ContinuousLinearMap.id ℝ E) y := |
| 320 | fun y => hasFDerivAt_translate (d := d) k h y |
| 321 | have h_comp_at : ∀ y : E, |
| 322 | HasFDerivAt (fun z : E => g (z + h • EuclideanSpace.single k 1)) |
| 323 | (fderiv ℝ g (y + h • EuclideanSpace.single k 1)) y := by |
| 324 | intro y |
| 325 | have hcomp := |
| 326 | (hg_at (y + h • EuclideanSpace.single k 1)).comp y (h_translate_at y) |
| 327 | have heq : |
| 328 | ((fderiv ℝ g (y + h • EuclideanSpace.single k 1)).comp |
| 329 | (ContinuousLinearMap.id ℝ E)) = |
| 330 | fderiv ℝ g (y + h • EuclideanSpace.single k 1) := by |
| 331 | ext z |
| 332 | rfl |
| 333 | rw [heq] at hcomp |
| 334 | exact hcomp |
| 335 | have h_diff_at : ∀ y : E, |
| 336 | HasFDerivAt |
| 337 | (fun z : E => g (z + h • EuclideanSpace.single k 1) - g z) |
| 338 | (fderiv ℝ g (y + h • EuclideanSpace.single k 1) - fderiv ℝ g y) y := by |
| 339 | intro y |
| 340 | exact (h_comp_at y).sub (hg_at y) |
| 341 | have h_div_at : ∀ y : E, |
| 342 | HasFDerivAt |
| 343 | (fun z : E => |
| 344 | (g (z + h • EuclideanSpace.single k 1) - g z) / h) |
| 345 | (h⁻¹ • (fderiv ℝ g (y + h • EuclideanSpace.single k 1) - |
| 346 | fderiv ℝ g y)) y := by |
| 347 | intro y |
| 348 | have hcs := (h_diff_at y).const_smul h⁻¹ |
| 349 | have heq_fun : |
| 350 | (h⁻¹ • fun z : E => g (z + h • EuclideanSpace.single k 1) - g z) = |
| 351 | fun z : E => |
| 352 | (g (z + h • EuclideanSpace.single k 1) - g z) / h := by |
| 353 | funext z |
| 354 | change h⁻¹ • (g (z + h • EuclideanSpace.single k 1) - g z) = |
| 355 | (g (z + h • EuclideanSpace.single k 1) - g z) / h |
| 356 | rw [div_eq_inv_mul, smul_eq_mul] |
| 357 | rw [heq_fun] at hcs |
| 358 | exact hcs |
| 359 | have heq_diffQuot : |
| 360 | (Poincare.Analysis.Sobolev.diffQuot k h g) = |
| 361 | fun y : E => (g (y + h • EuclideanSpace.single k 1) - g y) / h := by |
| 362 | funext y |
| 363 | exact Poincare.Analysis.Sobolev.diffQuot_apply_of_ne |
| 364 | (d := d) k hh g y |
| 365 | rw [heq_diffQuot] |
| 366 | have h_at : HasFDerivAt |
| 367 | (fun y : E => (g (y + h • EuclideanSpace.single k 1) - g y) / h) |
| 368 | (h⁻¹ • (fderiv ℝ g (x + h • EuclideanSpace.single k 1) - |
| 369 | fderiv ℝ g x)) x := h_div_at x |
| 370 | rw [h_at.fderiv] |
| 371 | set ej : E := EuclideanSpace.single j 1 with hej |
| 372 | have h_apply : |
| 373 | (h⁻¹ • (fderiv ℝ g (x + h • EuclideanSpace.single k 1) - |
| 374 | fderiv ℝ g x)) ej = |
| 375 | h⁻¹ • ((fderiv ℝ g (x + h • EuclideanSpace.single k 1)) ej - |
| 376 | (fderiv ℝ g x) ej) := by |
| 377 | rw [smul_apply] |
| 378 | rw [sub_apply] |
| 379 | rw [h_apply] |
| 380 | rw [Poincare.Analysis.Sobolev.diffQuot_apply_of_ne |
| 381 | (d := d) k hh _ x] |
| 382 | rw [div_eq_inv_mul, smul_eq_mul] |
| 383 | |
| 384 | omit [NeZero d] in |
| 385 | theorem fderiv_eta_sq_times_diffQuot_apply |
| 386 | {η u : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 387 | (k j : Fin d) {h : ℝ} (hh : h ≠ 0) (x : E) : |
| 388 | (fderiv ℝ |
| 389 | (fun y : E => η y ^ 2 * |
| 390 | Poincare.Analysis.Sobolev.diffQuot k h u y) x) |
| 391 | (EuclideanSpace.single j 1) = |
| 392 | 2 * η x * ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 393 | Poincare.Analysis.Sobolev.diffQuot k h u x + |
| 394 | η x ^ 2 * |
| 395 | Poincare.Analysis.Sobolev.diffQuot k h |
| 396 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x := by |
| 397 | have hη_diff : Differentiable ℝ η := hη.differentiable (by simp) |
| 398 | have hη_sq_diff : Differentiable ℝ (fun y : E => η y ^ 2) := |
| 399 | (hη.pow 2).differentiable (by simp) |
| 400 | have h_diffQuot_u_smooth : |
| 401 | ContDiff ℝ (⊤ : ℕ∞) |
| 402 | (Poincare.Analysis.Sobolev.diffQuot k h u) := |
| 403 | contDiff_diffQuot_of_contDiff (d := d) hu k hh |
| 404 | have h_diffQuot_u_diff : |
| 405 | Differentiable ℝ |
| 406 | (Poincare.Analysis.Sobolev.diffQuot k h u) := |
| 407 | h_diffQuot_u_smooth.differentiable (by simp) |
| 408 | set ej : E := EuclideanSpace.single j 1 with hej |
| 409 | have h_prod : |
| 410 | fderiv ℝ |
| 411 | (fun y : E => η y ^ 2 * |
| 412 | Poincare.Analysis.Sobolev.diffQuot k h u y) x = |
| 413 | η x ^ 2 • |
| 414 | fderiv ℝ |
| 415 | (Poincare.Analysis.Sobolev.diffQuot k h u) x + |
| 416 | Poincare.Analysis.Sobolev.diffQuot k h u x • |
| 417 | fderiv ℝ (fun y : E => η y ^ 2) x := by |
| 418 | exact fderiv_fun_mul (hη_sq_diff x) (h_diffQuot_u_diff x) |
| 419 | rw [h_prod] |
| 420 | rw [add_apply, |
| 421 | smul_apply, |
| 422 | smul_apply] |
| 423 | have hη_pow_fd : |
| 424 | fderiv ℝ (fun y : E => η y ^ 2) x = |
| 425 | ((2 : ℕ) • (η x) ^ ((2 : ℕ) - 1)) • fderiv ℝ η x := |
| 426 | fderiv_fun_pow 2 (hη_diff x) |
| 427 | rw [hη_pow_fd] |
| 428 | rw [smul_apply] |
| 429 | have hpow1 : (η x) ^ ((2 : ℕ) - 1) = η x := by |
| 430 | norm_num |
| 431 | rw [hpow1] |
| 432 | have h_fderiv_diffQuot : |
| 433 | (fderiv ℝ |
| 434 | (Poincare.Analysis.Sobolev.diffQuot k h u) x) ej = |
| 435 | Poincare.Analysis.Sobolev.diffQuot k h |
| 436 | (fun y : E => (fderiv ℝ u y) ej) x := |
| 437 | fderiv_diffQuot_apply_eq_diffQuot_partial (d := d) hu k j hh x |
| 438 | rw [h_fderiv_diffQuot] |
| 439 | have h_two_smul : ((2 : ℕ) • η x) = 2 * η x := by |
| 440 | rw [two_smul] |
| 441 | ring |
| 442 | rw [h_two_smul] |
| 443 | change η x ^ 2 * |
| 444 | Poincare.Analysis.Sobolev.diffQuot k h |
| 445 | (fun y : E => (fderiv ℝ u y) ej) x + |
| 446 | Poincare.Analysis.Sobolev.diffQuot k h u x * |
| 447 | (2 * η x * (fderiv ℝ η x) ej) = |
| 448 | 2 * η x * (fderiv ℝ η x) ej * |
| 449 | Poincare.Analysis.Sobolev.diffQuot k h u x + |
| 450 | η x ^ 2 * |
| 451 | Poincare.Analysis.Sobolev.diffQuot k h |
| 452 | (fun y : E => (fderiv ℝ u y) ej) x |
| 453 | ring |
| 454 | |
| 455 | omit [NeZero d] in |
| 456 | theorem fderiv_nirenbergTestFunction_apply |
| 457 | {η u : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 458 | (k j : Fin d) {h : ℝ} (hh : h ≠ 0) (x : E) : |
| 459 | (fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 460 | (EuclideanSpace.single j 1) = |
| 461 | Poincare.Analysis.Sobolev.diffQuot k (-h) |
| 462 | (fun y : E => |
| 463 | 2 * η y * ((fderiv ℝ η y) (EuclideanSpace.single j 1)) * |
| 464 | Poincare.Analysis.Sobolev.diffQuot k h u y + |
| 465 | η y ^ 2 * |
| 466 | Poincare.Analysis.Sobolev.diffQuot k h |
| 467 | (fun z : E => |
| 468 | (fderiv ℝ u z) (EuclideanSpace.single j 1)) y) |
| 469 | x := by |
| 470 | unfold nirenbergTestFunction |
| 471 | have hnh : (-h) ≠ 0 := neg_ne_zero.mpr hh |
| 472 | have hg_smooth : |
| 473 | ContDiff ℝ (⊤ : ℕ∞) |
| 474 | (fun y : E => η y ^ 2 * |
| 475 | Poincare.Analysis.Sobolev.diffQuot k h u y) := by |
| 476 | have h_eta_sq : ContDiff ℝ (⊤ : ℕ∞) (fun y : E => η y ^ 2) := hη.pow 2 |
| 477 | have h_diffQuot_u : |
| 478 | ContDiff ℝ (⊤ : ℕ∞) |
| 479 | (Poincare.Analysis.Sobolev.diffQuot k h u) := |
| 480 | contDiff_diffQuot_of_contDiff (d := d) hu k hh |
| 481 | exact h_eta_sq.mul h_diffQuot_u |
| 482 | rw [fderiv_diffQuot_apply_eq_diffQuot_partial (d := d) hg_smooth k j hnh x] |
| 483 | have h_pointwise : |
| 484 | (fun y : E => |
| 485 | (fderiv ℝ |
| 486 | (fun z : E => η z ^ 2 * |
| 487 | Poincare.Analysis.Sobolev.diffQuot k h u z) y) |
| 488 | (EuclideanSpace.single j 1)) = |
| 489 | fun y : E => |
| 490 | 2 * η y * ((fderiv ℝ η y) (EuclideanSpace.single j 1)) * |
| 491 | Poincare.Analysis.Sobolev.diffQuot k h u y + |
| 492 | η y ^ 2 * |
| 493 | Poincare.Analysis.Sobolev.diffQuot k h |
| 494 | (fun z : E => |
| 495 | (fderiv ℝ u z) (EuclideanSpace.single j 1)) y := by |
| 496 | funext y |
| 497 | exact fderiv_eta_sq_times_diffQuot_apply (d := d) hη hu k j hh y |
| 498 | rw [h_pointwise] |
| 499 | |
| 500 | example {η u : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 501 | (k : Fin d) : |
| 502 | ContDiff ℝ (⊤ : ℕ∞) (nirenbergTestFunction k 1 η u) := |
| 503 | contDiff_nirenbergTestFunction hη hu k one_ne_zero |
| 504 | |
| 505 | example {η : E → ℝ} (hη_supp : HasCompactSupport η) (u : E → ℝ) |
| 506 | (k : Fin d) (h : ℝ) : |
| 507 | HasCompactSupport (nirenbergTestFunction k h η u) := |
| 508 | hasCompactSupport_nirenbergTestFunction hη_supp k h |
| 509 | |
| 510 | end Poincare.Analysis.Sobolev.NirenbergTestFunction |