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/MasterInequality/CrossBoundsPointwiseProductBounds.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.Smooth.Coercivity |
| 13 | |
| 14 | |
| 15 | /-! |
| 16 | # Local elliptic energy estimates |
| 17 | |
| 18 | Adapted from Chow--Liao--Qin, `Analysis/Sobolev/Nirenberg/MasterInequality/CrossBoundsPointwiseProductBounds.lean`, |
| 19 | revision `1b535dd102b94cc42b107cca27059687888f08b3`. |
| 20 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 21 | The adaptation changes imports and namespaces and uses smooth cutoffs. |
| 22 | -/ |
| 23 | |
| 24 | noncomputable section |
| 25 | |
| 26 | open MeasureTheory Metric Filter Topology Set Function |
| 27 | open Poincare.Analysis.Sobolev |
| 28 | open Poincare.Analysis.Sobolev.NirenbergEuclidean |
| 29 | open Poincare.Analysis.Sobolev.NirenbergTestFunction |
| 30 | open Poincare.Analysis.Sobolev.NirenbergSubstitution |
| 31 | open Poincare.Analysis.Sobolev.NirenbergCoercivity |
| 32 | open scoped ENNReal NNReal Convolution Pointwise BigOperators InnerProductSpace |
| 33 | |
| 34 | namespace Poincare.Analysis.Sobolev.NirenbergCrossBounds |
| 35 | |
| 36 | variable {d : ℕ} [NeZero d] |
| 37 | |
| 38 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 39 | |
| 40 | omit [NeZero d] in |
| 41 | private theorem abs_diffQuot_le_of_bound |
| 42 | {g : E → ℝ} (hg : ContDiff ℝ 1 g) (k : Fin d) (h : ℝ) |
| 43 | {x : E} {M : ℝ} |
| 44 | (hM : ∀ y ∈ Metric.cthickening |h| ({x} : Set E), |
| 45 | |(fderiv ℝ g y) (EuclideanSpace.single k 1)| ≤ M) : |
| 46 | |diffQuot k h g x| ≤ M := by |
| 47 | by_cases hh : h = 0 |
| 48 | · subst hh |
| 49 | rw [diffQuot_zero_h] |
| 50 | have hx0 : x ∈ Metric.cthickening |0| ({x} : Set E) := by |
| 51 | have : x ∈ ({x} : Set E) := rfl |
| 52 | exact self_subset_cthickening _ this |
| 53 | have hM0 : 0 ≤ M := le_trans (abs_nonneg _) (hM x hx0) |
| 54 | simp only [Pi.zero_apply, abs_zero] |
| 55 | exact hM0 |
| 56 | set e : E := EuclideanSpace.single k (1 : ℝ) with he |
| 57 | have hFTC := diffQuot_eq_integral_partialDeriv (d := d) hg k hh x |
| 58 | rw [hFTC] |
| 59 | have hpt : ∀ s : ℝ, s ∈ Set.Ioc (0 : ℝ) 1 → |
| 60 | |(fderiv ℝ g (x + (s * h) • e)) e| ≤ M := by |
| 61 | intro s hs |
| 62 | have hin : x + (s * h) • e ∈ Metric.cthickening |h| ({x} : Set E) := by |
| 63 | refine Metric.mem_cthickening_of_dist_le _ x |h| ({x} : Set E) rfl ?_ |
| 64 | have hsing_norm : ‖(EuclideanSpace.single k (1 : ℝ) : E)‖ = 1 := by simp |
| 65 | have hdist_eq : |
| 66 | dist (x + (s * h) • e) x = |s * h| := by |
| 67 | rw [dist_eq_norm] |
| 68 | change ‖(x + (s * h) • e) - x‖ = |s * h| |
| 69 | rw [add_sub_cancel_left, norm_smul, hsing_norm, mul_one, |
| 70 | Real.norm_eq_abs] |
| 71 | rw [hdist_eq] |
| 72 | have hs_nn : 0 ≤ s := le_of_lt hs.1 |
| 73 | have hs_le_one : s ≤ 1 := hs.2 |
| 74 | have habs_eq : |s * h| = s * |h| := by |
| 75 | rw [abs_mul, abs_of_nonneg hs_nn] |
| 76 | rw [habs_eq] |
| 77 | have habs_h_nn : 0 ≤ |h| := abs_nonneg h |
| 78 | calc s * |h| ≤ 1 * |h| := |
| 79 | mul_le_mul_of_nonneg_right hs_le_one habs_h_nn |
| 80 | _ = |h| := one_mul _ |
| 81 | exact hM _ hin |
| 82 | have hint_cont : Continuous (fun s : ℝ => |
| 83 | (fderiv ℝ g (x + (s * h) • e)) e) := by |
| 84 | have hfd_cont : Continuous (fun y : E => fderiv ℝ g y) := |
| 85 | hg.continuous_fderiv one_ne_zero |
| 86 | have hgamma_cont : Continuous (fun s : ℝ => x + (s * h) • e) := |
| 87 | continuous_const.add |
| 88 | ((continuous_id.mul continuous_const).smul continuous_const) |
| 89 | exact (hfd_cont.comp hgamma_cont).clm_apply continuous_const |
| 90 | have hint_M : ∀ s : ℝ, s ∈ Set.Ioc (0 : ℝ) 1 → 0 ≤ M := |
| 91 | fun s hs => le_trans (abs_nonneg _) (hpt s hs) |
| 92 | have h1 : 0 ∈ Set.Ioc (0 : ℝ) 1 ∨ ¬ (0 : ℝ) ∈ Set.Ioc (0 : ℝ) 1 := em _ |
| 93 | have hM_nonneg : 0 ≤ M := by |
| 94 | have hs1 : (1 : ℝ) ∈ Set.Ioc (0 : ℝ) 1 := ⟨zero_lt_one, le_refl _⟩ |
| 95 | exact hint_M 1 hs1 |
| 96 | have h_int : |
| 97 | Integrable (fun s : ℝ => (fderiv ℝ g (x + (s * h) • e)) e) |
| 98 | ((volume : Measure ℝ).restrict (Set.Ioc (0 : ℝ) 1)) := |
| 99 | hint_cont.integrableOn_Ioc (a := 0) (b := 1) |
| 100 | have h_int_abs : |
| 101 | Integrable (fun s : ℝ => |(fderiv ℝ g (x + (s * h) • e)) e|) |
| 102 | ((volume : Measure ℝ).restrict (Set.Ioc (0 : ℝ) 1)) := |
| 103 | h_int.abs |
| 104 | have h_int_const : |
| 105 | Integrable (fun _ : ℝ => M) |
| 106 | ((volume : Measure ℝ).restrict (Set.Ioc (0 : ℝ) 1)) := by |
| 107 | have h_cont_M : Continuous (fun _ : ℝ => M) := continuous_const |
| 108 | exact h_cont_M.integrableOn_Ioc (a := 0) (b := 1) |
| 109 | have h_tri : |
| 110 | |∫ s in Set.Ioc (0 : ℝ) 1, (fderiv ℝ g (x + (s * h) • e)) e| ≤ |
| 111 | ∫ s in Set.Ioc (0 : ℝ) 1, |(fderiv ℝ g (x + (s * h) • e)) e| := by |
| 112 | exact abs_integral_le_integral_abs (μ := (volume : Measure ℝ).restrict _) |
| 113 | have h_mono : |
| 114 | ∫ s in Set.Ioc (0 : ℝ) 1, |(fderiv ℝ g (x + (s * h) • e)) e| ≤ |
| 115 | ∫ _s in Set.Ioc (0 : ℝ) 1, M := by |
| 116 | refine integral_mono_ae h_int_abs h_int_const ?_ |
| 117 | refine ae_restrict_iff_subtype measurableSet_Ioc |>.mpr ?_ |
| 118 | refine Filter.Eventually.of_forall ?_ |
| 119 | intro ⟨s, hs⟩ |
| 120 | exact hpt s hs |
| 121 | have h_const_int : |
| 122 | ∫ _s in Set.Ioc (0 : ℝ) 1, M = M := by |
| 123 | rw [integral_const, Measure.real, Measure.restrict_apply MeasurableSet.univ] |
| 124 | simp [Real.volume_Ioc] |
| 125 | rw [h_const_int] at h_mono |
| 126 | exact le_trans h_tri h_mono |
| 127 | |
| 128 | omit [NeZero d] in |
| 129 | theorem abs_diffQuot_a_le_of_bound_on_set |
| 130 | {a : E → ℝ} (ha : ContDiff ℝ 1 a) (k : Fin d) (h : ℝ) |
| 131 | {K : Set E} {M : ℝ} |
| 132 | (hM : ∀ y ∈ K, |(fderiv ℝ a y) (EuclideanSpace.single k 1)| ≤ M) |
| 133 | {x : E} (hx : Metric.cthickening |h| ({x} : Set E) ⊆ K) : |
| 134 | |diffQuot k h a x| ≤ M := by |
| 135 | refine abs_diffQuot_le_of_bound (d := d) ha k h ?_ |
| 136 | intro y hy |
| 137 | exact hM y (hx hy) |
| 138 | |
| 139 | omit [NeZero d] in |
| 140 | private theorem abs_translate_le_of_bound_on_set |
| 141 | {a : E → ℝ} (k : Fin d) (h : ℝ) |
| 142 | {K : Set E} {M : ℝ} |
| 143 | (hM : ∀ y ∈ K, |a y| ≤ M) |
| 144 | {x : E} (hx : x + h • EuclideanSpace.single k 1 ∈ K) : |
| 145 | |translate k h a x| ≤ M := by |
| 146 | unfold translate |
| 147 | exact hM _ hx |
| 148 | |
| 149 | omit [NeZero d] in |
| 150 | private theorem shift_in_omega' |
| 151 | (η : E → ℝ) (k : Fin d) {h h₀ : ℝ} |
| 152 | {Ω' : Set E} |
| 153 | (hh_supp_in_Ω' : Metric.cthickening h₀ (tsupport η) ⊆ Ω') |
| 154 | (h_abs : |h| ≤ h₀) |
| 155 | {x : E} (hx : x ∈ tsupport η) : |
| 156 | x + h • EuclideanSpace.single k 1 ∈ Ω' := by |
| 157 | refine hh_supp_in_Ω' ?_ |
| 158 | refine Metric.mem_cthickening_of_dist_le _ x h₀ (tsupport η) hx ?_ |
| 159 | have hsing_norm : ‖(EuclideanSpace.single k (1 : ℝ) : E)‖ = 1 := by simp |
| 160 | have hdist_eq : |
| 161 | dist (x + h • EuclideanSpace.single k 1) x = |h| := by |
| 162 | rw [dist_eq_norm, add_sub_cancel_left, norm_smul, hsing_norm, mul_one, |
| 163 | Real.norm_eq_abs] |
| 164 | rw [hdist_eq] |
| 165 | exact h_abs |
| 166 | |
| 167 | omit [NeZero d] in |
| 168 | theorem singleton_cthick_subset |
| 169 | (η : E → ℝ) {h h₀ : ℝ} |
| 170 | {Ω' : Set E} |
| 171 | (hh_supp_in_Ω' : Metric.cthickening h₀ (tsupport η) ⊆ Ω') |
| 172 | (h_abs : |h| ≤ h₀) |
| 173 | {x : E} (hx : x ∈ tsupport η) : |
| 174 | Metric.cthickening |h| ({x} : Set E) ⊆ Ω' := by |
| 175 | intro y hy |
| 176 | rw [Metric.mem_cthickening_iff] at hy |
| 177 | refine hh_supp_in_Ω' ?_ |
| 178 | rw [Metric.mem_cthickening_iff] |
| 179 | have hsub : ({x} : Set E) ⊆ tsupport η := by |
| 180 | intro z hz |
| 181 | rw [Set.mem_singleton_iff] at hz |
| 182 | rw [hz]; exact hx |
| 183 | have h_anti : Metric.infEDist y (tsupport η) ≤ Metric.infEDist y ({x} : Set E) := |
| 184 | Metric.infEDist_anti hsub |
| 185 | refine le_trans h_anti ?_ |
| 186 | refine le_trans hy ?_ |
| 187 | exact_mod_cast ENNReal.ofReal_le_ofReal h_abs |
| 188 | |
| 189 | lemma two_abs_mul_le_eps_sq_add (a b ε : ℝ) (hε : 0 < ε) : |
| 190 | 2 * |a| * |b| ≤ ε * a^2 + (1/ε) * b^2 := by |
| 191 | have hsqrt_pos : 0 < Real.sqrt ε := Real.sqrt_pos.mpr hε |
| 192 | have hsqrt_ne : Real.sqrt ε ≠ 0 := ne_of_gt hsqrt_pos |
| 193 | set u : ℝ := Real.sqrt ε * |a| |
| 194 | set v : ℝ := |b| / Real.sqrt ε |
| 195 | have huv : 2 * u * v = 2 * |a| * |b| := by |
| 196 | change 2 * (Real.sqrt ε * |a|) * (|b| / Real.sqrt ε) = 2 * |a| * |b| |
| 197 | field_simp |
| 198 | have hu_sq : u^2 = ε * a^2 := by |
| 199 | change (Real.sqrt ε * |a|)^2 = ε * a^2 |
| 200 | rw [mul_pow, Real.sq_sqrt hε.le, sq_abs] |
| 201 | have hv_sq : v^2 = (1/ε) * b^2 := by |
| 202 | change (|b| / Real.sqrt ε)^2 = (1/ε) * b^2 |
| 203 | rw [div_pow, Real.sq_sqrt hε.le, sq_abs] |
| 204 | field_simp |
| 205 | calc 2 * |a| * |b| = 2 * u * v := huv.symm |
| 206 | _ ≤ u^2 + v^2 := two_mul_le_add_sq u v |
| 207 | _ = ε * a^2 + (1/ε) * b^2 := by rw [hu_sq, hv_sq] |
| 208 | |
| 209 | theorem translated_coeff_cutoff_gradient_pointwise_bound |
| 210 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 211 | {u : E → ℝ} (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 212 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 213 | (hη_range : Set.range η ⊆ Set.Icc (0 : ℝ) 1) |
| 214 | {N : ℝ} (h_fderiv_eta : ∀ x : E, ‖fderiv ℝ η x‖ ≤ N) |
| 215 | {Ω' : Set E} {Λ : ℝ} |
| 216 | (h_Λ : ∀ i j : Fin d, ∀ x ∈ closure Ω', |B.a x i j| ≤ Λ) |
| 217 | (i j k : Fin d) {h : ℝ} |
| 218 | (hh_supp_in_Ω' : Metric.cthickening |h| (tsupport η) ⊆ Ω') |
| 219 | {ε : ℝ} (hε : 0 < ε) (x : E) : |
| 220 | |2 * translate k h (fun y => B.a y i j) x * (η x) * |
| 221 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 222 | diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 223 | diffQuot k h u x| ≤ |
| 224 | ε * (η x)^2 * |
| 225 | (diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x)^2 + |
| 226 | (1/ε) * Λ^2 * N^2 * |
| 227 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 228 | (diffQuot k h u x)^2 := by |
| 229 | let _ := hu |
| 230 | let _ := hη |
| 231 | by_cases hx : x ∈ tsupport η |
| 232 | · have h_shift_in : x + h • EuclideanSpace.single k 1 ∈ closure Ω' := by |
| 233 | have h_shift_in_Ω' : x + h • EuclideanSpace.single k 1 ∈ Ω' := |
| 234 | shift_in_omega' (d := d) η k hh_supp_in_Ω' (le_refl _) hx |
| 235 | exact subset_closure h_shift_in_Ω' |
| 236 | have h_τa_bound : |translate k h (fun y => B.a y i j) x| ≤ Λ := by |
| 237 | unfold translate |
| 238 | exact h_Λ i j _ h_shift_in |
| 239 | have h_dη_bound : |(fderiv ℝ η x) (EuclideanSpace.single j 1)| ≤ N := by |
| 240 | have hsing_norm : |
| 241 | ‖(EuclideanSpace.single j (1 : ℝ) : E)‖ = 1 := by simp |
| 242 | have h_apply : |
| 243 | ‖(fderiv ℝ η x) (EuclideanSpace.single j 1)‖ ≤ |
| 244 | ‖fderiv ℝ η x‖ * ‖(EuclideanSpace.single j (1 : ℝ) : E)‖ := |
| 245 | (fderiv ℝ η x).le_opNorm _ |
| 246 | rw [hsing_norm, mul_one] at h_apply |
| 247 | have h2 : ‖(fderiv ℝ η x) (EuclideanSpace.single j 1)‖ ≤ N := |
| 248 | h_apply.trans (h_fderiv_eta x) |
| 249 | rw [Real.norm_eq_abs] at h2 |
| 250 | exact h2 |
| 251 | have h_η_abs : |η x| ≤ 1 := by |
| 252 | have h_in : η x ∈ Set.Icc (0 : ℝ) 1 := hη_range ⟨x, rfl⟩ |
| 253 | have h0 : 0 ≤ η x := h_in.1 |
| 254 | have h1 : η x ≤ 1 := h_in.2 |
| 255 | rw [abs_of_nonneg h0]; exact h1 |
| 256 | have h_η_nn : 0 ≤ η x := (hη_range ⟨x, rfl⟩).1 |
| 257 | set A : ℝ := η x * |
| 258 | diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x |
| 259 | set B' : ℝ := translate k h (fun y => B.a y i j) x * |
| 260 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 261 | diffQuot k h u x |
| 262 | have h_eq_lhs : |
| 263 | |2 * translate k h (fun y => B.a y i j) x * (η x) * |
| 264 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 265 | diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 266 | diffQuot k h u x| = |
| 267 | 2 * |A| * |B'| := by |
| 268 | have hRHS : |
| 269 | (η x) * |
| 270 | (diffQuot k h |
| 271 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x) * |
| 272 | (translate k h (fun y => B.a y i j) x * |
| 273 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 274 | diffQuot k h u x) = |
| 275 | translate k h (fun y => B.a y i j) x * (η x) * |
| 276 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 277 | diffQuot k h |
| 278 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 279 | diffQuot k h u x := by ring |
| 280 | have h_AB' : A * B' = |
| 281 | translate k h (fun y => B.a y i j) x * (η x) * |
| 282 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 283 | diffQuot k h |
| 284 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 285 | diffQuot k h u x := by |
| 286 | change (η x) * _ * (translate k h _ x * _ * diffQuot k h u x) = _ |
| 287 | exact hRHS |
| 288 | have h_2AB' : 2 * A * B' = |
| 289 | 2 * translate k h (fun y => B.a y i j) x * (η x) * |
| 290 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 291 | diffQuot k h |
| 292 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 293 | diffQuot k h u x := by |
| 294 | have : 2 * (A * B') = 2 * |
| 295 | (translate k h (fun y => B.a y i j) x * (η x) * |
| 296 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 297 | diffQuot k h |
| 298 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 299 | diffQuot k h u x) := by rw [h_AB'] |
| 300 | linarith |
| 301 | rw [← h_2AB'] |
| 302 | rw [show |2 * A * B'| = 2 * |A| * |B'| by |
| 303 | rw [show (2 * A * B') = 2 * (A * B') by ring, abs_mul, abs_of_pos (by norm_num : (0:ℝ) < 2), |
| 304 | abs_mul] |
| 305 | ring] |
| 306 | rw [h_eq_lhs] |
| 307 | have h_young := two_abs_mul_le_eps_sq_add A B' ε hε |
| 308 | refine h_young.trans ?_ |
| 309 | have hA_sq : A^2 = (η x)^2 * |
| 310 | (diffQuot k h |
| 311 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x)^2 := by |
| 312 | change ((η x) * _)^2 = _ |
| 313 | ring |
| 314 | have hB'_sq_le : B'^2 ≤ Λ^2 * N^2 * |
| 315 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 316 | (diffQuot k h u x)^2 := by |
| 317 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 1 := by |
| 318 | rw [Set.indicator_of_mem hx] |
| 319 | rw [h_indicator] |
| 320 | change (translate k h (fun y => B.a y i j) x * |
| 321 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 322 | diffQuot k h u x)^2 ≤ _ |
| 323 | have h_τa_sq_le : (translate k h (fun y => B.a y i j) x)^2 ≤ Λ^2 := by |
| 324 | rw [← sq_abs]; exact pow_le_pow_left₀ (abs_nonneg _) h_τa_bound 2 |
| 325 | have h_dη_sq_le : ((fderiv ℝ η x) (EuclideanSpace.single j 1))^2 ≤ N^2 := by |
| 326 | rw [← sq_abs]; exact pow_le_pow_left₀ (abs_nonneg _) h_dη_bound 2 |
| 327 | have hΛ_nn : 0 ≤ Λ := by |
| 328 | have h_x_in_Ω' : x ∈ Ω' := |
| 329 | hh_supp_in_Ω' (self_subset_cthickening _ hx) |
| 330 | have h_x_in : x ∈ closure Ω' := subset_closure h_x_in_Ω' |
| 331 | exact le_trans (abs_nonneg _) (h_Λ i j x h_x_in) |
| 332 | have hN_nn : 0 ≤ N := le_trans (norm_nonneg _) (h_fderiv_eta x) |
| 333 | have hΛ_sq_nn : 0 ≤ Λ^2 := sq_nonneg _ |
| 334 | have hN_sq_nn : 0 ≤ N^2 := sq_nonneg _ |
| 335 | have h_dq_sq_nn : 0 ≤ (diffQuot k h u x)^2 := sq_nonneg _ |
| 336 | have h_τa_sq_nn : 0 ≤ (translate k h (fun y => B.a y i j) x)^2 := sq_nonneg _ |
| 337 | have h_dη_sq_nn : 0 ≤ ((fderiv ℝ η x) (EuclideanSpace.single j 1))^2 := sq_nonneg _ |
| 338 | have h_step1 : (translate k h (fun y => B.a y i j) x)^2 * |
| 339 | ((fderiv ℝ η x) (EuclideanSpace.single j 1))^2 * |
| 340 | (diffQuot k h u x)^2 ≤ |
| 341 | Λ^2 * N^2 * (diffQuot k h u x)^2 := by |
| 342 | have h_first : |
| 343 | (translate k h (fun y => B.a y i j) x)^2 * |
| 344 | ((fderiv ℝ η x) (EuclideanSpace.single j 1))^2 ≤ Λ^2 * N^2 := by |
| 345 | have hac := mul_le_mul h_τa_sq_le h_dη_sq_le h_dη_sq_nn hΛ_sq_nn |
| 346 | exact hac |
| 347 | exact mul_le_mul_of_nonneg_right h_first h_dq_sq_nn |
| 348 | calc (translate k h (fun y => B.a y i j) x * |
| 349 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 350 | diffQuot k h u x)^2 |
| 351 | = (translate k h (fun y => B.a y i j) x)^2 * |
| 352 | ((fderiv ℝ η x) (EuclideanSpace.single j 1))^2 * |
| 353 | (diffQuot k h u x)^2 := by ring |
| 354 | _ ≤ Λ^2 * N^2 * (diffQuot k h u x)^2 := h_step1 |
| 355 | _ = Λ^2 * N^2 * 1 * (diffQuot k h u x)^2 := by rw [mul_one] |
| 356 | have hε_pos : 0 < (1 : ℝ) / ε := one_div_pos.mpr hε |
| 357 | have h_step : |
| 358 | (1/ε) * B'^2 ≤ (1/ε) * (Λ^2 * N^2 * |
| 359 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 360 | (diffQuot k h u x)^2) := |
| 361 | mul_le_mul_of_nonneg_left hB'_sq_le hε_pos.le |
| 362 | calc ε * A^2 + (1/ε) * B'^2 |
| 363 | ≤ ε * A^2 + (1/ε) * (Λ^2 * N^2 * |
| 364 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 365 | (diffQuot k h u x)^2) := by |
| 366 | linarith |
| 367 | _ = ε * (η x)^2 * |
| 368 | (diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x)^2 + |
| 369 | (1/ε) * Λ^2 * N^2 * |
| 370 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 371 | (diffQuot k h u x)^2 := by |
| 372 | rw [hA_sq]; ring |
| 373 | · have h_η_zero : η x = 0 := image_eq_zero_of_notMem_tsupport hx |
| 374 | have h_LHS_zero : 2 * translate k h (fun y => B.a y i j) x * (η x) * |
| 375 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 376 | diffQuot k h |
| 377 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x * |
| 378 | diffQuot k h u x = 0 := by |
| 379 | rw [h_η_zero]; ring |
| 380 | rw [h_LHS_zero, abs_zero] |
| 381 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 0 := |
| 382 | Set.indicator_of_notMem hx _ |
| 383 | have h_t1_nn : 0 ≤ ε * (η x)^2 * |
| 384 | (diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single i 1)) x)^2 := by |
| 385 | apply mul_nonneg |
| 386 | · apply mul_nonneg hε.le (sq_nonneg _) |
| 387 | · exact sq_nonneg _ |
| 388 | have h_t2_zero : (1/ε) * Λ^2 * N^2 * |
| 389 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 390 | (diffQuot k h u x)^2 = 0 := by |
| 391 | rw [h_indicator]; ring |
| 392 | linarith |
| 393 | |
| 394 | |
| 395 | theorem diffQuot_coeff_cutoff_squared_pointwise_bound |
| 396 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 397 | {u : E → ℝ} |
| 398 | {η : E → ℝ} |
| 399 | (hη_range : Set.range η ⊆ Set.Icc (0 : ℝ) 1) |
| 400 | (i j k : Fin d) |
| 401 | {Ω' : Set E} {M : ℝ} (hM_nn : 0 ≤ M) |
| 402 | (h_M : ∀ i j : Fin d, ∀ x ∈ closure Ω', |
| 403 | |(fderiv ℝ (fun y : E => B.a y i j) x) (EuclideanSpace.single k 1)| ≤ M) |
| 404 | {h : ℝ} |
| 405 | (hh_supp_in_Ω' : Metric.cthickening |h| (tsupport η) ⊆ Ω') |
| 406 | {ε : ℝ} (hε : 0 < ε) (x : E) : |
| 407 | |diffQuot k h (fun y => B.a y i j) x * (η x)^2 * |
| 408 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 409 | diffQuot k h |
| 410 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x| ≤ |
| 411 | ε * (η x)^2 * |
| 412 | (diffQuot k h |
| 413 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x)^2 + |
| 414 | (M^2 / (4 * ε)) * (η x)^2 * |
| 415 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 416 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 := by |
| 417 | classical |
| 418 | by_cases hx : x ∈ tsupport η |
| 419 | · have h_dq_a_bound : |diffQuot k h (fun y => B.a y i j) x| ≤ M := |
| 420 | abs_diffQuot_a_le_of_bound_on_set (d := d) (B.contDiff_a i j |>.of_le (by norm_cast)) k h |
| 421 | (h_M i j) ((singleton_cthick_subset (d := d) η hh_supp_in_Ω' (le_refl _) hx).trans |
| 422 | subset_closure) |
| 423 | have h_η_in : η x ∈ Set.Icc (0 : ℝ) 1 := hη_range ⟨x, rfl⟩ |
| 424 | have h_η_nn : 0 ≤ η x := h_η_in.1 |
| 425 | have h_η_le : η x ≤ 1 := h_η_in.2 |
| 426 | have h_η_sq_nn : 0 ≤ (η x)^2 := sq_nonneg _ |
| 427 | set A : ℝ := η x * |
| 428 | diffQuot k h (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x with hA_def |
| 429 | set B' : ℝ := M * η x * |
| 430 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) with hB'_def |
| 431 | have h2ε_pos : 0 < 2 * ε := by linarith |
| 432 | have h_young := two_abs_mul_le_eps_sq_add A B' (2 * ε) h2ε_pos |
| 433 | have h_AB_abs : |A * B'| ≤ ε * A^2 + (1/(4*ε)) * B'^2 := by |
| 434 | have h1 : |A * B'| = |A| * |B'| := abs_mul A B' |
| 435 | have h_double : 2 * (ε * A^2 + (1/(4*ε)) * B'^2) = |
| 436 | 2 * ε * A^2 + (1/(2*ε)) * B'^2 := by |
| 437 | field_simp |
| 438 | ring |
| 439 | have h_ε_ne : ε ≠ 0 := ne_of_gt hε |
| 440 | linarith [h_young, h_double] |
| 441 | have h_lhs_bound : |
| 442 | |diffQuot k h (fun y => B.a y i j) x * (η x)^2 * |
| 443 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 444 | diffQuot k h |
| 445 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x| ≤ |
| 446 | |A * B'| := by |
| 447 | have h_lhs_abs_eq : |diffQuot k h (fun y => B.a y i j) x * (η x)^2 * |
| 448 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 449 | diffQuot k h |
| 450 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x| = |
| 451 | |diffQuot k h (fun y => B.a y i j) x| * (η x)^2 * |
| 452 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 453 | |diffQuot k h |
| 454 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x| := by |
| 455 | rw [abs_mul, abs_mul, abs_mul] |
| 456 | rw [show |(η x)^2| = (η x)^2 from abs_of_nonneg h_η_sq_nn] |
| 457 | have h_AB_abs_eq : |A * B'| = |
| 458 | M * (η x)^2 * |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 459 | |diffQuot k h |
| 460 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x| := by |
| 461 | change |(η x * _) * (M * η x * _)| = _ |
| 462 | rw [show η x * diffQuot k h |
| 463 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x * |
| 464 | (M * η x * (fderiv ℝ u x) (EuclideanSpace.single i 1)) = |
| 465 | M * (η x)^2 * (fderiv ℝ u x) (EuclideanSpace.single i 1) * |
| 466 | diffQuot k h |
| 467 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x from by |
| 468 | rw [sq]; ring] |
| 469 | rw [abs_mul, abs_mul, abs_mul] |
| 470 | rw [abs_of_nonneg hM_nn, abs_of_nonneg h_η_sq_nn] |
| 471 | rw [h_lhs_abs_eq, h_AB_abs_eq] |
| 472 | refine mul_le_mul_of_nonneg_right ?_ (abs_nonneg _) |
| 473 | refine mul_le_mul_of_nonneg_right ?_ (abs_nonneg _) |
| 474 | exact mul_le_mul_of_nonneg_right h_dq_a_bound h_η_sq_nn |
| 475 | refine h_lhs_bound.trans ?_ |
| 476 | refine h_AB_abs.trans ?_ |
| 477 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 1 := by |
| 478 | rw [Set.indicator_of_mem hx] |
| 479 | rw [h_indicator] |
| 480 | have hA_sq : A^2 = (η x)^2 * |
| 481 | (diffQuot k h |
| 482 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x)^2 := by |
| 483 | change (η x * _)^2 = _; ring |
| 484 | have hB'_sq_le : B'^2 ≤ M^2 * (η x)^2 * |
| 485 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 := by |
| 486 | change (M * η x * _)^2 ≤ _; nlinarith |
| 487 | have h_4ε_pos : 0 < 4 * ε := by linarith |
| 488 | have h_4ε_ne : (4 * ε) ≠ 0 := ne_of_gt h_4ε_pos |
| 489 | have h_inv_4ε_nn : 0 ≤ 1 / (4 * ε) := |
| 490 | one_div_nonneg.mpr (by linarith) |
| 491 | have h_step : |
| 492 | (1/(4*ε)) * B'^2 ≤ (1/(4*ε)) * (M^2 * (η x)^2 * |
| 493 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2) := |
| 494 | mul_le_mul_of_nonneg_left hB'_sq_le h_inv_4ε_nn |
| 495 | calc ε * A^2 + (1/(4*ε)) * B'^2 |
| 496 | ≤ ε * A^2 + (1/(4*ε)) * |
| 497 | (M^2 * (η x)^2 * |
| 498 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2) := by linarith |
| 499 | _ = ε * (η x)^2 * |
| 500 | (diffQuot k h |
| 501 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x)^2 + |
| 502 | (M^2 / (4 * ε)) * (η x)^2 * 1 * |
| 503 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 := by |
| 504 | rw [hA_sq] |
| 505 | have h_div_eq : 1 / (4 * ε) * (M^2 * (η x)^2 * |
| 506 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2) = |
| 507 | M^2 / (4 * ε) * (η x)^2 * 1 * |
| 508 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 := by |
| 509 | field_simp |
| 510 | linarith [h_div_eq] |
| 511 | · have h_η_zero : η x = 0 := image_eq_zero_of_notMem_tsupport hx |
| 512 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 0 := |
| 513 | Set.indicator_of_notMem hx _ |
| 514 | rw [h_indicator] |
| 515 | have h_lhs_zero : diffQuot k h (fun y => B.a y i j) x * (η x)^2 * |
| 516 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 517 | diffQuot k h |
| 518 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x = 0 := by |
| 519 | rw [h_η_zero]; ring |
| 520 | rw [h_lhs_zero, abs_zero] |
| 521 | have h_t1_nn : 0 ≤ ε * (η x)^2 * |
| 522 | (diffQuot k h |
| 523 | (fun y => (fderiv ℝ u y) (EuclideanSpace.single j 1)) x)^2 := by |
| 524 | apply mul_nonneg |
| 525 | · apply mul_nonneg hε.le (sq_nonneg _) |
| 526 | · exact sq_nonneg _ |
| 527 | have h_t2_zero : (M^2 / (4 * ε)) * (η x)^2 * 0 * |
| 528 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 = 0 := by ring |
| 529 | linarith |
| 530 | |
| 531 | theorem diffQuot_coeff_cutoff_gradient_pointwise_bound |
| 532 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 533 | {u : E → ℝ} |
| 534 | {η : E → ℝ} |
| 535 | (hη_range : Set.range η ⊆ Set.Icc (0 : ℝ) 1) |
| 536 | {N : ℝ} (h_fderiv_eta : ∀ x : E, ‖fderiv ℝ η x‖ ≤ N) |
| 537 | (i j k : Fin d) |
| 538 | {Ω' : Set E} {M : ℝ} (hM_nn : 0 ≤ M) |
| 539 | (h_M : ∀ i j : Fin d, ∀ x ∈ closure Ω', |
| 540 | |(fderiv ℝ (fun y : E => B.a y i j) x) (EuclideanSpace.single k 1)| ≤ M) |
| 541 | {h : ℝ} |
| 542 | (hh_supp_in_Ω' : Metric.cthickening |h| (tsupport η) ⊆ Ω') (x : E) : |
| 543 | |2 * diffQuot k h (fun y => B.a y i j) x * (η x) * |
| 544 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 545 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 546 | diffQuot k h u x| ≤ |
| 547 | M * N * |
| 548 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 549 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + |
| 550 | M * N * |
| 551 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 552 | (diffQuot k h u x)^2 := by |
| 553 | classical |
| 554 | by_cases hx : x ∈ tsupport η |
| 555 | · have h_dq_a_bound : |diffQuot k h (fun y => B.a y i j) x| ≤ M := by |
| 556 | have hCD : ContDiff ℝ 1 (fun y : E => B.a y i j) := |
| 557 | (B.contDiff_a i j).of_le (by norm_cast) |
| 558 | exact abs_diffQuot_a_le_of_bound_on_set (d := d) hCD k h |
| 559 | (h_M i j) ((singleton_cthick_subset (d := d) η hh_supp_in_Ω' (le_refl _) hx).trans |
| 560 | subset_closure) |
| 561 | have h_dη_bound : |(fderiv ℝ η x) (EuclideanSpace.single j 1)| ≤ N := by |
| 562 | have hsing_norm : |
| 563 | ‖(EuclideanSpace.single j (1 : ℝ) : E)‖ = 1 := by simp |
| 564 | have h_apply : |
| 565 | ‖(fderiv ℝ η x) (EuclideanSpace.single j 1)‖ ≤ |
| 566 | ‖fderiv ℝ η x‖ * ‖(EuclideanSpace.single j (1 : ℝ) : E)‖ := |
| 567 | (fderiv ℝ η x).le_opNorm _ |
| 568 | rw [hsing_norm, mul_one] at h_apply |
| 569 | have h2 := h_apply.trans (h_fderiv_eta x) |
| 570 | rw [Real.norm_eq_abs] at h2 |
| 571 | exact h2 |
| 572 | have h_η_in : η x ∈ Set.Icc (0 : ℝ) 1 := hη_range ⟨x, rfl⟩ |
| 573 | have h_η_nn : 0 ≤ η x := h_η_in.1 |
| 574 | have h_η_le : η x ≤ 1 := h_η_in.2 |
| 575 | have hN_nn : 0 ≤ N := le_trans (norm_nonneg _) (h_fderiv_eta x) |
| 576 | have h_lhs_eq : |
| 577 | |2 * diffQuot k h (fun y => B.a y i j) x * (η x) * |
| 578 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 579 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 580 | diffQuot k h u x| = |
| 581 | 2 * |diffQuot k h (fun y => B.a y i j) x| * (η x) * |
| 582 | |(fderiv ℝ η x) (EuclideanSpace.single j 1)| * |
| 583 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 584 | |diffQuot k h u x| := by |
| 585 | rw [show (2 * diffQuot k h (fun y => B.a y i j) x * (η x) * |
| 586 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 587 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 588 | diffQuot k h u x) = |
| 589 | 2 * (diffQuot k h (fun y => B.a y i j) x * |
| 590 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 591 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 592 | diffQuot k h u x * η x) from by ring] |
| 593 | rw [abs_mul, abs_of_pos (by norm_num : (0:ℝ) < 2)] |
| 594 | rw [abs_mul, abs_mul, abs_mul, abs_mul] |
| 595 | rw [abs_of_nonneg h_η_nn] |
| 596 | ring |
| 597 | rw [h_lhs_eq] |
| 598 | have h_step1 : |
| 599 | 2 * |diffQuot k h (fun y => B.a y i j) x| * (η x) * |
| 600 | |(fderiv ℝ η x) (EuclideanSpace.single j 1)| * |
| 601 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 602 | |diffQuot k h u x| ≤ |
| 603 | 2 * M * (η x) * N * |
| 604 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 605 | |diffQuot k h u x| := by |
| 606 | have h_step1a : |
| 607 | 2 * |diffQuot k h (fun y => B.a y i j) x| ≤ 2 * M := by |
| 608 | linarith |
| 609 | have h_step1b : |
| 610 | 2 * |diffQuot k h (fun y => B.a y i j) x| * (η x) ≤ 2 * M * (η x) := |
| 611 | mul_le_mul_of_nonneg_right h_step1a h_η_nn |
| 612 | have h_step1c : |
| 613 | 2 * |diffQuot k h (fun y => B.a y i j) x| * (η x) * |
| 614 | |(fderiv ℝ η x) (EuclideanSpace.single j 1)| ≤ |
| 615 | 2 * M * (η x) * N := by |
| 616 | have h_step1c1 : 0 ≤ 2 * M * (η x) := |
| 617 | mul_nonneg (mul_nonneg (by linarith) hM_nn) h_η_nn |
| 618 | calc 2 * |diffQuot k h (fun y => B.a y i j) x| * (η x) * |
| 619 | |(fderiv ℝ η x) (EuclideanSpace.single j 1)| ≤ |
| 620 | 2 * M * (η x) * |
| 621 | |(fderiv ℝ η x) (EuclideanSpace.single j 1)| := by |
| 622 | exact mul_le_mul_of_nonneg_right h_step1b (abs_nonneg _) |
| 623 | _ ≤ 2 * M * (η x) * N := |
| 624 | mul_le_mul_of_nonneg_left h_dη_bound h_step1c1 |
| 625 | have h_step1c1 : 0 ≤ 2 * M * (η x) * N := |
| 626 | mul_nonneg (mul_nonneg (mul_nonneg (by linarith) hM_nn) h_η_nn) hN_nn |
| 627 | have h_intermediate : 2 * |diffQuot k h (fun y => B.a y i j) x| * (η x) * |
| 628 | |(fderiv ℝ η x) (EuclideanSpace.single j 1)| * |
| 629 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| ≤ |
| 630 | 2 * M * (η x) * N * |
| 631 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| := |
| 632 | mul_le_mul_of_nonneg_right h_step1c (abs_nonneg _) |
| 633 | exact mul_le_mul_of_nonneg_right h_intermediate (abs_nonneg _) |
| 634 | refine h_step1.trans ?_ |
| 635 | have h_young2 : 2 * |
| 636 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 637 | |diffQuot k h u x| ≤ |
| 638 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2 := by |
| 639 | have := two_abs_mul_le_eps_sq_add ((fderiv ℝ u x) (EuclideanSpace.single i 1)) |
| 640 | (diffQuot k h u x) 1 zero_lt_one |
| 641 | simp at this |
| 642 | linarith |
| 643 | have h_MN_η_nn : 0 ≤ M * (η x) * N := |
| 644 | mul_nonneg (mul_nonneg hM_nn h_η_nn) hN_nn |
| 645 | have h_step2 : |
| 646 | 2 * M * (η x) * N * |
| 647 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 648 | |diffQuot k h u x| ≤ |
| 649 | M * (η x) * N * |
| 650 | (((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2) := by |
| 651 | have h_eq : 2 * M * (η x) * N * |
| 652 | |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 653 | |diffQuot k h u x| = |
| 654 | M * (η x) * N * |
| 655 | (2 * |(fderiv ℝ u x) (EuclideanSpace.single i 1)| * |
| 656 | |diffQuot k h u x|) := by ring |
| 657 | rw [h_eq] |
| 658 | exact mul_le_mul_of_nonneg_left h_young2 h_MN_η_nn |
| 659 | refine h_step2.trans ?_ |
| 660 | have h_step3 : |
| 661 | M * (η x) * N * |
| 662 | (((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2) ≤ |
| 663 | M * N * |
| 664 | (((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2) := by |
| 665 | have h_M_η_N_le : M * (η x) * N ≤ M * 1 * N := by |
| 666 | refine mul_le_mul_of_nonneg_right ?_ hN_nn |
| 667 | exact mul_le_mul_of_nonneg_left h_η_le hM_nn |
| 668 | have h_M_N_eq : M * 1 * N = M * N := by ring |
| 669 | have h_fact_nn : 0 ≤ ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + |
| 670 | (diffQuot k h u x)^2 := by |
| 671 | exact add_nonneg (sq_nonneg _) (sq_nonneg _) |
| 672 | calc M * (η x) * N * |
| 673 | (((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2) ≤ |
| 674 | M * 1 * N * |
| 675 | (((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2) := |
| 676 | mul_le_mul_of_nonneg_right h_M_η_N_le h_fact_nn |
| 677 | _ = M * N * |
| 678 | (((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 + (diffQuot k h u x)^2) := by |
| 679 | rw [h_M_N_eq] |
| 680 | refine h_step3.trans ?_ |
| 681 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 1 := by |
| 682 | rw [Set.indicator_of_mem hx] |
| 683 | rw [h_indicator] |
| 684 | ring_nf |
| 685 | rfl |
| 686 | · have h_η_zero : η x = 0 := image_eq_zero_of_notMem_tsupport hx |
| 687 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 0 := |
| 688 | Set.indicator_of_notMem hx _ |
| 689 | have h_lhs_zero : 2 * diffQuot k h (fun y => B.a y i j) x * (η x) * |
| 690 | ((fderiv ℝ η x) (EuclideanSpace.single j 1)) * |
| 691 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 692 | diffQuot k h u x = 0 := by |
| 693 | rw [h_η_zero]; ring |
| 694 | rw [h_lhs_zero, abs_zero, h_indicator] |
| 695 | have h_t1 : M * N * 0 * |
| 696 | ((fderiv ℝ u x) (EuclideanSpace.single i 1))^2 = 0 := by ring |
| 697 | have h_t2 : M * N * 0 * (diffQuot k h u x)^2 = 0 := by ring |
| 698 | linarith |
| 699 | |
| 700 | omit [NeZero d] in |
| 701 | private lemma fderiv_eta_sq_diffQuot_apply |
| 702 | {u : E → ℝ} (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 703 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 704 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) (x : E) : |
| 705 | (fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 706 | (EuclideanSpace.single k 1) = |
| 707 | 2 * η x * ((fderiv ℝ η x) (EuclideanSpace.single k 1)) * |
| 708 | diffQuot k h u x + |
| 709 | η x ^ 2 * diffQuot k h |
| 710 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x := by |
| 711 | have h_apply := |
| 712 | Poincare.Analysis.Sobolev.NirenbergTestFunction.fderiv_eta_sq_times_diffQuot_apply |
| 713 | (d := d) hη hu k k hh x |
| 714 | exact h_apply |
| 715 | |
| 716 | omit [NeZero d] in |
| 717 | lemma fderiv_eta_sq_diffQuot_sq_bound |
| 718 | {u : E → ℝ} (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 719 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 720 | (hη_range : Set.range η ⊆ Set.Icc (0 : ℝ) 1) |
| 721 | {N : ℝ} (h_fderiv_eta : ∀ x : E, ‖fderiv ℝ η x‖ ≤ N) |
| 722 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) (x : E) : |
| 723 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 724 | (EuclideanSpace.single k 1))^2 ≤ |
| 725 | 8 * N^2 * |
| 726 | (Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x) * |
| 727 | (diffQuot k h u x)^2 + |
| 728 | 2 * (η x)^2 * |
| 729 | (diffQuot k h |
| 730 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2 := by |
| 731 | rw [fderiv_eta_sq_diffQuot_apply (d := d) hu hη k hh x] |
| 732 | set A : ℝ := 2 * η x * ((fderiv ℝ η x) (EuclideanSpace.single k 1)) * |
| 733 | diffQuot k h u x with hA_def |
| 734 | set B' : ℝ := η x ^ 2 * diffQuot k h |
| 735 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x with hB'_def |
| 736 | have h_AB_sq : (A + B')^2 ≤ 2 * A^2 + 2 * B'^2 := by nlinarith [sq_nonneg (A - B')] |
| 737 | refine h_AB_sq.trans ?_ |
| 738 | have hN_nn : 0 ≤ N := le_trans (norm_nonneg _) (h_fderiv_eta x) |
| 739 | have h_dη_bound : |(fderiv ℝ η x) (EuclideanSpace.single k 1)| ≤ N := by |
| 740 | have hsing_norm : |
| 741 | ‖(EuclideanSpace.single k (1 : ℝ) : E)‖ = 1 := by simp |
| 742 | have h_apply : |
| 743 | ‖(fderiv ℝ η x) (EuclideanSpace.single k 1)‖ ≤ |
| 744 | ‖fderiv ℝ η x‖ * ‖(EuclideanSpace.single k (1 : ℝ) : E)‖ := |
| 745 | (fderiv ℝ η x).le_opNorm _ |
| 746 | rw [hsing_norm, mul_one] at h_apply |
| 747 | have h2 := h_apply.trans (h_fderiv_eta x) |
| 748 | rw [Real.norm_eq_abs] at h2 |
| 749 | exact h2 |
| 750 | by_cases hx : x ∈ tsupport η |
| 751 | · have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 1 := by |
| 752 | rw [Set.indicator_of_mem hx] |
| 753 | rw [h_indicator] |
| 754 | have h_η_in : η x ∈ Set.Icc (0 : ℝ) 1 := hη_range ⟨x, rfl⟩ |
| 755 | have h_η_le : η x ≤ 1 := h_η_in.2 |
| 756 | have h_η_nn : 0 ≤ η x := h_η_in.1 |
| 757 | have h_η_sq_le_one : (η x)^2 ≤ 1 := by |
| 758 | calc (η x)^2 ≤ (1 : ℝ)^2 := |
| 759 | pow_le_pow_left₀ h_η_nn h_η_le 2 |
| 760 | _ = 1 := one_pow _ |
| 761 | have h_A_sq_bound : A^2 ≤ 4 * N^2 * (diffQuot k h u x)^2 := by |
| 762 | change (2 * η x * ((fderiv ℝ η x) (EuclideanSpace.single k 1)) * |
| 763 | diffQuot k h u x)^2 ≤ _ |
| 764 | have h_pow_2 : (2 * η x * ((fderiv ℝ η x) (EuclideanSpace.single k 1)) * |
| 765 | diffQuot k h u x)^2 = |
| 766 | 4 * (η x)^2 * ((fderiv ℝ η x) (EuclideanSpace.single k 1))^2 * |
| 767 | (diffQuot k h u x)^2 := by ring |
| 768 | rw [h_pow_2] |
| 769 | have h_dη_sq_le : ((fderiv ℝ η x) (EuclideanSpace.single k 1))^2 ≤ N^2 := by |
| 770 | rw [← sq_abs]; exact pow_le_pow_left₀ (abs_nonneg _) h_dη_bound 2 |
| 771 | have h_η_sq_nn : 0 ≤ (η x)^2 := sq_nonneg _ |
| 772 | have h_dq_sq_nn : 0 ≤ (diffQuot k h u x)^2 := sq_nonneg _ |
| 773 | have h_step1 : |
| 774 | 4 * (η x)^2 * ((fderiv ℝ η x) (EuclideanSpace.single k 1))^2 ≤ 4 * 1 * N^2 := by |
| 775 | have h1 : (η x)^2 ≤ 1 := h_η_sq_le_one |
| 776 | have h2 : ((fderiv ℝ η x) (EuclideanSpace.single k 1))^2 ≤ N^2 := h_dη_sq_le |
| 777 | have h_first : (η x)^2 * ((fderiv ℝ η x) (EuclideanSpace.single k 1))^2 ≤ 1 * N^2 := by |
| 778 | exact mul_le_mul h1 h2 (sq_nonneg _) (le_of_lt (by linarith [sq_nonneg (η x)])) |
| 779 | nlinarith |
| 780 | calc 4 * (η x)^2 * ((fderiv ℝ η x) (EuclideanSpace.single k 1))^2 * |
| 781 | (diffQuot k h u x)^2 ≤ |
| 782 | 4 * 1 * N^2 * (diffQuot k h u x)^2 := |
| 783 | mul_le_mul_of_nonneg_right h_step1 h_dq_sq_nn |
| 784 | _ = 4 * N^2 * (diffQuot k h u x)^2 := by ring |
| 785 | have h_first : 2 * A^2 ≤ 8 * N^2 * 1 * (diffQuot k h u x)^2 := by |
| 786 | have h := mul_le_mul_of_nonneg_left h_A_sq_bound (by norm_num : (0 : ℝ) ≤ 2) |
| 787 | linarith |
| 788 | have h_B'_sq : B'^2 = (η x)^4 * |
| 789 | (diffQuot k h |
| 790 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2 := by |
| 791 | change (η x ^ 2 * _)^2 = _ |
| 792 | ring |
| 793 | have h_B'_sq_le : 2 * B'^2 ≤ 2 * (η x)^2 * |
| 794 | (diffQuot k h |
| 795 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2 := by |
| 796 | rw [h_B'_sq] |
| 797 | have h_η_sq_nn : 0 ≤ (η x)^2 := sq_nonneg _ |
| 798 | have h_dq_sq_nn : 0 ≤ (diffQuot k h |
| 799 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2 := sq_nonneg _ |
| 800 | have h_4_eq : (η x)^4 = (η x)^2 * (η x)^2 := by ring |
| 801 | rw [h_4_eq] |
| 802 | have h_step : |
| 803 | (η x)^2 * ((η x)^2 * |
| 804 | (diffQuot k h |
| 805 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2) ≤ |
| 806 | (η x)^2 * |
| 807 | (diffQuot k h |
| 808 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2 := by |
| 809 | have h_inner_nn : 0 ≤ ((η x)^2 * |
| 810 | (diffQuot k h |
| 811 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2) := |
| 812 | mul_nonneg h_η_sq_nn h_dq_sq_nn |
| 813 | nlinarith |
| 814 | nlinarith |
| 815 | linarith |
| 816 | · have h_η_zero : η x = 0 := image_eq_zero_of_notMem_tsupport hx |
| 817 | have h_indicator : Set.indicator (tsupport η) (fun _ : E => (1 : ℝ)) x = 0 := |
| 818 | Set.indicator_of_notMem hx _ |
| 819 | rw [h_indicator] |
| 820 | have h_A_zero : A = 0 := by rw [hA_def, h_η_zero]; ring |
| 821 | have h_B'_zero : B' = 0 := by rw [hB'_def, h_η_zero]; ring |
| 822 | rw [h_A_zero, h_B'_zero] |
| 823 | rw [h_η_zero] |
| 824 | have h_t1_zero : 8 * N^2 * 0 * (diffQuot k h u x)^2 = 0 := by ring |
| 825 | have h_t2_zero : 2 * (0 : ℝ)^2 * |
| 826 | (diffQuot k h |
| 827 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x)^2 = 0 := by ring |
| 828 | have h_lhs_zero : (0 : ℝ)^2 + 2 * (0 : ℝ)^2 = 0 := by ring |
| 829 | nlinarith [sq_nonneg (diffQuot k h |
| 830 | (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single k 1)) x), |
| 831 | sq_nonneg (diffQuot k h u x)] |
| 832 | |
| 833 | end Poincare.Analysis.Sobolev.NirenbergCrossBounds |