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 | /-- A common bound for each input jet yields the usual Leibniz bound. -/ |
| 261 | theorem mul_jets_bound {f g : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 262 | (hf : ContDiffOn ℝ ∞ f s) (hg : ContDiffOn ℝ ∞ g s) {x : E} (hx : x ∈ s) |
| 263 | (n : ℕ) {C D : ℝ} (hC : 0 ≤ C) (_hD : 0 ≤ D) |
| 264 | (hfj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i f x‖ ≤ C) |
| 265 | (hgj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ D) : |
| 266 | ‖iteratedFDeriv ℝ n (fun y => f y * g y) x‖ ≤ chooseSum n * C * D := by |
| 267 | have h := norm_iteratedFDerivWithin_mul_le hf hg hs.uniqueDiffOn hx (nat_le_infty n) |
| 268 | simp only [iteratedFDerivWithin_of_isOpen _ hs hx] at h |
| 269 | apply h.trans |
| 270 | calc |
| 271 | _ ≤ ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * C * D := by |
| 272 | apply Finset.sum_le_sum |
| 273 | intro i hi |
| 274 | have hin : i ≤ n := by simpa only [Finset.mem_range, Nat.lt_succ_iff] using hi |
| 275 | gcongr |
| 276 | · exact hfj i hin |
| 277 | · exact hgj (n - i) (Nat.sub_le _ _) |
| 278 | _ = chooseSum n * C * D := by rw [← Finset.sum_mul, ← Finset.sum_mul]; rfl |
| 279 | |
| 280 | omit [NormedSpace ℝ E] in |
| 281 | theorem signed_rescale_eventually {g r : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 282 | (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) {w : ℝ} (hw : 0 < w) : |
| 283 | (fun y => r y / (2 * Real.sqrt (g y))) =ᶠ[𝓝 x] |
| 284 | (fun y => (Real.sqrt w / 2) * |
| 285 | (normalizeAt w r y * (normalizeAt w g y) ^ (-(1 / 2 : ℝ)))) := by |
| 286 | filter_upwards [hs.mem_nhds hx] with y hy |
| 287 | have hG := normalized_pos hw hpos hy |
| 288 | have hsq : Real.sqrt (g y) = Real.sqrt w * Real.sqrt (normalizeAt w g y) := by |
| 289 | rw [← Real.sqrt_mul hw.le] |
| 290 | congr 1 |
| 291 | simp only [normalizeAt, ← mul_assoc, mul_inv_cancel₀ hw.ne', one_mul] |
| 292 | have hR : r y = w * normalizeAt w r y := by |
| 293 | simp only [normalizeAt, ← mul_assoc, mul_inv_cancel₀ hw.ne', one_mul] |
| 294 | rw [Real.rpow_neg hG.le, ← Real.sqrt_eq_rpow] |
| 295 | have hwroot := Real.sq_sqrt hw.le |
| 296 | calc |
| 297 | _ = (Real.sqrt w) ^ 2 * normalizeAt w r y / |
| 298 | (2 * (Real.sqrt w * Real.sqrt (normalizeAt w g y))) := by rw [hwroot, ← hR, ← hsq] |
| 299 | _ = _ := by |
| 300 | field_simp [(Real.sqrt_pos.mpr hw).ne', (Real.sqrt_pos.mpr hG).ne'] |
| 301 | |
| 302 | /-- Signed updates inherit the same half-weight as the primary square root. -/ |
| 303 | theorem signed_jet_bound {g r : E → ℝ} {s : Set E} (hs : IsOpen s) |
| 304 | (hg : ContDiffOn ℝ ∞ g s) (hr : ContDiffOn ℝ ∞ r s) |
| 305 | (hpos : ∀ x ∈ s, 0 < g x) {x : E} (hx : x ∈ s) |
| 306 | {w B : ℝ} (hw : 0 < w) (hB : 1 ≤ B) (n : ℕ) |
| 307 | (hlo : w / B ≤ g x) |
| 308 | (hgj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i g x‖ ≤ w * B) |
| 309 | (hrj : ∀ i ≤ n, ‖iteratedFDeriv ℝ i r x‖ ≤ w * B) : |
| 310 | ‖iteratedFDeriv ℝ n (fun y => r y / (2 * Real.sqrt (g y))) x‖ ≤ |
| 311 | Real.sqrt w * (chooseSum n * orderBound (-(1 / 2 : ℝ)) n / 2) * B ^ (2 * n + 2) := by |
| 312 | have hhi : g x ≤ w * B := by |
| 313 | have h0 := hgj 0 (Nat.zero_le n) |
| 314 | simpa only [norm_iteratedFDeriv_zero, Real.norm_eq_abs, abs_of_pos (hpos x hx)] using h0 |
| 315 | obtain ⟨hu, hi⟩ := normalized_bounds hw hB hpos hx hlo hhi |
| 316 | have hG := normalized_contDiffOn hg w |
| 317 | have hR := normalized_contDiffOn hr w |
| 318 | have hGp : ∀ y ∈ s, 0 < normalizeAt w g y := fun y hy => normalized_pos hw hpos hy |
| 319 | have hP : ContDiffOn ℝ ∞ (fun y => normalizeAt w g y ^ (-(1 / 2 : ℝ))) s := |
| 320 | hG.rpow_const_of_ne (fun y hy => (hGp y hy).ne') |
| 321 | have hPj : ∀ i ≤ n, |
| 322 | ‖iteratedFDeriv ℝ i (fun y => normalizeAt w g y ^ (-(1 / 2 : ℝ))) x‖ ≤ |
| 323 | orderBound (-(1 / 2 : ℝ)) n * B ^ (2 * n + 1) := by |
| 324 | intro i hin |
| 325 | exact rpow_comp_jets_bound hs hG hGp hx _ n hB |
| 326 | (neg_half_power_bound hB (hGp x hx) hi) hi |
| 327 | (fun k hk => normalized_jet_bound hs hg hx hw k (hgj k hk)) hin |
| 328 | have hp := mul_jets_bound hs hR hP hx n (zero_le_one.trans hB) |
| 329 | (mul_nonneg (orderBound_nonneg _ n) (pow_nonneg (zero_le_one.trans hB) _)) |
| 330 | (fun i hin => normalized_jet_bound hs hr hx hw i (hrj i hin)) hPj |
| 331 | rw [jet_congr (signed_rescale_eventually hs hpos hx hw) n, |
| 332 | norm_jet_const_mul ((hR.mul hP).contDiffAt (hs.mem_nhds hx)), |
| 333 | abs_of_pos (div_pos (Real.sqrt_pos.mpr hw) (by norm_num))] |
| 334 | apply (mul_le_mul_of_nonneg_left hp (div_pos (Real.sqrt_pos.mpr hw) (by norm_num)).le).trans_eq |
| 335 | rw [show 2 * n + 2 = (2 * n + 1) + 1 by omega, pow_succ] |
| 336 | ring |
| 337 | |
| 338 | end Frechet |
| 339 | |
| 340 | section PolynomialControl |
| 341 | |
| 342 | variable {X : Type*} |
| 343 | |
| 344 | /-- An upper bound with a fixed finite power of each allowed large scale. |
| 345 | The controlled function need not have any regularity. -/ |
| 346 | def PolyBound (s : Set X) (S T : X → ℝ) (f : X → ℝ) : Prop := |
| 347 | ∃ C : ℝ, 1 ≤ C ∧ ∃ K N : ℕ, ∀ x ∈ s, f x ≤ C * S x ^ K * T x ^ N |
| 348 | |
| 349 | variable {s : Set X} {S T f g : X → ℝ} |
| 350 | |
| 351 | theorem PolyBound.mono (hf : PolyBound s S T f) (h : ∀ x ∈ s, g x ≤ f x) : |
| 352 | PolyBound s S T g := by |
| 353 | obtain ⟨C, hC, K, N, hb⟩ := hf |
| 354 | exact ⟨C, hC, K, N, fun x hx => (h x hx).trans (hb x hx)⟩ |
| 355 | |
| 356 | theorem polyBound_one : PolyBound s S T (fun _ => 1) := by |
| 357 | exact ⟨1, le_rfl, 0, 0, by simp⟩ |
| 358 | |
| 359 | theorem polyBound_zero : PolyBound s S T (fun _ => 0) := |
| 360 | polyBound_one.mono (by intro x hx; norm_num) |
| 361 | |
| 362 | theorem PolyBound.add (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 363 | (hf : PolyBound s S T f) (hg : PolyBound s S T g) : |
| 364 | PolyBound s S T (fun x => f x + g x) := by |
| 365 | obtain ⟨C, hC, K, N, hb⟩ := hf |
| 366 | obtain ⟨D, hD, L, M, hd⟩ := hg |
| 367 | refine ⟨C + D, by linarith, K + L, N + M, ?_⟩ |
| 368 | intro x hx |
| 369 | have hS0 := zero_le_one.trans (hS x hx) |
| 370 | have hT0 := zero_le_one.trans (hT x hx) |
| 371 | have hk : S x ^ K ≤ S x ^ (K + L) := pow_le_pow_right₀ (hS x hx) (Nat.le_add_right _ _) |
| 372 | have hl : S x ^ L ≤ S x ^ (K + L) := pow_le_pow_right₀ (hS x hx) (Nat.le_add_left _ _) |
| 373 | have hn : T x ^ N ≤ T x ^ (N + M) := pow_le_pow_right₀ (hT x hx) (Nat.le_add_right _ _) |
| 374 | have hm : T x ^ M ≤ T x ^ (N + M) := pow_le_pow_right₀ (hT x hx) (Nat.le_add_left _ _) |
| 375 | calc |
| 376 | _ ≤ C * S x ^ K * T x ^ N + D * S x ^ L * T x ^ M := add_le_add (hb x hx) (hd x hx) |
| 377 | _ ≤ C * S x ^ (K + L) * T x ^ (N + M) + D * S x ^ (K + L) * T x ^ (N + M) := by |
| 378 | apply add_le_add |
| 379 | · gcongr |
| 380 | · gcongr |
| 381 | _ = _ := by ring |
| 382 | |
| 383 | theorem PolyBound.sum {ι : Type*} (u : Finset ι) (F : ι → X → ℝ) |
| 384 | (hS : ∀ x ∈ s, 1 ≤ S x) (hT : ∀ x ∈ s, 1 ≤ T x) |
| 385 | (hF : ∀ i ∈ u, PolyBound s S T (F i)) : |
| 386 | PolyBound s S T (fun x => ∑ i ∈ u, F i x) := by |
| 387 | classical |
| 388 | induction u using Finset.induction_on with |
| 389 | | empty => simpa only [Finset.sum_empty] using (polyBound_zero (s := s) (S := S) (T := T)) |
| 390 | | @insert i u hi ih => |
| 391 | simp only [Finset.sum_insert hi] |
| 392 | exact (hF i (Finset.mem_insert_self _ _)).add hS hT |
| 393 | (ih (fun j hj => hF j (Finset.mem_insert_of_mem hj))) |
| 394 | |
| 395 | end PolynomialControl |
| 396 | |
| 397 | section WeightedJets |
| 398 | |
| 399 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 400 | |
| 401 | /-- A finite envelope of the input jets and the positive denominator lower bound. |
| 402 | This function is never differentiated. -/ |
| 403 | def envelope (w g r : E → ℝ) (n : ℕ) (x : E) : ℝ := |
| 404 | 1 + w x / g x + ∑ i ∈ Finset.range (n + 1), |
| 405 | (‖iteratedFDeriv ℝ i g x‖ / w x + ‖iteratedFDeriv ℝ i r x‖ / w x) |
| 406 | |
| 407 | end WeightedJets |
| 408 | |
| 409 | section GaussianEdge |
| 410 | |
| 411 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 412 | |
| 413 | end GaussianEdge |
| 414 | |
| 415 | end NavierStokes.WeightedQuotients |