| | @@ -1,11 +1,13 @@ |
| 1 | 1 | import ErdosSwarm.Erdos30 |
| 2 | +import ErdosSwarm.Erdos530 |
| 2 | 3 | import ErdosSwarm.Erdos530Spread |
| 3 | 4 | |
| 4 | 5 | /-! |
| 5 | 6 | # Erdős Problem 30 lower bounds |
| 6 | 7 | |
| 7 | 8 | Averaging translates of a cyclic Sidon set against an initial interval gives |
| 8 | | −a lower bound for the largest Sidon subset of that interval. |
| 9 | +a lower bound for the largest Sidon subset of that interval. With Ruzsa's set |
| 10 | +modulo `p * (p - 1)`, this gives `h ((p - 1) ^ 2) ≥ p - 1` for every prime `p`. |
| 9 | 11 | -/ |
| 10 | 12 | |
| 11 | 13 | namespace ErdosSwarm.Erdos30 |
| | @@ -54,4 +56,30 @@ theorem min_mul_card_le_mul_h_of_isSidon (N : ℕ) {m : ℕ} [NeZero m] |
| 54 | 56 | rw [ZMod.card, hI] at havg |
| 55 | 57 | exact havg.trans (Nat.mul_le_mul_left m hcard) |
| 56 | 58 | |
| 59 | +/-- Averaging Ruzsa's set of density `1 / p` over intervals of length at most `p * (p - 1)` |
| 60 | +gives an interval lower bound for every prime `p`. -/ |
| 61 | +theorem min_le_prime_mul_h (p : ℕ) (hp : p.Prime) (N : ℕ) : |
| 62 | + min N (p * (p - 1)) ≤ p * _root_.Erdos30.h N := by |
| 63 | + have : Fact p.Prime := ⟨hp⟩ |
| 64 | + have hpos := Nat.sub_pos_of_lt hp.one_lt |
| 65 | + have : NeZero (p * (p - 1)) := ⟨(Nat.mul_pos hp.pos hpos).ne'⟩ |
| 66 | + obtain ⟨S, hcard, hS⟩ := exists_ruzsa_sidon (p := p) |
| 67 | + have hbound := min_mul_card_le_mul_h_of_isSidon N S hS |
| 68 | + rw [hcard, mul_right_comm p (p - 1) (_root_.Erdos30.h N)] at hbound |
| 69 | + exact Nat.le_of_mul_le_mul_right hbound hpos |
| 70 | + |
| 71 | +/-- The interval of length `(p - 1) ^ 2` contains a Sidon set of at least `p - 1` elements. -/ |
| 72 | +theorem pred_prime_le_h_sq (p : ℕ) (hp : p.Prime) : |
| 73 | + p - 1 ≤ _root_.Erdos30.h ((p - 1) ^ 2) := by |
| 74 | + obtain ⟨q, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hp.ne_zero |
| 75 | + simp only [Nat.succ_sub_one] |
| 76 | + have hbound := min_le_prime_mul_h (q + 1) hp (q ^ 2) |
| 77 | + rw [Nat.succ_sub_one, min_eq_left (by |
| 78 | + rw [sq] |
| 79 | + exact Nat.mul_le_mul_right q (Nat.le_succ q))] at hbound |
| 80 | + by_contra! hlt |
| 81 | + -- If h + 1 ≤ q, then (q + 1) * h ≤ q² - 1, contradicting the interval bound. |
| 82 | + have hstep := Nat.mul_le_mul_left (q + 1) (Nat.succ_le_of_lt hlt) |
| 83 | + nlinarith only [hbound, hstep] |
| 84 | + |
| 57 | 85 | end ErdosSwarm.Erdos30 |