| 1 | module |
| 2 | |
| 3 | public import E424.DirichletError.L29 |
| 4 | public import E424.DirichletError.L29abAux |
| 5 | public import E424.MacroRigidity |
| 6 | public import E424.PropD |
| 7 | |
| 8 | @[expose] public section |
| 9 | |
| 10 | /-! |
| 11 | # Section 7 of the outline: L29ab |
| 12 | -/ |
| 13 | |
| 14 | set_option linter.style.header false |
| 15 | open Finset MeasureTheory Filter Topology |
| 16 | |
| 17 | namespace E424 |
| 18 | |
| 19 | /-- `∑_{N ∈ 𝒩(W)} ∫_{|t| ≤ N/H1} |Err_N^S|²`. -/ |
| 20 | noncomputable def errSum (W : Win) (S : Finset ℕ) : ℝ := |
| 21 | ∑ k ∈ W.dy, ∫ t in Low W.lo (2 ^ k), ‖Err S (2 ^ k) t‖ ^ 2 |
| 22 | |
| 23 | /-- **Lemma 29 (a)**: the block `S2` at `K2 = (log lo)^C2`. The last bracket `E(rc·bad)` is bounded by |
| 24 | AM-GM (`pt_rb_le`), the shifted fourth moments by `E_shift4_le`, and `D_W` by Proposition D. -/ |
| 25 | theorem L29a (η cS e : ℝ) (hη : 0 < η) (hη1 : η ≤ 1 / 1000) (hc : 0 < cS) (he : 0 < e) : |
| 26 | ∃ N0 : ℝ, ∀ W : Win, W.Adm η N0 → |
| 27 | ∀ (ρ : ℕ) (S : Finset ℕ), ρ = 53 ∨ ρ = 23 → BlockFam cS (K2 W.lo) ρ S → errSum W S ≤ e * W.len := by |
| 28 | obtain ⟨C29, hC29, N29, h29⟩ := L29 |
| 29 | obtain ⟨C14, hC14, hL14⟩ := L14 |
| 30 | -- constants (opaque, with their defining equations) |
| 31 | obtain ⟨K5, hK5⟩ : ∃ x : ℝ, x = 2 * (2 * C14 + 1) := ⟨_, rfl⟩ |
| 32 | obtain ⟨K4, hK4⟩ : ∃ x : ℝ, x = C14 + 1 := ⟨_, rfl⟩ |
| 33 | obtain ⟨Kb, hKb⟩ : ∃ x : ℝ, x = 3 / 2 + K4 / 2 := ⟨_, rfl⟩ |
| 34 | obtain ⟨Q, hQ⟩ : ∃ x : ℝ, x = 16 + 8 * K5 / cS ^ 4 := ⟨_, rfl⟩ |
| 35 | have hK5p : 0 < K5 := by rw [hK5]; positivity |
| 36 | have hK4p : 0 < K4 := by rw [hK4]; positivity |
| 37 | have hKbp : 0 < Kb := by rw [hKb]; positivity |
| 38 | have hQp : 0 < Q := by rw [hQ]; positivity |
| 39 | obtain ⟨δ, hδ⟩ : ∃ x : ℝ, x = e * cS ^ 2 / (3 * C29 * Kb) := ⟨_, rfl⟩ |
| 40 | have hδp : 0 < δ := by rw [hδ]; positivity |
| 41 | obtain ⟨E1, hE1⟩ : ∃ x : ℝ, x = e ^ 2 / (9 * C29 ^ 2 * Q) := ⟨_, rfl⟩ |
| 42 | have hE1p : 0 < E1 := by rw [hE1]; positivity |
| 43 | obtain ⟨e1, he1⟩ : ∃ x : ℝ, x = min (δ ^ 2) E1 := ⟨_, rfl⟩ |
| 44 | have he1p : 0 < e1 := by rw [he1]; exact lt_min (by positivity) hE1p |
| 45 | have he1δ : e1 ≤ δ ^ 2 := by rw [he1]; exact min_le_left _ _ |
| 46 | have he1E : e1 ≤ E1 := by rw [he1]; exact min_le_right _ _ |
| 47 | obtain ⟨ηR, hηR⟩ : ∃ x : ℝ, x = e * cS ^ 2 / (3 * C29) := ⟨_, rfl⟩ |
| 48 | have hηRp : 0 < ηR := by rw [hηR]; positivity |
| 49 | obtain ⟨N2, hN2⟩ := PropD η hη (C2 * 200 + 3) e1 he1p |
| 50 | -- eventual facts in `lo` |
| 51 | have hQe : ∀ᶠ lo : ℝ in atTop, 1 / H1 lo < ηR / 2 := by |
| 52 | have hT : Tendsto (fun lo : ℝ => 1 / H1 lo) atTop (𝓝 0) := by |
| 53 | have h1 : Tendsto (fun lo : ℝ => Real.log lo ^ (C2 * 200)) atTop atTop := |
| 54 | (tendsto_pow_atTop (by unfold C2; norm_num)).comp Real.tendsto_log_atTop |
| 55 | have h2 : (fun lo : ℝ => 1 / H1 lo) = fun lo => (Real.log lo ^ (C2 * 200))⁻¹ := by |
| 56 | funext lo; unfold H1 K2; rw [← pow_mul, one_div] |
| 57 | rw [h2] |
| 58 | exact tendsto_inv_atTop_zero.comp h1 |
| 59 | exact (tendsto_order.1 hT).2 _ (by positivity) |
| 60 | have hRe : ∀ᶠ lo : ℝ in atTop, lo ^ (-(0.01 : ℝ)) < ηR / 2 := |
| 61 | (tendsto_order.1 (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 0.01))).2 _ (by positivity) |
| 62 | have hH8e : ∀ᶠ lo : ℝ in atTop, 8 * H1 lo ≤ lo ^ (0.001 : ℝ) := by |
| 63 | filter_upwards [eventually_log_pow_le (C2 * 200) (δ := 0.001) (by norm_num) (c := 8) |
| 64 | (by norm_num)] with lo hlo |
| 65 | unfold H1 K2 |
| 66 | rw [← pow_mul] |
| 67 | exact hlo |
| 68 | have hz3e : ∀ᶠ lo : ℝ in atTop, 3 ≤ K2 lo := by |
| 69 | have h1 : Tendsto (fun lo : ℝ => K2 lo) atTop atTop := by |
| 70 | unfold K2 |
| 71 | exact (tendsto_pow_atTop (by unfold C2; norm_num)).comp Real.tendsto_log_atTop |
| 72 | exact h1.eventually_ge_atTop 3 |
| 73 | have hcarde : ∀ᶠ lo : ℝ in atTop, Real.log lo ^ (C2 * 200 * 4) ≤ lo := by |
| 74 | filter_upwards [eventually_log_pow_le (C2 * 200 * 4) (δ := 1) (by norm_num) (c := 1) |
| 75 | (by norm_num)] with lo hlo |
| 76 | simpa using hlo |
| 77 | have hsqe : ∀ᶠ lo : ℝ in atTop, Real.log lo ^ (C2 * 200) ≤ Real.exp (Real.sqrt (Real.log lo)) := |
| 78 | eventually_pow_le_exp_sqrt _ |
| 79 | have hse : ∀ᶠ lo : ℝ in atTop, Real.log lo ^ (C2 * 200) ≤ lo ^ (0.49 : ℝ) := by |
| 80 | filter_upwards [eventually_log_pow_le (C2 * 200) (δ := 0.49) (by norm_num) (c := 1) |
| 81 | (by norm_num)] with lo hlo |
| 82 | simpa using hlo |
| 83 | have hlog8e : ∀ᶠ lo : ℝ in atTop, 8 ≤ Real.log lo := |
| 84 | Real.tendsto_log_atTop.eventually_ge_atTop 8 |
| 85 | have hηlog : ∀ᶠ lo : ℝ in atTop, 1 ≤ η * Real.log lo := |
| 86 | (Real.tendsto_log_atTop.const_mul_atTop hη).eventually_ge_atTop 1 |
| 87 | have hge3 : ∀ᶠ lo : ℝ in atTop, 3 ≤ lo := eventually_ge_atTop 3 |
| 88 | have hall := hQe.and (hRe.and (hH8e.and (hz3e.and (hcarde.and (hsqe.and (hse.and (hlog8e.and (hηlog.and hge3)))))))) |
| 89 | obtain ⟨N4, hN4⟩ := eventually_atTop.mp hall |
| 90 | refine ⟨max (max N29 N2) N4, ?_⟩ |
| 91 | intro W hW ρ S hρ hS |
| 92 | have hWlo : max (max N29 N2) N4 ≤ W.lo := hW.le_lo |
| 93 | have hN29 : N29 ≤ W.lo := (le_trans (le_max_left _ _) (le_max_left _ _)).trans hWlo |
| 94 | have hW2 : W.Adm η N2 := hW.mono (le_trans (le_max_right _ _) (le_max_left _ _)) |
| 95 | obtain ⟨hQW, hRW, hH8W, hz3W, hcarW, hsqW, hseW, hlog8W, hηlogW, hge3W⟩ := |
| 96 | hN4 W.lo (le_trans (le_max_right _ _) hWlo) |
| 97 | have hlo3 : 3 ≤ W.lo := hW.three_le |
| 98 | have hlo1 : 1 ≤ W.lo := by linarith |
| 99 | have hlo0 : 0 < W.lo := by linarith |
| 100 | have hhi : W.lo ≤ W.hi := hW.lo_lt.le |
| 101 | have hlenpos : 0 < W.len := hW.len_pos hη |
| 102 | have hlen1 : 1 ≤ W.len := le_trans hηlogW hW.le_len |
| 103 | have hloge : Real.log 2 ≤ W.len := le_trans (by linarith [Real.log_two_lt_d9]) hlen1 |
| 104 | have hlog0 : 0 ≤ Real.log W.lo := by linarith |
| 105 | -- the block parameter `H = H1 lo = (log lo)^(C2 * 200)` |
| 106 | obtain ⟨H, hHdef⟩ : ∃ x : ℝ, x = H1 W.lo := ⟨_, rfl⟩ |
| 107 | have hH_eq : H = Real.log W.lo ^ (C2 * 200) := by |
| 108 | rw [hHdef]; unfold H1 K2; rw [← pow_mul] |
| 109 | have hHpos : 1 ≤ H := by rw [hH_eq]; exact one_le_pow₀ (by linarith) |
| 110 | have hH8 : 8 * H ≤ W.lo ^ (0.001 : ℝ) := by rw [hHdef]; exact hH8W |
| 111 | have hHle : H ≤ W.lo ^ (0.001 : ℝ) := by linarith |
| 112 | have hHlo : 8 * H ≤ W.lo := hH8.trans (by |
| 113 | calc W.lo ^ (0.001 : ℝ) ≤ W.lo ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le hlo1 (by norm_num) |
| 114 | _ = W.lo := Real.rpow_one _) |
| 115 | have hQW' : 1 / H < ηR / 2 := by rw [hHdef]; exact hQW |
| 116 | obtain ⟨R, hR⟩ : ∃ x : ℝ, x = 1 / H + W.lo ^ (-(0.01 : ℝ)) := ⟨_, rfl⟩ |
| 117 | have hRle : R ≤ e * cS ^ 2 / (3 * C29) := by |
| 118 | rw [← hηR, hR]; linarith |
| 119 | have hR0 : 0 ≤ R := by |
| 120 | rw [hR]; exact add_nonneg (div_nonneg zero_le_one (by linarith)) (Real.rpow_nonneg hlo0.le _) |
| 121 | -- the family `S` at `z = K2 lo` |
| 122 | obtain ⟨z, hz⟩ : ∃ x : ℝ, x = K2 W.lo := ⟨_, rfl⟩ |
| 123 | have hz200 : z ^ 200 = Real.log W.lo ^ (C2 * 200) := by |
| 124 | rw [hz]; unfold K2; rw [← pow_mul] |
| 125 | have hfam : IsFam z S := by rw [hz]; exact hS.fam |
| 126 | have hz3 : 3 ≤ z := by rw [hz]; exact hz3W |
| 127 | have hz2 : 2 ≤ z := by linarith |
| 128 | have hsle : ∀ s ∈ S, (s : ℝ) ≤ W.lo ^ (0.49 : ℝ) := fun s hs => |
| 129 | (hfam s hs).2.1.trans (by rw [hz200]; exact hseW) |
| 130 | have hsub : S ⊆ Finset.Icc 1 ⌊z ^ 200⌋₊ := fun s hs => by |
| 131 | have h1 : (s : ℝ) ≤ z ^ 200 := (hfam s hs).2.1 |
| 132 | have h2 : (1 : ℝ) ≤ s := by have := (hfam s hs).1; linarith |
| 133 | exact Finset.mem_Icc.mpr ⟨by exact_mod_cast h2, Nat.le_floor h1⟩ |
| 134 | have hcardR : (S.card : ℝ) ≤ z ^ 200 := by |
| 135 | have h1 : S.card ≤ ⌊z ^ 200⌋₊ := by |
| 136 | have := Finset.card_le_card hsub |
| 137 | simpa using this |
| 138 | exact (Nat.cast_le.mpr h1).trans (Nat.floor_le (by positivity)) |
| 139 | have hcardW : (S.card : ℝ) ^ 4 ≤ W.lo := by |
| 140 | have h1 : (S.card : ℝ) ^ 4 ≤ (z ^ 200) ^ 4 := pow_le_pow_left₀ (by positivity) hcardR 4 |
| 141 | rw [hz200, ← pow_mul] at h1 |
| 142 | exact h1.trans hcarW |
| 143 | have hL14' : ∀ V : Win, 1 ≤ V.lo → V.lo ≤ V.hi → |
| 144 | V.sum (fun n => rc S n ^ 4) ≤ C14 * V.len + (S.card : ℝ) ^ 4 / V.lo := |
| 145 | fun V h1 h2 => hL14 z hz2 S hfam V h1 h2 |
| 146 | -- unshifted fourth moment and the shifted ones |
| 147 | have hE4 : W.E (fun n => rc S n ^ 4) ≤ K4 := by |
| 148 | have h1 := hL14' W hlo1 hhi |
| 149 | have h2 : (S.card : ℝ) ^ 4 / W.lo ≤ 1 := by rw [div_le_one hlo0]; exact hcardW |
| 150 | have h3 : C14 * 1 ≤ C14 * W.len := mul_le_mul_of_nonneg_left hlen1 hC14.le |
| 151 | unfold Win.E |
| 152 | rw [div_le_iff₀ hlenpos, hK4] |
| 153 | linarith |
| 154 | have hshift4 : ∀ h : ℕ, (h : ℝ) ≤ 8 * H → W.E (fun n => rc S (n + h) ^ 4) ≤ K5 := fun h hh => by |
| 155 | rw [hK5] |
| 156 | exact E_shift4_le W S hC14.le h hlo1 hhi hlen1 (by linarith) (by linarith) hcardW hL14' |
| 157 | have hV : ∀ h : ℕ, (h : ℝ) ≤ 8 * H → |
| 158 | W.E (fun n => (ms S - rc S (n + h)) ^ 4) ≤ 16 * ms S ^ 4 + 8 * K5 := fun h hh => |
| 159 | E_fourth_le W (fun n => rc S (n + h)) (ms S) K5 hlo1 hhi hloge (hshift4 h hh) |
| 160 | -- `D_W h ≤ e1` for `h ≤ 8H` (Proposition D, `C3 = 200 C2 + 3`) |
| 161 | have hD : ∀ h : ℕ, (h : ℝ) ≤ 8 * H → W.D h ≤ e1 := by |
| 162 | intro h hh |
| 163 | rcases Nat.eq_zero_or_pos h with rfl | hpos |
| 164 | · have : W.D 0 = 0 := by simp [Win.D, Win.E, Win.sum, ind] |
| 165 | linarith |
| 166 | · refine (hN2 W hW2).2.1 h hpos ?_ |
| 167 | rw [hH_eq] at hh |
| 168 | calc (h : ℝ) ≤ 8 * Real.log W.lo ^ (C2 * 200) := hh |
| 169 | _ ≤ Real.log W.lo ^ (C2 * 200 + 3) := eight_mul_pow_le _ _ hlog8W |
| 170 | -- the last bracket: `E(rc·bad) ≤ δ Kb` |
| 171 | have hA : ∀ s ∈ S, s ∈ A ∧ s % 3 = 2 := fun s hs => by |
| 172 | obtain ⟨hA', hmod, -⟩ := hS.mem s hs |
| 173 | exact ⟨hA', by omega⟩ |
| 174 | have hbad : W.E (badCount S) ≤ e1 := |
| 175 | (hN2 W hW2).2.2 z S hz3 hfam hA (by rw [hz200]; exact hsqW) |
| 176 | have hb : W.E (fun n => rc S n * badCount S n) ≤ δ * Kb := by |
| 177 | have h1 := E_rb_le W S hδp hlo1 hhi hloge hE4 |
| 178 | have h2 : 1 / (2 * δ) * W.E (badCount S) ≤ δ / 2 := by |
| 179 | calc 1 / (2 * δ) * W.E (badCount S) ≤ 1 / (2 * δ) * δ ^ 2 := |
| 180 | mul_le_mul_of_nonneg_left (hbad.trans he1δ) (by positivity) |
| 181 | _ = δ / 2 := by field_simp |
| 182 | have h3 : δ * (1 + K4 / 2) + δ / 2 = δ * Kb := by rw [hKb]; ring |
| 183 | linarith |
| 184 | have hm : cS ≤ ms S := hS.mass |
| 185 | have hm0 : 0 < ms S := by linarith |
| 186 | have hL := h29 W hlo3 hN29 hlen1 z S hz3 hfam hsle hm0 H hHpos hHle e1 |
| 187 | (16 * ms S ^ 4 + 8 * K5) (δ * Kb) hD hV hb |
| 188 | -- `√(e1 V) ≤ e m² / (3 C29)` |
| 189 | have hs : Real.sqrt (e1 * (16 * ms S ^ 4 + 8 * K5)) ≤ e * ms S ^ 2 / (3 * C29) := by |
| 190 | have hQm : 16 * ms S ^ 4 + 8 * K5 ≤ Q * ms S ^ 4 := by |
| 191 | have h1 : 1 ≤ ms S ^ 4 / cS ^ 4 := by |
| 192 | rw [le_div_iff₀ (by positivity), one_mul] |
| 193 | exact pow_le_pow_left₀ hc.le hm 4 |
| 194 | have h2 : Q * ms S ^ 4 = 16 * ms S ^ 4 + 8 * K5 * (ms S ^ 4 / cS ^ 4) := by |
| 195 | rw [hQ]; field_simp |
| 196 | rw [h2] |
| 197 | linarith [mul_le_mul_of_nonneg_left h1 (by positivity : (0 : ℝ) ≤ 8 * K5)] |
| 198 | have hV' : e1 * (16 * ms S ^ 4 + 8 * K5) ≤ (e * ms S ^ 2 / (3 * C29)) ^ 2 := by |
| 199 | calc e1 * (16 * ms S ^ 4 + 8 * K5) ≤ E1 * (Q * ms S ^ 4) := |
| 200 | mul_le_mul he1E hQm (by positivity) hE1p.le |
| 201 | _ = (e * ms S ^ 2 / (3 * C29)) ^ 2 := by |
| 202 | rw [hE1]; have := hQp.ne'; field_simp; ring |
| 203 | calc Real.sqrt (e1 * (16 * ms S ^ 4 + 8 * K5)) |
| 204 | ≤ Real.sqrt ((e * ms S ^ 2 / (3 * C29)) ^ 2) := Real.sqrt_le_sqrt hV' |
| 205 | _ = e * ms S ^ 2 / (3 * C29) := Real.sqrt_sq (by positivity) |
| 206 | have hb' : δ * Kb ≤ e * cS ^ 2 / (3 * C29) := |
| 207 | le_of_eq (by rw [hδ]; field_simp) |
| 208 | -- the statement's sum is the one of Lemma 29 |
| 209 | have hconv : errSum W S = |
| 210 | ∑ k ∈ W.dy, ∫ t in (-(2 ^ k / H))..(2 ^ k / H), ‖Err S (2 ^ k) t‖ ^ 2 := by |
| 211 | unfold errSum |
| 212 | refine Finset.sum_congr rfl fun k _ => ?_ |
| 213 | have hN : 0 ≤ (2 : ℝ) ^ k / H := div_nonneg (by positivity) (by linarith) |
| 214 | have hab : -((2 : ℝ) ^ k / H) ≤ (2 : ℝ) ^ k / H := by linarith |
| 215 | unfold Low |
| 216 | rw [← hHdef, integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le hab] |
| 217 | rw [hconv] |
| 218 | refine hL.trans ?_ |
| 219 | rw [← hR] |
| 220 | exact L29a_alg C29 cS e (ms S) R _ (δ * Kb) W.len hC29 hc he hm hm0 hlenpos.le hR0 |
| 221 | (mul_pos hδp hKbp).le hRle hb' hs |
| 222 | |
| 223 | /-- **Lemma 29 (b)**: the macroscopic family `S3` at `lo^0.45`, `τ3 = 1/100`. Uses Lemma 27(i). -/ |
| 224 | theorem L29b (η cS : ℝ) (hη : 0 < η) (hη1 : η ≤ 1 / 1000) (hc : 0 < cS) : ∃ C > 0, ∀ e > 0, |
| 225 | ∃ N0 : ℝ, ∀ (β ε ε' Nε : ℝ), 0 ≤ ε → 0 ≤ ε' → Ext η β ε Nε → |
| 226 | ∀ W : Win, W.Adm η N0 → W.len ≤ 4 * η * Real.log W.lo → β - ε' ≤ W.E F → |
| 227 | Nε ≤ W.lo ^ (1 / 2 : ℝ) → |
| 228 | ∀ (ρ : ℕ) (S : Finset ℕ), ρ = 53 ∨ ρ = 23 → MacroFam cS (1 / 100) (W.lo ^ (0.45 : ℝ)) ρ S → |
| 229 | errSum W S ≤ (C * (ε + ε') + e) * W.len := by |
| 230 | obtain ⟨C29, hC29, N29, h29⟩ := L29 |
| 231 | set B : ℝ := 2 ^ 224 with hB |
| 232 | have hB0 : 0 < B := by positivity |
| 233 | clear_value B |
| 234 | refine ⟨C29 * (100 * B / cS), by positivity, fun e he => ?_⟩ |
| 235 | -- tolerances: `δ` for the `sqrt(yV)` term, `e1` for `y = D` bound, `e2` for L27, `ηQ` for `1/H + lo^{-0.01}` |
| 236 | set G : ℝ := (1 + 100 * B / cS) ^ 2 with hG |
| 237 | have hG0 : 0 < G := by rw [hG]; positivity |
| 238 | clear_value G |
| 239 | set δ : ℝ := e / (3 * C29 * G) with hδ |
| 240 | have hδ0 : 0 < δ := by rw [hδ]; positivity |
| 241 | clear_value δ |
| 242 | set e1 : ℝ := δ ^ 2 / 2 with he1 |
| 243 | have he10 : 0 < e1 := by rw [he1]; positivity |
| 244 | clear_value e1 |
| 245 | set e2 : ℝ := e * cS / (3 * C29 * (100 * B)) with he2 |
| 246 | have he20 : 0 < e2 := by rw [he2]; positivity |
| 247 | clear_value e2 |
| 248 | set ηQ : ℝ := e * cS ^ 2 / (3 * C29 * 10 ^ 4) with hηQ |
| 249 | have hηQ0 : 0 < ηQ := by rw [hηQ]; positivity |
| 250 | clear_value ηQ |
| 251 | obtain ⟨N2, hN2⟩ := PropD η hη (C2 * 200 + 3) e1 he10 |
| 252 | obtain ⟨N3, hN3⟩ := L27 η cS (1 / 100) e2 hη hη1 hc (by norm_num) (by norm_num) he20 |
| 253 | -- eventual facts in `lo` |
| 254 | have hQ : ∀ᶠ lo : ℝ in atTop, 1 / H1 lo < ηQ / 2 := by |
| 255 | have hT : Tendsto (fun lo : ℝ => 1 / H1 lo) atTop (𝓝 0) := by |
| 256 | have h1 : Tendsto (fun lo : ℝ => Real.log lo ^ (C2 * 200)) atTop atTop := |
| 257 | (tendsto_pow_atTop (by unfold C2; norm_num)).comp Real.tendsto_log_atTop |
| 258 | have h2 : (fun lo : ℝ => 1 / H1 lo) = fun lo => (Real.log lo ^ (C2 * 200))⁻¹ := by |
| 259 | funext lo; unfold H1 K2; rw [← pow_mul, one_div] |
| 260 | rw [h2] |
| 261 | exact tendsto_inv_atTop_zero.comp h1 |
| 262 | exact (tendsto_order.1 hT).2 _ (by positivity) |
| 263 | have hR : ∀ᶠ lo : ℝ in atTop, lo ^ (-(0.01 : ℝ)) < ηQ / 2 := |
| 264 | (tendsto_order.1 (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 0.01))).2 _ (by positivity) |
| 265 | have hH8 : ∀ᶠ lo : ℝ in atTop, 8 * H1 lo ≤ lo ^ (0.001 : ℝ) := by |
| 266 | filter_upwards [eventually_log_pow_le (C2 * 200) (δ := 0.001) (by norm_num) (c := 8) |
| 267 | (by norm_num)] with lo hlo |
| 268 | unfold H1 K2 |
| 269 | rw [← pow_mul] |
| 270 | exact hlo |
| 271 | have hlo2 : ∀ᶠ lo : ℝ in atTop, 2 ≤ lo ^ (0.004 : ℝ) := |
| 272 | (tendsto_rpow_atTop (by norm_num : (0 : ℝ) < 0.004)).eventually_ge_atTop 2 |
| 273 | have hz3 : ∀ᶠ lo : ℝ in atTop, 3 ≤ lo ^ (0.0045 : ℝ) := |
| 274 | (tendsto_rpow_atTop (by norm_num : (0 : ℝ) < 0.0045)).eventually_ge_atTop 3 |
| 275 | have hlog8 : ∀ᶠ lo : ℝ in atTop, 8 ≤ Real.log lo := |
| 276 | Real.tendsto_log_atTop.eventually_ge_atTop 8 |
| 277 | have hηlog : ∀ᶠ lo : ℝ in atTop, 1 ≤ η * Real.log lo := |
| 278 | (Real.tendsto_log_atTop.const_mul_atTop hη).eventually_ge_atTop 1 |
| 279 | have hge3 : ∀ᶠ lo : ℝ in atTop, 3 ≤ lo := eventually_ge_atTop 3 |
| 280 | obtain ⟨N4, hN4⟩ := eventually_atTop.mp |
| 281 | (hQ.and (hR.and (hH8.and (hlo2.and (hz3.and (hlog8.and (hηlog.and hge3))))))) |
| 282 | refine ⟨max (max N29 N2) (max N3 N4), ?_⟩ |
| 283 | intro β ε ε' Nε hε hε' hext W hW hlen hβ hNε ρ S hρ hS |
| 284 | have hWlo : max (max N29 N2) (max N3 N4) ≤ W.lo := hW.le_lo |
| 285 | obtain ⟨hQW, hRW, hH8W, hlo2W, hz3W, hlog8W, hηlogW, hge3W⟩ := |
| 286 | hN4 W.lo (le_trans (le_trans (le_max_right _ _) (le_max_right _ _)) hWlo) |
| 287 | have hN29 : N29 ≤ W.lo := (le_trans (le_max_left _ _) (le_max_left _ _)).trans hWlo |
| 288 | have hW2 : W.Adm η N2 := hW.mono (le_trans (le_max_right _ _) (le_max_left _ _)) |
| 289 | have hW3 : W.Adm η N3 := hW.mono (le_trans (le_max_left _ _) (le_max_right _ _)) |
| 290 | have hlo3 : 3 ≤ W.lo := hW.three_le |
| 291 | have hlo1 : 1 ≤ W.lo := by linarith |
| 292 | have hlo0 : 0 < W.lo := by linarith |
| 293 | have hlenpos : 0 < W.len := hW.len_pos hη |
| 294 | have hlen1 : 1 ≤ W.len := le_trans hηlogW hW.le_len |
| 295 | have hloge : Real.log 2 ≤ W.len := le_trans (by linarith [Real.log_two_lt_d9]) hlen1 |
| 296 | have hlog0 : 0 ≤ Real.log W.lo := by linarith |
| 297 | -- the block parameter `H = H1 lo = (log lo)^(C2 * 200)` |
| 298 | set H := H1 W.lo with hHdef |
| 299 | clear_value H |
| 300 | have hH_eq : H = Real.log W.lo ^ (C2 * 200) := by |
| 301 | rw [hHdef]; unfold H1 K2; rw [← pow_mul] |
| 302 | have hHpos : 1 ≤ H := by rw [hH_eq]; exact one_le_pow₀ (by linarith) |
| 303 | have hHle : H ≤ W.lo ^ (0.001 : ℝ) := by linarith [hH8W] |
| 304 | -- `hi ≤ lo^1.004`, from `len ≤ 4 η log lo` |
| 305 | have hhi : W.hi ≤ W.lo ^ (1.004 : ℝ) := by |
| 306 | have hexp : W.hi = W.lo * Real.exp W.len := by |
| 307 | rw [Win.len, Real.exp_log (div_pos hW.hi_pos hlo0)] |
| 308 | field_simp |
| 309 | have h1 : Real.exp W.len ≤ W.lo ^ (4 * η) := by |
| 310 | rw [Real.rpow_def_of_pos hlo0] |
| 311 | calc Real.exp W.len ≤ Real.exp (4 * η * Real.log W.lo) := Real.exp_le_exp.mpr hlen |
| 312 | _ = Real.exp (Real.log W.lo * (4 * η)) := by ring_nf |
| 313 | have h2 : W.lo * W.lo ^ (4 * η) = W.lo ^ (1 + 4 * η) := by |
| 314 | rw [Real.rpow_add hlo0, Real.rpow_one] |
| 315 | have h3 : W.lo ^ (1 + 4 * η) ≤ W.lo ^ (1.004 : ℝ) := |
| 316 | Real.rpow_le_rpow_of_exponent_le hlo1 (by linarith) |
| 317 | calc W.hi = W.lo * Real.exp W.len := hexp |
| 318 | _ ≤ W.lo * W.lo ^ (4 * η) := mul_le_mul_of_nonneg_left h1 hlo0.le |
| 319 | _ = W.lo ^ (1 + 4 * η) := h2 |
| 320 | _ ≤ W.lo ^ (1.004 : ℝ) := h3 |
| 321 | -- the family parameter `z = Y^(1/100)`, `Y = lo^0.45` |
| 322 | set Y := W.lo ^ (0.45 : ℝ) with hY |
| 323 | clear_value Y |
| 324 | set z := Y ^ (1 / 100 : ℝ) with hz |
| 325 | clear_value z |
| 326 | have hY1 : 1 < Y := by rw [hY]; exact Real.one_lt_rpow (by linarith) (by norm_num) |
| 327 | have hz_eq : z = W.lo ^ (0.0045 : ℝ) := by |
| 328 | rw [hz, hY, ← Real.rpow_mul hlo0.le]; norm_num |
| 329 | have hz3' : 3 ≤ z := by rw [hz_eq]; exact hz3W |
| 330 | have hz224 : z ^ 224 = W.lo ^ (1.008 : ℝ) := by |
| 331 | rw [hz_eq, ← Real.rpow_natCast, ← Real.rpow_mul hlo0.le]; norm_num |
| 332 | have hWz : W.hi + 8 * H ≤ z ^ 224 := by |
| 333 | rw [hz224] |
| 334 | have h8 : 8 * H ≤ W.lo ^ (1.004 : ℝ) := |
| 335 | le_trans hH8W (Real.rpow_le_rpow_of_exponent_le hlo1 (by norm_num)) |
| 336 | have h5 : W.lo ^ (1.008 : ℝ) = W.lo ^ (0.004 : ℝ) * W.lo ^ (1.004 : ℝ) := by |
| 337 | rw [← Real.rpow_add hlo0]; norm_num |
| 338 | rw [h5] |
| 339 | nlinarith [Real.rpow_nonneg hlo0.le (1.004 : ℝ)] |
| 340 | -- the macroscopic family |
| 341 | have hS_rough : ∀ s ∈ S, Rough z s := fun s hs => by |
| 342 | rw [hz]; exact (hS.mem s hs).2.2.2.2 |
| 343 | have hrcAll : ∀ m : ℕ, 1 ≤ m → (m : ℝ) ≤ W.hi + 8 * H → rc S m ≤ B := fun m hm hmH => by |
| 344 | rw [hB]; exact L14_pointwise z (by linarith) S hS_rough 224 m hm (hmH.trans hWz) |
| 345 | have hfam : IsFam z S := fun s hs => by |
| 346 | obtain ⟨-, -, hYs, hsY, hR⟩ := hS.mem s hs |
| 347 | have hzY : z < Y := by |
| 348 | have := Real.rpow_lt_rpow_of_exponent_lt hY1 (by norm_num : (1 / 100 : ℝ) < 1) |
| 349 | rw [Real.rpow_one] at this |
| 350 | rwa [hz] |
| 351 | have hR' : Rough z s := by rw [hz]; exact hR |
| 352 | have hz200 : z ^ 200 = Y ^ (2 : ℝ) := by |
| 353 | rw [hz, ← Real.rpow_natCast, ← Real.rpow_mul (by linarith)]; norm_num |
| 354 | refine ⟨lt_of_lt_of_le hzY hYs, ?_, hR'⟩ |
| 355 | rw [hz200] |
| 356 | exact hsY.trans (Real.rpow_le_rpow_of_exponent_le hY1.le (by norm_num)) |
| 357 | have hsle : ∀ s ∈ S, (s : ℝ) ≤ W.lo ^ (0.49 : ℝ) := fun s hs => by |
| 358 | obtain ⟨-, -, -, hsY, -⟩ := hS.mem s hs |
| 359 | have hpow : Y ^ (1 + 1 / 100 : ℝ) = W.lo ^ (0.45 * (1 + 1 / 100) : ℝ) := by |
| 360 | rw [hY, ← Real.rpow_mul hlo0.le] |
| 361 | refine hsY.trans ?_ |
| 362 | rw [hpow] |
| 363 | exact Real.rpow_le_rpow_of_exponent_le hlo1 (by norm_num) |
| 364 | have hmass : cS / 100 ≤ ms S := by have := hS.mass; linarith |
| 365 | have hMpos : 0 < ms S := by linarith |
| 366 | -- shifts stay below `hi + 8H` |
| 367 | have hshift : ∀ n ∈ W.pts, ∀ h : ℕ, (h : ℝ) ≤ 8 * H → |
| 368 | 1 ≤ n + h ∧ ((n + h : ℕ) : ℝ) ≤ W.hi + 8 * H := by |
| 369 | intro n hn h hh |
| 370 | obtain ⟨hnlo, hnhi⟩ := (Win.mem_pts hlo0.le hW.hi_pos.le).mp hn |
| 371 | have h1 : (1 : ℝ) ≤ n := by linarith |
| 372 | have h1' : 1 ≤ n := by exact_mod_cast h1 |
| 373 | refine ⟨by omega, ?_⟩ |
| 374 | push_cast |
| 375 | linarith |
| 376 | have hrc_pt : ∀ n ∈ W.pts, rc S n ≤ B := fun n hn => by |
| 377 | obtain ⟨hnlo, hnhi⟩ := (Win.mem_pts hlo0.le hW.hi_pos.le).mp hn |
| 378 | have h1 : (1 : ℝ) ≤ n := by linarith |
| 379 | have h1' : 1 ≤ n := by exact_mod_cast h1 |
| 380 | exact hrcAll n h1' (by linarith [show (0 : ℝ) ≤ 8 * H by linarith]) |
| 381 | -- fourth moments of the shifted divisor counts |
| 382 | have hV : ∀ h : ℕ, (h : ℝ) ≤ 8 * H → |
| 383 | W.E (fun n => (ms S - rc S (n + h)) ^ 4) ≤ 2 * (ms S + B) ^ 4 := by |
| 384 | intro h hh |
| 385 | refine le_trans (W.E_mono hlenpos.le (fun n hn => ?_)) |
| 386 | (E_const_le W _ (by positivity) hlo1 hW.lo_lt.le hloge) |
| 387 | obtain ⟨hn1, hnH⟩ := hshift n hn h hh |
| 388 | have hr := hrcAll (n + h) hn1 hnH |
| 389 | have hr0 := rc_nonneg S (n + h) |
| 390 | have h1 : |ms S - rc S (n + h)| ≤ ms S + B := |
| 391 | abs_le.mpr ⟨by linarith [ms_nonneg S], by linarith [ms_nonneg S]⟩ |
| 392 | calc (ms S - rc S (n + h)) ^ 4 = |ms S - rc S (n + h)| ^ 4 := (Even.pow_abs ⟨2, rfl⟩ _).symm |
| 393 | _ ≤ (ms S + B) ^ 4 := pow_le_pow_left₀ (abs_nonneg _) h1 4 |
| 394 | -- `D_W h ≤ e1` for `h ≤ 8H`, from Proposition D with `C3 = 200 C2 + 3` |
| 395 | have hD : ∀ h : ℕ, (h : ℝ) ≤ 8 * H → W.D h ≤ e1 := by |
| 396 | intro h hh |
| 397 | rcases Nat.eq_zero_or_pos h with rfl | hpos |
| 398 | · have : W.D 0 = 0 := by simp [Win.D, Win.E, Win.sum, ind] |
| 399 | linarith |
| 400 | · refine (hN2 W hW2).2.1 h hpos ?_ |
| 401 | calc (h : ℝ) ≤ 8 * H := hh |
| 402 | _ = 8 * Real.log W.lo ^ (C2 * 200) := by rw [hH_eq] |
| 403 | _ ≤ Real.log W.lo ^ (C2 * 200 + 3) := eight_mul_pow_le _ _ hlog8W |
| 404 | -- the last bracket: `rc ≤ B` on the window, then Lemma 27(i) for `E(badCount)` |
| 405 | have hbad0 : ∀ n : ℕ, 0 ≤ badCount S n := fun n => Finset.sum_nonneg fun s _ => ind_nonneg _ |
| 406 | have hb : W.E (fun n => rc S n * badCount S n) ≤ B * (ms S * (ε + ε' + e2)) := by |
| 407 | have hL27 := (hN3 β ε ε' Nε hε hε' hext W hW3 hlen hβ 0.45 |
| 408 | (by norm_num) (by norm_num) (hNε.trans (Real.rpow_le_rpow_of_exponent_le hlo1 (by norm_num))) |
| 409 | ρ S hρ (by rw [← hY]; exact hS)).1 |
| 410 | have hbad : W.E (badCount S) ≤ ms S * (ε + ε' + e2) := by |
| 411 | have h := (div_le_iff₀ hMpos).mp hL27 |
| 412 | linarith |
| 413 | calc W.E (fun n => rc S n * badCount S n) ≤ W.E (fun n => B * badCount S n) := |
| 414 | W.E_mono hlenpos.le (fun n hn => mul_le_mul_of_nonneg_right (hrc_pt n hn) (hbad0 n)) |
| 415 | _ = B * W.E (badCount S) := by rw [Win.E_const_mul] |
| 416 | _ ≤ B * (ms S * (ε + ε' + e2)) := mul_le_mul_of_nonneg_left hbad hB0.le |
| 417 | have hL := h29 W hlo3 hN29 hlen1 z S hz3' hfam hsle hMpos H hHpos hHle e1 |
| 418 | (2 * (ms S + B) ^ 4) (B * (ms S * (ε + ε' + e2))) hD hV hb |
| 419 | -- the statement's sum is the one of Lemma 29 |
| 420 | have hconv : errSum W S = |
| 421 | ∑ k ∈ W.dy, ∫ t in (-(2 ^ k / H))..(2 ^ k / H), ‖Err S (2 ^ k) t‖ ^ 2 := by |
| 422 | unfold errSum |
| 423 | refine Finset.sum_congr rfl fun k _ => ?_ |
| 424 | have hN : 0 ≤ (2 : ℝ) ^ k / H := div_nonneg (by positivity) (by linarith) |
| 425 | have hab : -((2 : ℝ) ^ k / H) ≤ (2 : ℝ) ^ k / H := by linarith |
| 426 | unfold Low |
| 427 | rw [← hHdef, integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le hab] |
| 428 | have hsq : Real.sqrt (e1 * (2 * (ms S + B) ^ 4)) = δ * (ms S + B) ^ 2 := by |
| 429 | rw [show e1 * (2 * (ms S + B) ^ 4) = (δ * (ms S + B) ^ 2) ^ 2 by rw [he1]; ring] |
| 430 | exact Real.sqrt_sq (by positivity) |
| 431 | rw [hconv] |
| 432 | refine hL.trans ?_ |
| 433 | rw [hsq] |
| 434 | have hR0 : 0 ≤ 1 / H + W.lo ^ (-(0.01 : ℝ)) := |
| 435 | add_nonneg (div_nonneg zero_le_one (by linarith)) (Real.rpow_nonneg hlo0.le _) |
| 436 | exact L29b_alg C29 B cS e δ G e2 ηQ (1 / H + W.lo ^ (-(0.01 : ℝ))) (ms S) ε ε' W.len hC29 |
| 437 | hB0 hc he hmass hMpos hε hε' he20 (by linarith [hQW, hRW]) hR0 hδ hG hηQ he2 hδ0 hlenpos.le |
| 438 | |
| 439 | end E424 |
| 440 | |