This journal is in preparation. Submissions are open as a pilot and the editorial board is being formed. Articles marked Demonstration show the format only.
Journal of Machine-Verified MathematicsPeer-reviewed mathematics with machine-checked proofs, for the age of AI

E424/LowBand/L40.lean

All files · 227 lines · source at the verified commit

1module
2
3public import E424.LowBand.Defs
4public import E424.Setup.L3log
5public import E424.PropD
6public import E424.LowBand.L40Aux2
7public import E424.LowBand.L40Aux3
8public import E424.LowBand.L39Aux
9
10@[expose] public section
11
12/-!
13# Section 9 of the outline: L40 (assembly)
14-/
15
16set_option linter.style.header false
17open Finset MeasureTheory
18
19namespace E424
20
21set_option maxHeartbeats 1600000 in
22/-- **Lemma 40.** `C` must not depend on `τ`. -/
23theorem L40 (η : ℝ) (hη : 0 < η) (hη1 : η ≤ 1 / 1000) : ∃ C > 0, ∀ τ e : ℝ, 0 < τ → τ ≤ η / 4 → 0 < e →
24 ∃ N0 : ℝ, ∀ W : Win, W.Adm η N0 → W.len ≤ 21 / 10 * η * Real.log W.lo → ∀ ςn r0 : ℝ, 0 ≤ ςn → 0 ≤ r0 →
25 L2err W ≤ ςn * W.len → (∀ x ∈ Set.Icc 0 (Lt W τ), rhoq W τ 0 x ≤ r0) →
26 W.E F ≤ C * (r0 + Real.sqrt ςn + τ / η) + e := by
27 obtain ⟨α, hα, hα1, x0, hx0, hL3⟩ := L3_int
28 obtain ⟨N1, hb⟩ := L35_bounds
29 refine ⟨2 / α + 1, by positivity, fun τ e hτ hτη he => ?_⟩
30 set e1 := α * e / 4 with he1
31 have he1p : 0 < e1 := by positivity
32 obtain ⟨N2, hD⟩ := PropD η hη 1 e1 he1p
33 refine ⟨max (max N1 N2) (max x0 (Real.exp (30 / η + 15 / (2 * τ * e1) + 16 / (η * e)))), fun W hW _ ςn r0 hς hr0 hL2 hrho => ?_⟩
34 have hlo1 : N1 ≤ W.lo := (le_max_left _ _).trans ((le_max_left _ _).trans hW.le_lo)
35 have hlo2 : N2 ≤ W.lo := (le_max_right _ _).trans ((le_max_left _ _).trans hW.le_lo)
36 have hlo3 : x0 ≤ W.lo := (le_max_left _ _).trans ((le_max_right _ _).trans hW.le_lo)
37 have hlo4 := (le_max_right _ _).trans ((le_max_right _ _).trans hW.le_lo)
38 have hT : 30 / η + 15 / (2 * τ * e1) + 16 / (η * e) ≤ Real.log W.lo := by
39 have := Real.log_le_log (Real.exp_pos _) hlo4
40 rwa [Real.log_exp] at this
41 have hlo0 := hW.lo_pos
42 have hhi0 := hW.hi_pos
43 have hlt := hW.lo_lt
44 have hlo1' : 1 ≤ W.lo := by linarith [hW.three_le]
45 have hW2 : W.Adm η N2 := ⟨hW.three_le, hW.lo_lt, hlo2, hW.le_len, hW.len_le⟩
46 have hmu : W.mu G1 ≤ e1 := (hD W hW2).1.2.2.2.1
47 have hT0 : 0 ≤ Real.log W.lo := by linarith [hW.one_lt_log]
48 have t1 : 0 ≤ 30 / η := by positivity
49 have t2 : 0 ≤ 15 / (2 * τ * e1) := by positivity
50 have t3 : 0 ≤ 16 / (η * e) := by positivity
51 have hT1 : 30 ≤ η * Real.log W.lo := by
52 have : 30 / η ≤ Real.log W.lo := by linarith
53 rwa [div_le_iff₀ hη, mul_comm] at this
54 have hT2 : 15 ≤ 2 * τ * e1 * Real.log W.lo := by
55 have : 15 / (2 * τ * e1) ≤ Real.log W.lo := by linarith
56 rwa [div_le_iff₀ (by positivity), mul_comm] at this
57 have hT3 : 16 ≤ η * e * Real.log W.lo := by
58 have : 16 / (η * e) ≤ Real.log W.lo := by linarith
59 rwa [div_le_iff₀ (by positivity), mul_comm] at this
60 have hlen := hW.le_len
61 have hlenp : 0 < W.len := by linarith
62 have hL : Lt W τ = 0.4 * (τ * Real.log W.lo) := by
63 show τ * (0.4 * Real.log W.lo) = _; ring
64 have hLpos : 0 < Lt W τ := by rw [hL]; nlinarith [hW.one_lt_log]
65 have hLlen : Lt W τ ≤ 0.1 * W.len := by
66 rw [hL]
67 have := mul_le_mul_of_nonneg_right hτη hT0
68 linarith
69 have hLe : 3 ≤ e1 * Lt W τ := by rw [hL]; linarith
70 have hXe := Xlen_eq W τ hlo0 hhi0
71 have hP : Xlen W τ = W.len - 6 - 2 * Lt W τ := rfl
72 have hlenlog : W.len = Real.log W.hi - Real.log W.lo := Real.log_div hhi0.ne' hlo0.ne'
73 have hPpos : 0 < Xlen W τ := by rw [hP]; linarith
74 have hPlen : Xlen W τ ≤ W.len := by rw [hP]; linarith
75 -- the ambient functions
76 set T := Real.log W.lo with hTdef
77 set L := Lt W τ with hLdef
78 set a := T + 3 with hadef
79 set b := Real.log W.hi - 3 - 2 * L with hbdef
80 have hba : b - a = Xlen W τ := by linarith [hXe]
81 have hab : a ≤ b := by linarith
82 have hLb : b + L ≤ Real.log W.hi - 3 := by linarith
83 set g : ℝ → ℝ := fun x => F ⌊Real.exp x⌋₊ with hgdef
84 set γ : ℝ → ℝ := fun x => ind (⌊Real.exp x⌋₊ ∈ G1) with hγdef
85 set h : ℝ → ℝ := Fb (Qs W.lo) with hhdef
86 have hh2 : ∀ x ∈ Set.Icc a (b + L), |h x| ≤ 2 := by
87 intro x hx
88 obtain ⟨h0, h1, -⟩ := hb W.lo hlo1 x (by linarith [hx.1])
89 have : W.lo ^ (-(0.4 : ℝ)) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hlo1' (by norm_num)
90 rw [abs_of_nonneg h0]; linarith
91 have hR : ∀ x ∈ Set.Icc (0 : ℝ) L, ∫ z in a..b, |h z - h (z + x)| ≤ r0 * Xlen W τ := by
92 intro x hx
93 have := hrho x hx
94 unfold rhoq at this
95 rw [div_le_iff₀ hPpos] at this
96 simpa [hhdef, hadef, hbdef, hTdef, hLdef] using this
97 have hL3' : ∀ z ∈ Set.Icc a b, α * L - 3 ≤ ∫ x in z..(z + L), ((1 - g x) + γ x) := by
98 intro z hz
99 have hx0z : x0 ≤ Real.exp z := hlo3.trans (by
100 rw [← Real.log_le_iff_le_exp hlo0]; linarith [hz.1])
101 have := hL3 (Real.exp z) (Real.exp (z + L)) hx0z (Real.exp_le_exp.2 (by linarith))
102 have e2 : Real.log (Real.exp (z + L) / Real.exp z) = L := by
103 rw [← Real.exp_sub, Real.log_exp]; ring
104 rw [e2, Real.log_exp, Real.log_exp] at this
105 exact this
106 have hcore := core (g := g) (γ := γ) (h := h) (α := α) (L := L) (a := a) (b := b)
107 (R := r0 * Xlen W τ) (Sm35.measurable_floor_exp F) (Sm35.measurable_floor_exp fun n => ind (n ∈ G1))
108 (measurable_Fb _) (fun x => f_eq_zero_or_one _) (fun x => ind_nonneg _) (fun x => ind_le_one _)
109 hh2 hα hLpos hab hL3' hR
110 -- `F̄` is bounded by 2 on all of `[a, ∞)`
111 have hh2' : ∀ x, a ≤ x → |h x| ≤ 2 := by
112 intro x hx
113 obtain ⟨h0, h1, -⟩ := hb W.lo hlo1 x (by linarith)
114 have : W.lo ^ (-(0.4 : ℝ)) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hlo1' (by norm_num)
115 rw [abs_of_nonneg h0]; linarith
116 have hq : a ≤ Real.log W.hi - 3 := by linarith
117 have hgm : Measurable g := Sm35.measurable_floor_exp F
118 have hhm : Measurable h := measurable_Fb _
119 have hg1 : ∀ x, |g x| ≤ 1 := fun x => by
120 rw [abs_of_nonneg (F_nonneg _)]; exact F_le_one _
121 have hu3 : ∀ x, a ≤ x → |g x - h x| ≤ 3 := fun x hx =>
122 (abs_sub _ _).trans (by linarith [hg1 x, hh2' x hx])
123 -- (1) `L²` to `L¹`
124 have hΔ : ∫ x in a..(b + L), |h x - g x| ≤ Real.sqrt ςn * W.len := by
125 refine le_of_forall_pos_le_add fun ε hε => ?_
126 set lam := Real.sqrt ςn + ε / W.len with hlam
127 have hlam0 : 0 < lam := by positivity
128 have hlam2 : ςn ≤ lam ^ 2 := by
129 have : Real.sqrt ςn ≤ lam := by rw [hlam]; have : 0 ≤ ε / W.len := by positivity
130 linarith
131 calc ςn = Real.sqrt ςn ^ 2 := (Real.sq_sqrt hς).symm
132 _ ≤ lam ^ 2 := by gcongr
133 have hii : ∀ φ : ℝ → ℝ, Measurable φ → (∀ x, a ≤ x → |φ x| ≤ 9) →
134 IntervalIntegrable φ volume a (Real.log W.hi - 3) :=
135 fun φ hφ hb9 => ii_of_bdd hq hφ fun x hx => hb9 x hx.1
136 have hum : Measurable fun x => g x - h x := hgm.sub hhm
137 have key := l1_le (u := fun x => g x - h x) hq hlam0 (D := W.len) (by linarith)
138 (hii _ hum.abs fun x hx => by rw [abs_abs]; linarith [hu3 x hx])
139 (hii _ (hum.pow_const 2) fun x hx => by
140 rw [abs_of_nonneg (sq_nonneg _), sq]
141 have := hu3 x hx
142 have := abs_nonneg (g x - h x)
143 nlinarith [abs_mul_abs_self (g x - h x)])
144 (by
145 have : (∫ x in a..(Real.log W.hi - 3), (g x - h x) ^ 2) = L2err W := rfl
146 rw [this]
147 calc L2err W ≤ ςn * W.len := hL2
148 _ ≤ lam ^ 2 * W.len := mul_le_mul_of_nonneg_right hlam2 hlenp.le)
149 have hmono : ∫ x in a..(b + L), |h x - g x| ≤ ∫ x in a..(Real.log W.hi - 3), |g x - h x| := by
150 have e0 : ∀ x, |h x - g x| = |g x - h x| := fun x => abs_sub_comm _ _
151 simp_rw [e0]
152 exact intervalIntegral.integral_mono_interval le_rfl (by linarith) hLb
153 (Filter.Eventually.of_forall fun x => abs_nonneg _)
154 (hii _ hum.abs fun x hx => by rw [abs_abs]; linarith [hu3 x hx])
155 have : lam * W.len = Real.sqrt ςn * W.len + ε := by rw [hlam]; field_simp
156 linarith
157 -- (2) the exceptional set
158 have hm_le : ((⌊W.lo⌋₊ + 1 : ℕ) : ℝ) ≤ Real.exp a := by
159 have h1 : ((⌊W.lo⌋₊ + 1 : ℕ) : ℝ) ≤ W.lo + 1 := by push_cast; linarith [Nat.floor_le hlo0.le]
160 have h2 : Real.exp a = W.lo * Real.exp 3 := by
161 rw [hadef, Real.exp_add, hTdef, Real.exp_log hlo0]
162 have h3 := Real.add_one_le_exp (3 : ℝ)
163 rw [h2]; nlinarith
164 have hlogm : Real.log (⌊W.lo⌋₊ + 1 : ℕ) ≤ a := by
165 rwa [Real.log_le_iff_le_exp (by positivity)]
166 have hM_gt : W.hi < ((⌊W.hi⌋₊ + 1 : ℕ) : ℝ) := by push_cast; exact Nat.lt_floor_add_one W.hi
167 have hlogM : Real.log W.hi < Real.log (⌊W.hi⌋₊ + 1 : ℕ) := Real.log_lt_log hhi0 hM_gt
168 have hΓ : ∫ x in a..(b + L), γ x ≤ e1 * W.len := by
169 have := win_int_le (g := fun n => ind (n ∈ G1)) (fun n => ind_nonneg _) (fun n => ind_le_one _)
170 hlt hlogm (by linarith : a ≤ b + L) (by linarith)
171 refine this.trans ?_
172 rw [Win.sum_eq_E_mul hlenp]
173 exact mul_le_mul_of_nonneg_right hmu hlenp.le
174 -- (3) the edge term
175 have hedge : 3 * (b - a) / L ≤ e1 * W.len := by
176 rw [div_le_iff₀ hLpos, hba]
177 nlinarith [hLe, hPlen, hlenp]
178 -- (4) from the sum to the integral
179 have hlogm' : T ≤ Real.log (⌊W.lo⌋₊ + 1 : ℕ) := by
180 refine Real.log_le_log hlo0 ?_
181 push_cast; linarith [Nat.lt_floor_add_one W.lo]
182 have hlogM2 : Real.log (⌊W.hi⌋₊ + 1 : ℕ) ≤ Real.log W.hi + 1 := by
183 have hM2 : ((⌊W.hi⌋₊ + 1 : ℕ) : ℝ) ≤ 2 * W.hi := by
184 push_cast; linarith [Nat.floor_le hhi0.le, show 1 ≤ W.hi by linarith]
185 calc Real.log (⌊W.hi⌋₊ + 1 : ℕ) ≤ Real.log (2 * W.hi) := Real.log_le_log (by positivity) hM2
186 _ = Real.log 2 + Real.log W.hi := Real.log_mul (by norm_num) hhi0.ne'
187 _ ≤ Real.log W.hi + 1 := by linarith [Real.log_two_lt_d9]
188 have hsumF := win_sum_le (g := F) F_nonneg F_le_one hlt hlogm (b := b) (by linarith)
189 -- (5) assembly
190 have hX : α * ∫ z in a..b, g z ≤ W.len * (2 * Real.sqrt ςn + 2 * e1 + r0) := by
191 have : r0 * Xlen W τ ≤ r0 * W.len := mul_le_mul_of_nonneg_left hPlen hr0
192 linarith [hcore, hΔ, hΓ, hedge]
193 have hXd : (∫ z in a..b, g z) ≤ W.len * ((2 * Real.sqrt ςn + r0) / α) + W.len * e / 2 := by
194 have h1 : ∫ z in a..b, g z ≤ W.len * (2 * Real.sqrt ςn + 2 * e1 + r0) / α := by
195 rw [le_div_iff₀ hα]; linarith
196 have h2 : W.len * (2 * Real.sqrt ςn + 2 * e1 + r0) / α =
197 W.len * ((2 * Real.sqrt ςn + r0) / α) + W.len * e / 2 := by
198 rw [he1]; field_simp; ring
199 linarith
200 have hK : (2 * Real.sqrt ςn + r0) / α ≤ 2 / α * (r0 + Real.sqrt ςn) := by
201 calc (2 * Real.sqrt ςn + r0) / α ≤ (2 * (r0 + Real.sqrt ςn)) / α :=
202 div_le_div_of_nonneg_right (by linarith [Real.sqrt_nonneg ςn]) hα.le
203 _ = 2 / α * (r0 + Real.sqrt ςn) := by ring
204 have hL2' : 2 * L ≤ 0.8 * (τ / η) * W.len := by
205 rw [hL]
206 have : τ * Real.log W.lo ≤ τ / η * W.len := by
207 rw [div_mul_eq_mul_div, le_div_iff₀ hη]
208 linarith [mul_le_mul_of_nonneg_left hlen hτ.le]
209 linarith
210 have h8 : 8 ≤ W.len * e / 2 := by linarith [mul_le_mul_of_nonneg_right hlen he.le, hT3]
211 have hK' := mul_le_mul_of_nonneg_left hK hlenp.le
212 have hexp : W.len * (2 / α * (r0 + Real.sqrt ςn) + e + 0.8 * (τ / η)) =
213 W.len * (2 / α * (r0 + Real.sqrt ςn)) + W.len * e + 0.8 * (τ / η) * W.len := by ring
214 have hsum : W.sum F ≤ W.len * (2 / α * (r0 + Real.sqrt ςn) + e + 0.8 * (τ / η)) := by
215 rw [hexp]
216 linarith [hsumF, hXd, hlogm', hlogM2, hL2', h8, hK']
217 unfold Win.E
218 rw [div_le_iff₀ hlenp]
219 have hpos : 0 ≤ 2 / α * (τ / η) + (r0 + Real.sqrt ςn) + 0.2 * (τ / η) := by positivity
220 have hfin : ((2 / α + 1) * (r0 + Real.sqrt ςn + τ / η) + e) * W.len =
221 W.len * (2 / α * (r0 + Real.sqrt ςn) + e + 0.8 * (τ / η)) +
222 W.len * (2 / α * (τ / η) + (r0 + Real.sqrt ςn) + 0.2 * (τ / η)) := by ring
223 rw [hfin]
224 linarith [mul_nonneg hlenp.le hpos]
225
226end E424
227