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 Euler.EulerProof |
| 2 | |
| 3 | /-! |
| 4 | A common choice of the starting stage and base scale for the concrete |
| 5 | coefficient, time-width, and pressure costs in the outer construction. |
| 6 | -/ |
| 7 | |
| 8 | /-! ## From `Euler/PacketSourceScaleBounds.lean` |
| 9 | |
| 10 | The text of `Euler/PacketSourceScaleBounds.lean`, folded into this file, which was its only importer. -/ |
| 11 | |
| 12 | section |
| 13 | |
| 14 | /-! |
| 15 | Pointwise bounds for the literal scale expressions in (37)--(39). They |
| 16 | exhibit a finite list of exponential costs to which the existing uniform |
| 17 | scale-choice theorem applies. The estimates here contain no field data. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | |
| 23 | namespace EulerPacketSourceScaleBounds |
| 24 | |
| 25 | open Real EulerScale EulerPacketScaleGeometry EulerPacketSourceScales EulerPacketSourceTime |
| 26 | |
| 27 | def monomialCost (J d B : ℕ) (a b c C : ℝ) (p q : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := |
| 28 | C * ((J + n : ℕ) : ℝ)^p * (x n)^q * |
| 29 | exp (-b * (x n / ((J + n : ℕ) : ℝ)^a) + |
| 30 | c * (x n / ((J - d + n : ℕ) : ℝ)^B)) |
| 31 | |
| 32 | theorem monomialCost_nonneg (J d B : ℕ) (a b c C : ℝ) (p q : ℕ) |
| 33 | (x : ℕ → ℝ) (n : ℕ) (hC : 0 ≤ C) (hx : 0 ≤ x n) : |
| 34 | 0 ≤ monomialCost J d B a b c C p q x n := by |
| 35 | unfold monomialCost |
| 36 | positivity |
| 37 | |
| 38 | theorem monomialCost_eq_exp (J d B : ℕ) (a b c C : ℝ) (p q : ℕ) |
| 39 | (x : ℕ → ℝ) (n : ℕ) (hJ : 1 ≤ J) (hC : 0 < C) (hx : 0 < x n) : |
| 40 | monomialCost J d B a b c C p q x n = |
| 41 | exp (-b * (x n / ((J + n : ℕ) : ℝ)^a) + |
| 42 | c * (x n / ((J - d + n : ℕ) : ℝ)^B) + |
| 43 | log C + p * log ((J + n : ℕ) : ℝ) + q * log (x n)) := by |
| 44 | have hj : (0 : ℝ) < (J + n : ℕ) := by exact_mod_cast (show 0 < J+n by omega) |
| 45 | simp only [monomialCost, exp_add, exp_log hC, exp_nat_mul, exp_log hj, exp_log hx] |
| 46 | ring |
| 47 | |
| 48 | theorem theta_weighted_monomial_bound |
| 49 | (J d B : ℕ) (a b c D C : ℝ) (p q A : ℕ) (x : ℕ → ℝ) (n : ℕ) |
| 50 | (hJ : 1 ≤ J) (hC : 1 ≤ C) (hD : 0 ≤ D) (hx : ∀ n, 1 ≤ x n) : |
| 51 | monomialCost J d B a b c D p q x n * sourceTheta J C x n^A ≤ |
| 52 | monomialCost J d B a b c (D*(2*C)^A) (p+2*A) (q+2*A) x n := by |
| 53 | have hθ := pow_le_pow_left₀ (le_trans zero_le_one (sourceTheta_bounds hJ hC hx n).1) |
| 54 | (sourceTheta_bounds hJ hC hx n).2 A |
| 55 | have hh := mul_le_mul_of_nonneg_left hθ |
| 56 | (monomialCost_nonneg J d B a b c D p q x n hD (le_trans zero_le_one (hx n))) |
| 57 | convert! hh using 1 |
| 58 | simp only [monomialCost, mul_pow, ← pow_mul] |
| 59 | ring |
| 60 | |
| 61 | theorem sourcePriorError_bound (J : ℕ) (hJ : 3 ≤ J) (x : ℕ → ℝ) (n : ℕ) |
| 62 | (hx : 0 ≤ x n) : |
| 63 | sourcePriorError J x n ≤ exp (-(1/4)*(x n/((J+n : ℕ) : ℝ)^4)) := by |
| 64 | have hp : (0 : ℝ) < (J-1+n : ℕ) := by exact_mod_cast (show 0 < J-1+n by omega) |
| 65 | have hpj : ((J-1+n : ℕ) : ℝ) ≤ (J+n : ℕ) := by exact_mod_cast (show J-1+n ≤ J+n by omega) |
| 66 | have hd := div_le_div_of_nonneg_left hx |
| 67 | (show 0 < 4*((J-1+n : ℕ) : ℝ)^4 by positivity) |
| 68 | (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hp.le hpj 4) (by norm_num : (0:ℝ) ≤ 4)) |
| 69 | apply exp_le_exp.mpr |
| 70 | change -x n/(4*((J-1+n : ℕ) : ℝ)^4) ≤ _ |
| 71 | convert! neg_le_neg hd using 1 <;> ring |
| 72 | |
| 73 | theorem sourceNeighborError_bound (J : ℕ) (hJ : 3 ≤ J) (c : ℝ) (hc : 0 ≤ c) |
| 74 | (x : ℕ → ℝ) (n : ℕ) (hx : 0 ≤ x n) : |
| 75 | sourceNeighborError J c x n ≤ |
| 76 | exp (-(x n/((J+n : ℕ) : ℝ)^(7/2 : ℝ)) + |
| 77 | (2*c)*(x n/((J-1+n : ℕ) : ℝ)^4)) := by |
| 78 | have hp : (1 : ℝ) ≤ (J-1+n : ℕ) := by exact_mod_cast (show 1 ≤ J-1+n by omega) |
| 79 | have hd := div_le_div_of_nonneg_left (mul_nonneg hc hx) |
| 80 | (by positivity : 0 < ((J-1+n : ℕ) : ℝ)^4) |
| 81 | (pow_le_pow_right₀ hp (by decide : 4 ≤ 7)) |
| 82 | unfold sourceNeighborError |
| 83 | apply exp_le_exp.mpr |
| 84 | simp only [div_eq_mul_inv] at hd ⊢ |
| 85 | linarith only [hd] |
| 86 | |
| 87 | /-- The complete coefficient error is controlled by three explicit costs, |
| 88 | with exactly the preceding-stage powers and the real support exponent 7/2. -/ |
| 89 | theorem sourceCoefficientError_bound (J : ℕ) (hJ : 3 ≤ J) (C c : ℝ) |
| 90 | (hC : 1 ≤ C) (hc : 0 ≤ c) (A : ℕ) (x : ℕ → ℝ) (hx : ∀ n, 1 ≤ x n) (n : ℕ) : |
| 91 | sourceCoefficientError J C c x n * sourceTheta J C x n^A ≤ |
| 92 | monomialCost J 2 9 7 (1/2) 2 (128*(2*C)^(A+1)) (2*(A+1)) (2*(A+1)) x n + |
| 93 | monomialCost J 0 5 4 (1/4) 0 (16*(2*C)^A) (2*A) (2*A) x n + |
| 94 | monomialCost J 1 4 (7/2) 1 (2*c) (16*(2*C)^A) (2*A) (2*A) x n := by |
| 95 | have hJ1 : 1 ≤ J := by omega |
| 96 | have hθ : 0 ≤ sourceTheta J C x n := le_trans zero_le_one (sourceTheta_bounds hJ1 hC hx n).1 |
| 97 | have hxp : ∀ n, 0 ≤ x n := fun n => le_trans zero_le_one (hx n) |
| 98 | have hs := mul_le_mul_of_nonneg_right |
| 99 | (source_shear_gradient_bound J hJ x hxp n) (pow_nonneg hθ (A+1)) |
| 100 | have hs16 := mul_le_mul_of_nonneg_left hs (by norm_num : (0:ℝ) ≤ 16) |
| 101 | have hsm := theta_weighted_monomial_bound J 2 9 7 (1/2) 2 128 C 0 0 (A+1) x n hJ1 hC |
| 102 | (by norm_num) hx |
| 103 | have hshear : 16*(sourceEpsilon J x n*sourceTheta J C x n*sourceOlderGradient J x n^2)* |
| 104 | sourceTheta J C x n^A ≤ |
| 105 | monomialCost J 2 9 7 (1/2) 2 (128*(2*C)^(A+1)) (2*(A+1)) (2*(A+1)) x n := by |
| 106 | apply le_trans _ (by simpa only [Nat.zero_add] using hsm) |
| 107 | convert! hs16 using 1 <;> simp only [monomialCost, rpow_ofNat, pow_zero, pow_succ] <;> ring |
| 108 | have hp := mul_le_mul_of_nonneg_right |
| 109 | (sourcePriorError_bound J hJ x n (hxp n)) (pow_nonneg hθ A) |
| 110 | have hp16 := mul_le_mul_of_nonneg_left hp (by norm_num : (0:ℝ) ≤ 16) |
| 111 | have hpm := theta_weighted_monomial_bound J 0 5 4 (1/4) 0 16 C 0 0 A x n hJ1 hC |
| 112 | (by norm_num) hx |
| 113 | have hprior : 16*sourcePriorError J x n*sourceTheta J C x n^A ≤ |
| 114 | monomialCost J 0 5 4 (1/4) 0 (16*(2*C)^A) (2*A) (2*A) x n := by |
| 115 | apply le_trans _ (by simpa only [Nat.zero_add] using hpm) |
| 116 | simpa only [monomialCost, rpow_ofNat, zero_mul, add_zero, pow_zero, mul_one, mul_assoc] using hp16 |
| 117 | have hn := mul_le_mul_of_nonneg_right |
| 118 | (sourceNeighborError_bound J hJ c hc x n (hxp n)) (pow_nonneg hθ A) |
| 119 | have hn16 := mul_le_mul_of_nonneg_left hn (by norm_num : (0:ℝ) ≤ 16) |
| 120 | have hnm := theta_weighted_monomial_bound J 1 4 (7/2) 1 (2*c) 16 C 0 0 A x n hJ1 hC |
| 121 | (by norm_num) hx |
| 122 | have hneighbor : 16*sourceNeighborError J c x n*sourceTheta J C x n^A ≤ |
| 123 | monomialCost J 1 4 (7/2) 1 (2*c) (16*(2*C)^A) (2*A) (2*A) x n := by |
| 124 | apply le_trans _ (by simpa only [Nat.zero_add] using hnm) |
| 125 | simpa only [monomialCost, neg_one_mul, pow_zero, mul_one, mul_assoc] using hn16 |
| 126 | have hh := add_le_add (add_le_add hshear hprior) hneighbor |
| 127 | convert! hh using 1 |
| 128 | unfold sourceCoefficientError |
| 129 | ring |
| 130 | |
| 131 | theorem sourceExtraTime_bound (J : ℕ) (hJ : 1 ≤ J) (C : ℝ) (hC : 1 ≤ C) |
| 132 | (A : ℕ) (x : ℕ → ℝ) (hx : ∀ n, 1 ≤ x n) (n : ℕ) |
| 133 | (a : ℝ) (ha : 0 ≤ a) (ha₂ : a ≤ 2) : |
| 134 | 2*sqrt (a*exp (x n/((J-1+n : ℕ) : ℝ)^7))*sourceNextTimeWidth J x n* |
| 135 | sourceTheta J C x n^A ≤ |
| 136 | monomialCost J 1 7 5 (1/2) (1/2) (48*(2*C)^A) (6+2*A) (2+2*A) x n := by |
| 137 | have hθ : 0 ≤ sourceTheta J C x n := le_trans zero_le_one (sourceTheta_bounds hJ hC hx n).1 |
| 138 | have hh := mul_le_mul_of_nonneg_right (source_extra_time_bound J hJ x n ha ha₂) (pow_nonneg hθ A) |
| 139 | have hm := theta_weighted_monomial_bound J 1 7 5 (1/2) (1/2) 48 C 6 2 A x n hJ hC (by norm_num) hx |
| 140 | apply le_trans hh |
| 141 | simpa only [monomialCost, rpow_ofNat] using hm |
| 142 | |
| 143 | theorem sourceTimeRatio_bound (J : ℕ) (hJ : 1 ≤ J) (x : ℕ → ℝ) (n : ℕ) : |
| 144 | sourceTimeRatio J x n ≤ monomialCost J 1 7 5 (1/2) (1/2) 4 4 0 x n := by |
| 145 | have hj : (1 : ℝ) ≤ (J+n : ℕ) := by exact_mod_cast (show 1 ≤ J+n by omega) |
| 146 | have hp : (((J+n : ℕ) : ℝ)+1)^2 ≤ 4*((J+n : ℕ) : ℝ)^2 := by nlinarith only [hj] |
| 147 | have hh := mul_le_mul_of_nonneg_right hp (sq_nonneg ((J+n : ℕ) : ℝ)) |
| 148 | have he := mul_le_mul_of_nonneg_right hh |
| 149 | (exp_pos (-x n/(2*((J+n : ℕ) : ℝ)^5)+x n/(2*((J-1+n : ℕ) : ℝ)^7))).le |
| 150 | have hexp : exp (-x n/(2*((J+n : ℕ) : ℝ)^5)+x n/(2*((J-1+n : ℕ) : ℝ)^7)) = |
| 151 | exp (-(1/2)*(x n/((J+n : ℕ) : ℝ)^5)+(1/2)*(x n/((J-1+n : ℕ) : ℝ)^7)) := by |
| 152 | congr 1 |
| 153 | ring |
| 154 | rw [hexp] at he |
| 155 | convert! he using 1 <;> simp only [sourceTimeRatio, monomialCost, rpow_ofNat, pow_zero, mul_one] |
| 156 | · rw [hexp] |
| 157 | · ring |
| 158 | |
| 159 | theorem sourceParentSquareRatio_eq (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : |
| 160 | exp (2*x n/((J-1+n : ℕ) : ℝ)^7)/exp (x n/((J+n : ℕ) : ℝ)^5) = |
| 161 | monomialCost J 1 7 5 1 2 1 0 0 x n := by |
| 162 | rw [← exp_sub] |
| 163 | simp only [monomialCost, pow_zero, mul_one, one_mul, rpow_ofNat] |
| 164 | congr 1 |
| 165 | ring |
| 166 | |
| 167 | theorem sourceGoodCost_bound (J : ℕ) (hJ : 3 ≤ J) (x : ℕ → ℝ) (n : ℕ) (hx : 0 ≤ x n) : |
| 168 | exp (-x n/((J+n : ℕ) : ℝ)^3)*exp (x n/((J+n : ℕ) : ℝ)^5)* |
| 169 | exp (x n/((J-1+n : ℕ) : ℝ)^7) ≤ monomialCost J 1 5 3 1 2 1 0 0 x n := by |
| 170 | have hp : (1 : ℝ) ≤ (J-1+n : ℕ) := by exact_mod_cast (show 1 ≤ J-1+n by omega) |
| 171 | have hpj : ((J-1+n : ℕ) : ℝ) ≤ (J+n : ℕ) := by exact_mod_cast (show J-1+n ≤ J+n by omega) |
| 172 | have hd₁ := div_le_div_of_nonneg_left hx (by positivity : 0 < ((J-1+n : ℕ) : ℝ)^5) |
| 173 | (pow_le_pow_left₀ (le_trans zero_le_one hp) hpj 5) |
| 174 | have hd₂ := div_le_div_of_nonneg_left hx (by positivity : 0 < ((J-1+n : ℕ) : ℝ)^5) |
| 175 | (pow_le_pow_right₀ hp (by decide : 5 ≤ 7)) |
| 176 | rw [← exp_add, ← exp_add] |
| 177 | simp only [monomialCost, pow_zero, one_mul, neg_one_mul, rpow_ofNat] |
| 178 | apply exp_le_exp.mpr |
| 179 | simp only [div_eq_mul_inv] at hd₁ hd₂ ⊢ |
| 180 | linarith only [hd₁, hd₂] |
| 181 | |
| 182 | end EulerPacketSourceScaleBounds |
| 183 | end |
| 184 | |
| 185 | end |
| 186 | |
| 187 | noncomputable section |
| 188 | |
| 189 | |
| 190 | namespace EulerPacketSourceScaleChoice |
| 191 | |
| 192 | open Real Filter EulerScale EulerPacketSourceScales EulerPacketSourceTime |
| 193 | EulerPacketScaleGeometry EulerPacketFiniteScaleChoice EulerPacketSourceScaleBounds |
| 194 | |
| 195 | open scoped Topology |
| 196 | |
| 197 | structure CostSpec where |
| 198 | d : ℕ |
| 199 | B : ℕ |
| 200 | N : ℕ |
| 201 | a : ℝ |
| 202 | b : ℝ |
| 203 | c : ℝ |
| 204 | C : ℝ |
| 205 | p : ℕ |
| 206 | q : ℕ |
| 207 | d_le_two : d ≤ 2 |
| 208 | a_nonneg : 0 ≤ a |
| 209 | a_lt_B : a < B |
| 210 | a_le_N : a ≤ N |
| 211 | b_pos : 0 < b |
| 212 | C_pos : 0 < C |
| 213 | |
| 214 | def CostSpec.cost (s : CostSpec) (J : ℕ) (x : ℕ → ℝ) : ℕ → ℝ := |
| 215 | monomialCost J s.d s.B s.a s.b s.c s.C s.p s.q x |
| 216 | |
| 217 | /-- A finite list of literal exponential costs has summable, uniformly |
| 218 | small terms and a small total, using one fixed stage and then one base scale. -/ |
| 219 | theorem finite_uniform_choice {ι : Type*} [Fintype ι] (s : ι → CostSpec) : |
| 220 | ∃ J : ℕ, 3 ≤ J ∧ ∀ δ : ℝ, 0 < δ → ∃ X₀ : ℝ, 8 ≤ X₀ ∧ |
| 221 | ∀ x : ℕ → ℝ, X₀ ≤ x 0 → |
| 222 | (∀ n, x (n+1) = ((J+n : ℕ) : ℝ)^2*x n) → |
| 223 | ∀ i, Summable ((s i).cost J x) ∧ |
| 224 | (∑' n, (s i).cost J x n) ≤ δ ∧ ∀ n, (s i).cost J x n ≤ δ := by |
| 225 | obtain ⟨J, hJ, hchoice⟩ := finite_source_uniform_small_sum_choice |
| 226 | (fun i => (s i).d) (fun i => (s i).B) (fun i => (s i).N) |
| 227 | (fun i => (s i).a) (fun i => (s i).b) (fun i => (s i).c) |
| 228 | (fun i => log (s i).C) (fun i => ((s i).p : ℝ)) (fun i => ((s i).q : ℝ)) |
| 229 | (fun i => (s i).a_lt_B) (fun i => (s i).a_le_N) (fun i => (s i).b_pos) |
| 230 | refine ⟨J, hJ, ?_⟩ |
| 231 | intro δ hδ |
| 232 | obtain ⟨X₀, hX₀, hX⟩ := hchoice δ hδ |
| 233 | refine ⟨max 8 X₀, le_max_left _ _, ?_⟩ |
| 234 | intro x hx0 hx i |
| 235 | have hstart : X₀ ≤ x 0 := (le_max_right _ _).trans hx0 |
| 236 | have hxp := quadratic_growth_pos J (by omega) x (lt_of_lt_of_le zero_lt_one (hX₀.trans hstart)) hx |
| 237 | have hdJ : (s i).d < J := lt_of_le_of_lt (s i).d_le_two (by omega) |
| 238 | have hsum : Summable ((s i).cost J x) := |
| 239 | polynomial_source_scale_summable J (s i).d (s i).B hdJ x (hxp 0) hx |
| 240 | (s i).a (s i).b (s i).c (s i).C (s i).p (s i).q |
| 241 | (s i).a_nonneg (s i).a_lt_B (s i).b_pos (s i).C_pos |
| 242 | have hbound : (∑' n, (s i).cost J x n) ≤ δ := by |
| 243 | convert! hX x hstart hx i using 1 |
| 244 | apply tsum_congr |
| 245 | intro n |
| 246 | exact monomialCost_eq_exp J (s i).d (s i).B (s i).a (s i).b (s i).c (s i).C |
| 247 | (s i).p (s i).q x n (by omega) (s i).C_pos (hxp n) |
| 248 | refine ⟨hsum, hbound, ?_⟩ |
| 249 | intro n |
| 250 | apply le_trans (hsum.le_tsum n ?_) hbound |
| 251 | intro m hm |
| 252 | exact monomialCost_nonneg J (s i).d (s i).B (s i).a (s i).b (s i).c (s i).C |
| 253 | (s i).p (s i).q x m (s i).C_pos.le (hxp m).le |
| 254 | |
| 255 | inductive SourceCost |
| 256 | | shear | prior | neighbor | extra | width | parent | good |
| 257 | deriving DecidableEq |
| 258 | |
| 259 | instance : Fintype SourceCost where |
| 260 | elems := {.shear, .prior, .neighbor, .extra, .width, .parent, .good} |
| 261 | complete c := by cases c <;> simp |
| 262 | |
| 263 | def sourceCostSpec (C c : ℝ) (hC : 1 ≤ C) (A : ℕ) : SourceCost → CostSpec |
| 264 | | .shear => { |
| 265 | d := 2, B := 9, N := 7, a := 7, b := 1/2, c := 2, |
| 266 | C := 128*(2*C)^(A+1), p := 2*(A+1), q := 2*(A+1), |
| 267 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 268 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by positivity } |
| 269 | | .prior => { |
| 270 | d := 0, B := 5, N := 4, a := 4, b := 1/4, c := 0, |
| 271 | C := 16*(2*C)^A, p := 2*A, q := 2*A, |
| 272 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 273 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by positivity } |
| 274 | | .neighbor => { |
| 275 | d := 1, B := 4, N := 4, a := 7/2, b := 1, c := 2*c, |
| 276 | C := 16*(2*C)^A, p := 2*A, q := 2*A, |
| 277 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 278 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by positivity } |
| 279 | | .extra => { |
| 280 | d := 1, B := 7, N := 5, a := 5, b := 1/2, c := 1/2, |
| 281 | C := 48*(2*C)^A, p := 6+2*A, q := 2+2*A, |
| 282 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 283 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by positivity } |
| 284 | | .width => { |
| 285 | d := 1, B := 7, N := 5, a := 5, b := 1/2, c := 1/2, |
| 286 | C := 4, p := 4, q := 0, |
| 287 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 288 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by norm_num } |
| 289 | | .parent => { |
| 290 | d := 1, B := 7, N := 5, a := 5, b := 1, c := 2, |
| 291 | C := 1, p := 0, q := 0, |
| 292 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 293 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by norm_num } |
| 294 | | .good => { |
| 295 | d := 1, B := 5, N := 3, a := 3, b := 1, c := 2, |
| 296 | C := 1, p := 0, q := 0, |
| 297 | d_le_two := by norm_num, a_nonneg := by norm_num, a_lt_B := by norm_num, |
| 298 | a_le_N := by norm_num, b_pos := by norm_num, C_pos := by norm_num } |
| 299 | |
| 300 | structure SmallSeries (f : ℕ → ℝ) (δ : ℝ) : Prop where |
| 301 | nonneg : ∀ n, 0 ≤ f n |
| 302 | summable : Summable f |
| 303 | total_le : (∑' n, f n) ≤ δ |
| 304 | |
| 305 | theorem SmallSeries.term_le {f : ℕ → ℝ} {δ : ℝ} (h : SmallSeries f δ) (n : ℕ) : f n ≤ δ := |
| 306 | (h.summable.le_tsum n (fun m _ => h.nonneg m)).trans h.total_le |
| 307 | |
| 308 | theorem SmallSeries.weaken {f : ℕ → ℝ} {δ η : ℝ} (h : SmallSeries f δ) (hle : δ ≤ η) : |
| 309 | SmallSeries f η := ⟨h.nonneg, h.summable, h.total_le.trans hle⟩ |
| 310 | |
| 311 | theorem SmallSeries.mono {f g : ℕ → ℝ} {δ : ℝ} (h : SmallSeries f δ) |
| 312 | (hg : ∀ n, 0 ≤ g n) (hle : ∀ n, g n ≤ f n) : SmallSeries g δ := by |
| 313 | have hs := h.summable.of_nonneg_of_le hg hle |
| 314 | exact ⟨hg, hs, (hs.tsum_le_tsum hle h.summable).trans h.total_le⟩ |
| 315 | |
| 316 | def coefficientCost (J : ℕ) (C c : ℝ) (A : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := |
| 317 | sourceCoefficientError J C c x n * sourceTheta J C x n^A |
| 318 | |
| 319 | def extraTimeCost (J : ℕ) (C : ℝ) (A : ℕ) (x a : ℕ → ℝ) (n : ℕ) : ℝ := |
| 320 | 2*sqrt (a n*exp (x n/((J-1+n : ℕ) : ℝ)^7))*sourceNextTimeWidth J x n* |
| 321 | sourceTheta J C x n^A |
| 322 | |
| 323 | def parentSquareRatio (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := |
| 324 | exp (2*x n/((J-1+n : ℕ) : ℝ)^7)/exp (x n/((J+n : ℕ) : ℝ)^5) |
| 325 | |
| 326 | def goodCost (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := |
| 327 | exp (-x n/((J+n : ℕ) : ℝ)^3)*exp (x n/((J+n : ℕ) : ℝ)^5)* |
| 328 | exp (x n/((J-1+n : ℕ) : ℝ)^7) |
| 329 | |
| 330 | structure UniformBounds (J : ℕ) (C c : ℝ) (A : ℕ) (x : ℕ → ℝ) (δ : ℝ) : Prop where |
| 331 | coefficient : SmallSeries (coefficientCost J C c A x) δ |
| 332 | extraTime : ∀ a : ℕ → ℝ, (∀ n, 0 ≤ a n) → (∀ n, a n ≤ 2) → |
| 333 | SmallSeries (extraTimeCost J C A x a) δ |
| 334 | width : SmallSeries (sourceTimeRatio J x) δ |
| 335 | parent : SmallSeries (parentSquareRatio J x) δ |
| 336 | good : SmallSeries (goodCost J x) δ |
| 337 | |
| 338 | /-- The sequence in (37), now constructed rather than supplied. -/ |
| 339 | def scaleSequence (J : ℕ) (X : ℝ) : ℕ → ℝ |
| 340 | | 0 => X |
| 341 | | n+1 => ((J+n : ℕ) : ℝ)^2*scaleSequence J X n |
| 342 | |
| 343 | @[simp] theorem scaleSequence_zero (J : ℕ) (X : ℝ) : scaleSequence J X 0 = X := rfl |
| 344 | |
| 345 | theorem scaleSequence_succ (J : ℕ) (X : ℝ) (n : ℕ) : |
| 346 | scaleSequence J X (n+1) = ((J+n : ℕ) : ℝ)^2*scaleSequence J X n := rfl |
| 347 | |
| 348 | end EulerPacketSourceScaleChoice |