Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import NavierStokes.FlatCutoff |
| 2 | import NavierStokes.FlatZeroExtension |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.Bounds |
| 4 | import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas |
| 5 | import Mathlib.Analysis.SpecialFunctions.Pow.Deriv |
| 6 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 7 | |
| 8 | /-! |
| 9 | # Square roots and signed quotients from weighted derivative bounds |
| 10 | |
| 11 | The estimates use genuine Fréchet derivatives. A normalization used in a |
| 12 | pointwise estimate is constant in the differentiation variable: no regularity |
| 13 | of the quotient by a variable flat weight is assumed. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Topology ContDiff BigOperators |
| 20 | |
| 21 | namespace NavierStokes.WeightedQuotients |
| 22 | |
| 23 | theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := |
| 24 | WithTop.coe_le_coe.mpr le_top |
| 25 | |
| 26 | noncomputable def rpowCoeff (p : ℝ) : ℕ → ℝ |
| 27 | | 0 => 1 |
| 28 | | n + 1 => rpowCoeff p n * (p - (n : ℝ)) |
| 29 | |
| 30 | /-- Actual scalar derivatives of a real power on the positive half-line. -/ |
| 31 | theorem iteratedDeriv_rpow (p : ℝ) (n : ℕ) {t : ℝ} (ht : 0 < t) : |
| 32 | iteratedDeriv n (fun t : ℝ => t ^ p) t = rpowCoeff p n * t ^ (p - (n : ℝ)) := by |
| 33 | induction n generalizing t with |
| 34 | | zero => simp [rpowCoeff] |
| 35 | | succ n ih => |
| 36 | have he : iteratedDeriv n (fun t : ℝ => t ^ p) =ᶠ[𝓝 t] |
| 37 | (fun t => rpowCoeff p n * t ^ (p - (n : ℝ))) := by |
| 38 | filter_upwards [isOpen_Ioi.mem_nhds ht] with x hx |
| 39 | exact ih hx |
| 40 | have hd := (Real.hasDerivAt_rpow_const (p := p - (n : ℝ)) |
| 41 | (Or.inl ht.ne')).const_mul (rpowCoeff p n) |
| 42 | rw [iteratedDeriv_succ, (hd.congr_of_eventuallyEq he).deriv] |
| 43 | simp only [rpowCoeff, Nat.cast_add, Nat.cast_one] |
| 44 | rw [show p - (n : ℝ) - 1 = p - ((n : ℝ) + 1) by ring] |
| 45 | ring |
| 46 | |
| 47 | def coeffBound (p : ℝ) (n : ℕ) : ℝ := |
| 48 | (∑ k ∈ Finset.range (n + 1), |rpowCoeff p k|) + 1 |
| 49 | |
| 50 | theorem coeffBound_nonneg (p : ℝ) (n : ℕ) : 0 ≤ coeffBound p n := by |
| 51 | unfold coeffBound |
| 52 | positivity |
| 53 | |
| 54 | theorem abs_coeff_le (p : ℝ) {i n : ℕ} (hi : i ≤ n) : |rpowCoeff p i| ≤ coeffBound p n := by |
| 55 | have him : i ∈ Finset.range (n + 1) := Finset.mem_range.mpr (Nat.lt_succ_of_le hi) |
| 56 | have hs : |rpowCoeff p i| ≤ ∑ k ∈ Finset.range (n + 1), |rpowCoeff p k| := |
| 57 | Finset.single_le_sum (f := fun k => |rpowCoeff p k|) (fun k _ => abs_nonneg _) him |
| 58 | exact hs.trans (le_add_of_nonneg_right zero_le_one) |
| 59 | |
| 60 | theorem rpow_jet_bound (p : ℝ) {B t : ℝ} (hB : 1 ≤ B) (ht : 0 < t) |
| 61 | (hp : t ^ p ≤ B) (hi : t⁻¹ ≤ B) {i n : ℕ} (hin : i ≤ n) : |
| 62 | ‖iteratedFDeriv ℝ i (fun t : ℝ => t ^ p) t‖ ≤ coeffBound p n * B ^ (n + 1) := by |
| 63 | have hB0 : 0 ≤ B := zero_le_one.trans hB |
| 64 | have htpi : 0 ≤ t ^ p := (Real.rpow_pos_of_pos ht p).le |
| 65 | have hpow : (t⁻¹) ^ i ≤ B ^ i := by gcongr |
| 66 | have hmain : t ^ (p - (i : ℝ)) ≤ B * B ^ i := by |
| 67 | rw [Real.rpow_sub ht, Real.rpow_natCast, div_eq_mul_inv, ← inv_pow] |
| 68 | exact mul_le_mul hp hpow (pow_nonneg (inv_nonneg.mpr ht.le) _) hB0 |
| 69 | rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv, iteratedDeriv_rpow p i ht, |
| 70 | Real.norm_eq_abs, abs_mul, abs_of_pos (Real.rpow_pos_of_pos ht _)] |
| 71 | calc |
| 72 | _ ≤ coeffBound p n * (B * B ^ i) := |
| 73 | mul_le_mul (abs_coeff_le p hin) hmain (Real.rpow_pos_of_pos ht _).le |
| 74 | (coeffBound_nonneg p n) |
| 75 | _ = coeffBound p n * B ^ (i + 1) := by rw [pow_succ]; ring |
| 76 | _ ≤ coeffBound p n * B ^ (n + 1) := |
| 77 | mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hB (Nat.add_le_add_right hin 1)) |
| 78 | (coeffBound_nonneg p n) |
| 79 | |
| 80 | theorem sqrt_le_of_bounds {B t : ℝ} (hB : 1 ≤ B) (ht : 0 ≤ t) (hu : t ≤ B) : |
| 81 | Real.sqrt t ≤ B := by |
| 82 | have hs := Real.sq_sqrt ht |
| 83 | have hsn := Real.sqrt_nonneg t |
| 84 | nlinarith |
| 85 | |
| 86 | theorem half_power_bound {B t : ℝ} (hB : 1 ≤ B) (ht : 0 < t) (hu : t ≤ B) : |
| 87 | t ^ (1 / 2 : ℝ) ≤ B := by |
| 88 | rw [← Real.sqrt_eq_rpow] |
| 89 | exact sqrt_le_of_bounds hB ht.le hu |
| 90 | |
| 91 | theorem neg_half_power_bound {B t : ℝ} (hB : 1 ≤ B) (ht : 0 < t) (hi : t⁻¹ ≤ B) : |
| 92 | t ^ (-(1 / 2 : ℝ)) ≤ B := by |
| 93 | rw [Real.rpow_neg ht.le, ← Real.inv_rpow ht.le, ← Real.sqrt_eq_rpow] |
| 94 | exact sqrt_le_of_bounds hB (inv_nonneg.mpr ht.le) hi |
| 95 | |
| 96 | section Frechet |
| 97 | |
| 98 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 99 | |
| 100 | /-- The local-open form of the genuine Fréchet chain-rule estimate. -/ |
| 101 | theorem comp_jet_bound {f : E → ℝ} {g : ℝ → ℝ} {s : Set E} {t : Set ℝ} |
| 102 | (hs : IsOpen s) (ht : IsOpen t) (hf : ContDiffOn ℝ ∞ f s) |
| 103 | (hg : ContDiffOn ℝ ∞ g t) (hmap : MapsTo f s t) {x : E} (hx : x ∈ s) |
| 104 | (n : ℕ) {C D : ℝ} |
| 105 | (hC : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g (f x)‖ ≤ C) |
| 106 | (hD : ∀ i, 1 ≤ i → i ≤ n → ‖iteratedFDeriv ℝ i f x‖ ≤ D ^ i) : |
| 107 | ‖iteratedFDeriv ℝ n (g ∘ f) x‖ ≤ n.factorial * C * D ^ n := by |
| 108 | have h := norm_iteratedFDerivWithin_comp_le hg hf (nat_le_infty n) |
| 109 | ht.uniqueDiffOn hs.uniqueDiffOn hmap hx |
| 110 | (by |
| 111 | intro i hi |
| 112 | rw [iteratedFDerivWithin_of_isOpen i ht (hmap hx)] |
| 113 | exact hC i hi) |
| 114 | (by |
| 115 | intro i hi hin |
| 116 | rw [iteratedFDerivWithin_of_isOpen i hs hx] |
| 117 | exact hD i hi hin) |
| 118 | simpa only [iteratedFDerivWithin_of_isOpen n hs hx] using h |
| 119 | |
| 120 | theorem rpow_comp_jet_bound {f : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 121 | (hf : ContDiffOn ℝ ∞ f s) (hfpos : ∀ x ∈ s, 0 < f x) |
| 122 | {x : E} (hx : x ∈ s) (p : ℝ) (n : ℕ) {B : ℝ} (hB : 1 ≤ B) |
| 123 | (hp : f x ^ p ≤ B) (hi : (f x)⁻¹ ≤ B) |
| 124 | (hjet : ∀ i, 1 ≤ i → i ≤ n → ‖iteratedFDeriv ℝ i f x‖ ≤ B) : |
| 125 | ‖iteratedFDeriv ℝ n (fun y => f y ^ p) x‖ ≤ |
| 126 | n.factorial * coeffBound p n * B ^ (2 * n + 1) := by |
| 127 | have hg : ContDiffOn ℝ ∞ (fun t : ℝ => t ^ p) (Ioi 0) := by |
| 128 | intro t ht |
| 129 | exact (Real.contDiffAt_rpow_const_of_ne (show 0 < t from ht).ne').contDiffWithinAt |
| 130 | have h := comp_jet_bound hs isOpen_Ioi hf hg hfpos hx n |
| 131 | (fun i hin => rpow_jet_bound p hB (hfpos x hx) hp hi hin) |
| 132 | (by |
| 133 | intro i h1 hin |
| 134 | exact (hjet i h1 hin).trans (by |
| 135 | simpa only [pow_one] using pow_le_pow_right₀ hB h1)) |
| 136 | convert! h using 1 |
| 137 | rw [show 2 * n + 1 = (n + 1) + n by omega, pow_add] |
| 138 | ring |
| 139 | |
| 140 | theorem norm_jet_const_mul {f : E → ℝ} {x : E} (hf : ContDiffAt ℝ ∞ f x) |
| 141 | (c : ℝ) (n : ℕ) : |
| 142 | ‖iteratedFDeriv ℝ n (fun y => c * f y) x‖ = |c| * ‖iteratedFDeriv ℝ n f x‖ := by |
| 143 | have he : iteratedFDeriv ℝ n (fun y => c * f y) x = c • iteratedFDeriv ℝ n f x := by |
| 144 | simpa only [smul_eq_mul] using |
| 145 | iteratedFDeriv_const_smul_apply' (a := c) (hf.of_le (nat_le_infty n)) |
| 146 | rw [he] |
| 147 | exact norm_smul c (iteratedFDeriv ℝ n f x) |
| 148 | |
| 149 | /-- The multiplier here is a fixed scalar at the point being estimated. -/ |
| 150 | def normalizeAt (w : ℝ) (f : E → ℝ) : E → ℝ := fun y => w⁻¹ * f y |
| 151 | |
| 152 | theorem normalized_jet_bound {g : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 153 | (hg : ContDiffOn ℝ ∞ g s) {x : E} (hx : x ∈ s) {w B : ℝ} (hw : 0 < w) |
| 154 | (n : ℕ) (hjet : ‖iteratedFDeriv ℝ n g x‖ ≤ w * B) : |
| 155 | ‖iteratedFDeriv ℝ n (normalizeAt w g) x‖ ≤ B := by |
| 156 | change ‖iteratedFDeriv ℝ n (fun y => w⁻¹ * g y) x‖ ≤ B |
| 157 | rw [norm_jet_const_mul (hg.contDiffAt (hs.mem_nhds hx)), |
| 158 | abs_of_pos (inv_pos.mpr hw)] |
| 159 | have h := mul_le_mul_of_nonneg_left hjet (inv_pos.mpr hw).le |
| 160 | simpa only [← mul_assoc, inv_mul_cancel₀ hw.ne', one_mul] using h |
| 161 | |
| 162 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 163 | theorem normalized_pos {g : E → ℝ} {s : Set E} {w : ℝ} (hw : 0 < w) |
| 164 | (hg : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) : 0 < normalizeAt w g x := |
| 165 | mul_pos (inv_pos.mpr hw) (hg x hx) |
| 166 | |
| 167 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 168 | theorem normalized_bounds {g : E → ℝ} {s : Set E} {w B : ℝ} (hw : 0 < w) (hB : 1 ≤ B) |
| 169 | (hg : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) |
| 170 | (hlo : w / B ≤ g x) (hhi : g x ≤ w * B) : |
| 171 | normalizeAt w g x ≤ B ∧ (normalizeAt w g x)⁻¹ ≤ B := by |
| 172 | have hBpos : 0 < B := zero_lt_one.trans_le hB |
| 173 | constructor |
| 174 | · have h := mul_le_mul_of_nonneg_left hhi (inv_pos.mpr hw).le |
| 175 | simpa only [normalizeAt, ← mul_assoc, inv_mul_cancel₀ hw.ne', one_mul] using h |
| 176 | · apply (inv_le_iff_one_le_mul₀ (normalized_pos hw hg hx)).2 |
| 177 | have hm := (div_le_iff₀ hBpos).mp hlo |
| 178 | have h := mul_le_mul_of_nonneg_left hm (inv_pos.mpr hw).le |
| 179 | simpa only [normalizeAt, mul_left_comm, mul_comm, inv_mul_cancel₀ hw.ne', mul_inv_cancel₀ hw.ne', |
| 180 | mul_assoc, one_mul] using h |
| 181 | |
| 182 | theorem normalized_contDiffOn {g : E → ℝ} {s : Set E} (hg : ContDiffOn ℝ ∞ g s) (w : ℝ) : |
| 183 | ContDiffOn ℝ ∞ (normalizeAt w g) s := contDiffOn_const.mul hg |
| 184 | |
| 185 | theorem jet_congr {f g : E → ℝ} {x : E} (h : f =ᶠ[𝓝 x] g) (n : ℕ) : |
| 186 | iteratedFDeriv ℝ n f x = iteratedFDeriv ℝ n g x := by |
| 187 | simp only [← iteratedFDerivWithin_univ] |
| 188 | exact (h.filter_mono nhdsWithin_le_nhds).iteratedFDerivWithin_eq h.eq_of_nhds n |
| 189 | |
| 190 | omit [NormedSpace ℝ E] in |
| 191 | /-- Actual powers separate from a fixed positive rescaling on the given open domain. -/ |
| 192 | theorem rpow_rescale_eventually {g : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 193 | (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) {w : ℝ} (hw : 0 < w) (p : ℝ) : |
| 194 | (fun y => g y ^ p) =ᶠ[𝓝 x] (fun y => w ^ p * (normalizeAt w g y) ^ p) := by |
| 195 | filter_upwards [hs.mem_nhds hx] with y hy |
| 196 | rw [← Real.mul_rpow hw.le (normalized_pos hw hpos hy).le] |
| 197 | congr 1 |
| 198 | simp only [normalizeAt, ← mul_assoc, mul_inv_cancel₀ hw.ne', one_mul] |
| 199 | |
| 200 | theorem rescaled_rpow_jet_bound {g : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 201 | (hg : ContDiffOn ℝ ∞ g s) (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) |
| 202 | {w B : ℝ} (hw : 0 < w) (hB : 1 ≤ B) (p : ℝ) (n : ℕ) |
| 203 | (hpow : (normalizeAt w g x) ^ p ≤ B) (hinv : (normalizeAt w g x)⁻¹ ≤ B) |
| 204 | (hjet : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ w * B) : |
| 205 | ‖iteratedFDeriv ℝ n (fun y => g y ^ p) x‖ ≤ |
| 206 | w ^ p * (n.factorial * coeffBound p n) * B ^ (2 * n + 1) := by |
| 207 | have hf := normalized_contDiffOn hg w |
| 208 | have hfp : ∀ y ∈ s, 0 < normalizeAt w g y := fun y hy => normalized_pos hw hpos hy |
| 209 | have hb := rpow_comp_jet_bound hs hf hfp hx p n hB hpow hinv |
| 210 | (fun i _ hin => normalized_jet_bound hs hg hx hw i (hjet i hin)) |
| 211 | have he := jet_congr (rpow_rescale_eventually hs hpos hx hw p) n |
| 212 | rw [he, norm_jet_const_mul ((hf.contDiffAt (hs.mem_nhds hx)).rpow_const_of_ne |
| 213 | (hfp x hx).ne'), abs_of_pos (Real.rpow_pos_of_pos hw p)] |
| 214 | exact (mul_le_mul_of_nonneg_left hb (Real.rpow_pos_of_pos hw p).le).trans_eq (by ring) |
| 215 | |
| 216 | /-- Square-root estimates retain exactly the square root of the small weight. -/ |
| 217 | theorem sqrt_jet_bound {g : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 218 | (hg : ContDiffOn ℝ ∞ g s) (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) |
| 219 | {w B : ℝ} (hw : 0 < w) (hB : 1 ≤ B) (n : ℕ) |
| 220 | (hlo : w / B ≤ g x) (hjet : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ w * B) : |
| 221 | ‖iteratedFDeriv ℝ n (fun y => Real.sqrt (g y)) x‖ ≤ |
| 222 | Real.sqrt w * (n.factorial * coeffBound (1 / 2) n) * B ^ (2 * n + 1) := by |
| 223 | have hhi : g x ≤ w * B := by |
| 224 | have h0 := hjet 0 (Nat.zero_le n) |
| 225 | simpa only [norm_iteratedFDeriv_zero, Real.norm_eq_abs, abs_of_pos (hpos x hx)] using h0 |
| 226 | obtain ⟨hu, hi⟩ := normalized_bounds hw hB hpos hx hlo hhi |
| 227 | have h := rescaled_rpow_jet_bound hs hg hpos hx hw hB (1 / 2) n |
| 228 | (half_power_bound hB (normalized_pos hw hpos hx) hu) hi hjet |
| 229 | simpa only [← Real.sqrt_eq_rpow] using h |
| 230 | |
| 231 | def orderBound (p : ℝ) (n : ℕ) : ℝ := |
| 232 | ∑ k ∈ Finset.range (n + 1), k.factorial * coeffBound p k |
| 233 | |
| 234 | theorem orderBound_nonneg (p : ℝ) (n : ℕ) : 0 ≤ orderBound p n := by |
| 235 | apply Finset.sum_nonneg |
| 236 | intro k _ |
| 237 | exact mul_nonneg (Nat.cast_nonneg _) (coeffBound_nonneg p k) |
| 238 | |
| 239 | theorem orderBound_le (p : ℝ) {i n : ℕ} (hi : i ≤ n) : |
| 240 | i.factorial * coeffBound p i ≤ orderBound p n := by |
| 241 | exact Finset.single_le_sum (f := fun k => (k.factorial : ℝ) * coeffBound p k) |
| 242 | (fun k _ => mul_nonneg (Nat.cast_nonneg _) (coeffBound_nonneg p k)) |
| 243 | (Finset.mem_range.mpr (Nat.lt_succ_of_le hi)) |
| 244 | |
| 245 | theorem rpow_comp_jets_bound {f : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 246 | (hf : ContDiffOn ℝ ∞ f s) (hfpos : ∀ x ∈ s, 0 < f x) |
| 247 | {x : E} (hx : x ∈ s) (p : ℝ) (n : ℕ) {B : ℝ} (hB : 1 ≤ B) |
| 248 | (hp : f x ^ p ≤ B) (hi : (f x)⁻¹ ≤ B) |
| 249 | (hjet : ∀ i ≤ n, ‖iteratedFDeriv ℝ i f x‖ ≤ B) {i : ℕ} (hin : i ≤ n) : |
| 250 | ‖iteratedFDeriv ℝ i (fun y => f y ^ p) x‖ ≤ orderBound p n * B ^ (2 * n + 1) := by |
| 251 | have h := rpow_comp_jet_bound hs hf hfpos hx p i hB hp hi |
| 252 | (fun k _ hk => hjet k (hk.trans hin)) |
| 253 | apply h.trans |
| 254 | exact mul_le_mul (orderBound_le p hin) |
| 255 | (pow_le_pow_right₀ hB (by omega)) (pow_nonneg (zero_le_one.trans hB) _) |
| 256 | (orderBound_nonneg p n) |
| 257 | |
| 258 | def chooseSum (n : ℕ) : ℝ := ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) |
| 259 | |
| 260 | theorem chooseSum_nonneg (n : ℕ) : 0 ≤ chooseSum n := by |
| 261 | unfold chooseSum |
| 262 | positivity |
| 263 | |
| 264 | /-- A common bound for each input jet yields the usual Leibniz bound. -/ |
| 265 | theorem mul_jets_bound {f g : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 266 | (hf : ContDiffOn ℝ ∞ f s) (hg : ContDiffOn ℝ ∞ g s) {x : E} (hx : x ∈ s) |
| 267 | (n : ℕ) {C D : ℝ} (hC : 0 ≤ C) (_hD : 0 ≤ D) |
| 268 | (hfj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i f x‖ ≤ C) |
| 269 | (hgj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ D) : |
| 270 | ‖iteratedFDeriv ℝ n (fun y => f y * g y) x‖ ≤ chooseSum n * C * D := by |
| 271 | have h := norm_iteratedFDerivWithin_mul_le hf hg hs.uniqueDiffOn hx (nat_le_infty n) |
| 272 | simp only [iteratedFDerivWithin_of_isOpen _ hs hx] at h |
| 273 | apply h.trans |
| 274 | calc |
| 275 | _ ≤ ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * C * D := by |
| 276 | apply Finset.sum_le_sum |
| 277 | intro i hi |
| 278 | have hin : i ≤ n := by simpa only [Finset.mem_range, Nat.lt_succ_iff] using hi |
| 279 | gcongr |
| 280 | · exact hfj i hin |
| 281 | · exact hgj (n - i) (Nat.sub_le _ _) |
| 282 | _ = chooseSum n * C * D := by rw [← Finset.sum_mul, ← Finset.sum_mul]; rfl |
| 283 | |
| 284 | omit [NormedSpace ℝ E] in |
| 285 | theorem signed_rescale_eventually {g r : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 286 | (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) {w : ℝ} (hw : 0 < w) : |
| 287 | (fun y => r y / (2 * Real.sqrt (g y))) =ᶠ[𝓝 x] |
| 288 | (fun y => (Real.sqrt w / 2) * |
| 289 | (normalizeAt w r y * (normalizeAt w g y) ^ (-(1 / 2 : ℝ)))) := by |
| 290 | filter_upwards [hs.mem_nhds hx] with y hy |
| 291 | have hG := normalized_pos hw hpos hy |
| 292 | have hsq : Real.sqrt (g y) = Real.sqrt w * Real.sqrt (normalizeAt w g y) := by |
| 293 | rw [← Real.sqrt_mul hw.le] |
| 294 | congr 1 |
| 295 | simp only [normalizeAt, ← mul_assoc, mul_inv_cancel₀ hw.ne', one_mul] |
| 296 | have hR : r y = w * normalizeAt w r y := by |
| 297 | simp only [normalizeAt, ← mul_assoc, mul_inv_cancel₀ hw.ne', one_mul] |
| 298 | rw [Real.rpow_neg hG.le, ← Real.sqrt_eq_rpow] |
| 299 | have hwroot := Real.sq_sqrt hw.le |
| 300 | calc |
| 301 | _ = (Real.sqrt w) ^ 2 * normalizeAt w r y / |
| 302 | (2 * (Real.sqrt w * Real.sqrt (normalizeAt w g y))) := by rw [hwroot, ← hR, ← hsq] |
| 303 | _ = _ := by |
| 304 | field_simp [(Real.sqrt_pos.mpr hw).ne', (Real.sqrt_pos.mpr hG).ne'] |
| 305 | |
| 306 | /-- Signed updates inherit the same half-weight as the primary square root. -/ |
| 307 | theorem signed_jet_bound {g r : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 308 | (hg : ContDiffOn ℝ ∞ g s) (hr : ContDiffOn ℝ ∞ r s) |
| 309 | (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) |
| 310 | {w B : ℝ} (hw : 0 < w) (hB : 1 ≤ B) (n : ℕ) |
| 311 | (hlo : w / B ≤ g x) |
| 312 | (hgj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ w * B) |
| 313 | (hrj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i r x‖ ≤ w * B) : |
| 314 | ‖iteratedFDeriv ℝ n (fun y => r y / (2 * Real.sqrt (g y))) x‖ ≤ |
| 315 | Real.sqrt w * (chooseSum n * orderBound (-(1 / 2 : ℝ)) n / 2) * B ^ (2 * n + 2) := by |
| 316 | have hhi : g x ≤ w * B := by |
| 317 | have h0 := hgj 0 (Nat.zero_le n) |
| 318 | simpa only [norm_iteratedFDeriv_zero, Real.norm_eq_abs, abs_of_pos (hpos x hx)] using h0 |
| 319 | obtain ⟨hu, hi⟩ := normalized_bounds hw hB hpos hx hlo hhi |
| 320 | have hG := normalized_contDiffOn hg w |
| 321 | have hR := normalized_contDiffOn hr w |
| 322 | have hGp : ∀ y ∈ s, 0 < normalizeAt w g y := fun y hy => normalized_pos hw hpos hy |
| 323 | have hP : ContDiffOn ℝ ∞ (fun y => normalizeAt w g y ^ (-(1 / 2 : ℝ))) s := |
| 324 | hG.rpow_const_of_ne (fun y hy => (hGp y hy).ne') |
| 325 | have hPj : ∀ i ≤ n, |
| 326 | ‖iteratedFDeriv ℝ i (fun y => normalizeAt w g y ^ (-(1 / 2 : ℝ))) x‖ ≤ |
| 327 | orderBound (-(1 / 2 : ℝ)) n * B ^ (2 * n + 1) := by |
| 328 | intro i hin |
| 329 | exact rpow_comp_jets_bound hs hG hGp hx _ n hB |
| 330 | (neg_half_power_bound hB (hGp x hx) hi) hi |
| 331 | (fun k hk => normalized_jet_bound hs hg hx hw k (hgj k hk)) hin |
| 332 | have hp := mul_jets_bound hs hR hP hx n (zero_le_one.trans hB) |
| 333 | (mul_nonneg (orderBound_nonneg _ n) (pow_nonneg (zero_le_one.trans hB) _)) |
| 334 | (fun i hin => normalized_jet_bound hs hr hx hw i (hrj i hin)) hPj |
| 335 | rw [jet_congr (signed_rescale_eventually hs hpos hx hw) n, |
| 336 | norm_jet_const_mul ((hR.mul hP).contDiffAt (hs.mem_nhds hx)), |
| 337 | abs_of_pos (div_pos (Real.sqrt_pos.mpr hw) (by norm_num))] |
| 338 | apply (mul_le_mul_of_nonneg_left hp (div_pos (Real.sqrt_pos.mpr hw) (by norm_num)).le).trans_eq |
| 339 | rw [show 2 * n + 2 = (2 * n + 1) + 1 by omega, pow_succ] |
| 340 | ring |
| 341 | |
| 342 | end Frechet |
| 343 | |
| 344 | section PolynomialControl |
| 345 | |
| 346 | variable {X : Type*} |
| 347 | |
| 348 | /-- An upper bound with a fixed finite power of each allowed large scale. |
| 349 | The controlled function need not have any regularity. -/ |
| 350 | def PolyBound (s : Set X) (S T : X → ℝ) (f : X → ℝ) : Prop := |
| 351 | ∃ C : ℝ, 1 ≤ C ∧ ∃ K N : ℕ, ∀ x ∈ s, f x ≤ C * S x ^ K * T x ^ N |
| 352 | |
| 353 | variable {s : Set X} {S T f g : X → ℝ} |
| 354 | |
| 355 | theorem PolyBound.mono (hf : PolyBound s S T f) (h : ∀ x ∈ s, g x ≤ f x) : |
| 356 | PolyBound s S T g := by |
| 357 | obtain ⟨C, hC, K, N, hb⟩ := hf |
| 358 | exact ⟨C, hC, K, N, fun x hx => (h x hx).trans (hb x hx)⟩ |
| 359 | |
| 360 | theorem polyBound_one : PolyBound s S T (fun _ => 1) := by |
| 361 | exact ⟨1, le_rfl, 0, 0, by simp⟩ |
| 362 | |
| 363 | theorem polyBound_zero : PolyBound s S T (fun _ => 0) := |
| 364 | polyBound_one.mono (by intro x hx; norm_num) |
| 365 | |
| 366 | theorem PolyBound.add (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 367 | (hf : PolyBound s S T f) (hg : PolyBound s S T g) : |
| 368 | PolyBound s S T (fun x => f x + g x) := by |
| 369 | obtain ⟨C, hC, K, N, hb⟩ := hf |
| 370 | obtain ⟨D, hD, L, M, hd⟩ := hg |
| 371 | refine ⟨C + D, by linarith, K + L, N + M, ?_⟩ |
| 372 | intro x hx |
| 373 | have hS0 := zero_le_one.trans (hS x hx) |
| 374 | have hT0 := zero_le_one.trans (hT x hx) |
| 375 | have hk : S x ^ K ≤ S x ^ (K + L) := pow_le_pow_right₀ (hS x hx) (Nat.le_add_right _ _) |
| 376 | have hl : S x ^ L ≤ S x ^ (K + L) := pow_le_pow_right₀ (hS x hx) (Nat.le_add_left _ _) |
| 377 | have hn : T x ^ N ≤ T x ^ (N + M) := pow_le_pow_right₀ (hT x hx) (Nat.le_add_right _ _) |
| 378 | have hm : T x ^ M ≤ T x ^ (N + M) := pow_le_pow_right₀ (hT x hx) (Nat.le_add_left _ _) |
| 379 | calc |
| 380 | _ ≤ C * S x ^ K * T x ^ N + D * S x ^ L * T x ^ M := add_le_add (hb x hx) (hd x hx) |
| 381 | _ ≤ C * S x ^ (K + L) * T x ^ (N + M) + D * S x ^ (K + L) * T x ^ (N + M) := by |
| 382 | apply add_le_add |
| 383 | · gcongr |
| 384 | · gcongr |
| 385 | _ = _ := by ring |
| 386 | |
| 387 | theorem PolyBound.sum {ι : Type*} (u : Finset ι) (F : ι → X → ℝ) |
| 388 | (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 389 | (hF : ∀ i ∈ u, PolyBound s S T (F i)) : |
| 390 | PolyBound s S T (fun x => ∑ i ∈ u, F i x) := by |
| 391 | classical |
| 392 | induction u using Finset.induction_on with |
| 393 | | empty => simpa only [Finset.sum_empty] using (polyBound_zero (s := s) (S := S) (T := T)) |
| 394 | | @insert i u hi ih => |
| 395 | simp only [Finset.sum_insert hi] |
| 396 | exact (hF i (Finset.mem_insert_self _ _)).add hS hT |
| 397 | (ih (fun j hj => hF j (Finset.mem_insert_of_mem hj))) |
| 398 | |
| 399 | theorem PolyBound.pow (_hS : ∀ x ∈ s, 1 ≤ S x) (_hT : ∀ x ∈ s, 1 ≤ T x) |
| 400 | (hf : PolyBound s S T f) (hf0 : ∀ x ∈ s, 0 ≤ f x) (k : ℕ) : |
| 401 | PolyBound s S T (fun x => f x ^ k) := by |
| 402 | obtain ⟨C, hC, K, N, hb⟩ := hf |
| 403 | refine ⟨C ^ k, one_le_pow₀ hC, K * k, N * k, ?_⟩ |
| 404 | intro x hx |
| 405 | calc |
| 406 | _ ≤ (C * S x ^ K * T x ^ N) ^ k := pow_le_pow_left₀ (hf0 x hx) (hb x hx) k |
| 407 | _ = _ := by simp only [mul_pow, pow_mul] |
| 408 | |
| 409 | theorem PolyBound.const_mul (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 410 | (hf : PolyBound s S T f) {a : ℝ} (ha : 0 ≤ a) : |
| 411 | PolyBound s S T (fun x => a * f x) := by |
| 412 | obtain ⟨C, hC, K, N, hb⟩ := hf |
| 413 | refine ⟨(a + 1) * C, ?_, K, N, ?_⟩ |
| 414 | · nlinarith |
| 415 | · intro x hx |
| 416 | have hm : 0 ≤ C * S x ^ K * T x ^ N := |
| 417 | mul_nonneg (mul_nonneg (zero_le_one.trans hC) |
| 418 | (pow_nonneg (zero_le_one.trans (hS x hx)) _)) |
| 419 | (pow_nonneg (zero_le_one.trans (hT x hx)) _) |
| 420 | calc |
| 421 | _ ≤ a * (C * S x ^ K * T x ^ N) := mul_le_mul_of_nonneg_left (hb x hx) ha |
| 422 | _ ≤ (a + 1) * (C * S x ^ K * T x ^ N) := by nlinarith |
| 423 | _ = _ := by ring |
| 424 | |
| 425 | end PolynomialControl |
| 426 | |
| 427 | section WeightedJets |
| 428 | |
| 429 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 430 | |
| 431 | /-- A finite envelope of the input jets and the positive denominator lower bound. |
| 432 | This function is never differentiated. -/ |
| 433 | def envelope (w g r : E → ℝ) (n : ℕ) (x : E) : ℝ := |
| 434 | 1 + w x / g x + ∑ i ∈ Finset.range (n + 1), |
| 435 | (‖iteratedFDeriv ℝ i g x‖ / w x + ‖iteratedFDeriv ℝ i r x‖ / w x) |
| 436 | |
| 437 | theorem envelope_bounds {w g r : E → ℝ} {x : E} (hw : 0 < w x) (hg : 0 < g x) (n : ℕ) : |
| 438 | 1 ≤ envelope w g r n x ∧ w x / envelope w g r n x ≤ g x ∧ |
| 439 | (∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ w x * envelope w g r n x) ∧ |
| 440 | (∀ i ≤ n, ‖iteratedFDeriv ℝ i r x‖ ≤ w x * envelope w g r n x) := by |
| 441 | have hterm (i : ℕ) : 0 ≤ ‖iteratedFDeriv ℝ i g x‖ / w x + |
| 442 | ‖iteratedFDeriv ℝ i r x‖ / w x := by positivity |
| 443 | have hsum : 0 ≤ ∑ i ∈ Finset.range (n + 1), |
| 444 | (‖iteratedFDeriv ℝ i g x‖ / w x + ‖iteratedFDeriv ℝ i r x‖ / w x) := |
| 445 | Finset.sum_nonneg (fun i _ => hterm i) |
| 446 | have hB : 1 ≤ envelope w g r n x := by |
| 447 | dsimp only [envelope] |
| 448 | have hfrac : 0 ≤ w x / g x := (div_pos hw hg).le |
| 449 | linarith |
| 450 | have hlow : w x / g x ≤ envelope w g r n x := by |
| 451 | dsimp only [envelope] |
| 452 | linarith |
| 453 | have hlow' : w x / envelope w g r n x ≤ g x := by |
| 454 | apply (div_le_iff₀ (zero_lt_one.trans_le hB)).2 |
| 455 | simpa only [mul_comm] using (div_le_iff₀ hg).mp hlow |
| 456 | have hi (i : ℕ) (hin : i ≤ n) : |
| 457 | ‖iteratedFDeriv ℝ i g x‖ / w x + ‖iteratedFDeriv ℝ i r x‖ / w x ≤ |
| 458 | envelope w g r n x := by |
| 459 | have ht := Finset.single_le_sum |
| 460 | (f := fun i => ‖iteratedFDeriv ℝ i g x‖ / w x + ‖iteratedFDeriv ℝ i r x‖ / w x) |
| 461 | (fun i _ => hterm i) (Finset.mem_range.mpr (Nat.lt_succ_of_le hin)) |
| 462 | dsimp only [envelope] |
| 463 | have hlo : 0 ≤ w x / g x := (div_pos hw hg).le |
| 464 | linarith |
| 465 | refine ⟨hB, hlow', ?_, ?_⟩ |
| 466 | · intro i hin |
| 467 | have hnonneg : 0 ≤ ‖iteratedFDeriv ℝ i r x‖ / w x := by positivity |
| 468 | have h : ‖iteratedFDeriv ℝ i g x‖ / w x ≤ envelope w g r n x := by linarith [hi i hin] |
| 469 | simpa only [mul_comm] using (div_le_iff₀ hw).mp h |
| 470 | · intro i hin |
| 471 | have hnonneg : 0 ≤ ‖iteratedFDeriv ℝ i g x‖ / w x := by positivity |
| 472 | have h : ‖iteratedFDeriv ℝ i r x‖ / w x ≤ envelope w g r n x := by linarith [hi i hin] |
| 473 | simpa only [mul_comm] using (div_le_iff₀ hw).mp h |
| 474 | |
| 475 | theorem envelope_polyBound {s : Set E} {S T w g r : E → ℝ} |
| 476 | (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 477 | (hlower : PolyBound s S T (fun x => w x / g x)) |
| 478 | (hg : ∀ n, PolyBound s S T (fun x => ‖iteratedFDeriv ℝ n g x‖ / w x)) |
| 479 | (hr : ∀ n, PolyBound s S T (fun x => ‖iteratedFDeriv ℝ n r x‖ / w x)) (n : ℕ) : |
| 480 | PolyBound s S T (envelope w g r n) := by |
| 481 | apply PolyBound.add hS hT (PolyBound.add hS hT polyBound_one hlower) |
| 482 | exact PolyBound.sum (Finset.range (n + 1)) _ hS hT |
| 483 | (fun i _ => PolyBound.add hS hT (hg i) (hr i)) |
| 484 | |
| 485 | /-- All input jets carry `w`; the square root and arbitrary signed quotient |
| 486 | carry exactly `sqrt w`, with only polynomial changes in the allowed scales. -/ |
| 487 | theorem weighted_half_control {s : Set E} {S T w g r : E → ℝ} |
| 488 | (hs : IsOpen s) (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 489 | (hw : ∀ x ∈ s, 0 < w x) (hpos : ∀ x ∈ s, 0 < g x) |
| 490 | (hg : ContDiffOn ℝ ∞ g s) (hr : ContDiffOn ℝ ∞ r s) |
| 491 | (hlower : PolyBound s S T (fun x => w x / g x)) |
| 492 | (hgj : ∀ n, PolyBound s S T (fun x => ‖iteratedFDeriv ℝ n g x‖ / w x)) |
| 493 | (hrj : ∀ n, PolyBound s S T (fun x => ‖iteratedFDeriv ℝ n r x‖ / w x)) : |
| 494 | (∀ n, PolyBound s S T (fun x => |
| 495 | ‖iteratedFDeriv ℝ n (fun y => Real.sqrt (g y)) x‖ / Real.sqrt (w x))) ∧ |
| 496 | (∀ n, PolyBound s S T (fun x => |
| 497 | ‖iteratedFDeriv ℝ n (fun y => r y / (2 * Real.sqrt (g y))) x‖ / Real.sqrt (w x))) := by |
| 498 | have henv (n : ℕ) := envelope_polyBound hS hT hlower hgj hrj n |
| 499 | have hnonneg (n : ℕ) (x : E) (hx : x ∈ s) : 0 ≤ envelope w g r n x := |
| 500 | zero_le_one.trans (envelope_bounds (hw x hx) (hpos x hx) n).1 |
| 501 | constructor |
| 502 | · intro n |
| 503 | have hc : 0 ≤ (n.factorial : ℝ) * coeffBound (1 / 2) n := |
| 504 | mul_nonneg (Nat.cast_nonneg _) (coeffBound_nonneg _ _) |
| 505 | apply ((henv n).pow hS hT (hnonneg n) (2 * n + 1)).const_mul hS hT hc |>.mono |
| 506 | intro x hx |
| 507 | obtain ⟨hB, hlo, hG, hR⟩ := envelope_bounds (hw x hx) (hpos x hx) n |
| 508 | have h := sqrt_jet_bound hs hg hpos hx (hw x hx) hB n hlo hG |
| 509 | apply (div_le_iff₀ (Real.sqrt_pos.mpr (hw x hx))).2 |
| 510 | simpa only [mul_assoc, mul_left_comm, mul_comm] using h |
| 511 | · intro n |
| 512 | have hc : 0 ≤ chooseSum n * orderBound (-(1 / 2 : ℝ)) n / 2 := |
| 513 | div_nonneg (mul_nonneg (chooseSum_nonneg n) (orderBound_nonneg _ _)) (by norm_num) |
| 514 | apply ((henv n).pow hS hT (hnonneg n) (2 * n + 2)).const_mul hS hT hc |>.mono |
| 515 | intro x hx |
| 516 | obtain ⟨hB, hlo, hG, hR⟩ := envelope_bounds (hw x hx) (hpos x hx) n |
| 517 | have h := signed_jet_bound hs hg hr hpos hx (hw x hx) hB n hlo hG hR |
| 518 | apply (div_le_iff₀ (Real.sqrt_pos.mpr (hw x hx))).2 |
| 519 | simpa only [mul_assoc, mul_left_comm, mul_comm] using h |
| 520 | |
| 521 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 522 | /-- An explicit weighted lower estimate supplies the reciprocal envelope. |
| 523 | This assumption is pointwise, with no normalized smooth factor. -/ |
| 524 | theorem polyBound_of_lower {s : Set E} {S T w g : E → ℝ} |
| 525 | (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 526 | (hg : ∀ x ∈ s, 0 < g x) {c₀ : ℝ} (hc₀ : 0 < c₀) (K N : ℕ) |
| 527 | (hlower : ∀ x ∈ s, c₀ * w x / (S x ^ K * T x ^ N) ≤ g x) : |
| 528 | PolyBound s S T (fun x => w x / g x) := by |
| 529 | refine ⟨c₀⁻¹ + 1, by have := inv_pos.mpr hc₀; linarith, K, N, ?_⟩ |
| 530 | intro x hx |
| 531 | have hP : 0 < S x ^ K * T x ^ N := |
| 532 | mul_pos (pow_pos (zero_lt_one.trans_le (hS x hx)) _) |
| 533 | (pow_pos (zero_lt_one.trans_le (hT x hx)) _) |
| 534 | have h := (div_le_iff₀ hP).mp (hlower x hx) |
| 535 | apply (div_le_iff₀ (hg x hx)).2 |
| 536 | calc |
| 537 | w x = c₀⁻¹ * (c₀ * w x) := by rw [← mul_assoc, inv_mul_cancel₀ hc₀.ne', one_mul] |
| 538 | _ ≤ c₀⁻¹ * (g x * (S x ^ K * T x ^ N)) := |
| 539 | mul_le_mul_of_nonneg_left h (inv_pos.mpr hc₀).le |
| 540 | _ ≤ (c₀⁻¹ + 1) * (g x * (S x ^ K * T x ^ N)) := by |
| 541 | exact mul_le_mul_of_nonneg_right (by linarith) (mul_pos (hg x hx) hP).le |
| 542 | _ = _ := by ring |
| 543 | |
| 544 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 545 | /-- Convert the usual weighted upper inequality to the envelope notation. -/ |
| 546 | theorem polyBound_of_weighted {s : Set E} {S T w F : E → ℝ} |
| 547 | (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 548 | (hw : ∀ x ∈ s, 0 < w x) {C : ℝ} (hC : 0 ≤ C) (K N : ℕ) |
| 549 | (hbound : ∀ x ∈ s, F x ≤ C * S x ^ K * T x ^ N * w x) : |
| 550 | PolyBound s S T (fun x => F x / w x) := by |
| 551 | refine ⟨C + 1, by linarith, K, N, ?_⟩ |
| 552 | intro x hx |
| 553 | apply ((div_le_iff₀ (hw x hx)).mpr (hbound x hx)).trans |
| 554 | have hP : 0 ≤ S x ^ K * T x ^ N := |
| 555 | mul_nonneg (pow_nonneg (zero_le_one.trans (hS x hx)) _) |
| 556 | (pow_nonneg (zero_le_one.trans (hT x hx)) _) |
| 557 | nlinarith |
| 558 | |
| 559 | end WeightedJets |
| 560 | |
| 561 | section GaussianEdge |
| 562 | |
| 563 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 564 | |
| 565 | abbrev edgeStrip (U : Set E) : Set (E × ℝ) := U ×ˢ Ioo 0 1 |
| 566 | |
| 567 | /-- All full derivative tensors satisfy an exponential weight times fixed |
| 568 | powers of the allowed scale and inverse edge distance. -/ |
| 569 | def WeightedJets (c : ℝ) (U : Set E) (S : E × ℝ → ℝ) (f : E × ℝ → ℝ) : Prop := |
| 570 | ∀ n : ℕ, PolyBound (edgeStrip U) S (fun p => p.2⁻¹) |
| 571 | (fun p => ‖iteratedFDeriv ℝ n f p‖ / FlatCutoff.edge c p.2) |
| 572 | |
| 573 | /-- An external scale may vary with parameters, but is locally bounded at |
| 574 | the edge. Any fixed `S ≥ 1` satisfies this condition. -/ |
| 575 | def LocallyBoundedScale (U : Set E) (S : E × ℝ → ℝ) : Prop := |
| 576 | ∀ x ∈ U, ∃ V ∈ 𝓝 x, ∃ M : ℝ, 1 ≤ M ∧ |
| 577 | ∀ y ∈ V ∩ U, ∀ δ ∈ Ioo (0 : ℝ) 1, S (y, δ) ≤ M |
| 578 | |
| 579 | omit [NormedSpace ℝ E] in |
| 580 | theorem locallyBoundedScale_const (U : Set E) {S : ℝ} (hS : 1 ≤ S) : |
| 581 | LocallyBoundedScale U (fun _ => S) := by |
| 582 | intro x hx |
| 583 | exact ⟨univ, univ_mem, S, hS, by simp⟩ |
| 584 | |
| 585 | theorem sqrt_edge (c δ : ℝ) : Real.sqrt (FlatCutoff.edge c δ) = FlatCutoff.edge (c / 2) δ := by |
| 586 | by_cases hδ : δ ≤ 0 |
| 587 | · simp [FlatCutoff.edge_of_nonpos c hδ, FlatCutoff.edge_of_nonpos (c / 2) hδ] |
| 588 | · have hp : 0 < δ := lt_of_not_ge hδ |
| 589 | rw [FlatCutoff.edge_of_pos c hp, FlatCutoff.edge_of_pos (c / 2) hp, ← Real.exp_half] |
| 590 | congr 1 |
| 591 | ring |
| 592 | |
| 593 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 594 | theorem inverse_distance_one_le {U : Set E} {p : E × ℝ} (hp : p ∈ edgeStrip U) : |
| 595 | 1 ≤ p.2⁻¹ := (one_le_inv₀ hp.2.1).mpr hp.2.2.le |
| 596 | |
| 597 | /-- The hypotheses are inequalities for the input's actual derivatives. -/ |
| 598 | theorem WeightedJets.of_bounds {c : ℝ} {U : Set E} {S : E × ℝ → ℝ} {f : E × ℝ → ℝ} |
| 599 | (hS : ∀ p ∈ edgeStrip U, 1 ≤ S p) |
| 600 | (h : ∀ n : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ K N : ℕ, ∀ p ∈ edgeStrip U, |
| 601 | ‖iteratedFDeriv ℝ n f p‖ ≤ C * S p ^ K * FlatCutoff.edge c p.2 / p.2 ^ N) : |
| 602 | WeightedJets c U S f := by |
| 603 | intro n |
| 604 | obtain ⟨C, hC, K, N, hb⟩ := h n |
| 605 | apply polyBound_of_weighted hS (fun p hp => inverse_distance_one_le hp) |
| 606 | (fun p hp => FlatCutoff.edge_pos c hp.2.1) hC K N |
| 607 | intro p hp |
| 608 | convert! hb p hp using 1 |
| 609 | simp only [div_eq_mul_inv, inv_pow] |
| 610 | ring |
| 611 | |
| 612 | theorem weighted_half_jets {c : ℝ} {U : Set E} (hU : IsOpen U) |
| 613 | {S g r : E × ℝ → ℝ} (hS : ∀ p ∈ edgeStrip U, 1 ≤ S p) |
| 614 | (hpos : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), 0 < g p) |
| 615 | (hg : ContDiffOn ℝ ∞ g (U ×ˢ Ioi 0)) (hr : ContDiffOn ℝ ∞ r (U ×ˢ Ioi 0)) |
| 616 | (hlower : PolyBound (edgeStrip U) S (fun p => p.2⁻¹) |
| 617 | (fun p => FlatCutoff.edge c p.2 / g p)) |
| 618 | (hgj : WeightedJets c U S g) (hrj : WeightedJets c U S r) : |
| 619 | WeightedJets (c / 2) U S (fun p => Real.sqrt (g p)) ∧ |
| 620 | WeightedJets (c / 2) U S (fun p => r p / (2 * Real.sqrt (g p))) := by |
| 621 | have hsub : edgeStrip U ⊆ U ×ˢ Ioi (0 : ℝ) := fun p hp => ⟨hp.1, hp.2.1⟩ |
| 622 | have h := weighted_half_control (hU.prod isOpen_Ioo) hS |
| 623 | (fun p hp => inverse_distance_one_le hp) |
| 624 | (fun p hp => FlatCutoff.edge_pos c hp.2.1) (fun p hp => hpos p (hsub hp)) |
| 625 | (hg.mono hsub) (hr.mono hsub) hlower hgj hrj |
| 626 | constructor |
| 627 | · intro n |
| 628 | simpa only [sqrt_edge] using h.1 n |
| 629 | · intro n |
| 630 | simpa only [sqrt_edge] using h.2 n |
| 631 | |
| 632 | theorem WeightedJets.localGaussian {c : ℝ} {U : Set E} {S f : E × ℝ → ℝ} |
| 633 | (hS : ∀ p ∈ edgeStrip U, 1 ≤ S p) (hscale : LocallyBoundedScale U S) |
| 634 | (hf : WeightedJets c U S f) : FlatZeroExtension.LocalGaussianJets c U f := by |
| 635 | intro n x hx |
| 636 | obtain ⟨C, hC, K, N, hb⟩ := hf n |
| 637 | obtain ⟨V, hV, M, hM, hm⟩ := hscale x hx |
| 638 | refine ⟨V, hV, C * M ^ K, |
| 639 | mul_nonneg (zero_le_one.trans hC) (pow_nonneg (zero_le_one.trans hM) _), N, ?_⟩ |
| 640 | intro y hy δ hδ |
| 641 | have hp : (y, δ) ∈ edgeStrip U := ⟨hy.2, hδ⟩ |
| 642 | have he := FlatCutoff.edge_pos c hδ.1 |
| 643 | have hbase : 0 ≤ S (y, δ) := zero_le_one.trans (hS _ hp) |
| 644 | have hδinv : 0 ≤ δ⁻¹ := (inv_pos.mpr hδ.1).le |
| 645 | calc |
| 646 | ‖iteratedFDeriv ℝ n f (y, δ)‖ ≤ |
| 647 | (C * S (y, δ) ^ K * (δ⁻¹) ^ N) * FlatCutoff.edge c δ := |
| 648 | (div_le_iff₀ he).mp (hb (y, δ) hp) |
| 649 | _ ≤ (C * M ^ K * (δ⁻¹) ^ N) * FlatCutoff.edge c δ := by |
| 650 | gcongr |
| 651 | exact hm y hy δ hδ |
| 652 | _ = C * M ^ K * FlatCutoff.edge c δ / δ ^ N := by |
| 653 | simp only [div_eq_mul_inv, inv_pow] |
| 654 | ring |
| 655 | |
| 656 | /-- Joint smooth zero extension, and vanishing of every full edge tensor, |
| 657 | derived solely from weighted input-jet inequalities and a positive lower bound. -/ |
| 658 | theorem weighted_zero_extension {c : ℝ} (hc : 0 < c) {U : Set E} (hU : IsOpen U) |
| 659 | {S g r : E × ℝ → ℝ} (hS : ∀ p ∈ edgeStrip U, 1 ≤ S p) |
| 660 | (hscale : LocallyBoundedScale U S) |
| 661 | (hpos : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), 0 < g p) |
| 662 | (hg : ContDiffOn ℝ ∞ g (U ×ˢ Ioi 0)) (hr : ContDiffOn ℝ ∞ r (U ×ˢ Ioi 0)) |
| 663 | (hlower : PolyBound (edgeStrip U) S (fun p => p.2⁻¹) |
| 664 | (fun p => FlatCutoff.edge c p.2 / g p)) |
| 665 | (hgj : WeightedJets c U S g) (hrj : WeightedJets c U S r) : |
| 666 | ContDiffOn ℝ ∞ (FlatZeroExtension.zeroExtension (fun p => Real.sqrt (g p))) (U ×ˢ univ) ∧ |
| 667 | ContDiffOn ℝ ∞ (FlatZeroExtension.zeroExtension (fun p => r p / (2 * Real.sqrt (g p)))) |
| 668 | (U ×ˢ univ) ∧ |
| 669 | ∀ n : ℕ, ∀ x ∈ U, |
| 670 | iteratedFDeriv ℝ n (FlatZeroExtension.zeroExtension (fun p => Real.sqrt (g p))) (x, 0) = 0 ∧ |
| 671 | iteratedFDeriv ℝ n (FlatZeroExtension.zeroExtension |
| 672 | (fun p => r p / (2 * Real.sqrt (g p)))) (x, 0) = 0 := by |
| 673 | obtain ⟨ha, hb⟩ := weighted_half_jets hU hS hpos hg hr hlower hgj hrj |
| 674 | have haB := ha.localGaussian hS hscale |
| 675 | have hbB := hb.localGaussian hS hscale |
| 676 | have has : ContDiffOn ℝ ∞ (fun p => Real.sqrt (g p)) (U ×ˢ Ioi (0 : ℝ)) := |
| 677 | hg.sqrt (fun p hp => (hpos p hp).ne') |
| 678 | have hbs : ContDiffOn ℝ ∞ (fun p => r p / (2 * Real.sqrt (g p))) (U ×ˢ Ioi (0 : ℝ)) := |
| 679 | hr.div (contDiffOn_const.mul has) (fun p hp => |
| 680 | mul_ne_zero (by norm_num) (Real.sqrt_pos.mpr (hpos p hp)).ne') |
| 681 | have hc2 : 0 < c / 2 := by linarith |
| 682 | refine ⟨FlatZeroExtension.contDiffOn_zeroExtension hc2 hU has haB, |
| 683 | FlatZeroExtension.contDiffOn_zeroExtension hc2 hU hbs hbB, ?_⟩ |
| 684 | intro n x hx |
| 685 | exact ⟨FlatZeroExtension.iteratedFDeriv_zeroExtension_edge hc2 hU has haB n hx, |
| 686 | FlatZeroExtension.iteratedFDeriv_zeroExtension_edge hc2 hU hbs hbB n hx⟩ |
| 687 | |
| 688 | /-- Direct interface using only the original weighted input inequalities. -/ |
| 689 | theorem weighted_zero_extension_of_bounds {c : ℝ} (hc : 0 < c) {U : Set E} (hU : IsOpen U) |
| 690 | {S g r : E × ℝ → ℝ} (hS : ∀ p ∈ edgeStrip U, 1 ≤ S p) |
| 691 | (hscale : LocallyBoundedScale U S) |
| 692 | (hpos : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), 0 < g p) |
| 693 | (hg : ContDiffOn ℝ ∞ g (U ×ˢ Ioi 0)) (hr : ContDiffOn ℝ ∞ r (U ×ˢ Ioi 0)) |
| 694 | {c₀ : ℝ} (hc₀ : 0 < c₀) (K₀ N₀ : ℕ) |
| 695 | (hlower : ∀ p ∈ edgeStrip U, |
| 696 | c₀ * FlatCutoff.edge c p.2 / (S p ^ K₀ * (p.2⁻¹) ^ N₀) ≤ g p) |
| 697 | (hgBounds : ∀ n : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ K N : ℕ, ∀ p ∈ edgeStrip U, |
| 698 | ‖iteratedFDeriv ℝ n g p‖ ≤ C * S p ^ K * FlatCutoff.edge c p.2 / p.2 ^ N) |
| 699 | (hrBounds : ∀ n : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∃ K N : ℕ, ∀ p ∈ edgeStrip U, |
| 700 | ‖iteratedFDeriv ℝ n r p‖ ≤ C * S p ^ K * FlatCutoff.edge c p.2 / p.2 ^ N) : |
| 701 | ContDiffOn ℝ ∞ (FlatZeroExtension.zeroExtension (fun p => Real.sqrt (g p))) (U ×ˢ univ) ∧ |
| 702 | ContDiffOn ℝ ∞ (FlatZeroExtension.zeroExtension (fun p => r p / (2 * Real.sqrt (g p)))) |
| 703 | (U ×ˢ univ) ∧ |
| 704 | ∀ n : ℕ, ∀ x ∈ U, |
| 705 | iteratedFDeriv ℝ n (FlatZeroExtension.zeroExtension (fun p => Real.sqrt (g p))) (x, 0) = 0 ∧ |
| 706 | iteratedFDeriv ℝ n (FlatZeroExtension.zeroExtension |
| 707 | (fun p => r p / (2 * Real.sqrt (g p)))) (x, 0) = 0 := by |
| 708 | apply weighted_zero_extension hc hU hS hscale hpos hg hr |
| 709 | · exact polyBound_of_lower hS (fun p hp => inverse_distance_one_le hp) |
| 710 | (fun p hp => hpos p ⟨hp.1, hp.2.1⟩) hc₀ K₀ N₀ hlower |
| 711 | · exact WeightedJets.of_bounds hS hgBounds |
| 712 | · exact WeightedJets.of_bounds hS hrBounds |
| 713 | |
| 714 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 715 | theorem zeroExtension_sqrt_sq {U : Set E} {g : E × ℝ → ℝ} |
| 716 | (hpos : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), 0 < g p) {p : E × ℝ} (hp : p.1 ∈ U) : |
| 717 | (FlatZeroExtension.zeroExtension (fun p => Real.sqrt (g p)) p) ^ 2 = |
| 718 | FlatZeroExtension.zeroExtension g p := by |
| 719 | by_cases hδ : 0 < p.2 |
| 720 | · simp only [FlatZeroExtension.zeroExtension_of_pos _ hδ] |
| 721 | exact Real.sq_sqrt (hpos p ⟨hp, hδ⟩).le |
| 722 | · simp only [FlatZeroExtension.zeroExtension_of_nonpos _ (le_of_not_gt hδ), zero_pow (by decide : 2 ≠ 0)] |
| 723 | |
| 724 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] in |
| 725 | theorem zeroExtension_signed_identity {U : Set E} {g r : E × ℝ → ℝ} |
| 726 | (hpos : ∀ p ∈ U ×ˢ Ioi (0 : ℝ), 0 < g p) {p : E × ℝ} (hp : p.1 ∈ U) : |
| 727 | 2 * FlatZeroExtension.zeroExtension (fun p => Real.sqrt (g p)) p * |
| 728 | FlatZeroExtension.zeroExtension (fun p => r p / (2 * Real.sqrt (g p))) p = |
| 729 | FlatZeroExtension.zeroExtension r p := by |
| 730 | by_cases hδ : 0 < p.2 |
| 731 | · simp only [FlatZeroExtension.zeroExtension_of_pos _ hδ] |
| 732 | field_simp [(Real.sqrt_pos.mpr (hpos p ⟨hp, hδ⟩)).ne'] |
| 733 | · simp only [FlatZeroExtension.zeroExtension_of_nonpos _ (le_of_not_gt hδ), mul_zero] |
| 734 | |
| 735 | end GaussianEdge |
| 736 | |
| 737 | end NavierStokes.WeightedQuotients |