| 1 | module |
| 2 | |
| 3 | public import E424.HighBand.L33 |
| 4 | public import E424.DirichletError.Basic |
| 5 | |
| 6 | @[expose] public section |
| 7 | |
| 8 | /-! |
| 9 | # Lemma 34, auxiliary: splitting over a family, and the high-band integral |
| 10 | |
| 11 | `Fp_sq_le`: `F_N` is its `S`-average plus `Err`, and Cauchy-Schwarz with weights `1/s` bounds the average. |
| 12 | `highband_integral`: an integral over a set of `t` covered by intervals `[k, k+1)`, `k ∈ 𝒦`, is at most |
| 13 | twice the bound of L33 (the two parities of `k` are 1-separated classes; integrate over the shift `σ ∈ [0,1)`). |
| 14 | -/ |
| 15 | |
| 16 | set_option linter.style.header false |
| 17 | open Finset MeasureTheory |
| 18 | |
| 19 | namespace E424 |
| 20 | |
| 21 | /-- `‖a + b‖² ≤ 2‖a‖² + 2‖b‖²`. -/ |
| 22 | lemma sq_norm_add_le_two' (a b : ℂ) : ‖a + b‖ ^ 2 ≤ 2 * ‖a‖ ^ 2 + 2 * ‖b‖ ^ 2 := by |
| 23 | have h := norm_add_le a b |
| 24 | nlinarith [norm_nonneg a, norm_nonneg b, norm_nonneg (a + b), sq_nonneg (‖a‖ - ‖b‖)] |
| 25 | |
| 26 | /-- Pointwise splitting of `F_N` over a family `S` (all `s ≥ 1`, `m_S > 0`): |
| 27 | `‖F_N(t)‖² ≤ 2‖Err_N^S(t)‖² + 2 m_S⁻¹ ∑_{s ∈ S} s⁻¹ ‖F_{N/s}(t)‖²`. -/ |
| 28 | lemma Fp_sq_le (S : Finset ℕ) (hm : 0 < ms S) (hS : ∀ s ∈ S, 1 ≤ s) (N t : ℝ) : |
| 29 | ‖Fp N t‖ ^ 2 ≤ 2 * ‖Err S N t‖ ^ 2 + |
| 30 | 2 * ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2) := by |
| 31 | set X : ℂ := ((ms S)⁻¹ : ℝ) * ∑ s ∈ S, ((1 / s : ℝ) : ℂ) * nit s t * Fp (N / s) t with hX |
| 32 | have hdec : Fp N t = Err S N t + X := by |
| 33 | unfold Err; rw [hX]; ring |
| 34 | have h1 : ‖X‖ ≤ (ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ := by |
| 35 | rw [hX, norm_mul, Complex.norm_real, Real.norm_of_nonneg (inv_nonneg.2 (ms_nonneg S))] |
| 36 | gcongr |
| 37 | refine (norm_sum_le _ _).trans (sum_le_sum fun s _ => ?_) |
| 38 | rw [norm_mul, norm_mul, norm_nit, mul_one, Complex.norm_real, |
| 39 | Real.norm_of_nonneg (by positivity : (0 : ℝ) ≤ 1 / (s : ℝ))] |
| 40 | -- Cauchy-Schwarz (Titu form) with weights `1/s` |
| 41 | have hpos : ∀ s ∈ S, 0 < 1 / (s : ℝ) := fun s hs => by |
| 42 | have : (1 : ℝ) ≤ s := by exact_mod_cast hS s hs |
| 43 | positivity |
| 44 | have hms : ∑ s ∈ S, (1 / (s : ℝ)) = ms S := rfl |
| 45 | have hg : ∀ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 = |
| 46 | ((1 / (s : ℝ)) * ‖Fp (N / s) t‖) ^ 2 / (1 / (s : ℝ)) := by |
| 47 | intro s hs |
| 48 | have : (0 : ℝ) < 1 / (s : ℝ) := hpos s hs |
| 49 | field_simp |
| 50 | have titu : (∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖) ^ 2 / ms S ≤ |
| 51 | ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 := by |
| 52 | have := Finset.sq_sum_div_le_sum_sq_div S (fun s : ℕ => (1 / (s : ℝ)) * ‖Fp (N / s) t‖) |
| 53 | (g := fun s : ℕ => 1 / (s : ℝ)) hpos |
| 54 | rw [hms] at this |
| 55 | refine this.trans (le_of_eq (sum_congr rfl fun s hs => ?_)) |
| 56 | exact (hg s hs).symm |
| 57 | have hq : (∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖) ^ 2 ≤ |
| 58 | ms S * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 := by |
| 59 | rw [div_le_iff₀ hm] at titu |
| 60 | rw [mul_comm]; exact titu |
| 61 | have hX2 : ‖X‖ ^ 2 ≤ (ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 := by |
| 62 | have hn : 0 ≤ ‖X‖ := norm_nonneg _ |
| 63 | have hsq : ‖X‖ ^ 2 ≤ ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖) ^ 2 := |
| 64 | pow_le_pow_left₀ hn h1 2 |
| 65 | have hmsinv : (ms S)⁻¹ ^ 2 * ms S = (ms S)⁻¹ := by field_simp |
| 66 | calc ‖X‖ ^ 2 ≤ (ms S)⁻¹ ^ 2 * (∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖) ^ 2 := by |
| 67 | refine hsq.trans (le_of_eq ?_); ring |
| 68 | _ ≤ (ms S)⁻¹ ^ 2 * (ms S * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2) := |
| 69 | mul_le_mul_of_nonneg_left hq (sq_nonneg _) |
| 70 | _ = (ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 := by |
| 71 | rw [show (ms S)⁻¹ ^ 2 * (ms S * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2) = |
| 72 | ((ms S)⁻¹ ^ 2 * ms S) * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 by ring, hmsinv] |
| 73 | have hsplit := sq_norm_add_le_two' (Err S N t) X |
| 74 | rw [hdec] |
| 75 | linarith |
| 76 | |
| 77 | /-- Continuity of `t ↦ ‖F_N(t)‖²` and of `t ↦ ‖Err_N^S(t)‖²`. -/ |
| 78 | lemma continuous_normsq_Fp (N : ℝ) : Continuous fun t => ‖Fp N t‖ ^ 2 := |
| 79 | (continuous_Fp N).norm.pow 2 |
| 80 | |
| 81 | lemma continuous_normsq_Err (S : Finset ℕ) (N : ℝ) : Continuous fun t => ‖Err S N t‖ ^ 2 := |
| 82 | (continuous_Err S N).norm.pow 2 |
| 83 | |
| 84 | /-- An integral of a continuous function over a bounded set is integrable. -/ |
| 85 | lemma integrableOn_of_subset_Icc {f : ℝ → ℝ} (hf : Continuous f) {A : Set ℝ} {M : ℝ} |
| 86 | (hA : A ⊆ Set.Icc (-M) M) : IntegrableOn f A := |
| 87 | (hf.integrableOn_Icc).mono_set hA |
| 88 | |
| 89 | /-- Integrating `Fp_sq_le` over a bounded set. -/ |
| 90 | lemma Fp_sq_setIntegral_le (S : Finset ℕ) (hm : 0 < ms S) (hS : ∀ s ∈ S, 1 ≤ s) (N : ℝ) |
| 91 | {A : Set ℝ} {M : ℝ} (hA : A ⊆ Set.Icc (-M) M) : |
| 92 | (∫ t in A, ‖Fp N t‖ ^ 2) ≤ |
| 93 | 2 * (∫ t in A, ‖Err S N t‖ ^ 2) + |
| 94 | 2 * ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ∫ t in A, ‖Fp (N / s) t‖ ^ 2) := by |
| 95 | have hI : ∀ s ∈ S, IntegrableOn (fun t => ‖Fp (N / s) t‖ ^ 2) A := fun s _ => |
| 96 | integrableOn_of_subset_Icc (continuous_normsq_Fp _) hA |
| 97 | have hE : IntegrableOn (fun t => ‖Err S N t‖ ^ 2) A := |
| 98 | integrableOn_of_subset_Icc (continuous_normsq_Err S N) hA |
| 99 | have hF : IntegrableOn (fun t => ‖Fp N t‖ ^ 2) A := |
| 100 | integrableOn_of_subset_Icc (continuous_normsq_Fp N) hA |
| 101 | have hSum : IntegrableOn (fun t => ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2) A := |
| 102 | integrable_finsetSum _ fun s hs => Integrable.const_mul (hI s hs) _ |
| 103 | have hR : IntegrableOn (fun t => (ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2) A := |
| 104 | Integrable.const_mul hSum _ |
| 105 | have hRHS : IntegrableOn (fun t => 2 * ‖Err S N t‖ ^ 2 + |
| 106 | 2 * ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2)) A := |
| 107 | Integrable.add (Integrable.const_mul hE 2) (Integrable.const_mul hR 2) |
| 108 | have hsumI : ∫ t in A, ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 = |
| 109 | ∑ s ∈ S, (1 / (s : ℝ)) * ∫ t in A, ‖Fp (N / s) t‖ ^ 2 := by |
| 110 | rw [integral_finsetSum _ fun s hs => Integrable.const_mul (hI s hs) _] |
| 111 | exact sum_congr rfl fun s _ => integral_const_mul _ _ |
| 112 | calc (∫ t in A, ‖Fp N t‖ ^ 2) |
| 113 | ≤ ∫ t in A, (2 * ‖Err S N t‖ ^ 2 + |
| 114 | 2 * ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2)) := |
| 115 | setIntegral_mono hF hRHS fun t => Fp_sq_le S hm hS N t |
| 116 | _ = 2 * (∫ t in A, ‖Err S N t‖ ^ 2) + |
| 117 | 2 * ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ∫ t in A, ‖Fp (N / s) t‖ ^ 2) := by |
| 118 | have hA2 : ∫ t in A, (2 * ‖Err S N t‖ ^ 2 + |
| 119 | 2 * ((ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2)) = |
| 120 | 2 * (∫ t in A, ‖Err S N t‖ ^ 2) + 2 * (∫ t in A, (ms S)⁻¹ * ∑ s ∈ S, |
| 121 | (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2) := by |
| 122 | rw [integral_add (Integrable.const_mul hE 2) (Integrable.const_mul hR 2), |
| 123 | integral_const_mul, integral_const_mul] |
| 124 | have hA3 : ∫ t in A, (ms S)⁻¹ * ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 = |
| 125 | (ms S)⁻¹ * ∫ t in A, ∑ s ∈ S, (1 / (s : ℝ)) * ‖Fp (N / s) t‖ ^ 2 := |
| 126 | integral_const_mul _ _ |
| 127 | rw [hA2, hA3, hsumI] |
| 128 | |
| 129 | /-- Distinct integer shifts `k + x`, `k' + x` are 1-separated. -/ |
| 130 | lemma one_le_abs_int_shift {k k' : ℤ} (hne : k ≠ k') (x : ℝ) : |
| 131 | 1 ≤ |((k : ℝ) + x) - ((k' : ℝ) + x)| := by |
| 132 | have hz : (k - k' : ℤ) ≠ 0 := sub_ne_zero.2 hne |
| 133 | have h1 : (1 : ℝ) ≤ |((k - k' : ℤ) : ℝ)| := by exact_mod_cast Int.one_le_abs hz |
| 134 | have h2 : ((k : ℝ) + x) - ((k' : ℝ) + x) = ((k - k' : ℤ) : ℝ) := by push_cast; ring |
| 135 | rw [h2]; exact h1 |
| 136 | |
| 137 | /-- An integral of `‖F_Y‖²` over a set `A` in `[-M, M]` that is covered by the unit intervals |
| 138 | `[k, k+1)`, `k ∈ 𝒦`, is at most `R`, provided `R` bounds `∑ ‖F_Y(t)‖²` over every 1-separated |
| 139 | set of frequencies in the L33 range with at most `Y^{0.012}` points. The unit cells are shifted by |
| 140 | `x ∈ [0,1)` (`k + x`), so each `x` gives one such set, and integrating over `x` costs nothing. -/ |
| 141 | lemma highband_integral {Y R M : ℝ} {A : Set ℝ} (hA : A ⊆ Set.Icc (-M) M) {𝒦 : Finset ℤ} |
| 142 | (hcov : ∀ t ∈ A, ⌊t⌋ ∈ 𝒦) (hcard : (𝒦.card : ℝ) ≤ Y ^ (0.012 : ℝ)) |
| 143 | (hrange : ∀ t ∈ A, Y ^ (1.03 : ℝ) + 1 ≤ |t| ∧ |t| + 1 ≤ Y ^ (1.86 : ℝ)) |
| 144 | (hL : ∀ τ : Finset ℝ, (∀ t ∈ τ, Y ^ (1.03 : ℝ) ≤ |t| ∧ |t| ≤ Y ^ (1.86 : ℝ)) → |
| 145 | (∀ t ∈ τ, ∀ t' ∈ τ, t ≠ t' → 1 ≤ |t - t'|) → (τ.card : ℝ) ≤ Y ^ (0.012 : ℝ) → |
| 146 | ∑ t ∈ τ, ‖Fp Y t‖ ^ 2 ≤ R) : |
| 147 | ∫ t in A, ‖Fp Y t‖ ^ 2 ≤ R := by |
| 148 | classical |
| 149 | set 𝒦' := 𝒦.filter (fun k => ∃ t ∈ A, ⌊t⌋ = k) with h𝒦' |
| 150 | have hcov' : ∀ t ∈ A, ∃ k ∈ 𝒦', (k : ℝ) ≤ t ∧ t < (k : ℝ) + 1 := fun t ht => |
| 151 | ⟨⌊t⌋, mem_filter.2 ⟨hcov t ht, t, ht, rfl⟩, Int.floor_le t, Int.lt_floor_add_one t⟩ |
| 152 | have hsub1 : A ⊆ ⋃ k ∈ 𝒦', Set.Ico (k : ℝ) (k + 1) := fun t ht => by |
| 153 | obtain ⟨k, hk, h1, h2⟩ := hcov' t ht |
| 154 | exact Set.mem_iUnion₂.2 ⟨k, hk, h1, h2⟩ |
| 155 | have hbd : (⋃ k ∈ 𝒦', Set.Ico (k : ℝ) (k + 1)) ⊆ Set.Icc (-M - 1) (M + 1) := by |
| 156 | intro t ht |
| 157 | obtain ⟨k, hk, htk⟩ := Set.mem_iUnion₂.1 ht |
| 158 | obtain ⟨t0, ht0, hk0⟩ := (mem_filter.1 hk).2 |
| 159 | obtain ⟨h0a, h0b⟩ := hA ht0 |
| 160 | have h1 : (k : ℝ) ≤ t0 := by rw [← hk0]; exact Int.floor_le t0 |
| 161 | have h2 : t0 < (k : ℝ) + 1 := by rw [← hk0]; exact Int.lt_floor_add_one t0 |
| 162 | constructor <;> linarith [htk.1, htk.2] |
| 163 | have hInt : IntegrableOn (fun t => ‖Fp Y t‖ ^ 2) (⋃ k ∈ 𝒦', Set.Ico (k : ℝ) (k + 1)) := |
| 164 | (continuous_normsq_Fp Y).integrableOn_Icc.mono_set hbd |
| 165 | have hmono : ∫ t in A, ‖Fp Y t‖ ^ 2 ≤ ∫ t in (⋃ k ∈ 𝒦', Set.Ico (k : ℝ) (k + 1)), ‖Fp Y t‖ ^ 2 := |
| 166 | setIntegral_mono_set hInt (ae_of_all _ fun t => (by positivity : (0 : ℝ) ≤ ‖Fp Y t‖ ^ 2)) |
| 167 | (ae_of_all _ fun t ht => hsub1 ht) |
| 168 | have hsplit : ∫ t in (⋃ k ∈ 𝒦', Set.Ico (k : ℝ) (k + 1)), ‖Fp Y t‖ ^ 2 = |
| 169 | ∑ k ∈ 𝒦', ∫ t in Set.Ico (k : ℝ) (k + 1), ‖Fp Y t‖ ^ 2 := by |
| 170 | refine integral_biUnion_finset 𝒦' (fun k _ => measurableSet_Ico) (fun k _ k' _ hne => ?_) |
| 171 | (fun k _ => ?_) |
| 172 | · refine Set.disjoint_left.2 fun t h1 h2 => ?_ |
| 173 | have a1 : (k : ℝ) < (k' : ℝ) + 1 := by linarith [h1.1, h2.2] |
| 174 | have a2 : (k' : ℝ) < (k : ℝ) + 1 := by linarith [h2.1, h1.2] |
| 175 | have b1 : k < k' + 1 := by exact_mod_cast a1 |
| 176 | have b2 : k' < k + 1 := by exact_mod_cast a2 |
| 177 | exact hne (by omega) |
| 178 | · exact (continuous_normsq_Fp Y).integrableOn_Icc.mono_set Set.Ico_subset_Icc_self |
| 179 | have hk1 : ∀ k : ℤ, ∫ t in Set.Ico (k : ℝ) (k + 1), ‖Fp Y t‖ ^ 2 = |
| 180 | ∫ x in (0 : ℝ)..1, ‖Fp Y ((k : ℝ) + x)‖ ^ 2 := by |
| 181 | intro k |
| 182 | have h := intervalIntegral.integral_comp_add_left (a := 0) (b := 1) |
| 183 | (fun t : ℝ => ‖Fp Y t‖ ^ 2) (k : ℝ) |
| 184 | simp only [add_zero] at h |
| 185 | rw [h, intervalIntegral.integral_of_le (by linarith), integral_Ico_eq_integral_Ioc] |
| 186 | have hcont : ∀ k : ℤ, Continuous fun x : ℝ => ‖Fp Y ((k : ℝ) + x)‖ ^ 2 := fun k => |
| 187 | (continuous_normsq_Fp Y).comp (continuous_const.add continuous_id) |
| 188 | have hpt : ∀ x ∈ Set.Icc (0 : ℝ) 1, ∑ k ∈ 𝒦', ‖Fp Y ((k : ℝ) + x)‖ ^ 2 ≤ R := by |
| 189 | intro x hx |
| 190 | have hinj : Set.InjOn (fun k : ℤ => (k : ℝ) + x) ↑𝒦' := fun a _ b _ h => by |
| 191 | have : (a : ℝ) = b := by simp only at h; linarith |
| 192 | exact_mod_cast this |
| 193 | have hτsum : ∑ t ∈ 𝒦'.image (fun k : ℤ => (k : ℝ) + x), ‖Fp Y t‖ ^ 2 = |
| 194 | ∑ k ∈ 𝒦', ‖Fp Y ((k : ℝ) + x)‖ ^ 2 := Finset.sum_image hinj |
| 195 | rw [← hτsum] |
| 196 | refine hL _ ?_ ?_ ?_ |
| 197 | · intro t ht |
| 198 | obtain ⟨k, hk, rfl⟩ := mem_image.1 ht |
| 199 | obtain ⟨t0, ht0, hk0⟩ := (mem_filter.1 hk).2 |
| 200 | have hA0 := hrange t0 ht0 |
| 201 | have c1 : (k : ℝ) ≤ t0 := by rw [← hk0]; exact Int.floor_le t0 |
| 202 | have c2 : t0 < (k : ℝ) + 1 := by rw [← hk0]; exact Int.lt_floor_add_one t0 |
| 203 | have hd : |t0 - ((k : ℝ) + x)| ≤ 1 := by |
| 204 | rw [abs_le]; constructor <;> linarith [hx.1, hx.2] |
| 205 | have e1 := abs_sub_abs_le_abs_sub t0 ((k : ℝ) + x) |
| 206 | have e2 := abs_sub_abs_le_abs_sub ((k : ℝ) + x) t0 |
| 207 | have hd' : |((k : ℝ) + x) - t0| ≤ 1 := by rw [abs_sub_comm]; exact hd |
| 208 | exact ⟨by linarith [hA0.1], by linarith [hA0.2]⟩ |
| 209 | · intro t ht t' ht' hne |
| 210 | obtain ⟨k, -, rfl⟩ := mem_image.1 ht |
| 211 | obtain ⟨k', -, rfl⟩ := mem_image.1 ht' |
| 212 | exact one_le_abs_int_shift (fun h => hne (by rw [h])) x |
| 213 | · exact (Nat.cast_le.2 (card_image_le.trans (card_filter_le _ _))).trans hcard |
| 214 | have hint : ∫ x in (0 : ℝ)..1, ∑ k ∈ 𝒦', ‖Fp Y ((k : ℝ) + x)‖ ^ 2 ≤ ∫ _ in (0 : ℝ)..1, R := by |
| 215 | refine intervalIntegral.integral_mono_on zero_le_one ?_ intervalIntegrable_const |
| 216 | (fun x hx => hpt x hx) |
| 217 | exact (continuous_finsetSum 𝒦' fun k _ => hcont k).intervalIntegrable 0 1 |
| 218 | calc ∫ t in A, ‖Fp Y t‖ ^ 2 ≤ ∫ t in (⋃ k ∈ 𝒦', Set.Ico (k : ℝ) (k + 1)), ‖Fp Y t‖ ^ 2 := hmono |
| 219 | _ = ∑ k ∈ 𝒦', ∫ t in Set.Ico (k : ℝ) (k + 1), ‖Fp Y t‖ ^ 2 := hsplit |
| 220 | _ = ∫ x in (0 : ℝ)..1, ∑ k ∈ 𝒦', ‖Fp Y ((k : ℝ) + x)‖ ^ 2 := by |
| 221 | rw [intervalIntegral.integral_finsetSum fun k _ => (hcont k).intervalIntegrable 0 1] |
| 222 | exact sum_congr rfl fun k _ => hk1 k |
| 223 | _ ≤ ∫ _ in (0 : ℝ)..1, R := hint |
| 224 | _ = R := by simp |
| 225 | |
| 226 | end E424 |
| 227 | |