E424/DivisorMoments/L13.lean
| 1 | module |
| 2 | |
| 3 | public import E424.Setup |
| 4 | public import E424.DivisorMoments.L13Aux |
| 5 | |
| 6 | @[expose] public section |
| 7 | |
| 8 | /-! |
| 9 | # Section 4 of the outline: L13. Un-normalised window sums, valid on arbitrarily short windows. |
| 10 | -/ |
| 11 | |
| 12 | set_option linter.style.header false |
| 13 | open Finset |
| 14 | |
| 15 | namespace E424 |
| 16 | |
| 17 | /-- **Lemma 13.** Log-count of a residue class. -/ |
| 18 | theorem L13 (W : Win) (hlo : 0 < W.lo) (hhi : W.lo ≤ W.hi) (D r : ℕ) (hD : 0 < D) : |
| 19 | |W.sum (fun n => ind (n ≡ r [MOD D])) - W.len / D| ≤ 1 / W.lo := |
| 20 | L13Aux.main_bound hlo hhi hD r |
| 21 | |
| 22 | theorem sum_one_le (W : Win) (hlo : 0 < W.lo) (hhi : W.lo ≤ W.hi) : |
| 23 | |W.sum (fun _ => 1) - W.len| ≤ 1 / W.lo := by |
| 24 | have h := L13 W hlo hhi 1 0 one_pos |
| 25 | have h1 : (fun n : ℕ => ind (n ≡ 0 [MOD 1])) = fun _ => 1 := by |
| 26 | funext n; exact ind_true (Nat.modEq_one) |
| 27 | rw [h1] at h |
| 28 | simpa using h |
| 29 | |
| 30 | /-- `W.sum g ≤ c (len + 1/lo)` when `g ≤ c`. -/ |
| 31 | theorem sum_le_const (W : Win) (hlo : 0 < W.lo) (hhi : W.lo ≤ W.hi) {g : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) |
| 32 | (h : ∀ n ∈ W.pts, g n ≤ c) : W.sum g ≤ c * (W.len + 1 / W.lo) := by |
| 33 | have h1 := (abs_le.mp (sum_one_le W hlo hhi)).2 |
| 34 | calc W.sum g ≤ W.sum fun _ => c * 1 := Win.sum_mono fun n hn => by rw [mul_one]; exact h n hn |
| 35 | _ = c * W.sum fun _ => 1 := Win.sum_const_mul c |
| 36 | _ ≤ _ := by gcongr; linarith |
| 37 | |
| 38 | theorem E_le_const {η N : ℝ} (hη : 0 < η) {W : Win} (hW : W.Adm η N) {g : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) |
| 39 | (h : ∀ n ∈ W.pts, g n ≤ c) : W.E g ≤ c * (1 + 1 / (W.len * W.lo)) := by |
| 40 | have hL := hW.len_pos hη |
| 41 | have := sum_le_const W hW.lo_pos hW.lo_lt.le hc h |
| 42 | unfold Win.E |
| 43 | rw [div_le_iff₀ hL] |
| 44 | refine this.trans (le_of_eq ?_) |
| 45 | have := hW.lo_pos |
| 46 | field_simp |
| 47 | |
| 48 | end E424 |
| 49 |