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/L39Aux.lean

All files · 271 lines · source at the verified commit

1module
2
3public import E424.LowBand.Defs
4
5@[expose] public section
6
7/-!
8# Section 9: helpers for Lemma 39
9
10`Fb` is continuous and bounded on the ranges where `rhoq` and `dq` evaluate it. `rhoq` is a
11pseudo-metric on `[0, L]`, and `rhoq_le_dq` compares it with `dq` at two points of `U`, up to an
12edge term `164 (L + 1) / Xlen`.
13-/
14
15set_option linter.style.header false
16open Finset MeasureTheory
17
18namespace E424
19
20/-- `0 ≤ F̄ ≤ 41` where `Q ≤ e^x`, from the triangle-kernel bounds of Lemma 35. -/
21theorem fb_bounds {Q x : ℝ} (hQ : 100 ≤ Q) (hx : 40 * Q ≤ Real.exp x) :
22 0 ≤ Fb Q x ∧ Fb Q x ≤ 41 := by
23 have h := Sm35.Fb_le (by linarith : (10 : ℝ) ≤ Q) (by linarith : Q ≤ Real.exp x)
24 have hle : 40 * Q / Real.exp x ≤ 40 := by
25 rw [div_le_iff₀ (Real.exp_pos x)]; linarith
26 exact ⟨Sm35.Fb_nonneg (by linarith) x, by linarith⟩
27
28/-- `F̄` is continuous on the set where `40 Q ≤ e^t`, by the Lipschitz bound of Lemma 35. -/
29theorem fb_contOn {Q : ℝ} (hQ : 100 ≤ Q) : ContinuousOn (Fb Q) {t | 40 * Q ≤ Real.exp t} := by
30 have hL : LipschitzOnWith (Real.toNNReal (4 * Q)) (Fb Q) {t | 40 * Q ≤ Real.exp t} := by
31 refine LipschitzOnWith.of_dist_le_mul fun x hx y hy => ?_
32 rw [Real.dist_eq, Real.dist_eq, Real.coe_toNNReal _ (by linarith)]
33 exact Sm35.Fb_lip hQ hx hy
34 exact hL.continuousOn
35
36/-- `z ↦ F̄ (g z)` is continuous on `s` when every `g z` lies in the Lipschitz range. -/
37theorem fb_comp_contOn {Q : ℝ} (hQ : 100 ≤ Q) {s : Set ℝ} {g : ℝ → ℝ} (hg : ContinuousOn g s)
38 (hdom : ∀ z ∈ s, 40 * Q ≤ Real.exp (g z)) : ContinuousOn (fun z => Fb Q (g z)) s :=
39 (fb_contOn hQ).comp hg fun z hz => hdom z hz
40
41/-- Shifting the integration variable by `s` moves the endpoints by `s`. The integrand is bounded
42by `M` on `[a - |s|, b + |s|]`, so the two integrals differ by at most `2 M |s|`. -/
43theorem sliver {f : ℝ → ℝ} {a b s M : ℝ} (hab : a ≤ b)
44 (hc : ContinuousOn f (Set.Icc (a - |s|) (b + |s|)))
45 (hM : ∀ t ∈ Set.Icc (a - |s|) (b + |s|), |f t| ≤ M) :
46 |(∫ t in (a + s)..(b + s), f t) - ∫ t in a..b, f t| ≤ 2 * M * |s| := by
47 set I := Set.Icc (a - |s|) (b + |s|) with hI
48 have hs1 : -|s| ≤ s := neg_abs_le s
49 have hs2 : s ≤ |s| := le_abs_self s
50 have hmem : ∀ p ∈ ({a, b, a + s, b + s} : Set ℝ), p ∈ I := by
51 intro p hp
52 rcases hp with rfl | rfl | rfl | rfl <;> simp only [hI, Set.mem_Icc] <;> constructor <;> linarith [abs_nonneg s]
53 have hint : ∀ p ∈ ({a, b, a + s, b + s} : Set ℝ), ∀ q ∈ ({a, b, a + s, b + s} : Set ℝ),
54 IntervalIntegrable f volume p q := fun p hp q hq =>
55 (hc.mono (Set.uIcc_subset_Icc (hmem p hp) (hmem q hq))).intervalIntegrable (μ := volume)
56 have ia : IntervalIntegrable f volume a (b + s) := hint a (by simp) (b + s) (by simp)
57 have iaa : IntervalIntegrable f volume a (a + s) := hint a (by simp) (a + s) (by simp)
58 have iab : IntervalIntegrable f volume a b := hint a (by simp) b (by simp)
59 have e1 : (∫ t in a..(b + s), f t) - ∫ t in a..(a + s), f t = ∫ t in (a + s)..(b + s), f t :=
60 intervalIntegral.integral_interval_sub_left ia iaa
61 have e2 : (∫ t in a..(b + s), f t) - ∫ t in a..b, f t = ∫ t in b..(b + s), f t :=
62 intervalIntegral.integral_interval_sub_left ia iab
63 have hb : ‖∫ t in b..(b + s), f t‖ ≤ M * |s| := by
64 have := intervalIntegral.norm_integral_le_of_norm_le_const (a := b) (b := b + s) (C := M)
65 fun x hx => by
66 rw [Real.norm_eq_abs]
67 exact hM x (Set.uIcc_subset_Icc (hmem b (by simp)) (hmem (b + s) (by simp))
68 (Set.uIoc_subset_uIcc hx))
69 rwa [show b + s - b = s by ring] at this
70 have ha : ‖∫ t in a..(a + s), f t‖ ≤ M * |s| := by
71 have := intervalIntegral.norm_integral_le_of_norm_le_const (a := a) (b := a + s) (C := M)
72 fun x hx => by
73 rw [Real.norm_eq_abs]
74 exact hM x (Set.uIcc_subset_Icc (hmem a (by simp)) (hmem (a + s) (by simp))
75 (Set.uIoc_subset_uIcc hx))
76 rwa [show a + s - a = s by ring] at this
77 rw [Real.norm_eq_abs] at hb ha
78 have hM0 : 0 ≤ M := by
79 have := hM a (by simp only [hI, Set.mem_Icc]; constructor <;> linarith [abs_nonneg s])
80 exact (abs_nonneg _).trans this
81 have hb' := abs_le.1 hb
82 have ha' := abs_le.1 ha
83 have key : (∫ t in (a + s)..(b + s), f t) - ∫ t in a..b, f t
84 = (∫ t in b..(b + s), f t) - ∫ t in a..(a + s), f t := by linarith
85 rw [key, abs_le]
86 constructor <;> linarith
87
88/-- `Xlen` as the difference of the two integration endpoints of `rhoq`. -/
89theorem Xlen_eq (W : Win) (τ : ℝ) (hlo : 0 < W.lo) (hhi : 0 < W.hi) :
90 Xlen W τ = (Real.log W.hi - 3 - 2 * Lt W τ) - (Real.log W.lo + 3) := by
91 simp only [Xlen, Win.len]
92 rw [Real.log_div hhi.ne' hlo.ne']
93 ring
94
95/-- `rhoq` is symmetric. -/
96theorem rhoq_symm (W : Win) (τ x y : ℝ) : rhoq W τ x y = rhoq W τ y x := by
97 unfold rhoq
98 congr 1
99 exact intervalIntegral.integral_congr fun z _ => abs_sub_comm _ _
100
101/-- Continuous on `[[a, b]]` gives interval integrability for the volume. -/
102theorem ii_of_contOn {u : ℝ → ℝ} {a b : ℝ} (h : ContinuousOn u (Set.uIcc a b)) :
103 IntervalIntegrable u volume a b :=
104 h.intervalIntegrable
105
106/-- Continuity of the `z`-integrands of `rhoq` on its integration range. -/
107theorem rhoq_cont (W : Win) (τ : ℝ) (hlo : 3 ≤ W.lo) (hhi : W.lo < W.hi) (hL : 0 ≤ Lt W τ)
108 (hQ : 100 ≤ Qs W.lo) (hX : 0 < Xlen W τ)
109 (hG : 40 * Qs W.lo ≤ Real.exp (Real.log W.lo + 1 - Lt W τ)) (x y : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) :
110 ContinuousOn (fun z => |Fb (Qs W.lo) (z + x) - Fb (Qs W.lo) (z + y)|)
111 (Set.uIcc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ)) := by
112 have hlo0 : 0 < W.lo := by linarith
113 have hhi0 : 0 < W.hi := by linarith
114 have hzab : Real.log W.lo + 3 ≤ Real.log W.hi - 3 - 2 * Lt W τ := by
115 have := Xlen_eq W τ hlo0 hhi0
116 linarith
117 have hGd : ∀ t, Real.log W.lo + 1 - Lt W τ ≤ t → 40 * Qs W.lo ≤ Real.exp t :=
118 fun t ht => hG.trans (Real.exp_le_exp.2 ht)
119 have hcont : ∀ w : ℝ, 0 ≤ w → ContinuousOn (fun z => Fb (Qs W.lo) (z + w))
120 (Set.uIcc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ)) := by
121 intro w hw
122 refine fb_comp_contOn hQ (continuous_add_const w).continuousOn fun t ht => ?_
123 rw [Set.uIcc_of_le hzab] at ht
124 exact hGd (t + w) (by linarith [ht.1])
125 exact continuous_abs.comp_continuousOn ((hcont x hx).sub (hcont y hy))
126
127/-- Triangle inequality for `rhoq` at `x, y, z ≥ 0`: pointwise, then integrate. -/
128theorem rhoq_tri (W : Win) (τ x y z : ℝ) (hlo : 3 ≤ W.lo) (hhi : W.lo < W.hi) (hL : 0 ≤ Lt W τ)
129 (hQ : 100 ≤ Qs W.lo) (hX : 0 < Xlen W τ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z)
130 (hG : 40 * Qs W.lo ≤ Real.exp (Real.log W.lo + 1 - Lt W τ)) :
131 rhoq W τ x z ≤ rhoq W τ x y + rhoq W τ y z := by
132 have hlo0 : 0 < W.lo := by linarith
133 have hhi0 : 0 < W.hi := by linarith
134 have hzab : Real.log W.lo + 3 ≤ Real.log W.hi - 3 - 2 * Lt W τ := by
135 have := Xlen_eq W τ hlo0 hhi0; linarith
136 unfold rhoq
137 rw [← add_div]
138 apply div_le_div_of_nonneg_right _ hX.le
139 have hpt : ∀ t ∈ Set.Icc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ),
140 |Fb (Qs W.lo) (t + x) - Fb (Qs W.lo) (t + z)| ≤
141 |Fb (Qs W.lo) (t + x) - Fb (Qs W.lo) (t + y)| + |Fb (Qs W.lo) (t + y) - Fb (Qs W.lo) (t + z)| :=
142 fun t _ => abs_sub_le _ _ _
143 have i1 : IntervalIntegrable (fun t => |Fb (Qs W.lo) (t + x) - Fb (Qs W.lo) (t + z)|) volume
144 (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ) :=
145 ii_of_contOn (rhoq_cont W τ hlo hhi hL hQ hX hG x z hx hz)
146 have i2 : IntervalIntegrable (fun t => |Fb (Qs W.lo) (t + x) - Fb (Qs W.lo) (t + y)|) volume
147 (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ) :=
148 ii_of_contOn (rhoq_cont W τ hlo hhi hL hQ hX hG x y hx hy)
149 have i3 : IntervalIntegrable (fun t => |Fb (Qs W.lo) (t + y) - Fb (Qs W.lo) (t + z)|) volume
150 (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ) :=
151 ii_of_contOn (rhoq_cont W τ hlo hhi hL hQ hX hG y z hy hz)
152 have hI := intervalIntegral.integral_mono_on hzab i1 (i2.add i3) (fun t ht => hpt t ht)
153 rw [intervalIntegral.integral_add i2 i3] at hI
154 exact hI
155
156/-- Comparison of `rhoq` with `dq`: for `x - y = u - u'` with `u, u' ∈ U`, the `z`-window of
157`rhoq` is the `d`-window shifted by `s = ell + (y - u')`, so the two differ by the sliver `164 |s|`. -/
158theorem rhoq_le_dq (W : Win) (τ x y u u' : ℝ) (hlo : 3 ≤ W.lo) (hhi : W.lo < W.hi) (hL : 0 ≤ Lt W τ)
159 (hQ : 100 ≤ Qs W.lo) (hQ' : 100 ≤ Qs (Wy W).lo)
160 (hG : 40 * Qs W.lo ≤ Real.exp (Real.log W.lo + 1 - Lt W τ))
161 (hH : 40 * Qs (Wy W).lo ≤ Real.exp (Real.log W.lo - ell W + 2 - Lt W τ))
162 (hX : 0 < Xlen W τ) (hx : 0 ≤ x) (hy : 0 ≤ y) (hyL : y ≤ Lt W τ) (hxy : x - y = u - u')
163 (hu : ell W - 1 ≤ u ∧ u ≤ ell W + Lt W τ + 1) (hu' : ell W - 1 ≤ u' ∧ u' ≤ ell W + Lt W τ + 1) :
164 rhoq W τ x y ≤ dq W τ u + dq W τ u' + 164 * (Lt W τ + 1) / Xlen W τ := by
165 have hlo0 : 0 < W.lo := by linarith
166 have hhi0 : 0 < W.hi := by linarith
167 have hXe := Xlen_eq W τ hlo0 hhi0
168 have hzab : Real.log W.lo + 3 ≤ Real.log W.hi - 3 - 2 * Lt W τ := by linarith
169 have hdab : Real.log W.lo - ell W + 3 ≤ Real.log W.hi - ell W - 3 - 2 * Lt W τ := by linarith
170 have hsL : |ell W + (y - u')| ≤ Lt W τ + 1 := abs_le.2 ⟨by linarith, by linarith⟩
171 have hGd : ∀ t, Real.log W.lo + 1 - Lt W τ ≤ t → 40 * Qs W.lo ≤ Real.exp t :=
172 fun t ht => hG.trans (Real.exp_le_exp.2 ht)
173 have hHd : ∀ t, Real.log W.lo - ell W + 2 - Lt W τ ≤ t → 40 * Qs (Wy W).lo ≤ Real.exp t :=
174 fun t ht => hH.trans (Real.exp_le_exp.2 ht)
175 -- the sliver interval `I` and the domains of `F̄` on it
176 have hIG : ∀ u₀ : ℝ, ell W - 1 ≤ u₀ → ∀ t ∈ Set.Icc (Real.log W.lo - ell W + 3 - |ell W + (y - u')|)
177 (Real.log W.hi - ell W - 3 - 2 * Lt W τ + |ell W + (y - u')|), 40 * Qs W.lo ≤ Real.exp (t + u₀) :=
178 fun u₀ hu₀ t ht => hGd _ (by linarith [ht.1, hsL, hu₀])
179 have hIH : ∀ t ∈ Set.Icc (Real.log W.lo - ell W + 3 - |ell W + (y - u')|)
180 (Real.log W.hi - ell W - 3 - 2 * Lt W τ + |ell W + (y - u')|), 40 * Qs (Wy W).lo ≤ Real.exp t :=
181 fun t ht => hHd _ (by linarith [ht.1, hsL])
182 -- `F̄` differences on the sliver interval, with the domain facts above
183 have hA : ∀ u₀ : ℝ, ell W - 1 ≤ u₀ → ContinuousOn (fun t => |Fb (Qs W.lo) (t + u₀) - Fb (Qs (Wy W).lo) t|)
184 (Set.Icc (Real.log W.lo - ell W + 3 - |ell W + (y - u')|)
185 (Real.log W.hi - ell W - 3 - 2 * Lt W τ + |ell W + (y - u')|)) := fun u₀ hu₀ =>
186 continuous_abs.comp_continuousOn
187 ((fb_comp_contOn hQ (continuous_add_const u₀).continuousOn (hIG u₀ hu₀)).sub
188 ((fb_contOn hQ').mono fun t ht => hIH t ht))
189 have hbd : ∀ u₀ : ℝ, ell W - 1 ≤ u₀ → ∀ t ∈ Set.Icc (Real.log W.lo - ell W + 3 - |ell W + (y - u')|)
190 (Real.log W.hi - ell W - 3 - 2 * Lt W τ + |ell W + (y - u')|),
191 |Fb (Qs W.lo) (t + u₀) - Fb (Qs (Wy W).lo) t| ≤ 41 := by
192 intro u₀ hu₀ t ht
193 obtain ⟨g0, g1⟩ := fb_bounds hQ (hIG u₀ hu₀ t ht)
194 obtain ⟨h0, h1⟩ := fb_bounds hQ' (hIH t ht)
195 rw [abs_le]; constructor <;> linarith
196 -- the two slivers
197 have hS1 := sliver (a := Real.log W.lo - ell W + 3) (b := Real.log W.hi - ell W - 3 - 2 * Lt W τ)
198 (s := ell W + (y - u')) (M := 41) (f := fun t => |Fb (Qs W.lo) (t + u) - Fb (Qs (Wy W).lo) t|)
199 hdab (hA u hu.1) (fun t ht => (abs_abs _).le.trans (hbd u hu.1 t ht))
200 have hS2 := sliver (a := Real.log W.lo - ell W + 3) (b := Real.log W.hi - ell W - 3 - 2 * Lt W τ)
201 (s := ell W + (y - u')) (M := 41) (f := fun t => |Fb (Qs W.lo) (t + u') - Fb (Qs (Wy W).lo) t|)
202 hdab (hA u' hu'.1) (fun t ht => (abs_abs _).le.trans (hbd u' hu'.1 t ht))
203 beta_reduce at hS1 hS2
204 have ea : Real.log W.lo - ell W + 3 + (ell W + (y - u')) = Real.log W.lo + 3 + (y - u') := by ring
205 have eb : Real.log W.hi - ell W - 3 - 2 * Lt W τ + (ell W + (y - u'))
206 = Real.log W.hi - 3 - 2 * Lt W τ + (y - u') := by ring
207 rw [ea, eb] at hS1 hS2
208 have hab1 := abs_le.1 hS1
209 have hab2 := abs_le.1 hS2
210 -- the `z`-window maps into the sliver interval under `z ↦ z + (y - u')`
211 have hzI : Set.uIcc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ)
212 = Set.Icc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ) := Set.uIcc_of_le hzab
213 have hmapsto : Set.MapsTo (fun z => z + (y - u'))
214 (Set.uIcc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ))
215 (Set.Icc (Real.log W.lo - ell W + 3 - |ell W + (y - u')|)
216 (Real.log W.hi - ell W - 3 - 2 * Lt W τ + |ell W + (y - u')|)) := by
217 intro z hz
218 rw [hzI] at hz
219 constructor
220 · linarith [hz.1, neg_abs_le (ell W + (y - u'))]
221 · linarith [hz.2, le_abs_self (ell W + (y - u'))]
222 have hF1z : ContinuousOn (fun z => |Fb (Qs W.lo) (z + (y - u') + u) - Fb (Qs (Wy W).lo) (z + (y - u'))|)
223 (Set.uIcc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ)) :=
224 (hA u hu.1).comp (continuous_add_const (y - u')).continuousOn hmapsto
225 have hF2z : ContinuousOn (fun z => |Fb (Qs W.lo) (z + (y - u') + u') - Fb (Qs (Wy W).lo) (z + (y - u'))|)
226 (Set.uIcc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ)) :=
227 (hA u' hu'.1).comp (continuous_add_const (y - u')).continuousOn hmapsto
228 -- pointwise: `|G(z+x) - G(z+y)| ≤ |G(p+u) - H p| + |G(p+u') - H p|` with `p = z + (y - u')`
229 have hpt : ∀ z ∈ Set.Icc (Real.log W.lo + 3) (Real.log W.hi - 3 - 2 * Lt W τ),
230 |Fb (Qs W.lo) (z + x) - Fb (Qs W.lo) (z + y)| ≤
231 |Fb (Qs W.lo) (z + (y - u') + u) - Fb (Qs (Wy W).lo) (z + (y - u'))| +
232 |Fb (Qs W.lo) (z + (y - u') + u') - Fb (Qs (Wy W).lo) (z + (y - u'))| := by
233 intro z _
234 have e1 : z + (y - u') + u = z + x := by linarith
235 have e2 : z + (y - u') + u' = z + y := by ring
236 rw [e1, e2]
237 have h1 := abs_sub_le (Fb (Qs W.lo) (z + x)) (Fb (Qs (Wy W).lo) (z + (y - u'))) (Fb (Qs W.lo) (z + y))
238 rw [abs_sub_comm (Fb (Qs (Wy W).lo) (z + (y - u'))) (Fb (Qs W.lo) (z + y))] at h1
239 exact h1
240 have hmono := intervalIntegral.integral_mono_on hzab
241 (ii_of_contOn (rhoq_cont W τ hlo hhi hL hQ hX hG x y hx hy))
242 (g := fun z => |Fb (Qs W.lo) (z + (y - u') + u) - Fb (Qs (Wy W).lo) (z + (y - u'))| +
243 |Fb (Qs W.lo) (z + (y - u') + u') - Fb (Qs (Wy W).lo) (z + (y - u'))|)
244 (ii_of_contOn (hF1z.add hF2z)) (fun z hz => hpt z hz)
245 rw [intervalIntegral.integral_add (ii_of_contOn hF1z) (ii_of_contOn hF2z)] at hmono
246 -- change variables `z ↦ z + (y - u')` in both pieces
247 have cv1 := intervalIntegral.integral_comp_add_right
248 (fun t => |Fb (Qs W.lo) (t + u) - Fb (Qs (Wy W).lo) t|) (y - u')
249 (a := Real.log W.lo + 3) (b := Real.log W.hi - 3 - 2 * Lt W τ)
250 have cv2 := intervalIntegral.integral_comp_add_right
251 (fun t => |Fb (Qs W.lo) (t + u') - Fb (Qs (Wy W).lo) t|) (y - u')
252 (a := Real.log W.lo + 3) (b := Real.log W.hi - 3 - 2 * Lt W τ)
253 beta_reduce at cv1 cv2
254 rw [cv1, cv2] at hmono
255 have hdq1 : (∫ t in (Real.log W.lo - ell W + 3)..(Real.log W.hi - ell W - 3 - 2 * Lt W τ),
256 |Fb (Qs W.lo) (t + u) - Fb (Qs (Wy W).lo) t|) = Xlen W τ * dq W τ u := by
257 unfold dq; field_simp
258 have hdq2 : (∫ t in (Real.log W.lo - ell W + 3)..(Real.log W.hi - ell W - 3 - 2 * Lt W τ),
259 |Fb (Qs W.lo) (t + u') - Fb (Qs (Wy W).lo) t|) = Xlen W τ * dq W τ u' := by
260 unfold dq; field_simp
261 have hN : (∫ z in (Real.log W.lo + 3)..(Real.log W.hi - 3 - 2 * Lt W τ),
262 |Fb (Qs W.lo) (z + x) - Fb (Qs W.lo) (z + y)|)
263 ≤ Xlen W τ * dq W τ u + Xlen W τ * dq W τ u' + 164 * (Lt W τ + 1) := by
264 linarith [hab1.2, hab2.2, hsL, hdq1, hdq2]
265 unfold rhoq
266 calc _ ≤ (Xlen W τ * dq W τ u + Xlen W τ * dq W τ u' + 164 * (Lt W τ + 1)) / Xlen W τ :=
267 div_le_div_of_nonneg_right hN hX.le
268 _ = dq W τ u + dq W τ u' + 164 * (Lt W τ + 1) / Xlen W τ := by field_simp
269
270end E424
271