| 1 | module |
| 2 | |
| 3 | public import E424.MacroRigidity.Basic |
| 4 | public import E424.Setup |
| 5 | public import E424.Calc |
| 6 | |
| 7 | @[expose] public section |
| 8 | |
| 9 | /-! |
| 10 | # Section 6: helpers for Lemma 27 (macroscopic rigidity) |
| 11 | |
| 12 | `F_mul_le_of_not_bad` is the pointwise step of Lemma 27 (i). The other statements are the |
| 13 | analytic inputs of the proof, stated but not yet proved. |
| 14 | -/ |
| 15 | |
| 16 | set_option linter.style.header false |
| 17 | open Finset |
| 18 | |
| 19 | namespace E424 |
| 20 | |
| 21 | /-- Pointwise step of Lemma 27 (i). For `s ∈ A` with `9 ∤ s`, if `3n ∉ E_3` and `z ∉ G_3` |
| 22 | then `F (s z) ≤ F z`, where `n = s z`. -/ |
| 23 | theorem F_mul_le_of_not_bad {s z : ℕ} (hs : s ∈ A) (hs9 : s % 9 ≠ 0) (hz : 1 ≤ z) |
| 24 | (h3 : 3 * (s * z) ∉ Es 3) (hG : z ∉ G3) : F (s * z) ≤ F z := by |
| 25 | by_cases hU : 3 * (s * z) ∈ U |
| 26 | · have hfix : f (3 * (s * z)) = f (3 * (3 * (s * z)) - 1) := by |
| 27 | by_contra hne |
| 28 | exact h3 ⟨hU, hne⟩ |
| 29 | have h9U : 9 * z ∈ U := ⟨by omega, by omega⟩ |
| 30 | have hsne : s ≠ 9 * z := by |
| 31 | intro h |
| 32 | apply hs9 |
| 33 | rw [h] |
| 34 | exact Nat.mul_mod_right 9 z |
| 35 | have e1 : 3 * (3 * (s * z)) - 1 = s * (9 * z) - 1 := by |
| 36 | rw [show 3 * (3 * (s * z)) = s * (9 * z) by ring] |
| 37 | have hL4 : f (s * (9 * z) - 1) ≤ f (9 * z) := L4 hs h9U hsne |
| 38 | have hFz : F (3 * z) = F z := by |
| 39 | by_contra h |
| 40 | exact hG h |
| 41 | calc F (s * z) = f (3 * (s * z)) := rfl |
| 42 | _ = f (3 * (3 * (s * z)) - 1) := hfix |
| 43 | _ = f (s * (9 * z) - 1) := by rw [e1] |
| 44 | _ ≤ f (9 * z) := hL4 |
| 45 | _ = F (3 * z) := by unfold F; rw [show 3 * (3 * z) = 9 * z by ring] |
| 46 | _ = F z := hFz |
| 47 | · have h0 : F (s * z) = 0 := by |
| 48 | unfold F |
| 49 | exact f_eq_zero_of_not_U hU |
| 50 | rw [h0] |
| 51 | exact F_nonneg z |
| 52 | |
| 53 | /-- Family-sum identity: `E_W ∑_{s ∣ n} G(n/s) = ∑_s (1/s) E_{W/s} G`. Exact, no error term. -/ |
| 54 | theorem E_family_eq (W : Win) (hlo : 0 < W.lo) (hhi : W.lo ≤ W.hi) (S : Finset ℕ) |
| 55 | (hS : ∀ s ∈ S, 1 ≤ s) (G : ℕ → ℝ) : |
| 56 | W.E (fun n => ∑ s ∈ S with s ∣ n, G (n / s)) = ∑ s ∈ S, 1 / (s : ℝ) * (W.div s).E G := by |
| 57 | unfold Win.E |
| 58 | rw [L17_family W hlo.le hhi S hS fun _ => G, sum_div] |
| 59 | refine sum_congr rfl fun s hs => ?_ |
| 60 | have : (s : ℝ) ≠ 0 := by have := hS s hs; positivity |
| 61 | rw [Win.len_div this]; ring |
| 62 | |
| 63 | /-- Lemma 27 (step (c)): moving the window by `c` in log-scale changes `E_W G` by at most |
| 64 | `(2 log c + 4c/lo) / len`, for `0 ≤ G ≤ 1`. Used for `W/s` versus `W/Y`. -/ |
| 65 | theorem E_div_diff (W : Win) (hlo : 0 < W.lo) (hhi : W.lo ≤ W.hi) (hL : 0 < W.len) |
| 66 | (c : ℝ) (hc : 1 ≤ c) (G : ℕ → ℝ) (h0 : ∀ n, 0 ≤ G n) (h1 : ∀ n, G n ≤ 1) : |
| 67 | |(W.div c).E G - W.E G| ≤ (2 * Real.log c + 4 * c / W.lo) / W.len := by |
| 68 | have hc0 : 0 < c := by linarith |
| 69 | have h := L17_div W hlo hhi c hc G h0 h1 |
| 70 | have hlg : 0 ≤ Real.log c := Real.log_nonneg hc |
| 71 | unfold Win.E |
| 72 | rw [Win.len_div hc0.ne', ← sub_div, abs_div, abs_of_pos hL] |
| 73 | refine div_le_div_of_nonneg_right (h.trans ?_) hL.le |
| 74 | have : c / W.lo ≤ 4 * c / W.lo := by gcongr; linarith |
| 75 | linarith |
| 76 | |
| 77 | end E424 |
| 78 | |