| | @@ -0,0 +1,89 @@ |
| 1 | +import ErdosSwarm.Erdos530Gap78.Data |
| 2 | +import ErdosSwarm.Erdos530Gap103.Recorded |
| 3 | + |
| 4 | +/-! |
| 5 | +# Refinement at level `⌈m^(5/32)⌉` for Erdős #530 |
| 6 | + |
| 7 | +Equation (6) of Theorem 5 in `experiments/erdos530/upper-deletion-constant/NOTES.md` |
| 8 | +bounds the number of leaves in one container and the size of each recorded set. |
| 9 | +We count the leaves by replaying the recorded sets as in `Erdos530Gap103/Recorded.lean`. |
| 10 | +The initial one-step containers come from |
| 11 | +[Phal and Gemini, §4](https://github.com/shubhamphal/erdos-530/blob/42a01f6/paper/erdos_530.tex). |
| 12 | +-/ |
| 13 | + |
| 14 | +namespace ErdosSwarm.Erdos530Gap78 |
| 15 | + |
| 16 | +open Finset ErdosSwarm.Erdos530Gap ErdosSwarm.Erdos530Gap.Refinement |
| 17 | + |
| 18 | +/-- At this level, the weight `ρ = 24 / m^(5/32)` pays for the recorded vertices |
| 19 | +and satisfies `ρ |C| ≤ 48 m^(27/32)`. -/ |
| 20 | +private theorem refinement_weight_bounds {m : ℝ} {C : Finset ℕ} (hm : (2 : ℝ) ^ 256 ≤ m) |
| 21 | + (hn : (C.card : ℝ) ≤ 2 * m) : |
| 22 | + let ρ := 24 / m ^ (5 / 32 : ℝ) |
| 23 | + 3 ≤ level532 m ∧ 0 < ρ ∧ ρ ≤ 1 ∧ 18 ≤ ρ * level532 m ∧ |
| 24 | + ρ * C.card ≤ 48 * m ^ (27 / 32 : ℝ) := by |
| 25 | + let u := m ^ (5 / 32 : ℝ) |
| 26 | + let ρ := 24 / u |
| 27 | + have hm₀ : 0 < m := lt_of_lt_of_le (by norm_num) hm |
| 28 | + have hu₀ : 0 < u := Real.rpow_pos_of_pos hm₀ _ |
| 29 | + have hu24 : 24 ≤ u := calc |
| 30 | + 24 ≤ ((2 : ℝ) ^ (256 : ℕ)) ^ (5 / 32 : ℝ) := by |
| 31 | + rw [← Real.rpow_natCast_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 32 | + norm_num |
| 33 | + _ ≤ u := Real.rpow_le_rpow (by positivity) hm (by norm_num) |
| 34 | + have huL : u ≤ (level532 m : ℝ) := Nat.le_ceil _ |
| 35 | + have hl : 3 ≤ level532 m := by exact_mod_cast (show (3 : ℝ) ≤ level532 m by linarith) |
| 36 | + have hρ : 0 < ρ := div_pos (by norm_num) hu₀ |
| 37 | + refine ⟨hl, hρ, (div_le_one hu₀).mpr hu24, ?_, ?_⟩ |
| 38 | + · calc (18 : ℝ) ≤ 24 := by norm_num |
| 39 | + _ = ρ * u := (div_mul_cancel₀ _ hu₀.ne').symm |
| 40 | + _ ≤ ρ * level532 m := mul_le_mul_of_nonneg_left huL hρ.le |
| 41 | + · have hscale : m / u = m ^ (27 / 32 : ℝ) := by |
| 42 | + apply (div_eq_iff hu₀.ne').mpr |
| 43 | + dsimp only [u] |
| 44 | + rw [← Real.rpow_add hm₀] |
| 45 | + norm_num |
| 46 | + calc ρ * C.card ≤ ρ * (2 * m) := mul_le_mul_of_nonneg_left hn hρ.le |
| 47 | + _ = 48 * (m / u) := by dsimp only [ρ]; ring |
| 48 | + _ = _ := by rw [hscale] |
| 49 | + |
| 50 | +/-- The number of terminal leaves in a container at level `⌈m^(5/32)⌉` satisfies (6). -/ |
| 51 | +theorem refined_count {M : ℕ} {C : Finset ℕ} (hm : (2 : ℝ) ^ 256 ≤ Real.sqrt M) |
| 52 | + (hn : (C.card : ℝ) ≤ 2 * Real.sqrt M) : |
| 53 | + ((Erdos530Gap103.leaves C (level532 (Real.sqrt M))).card : ℝ) ≤ |
| 54 | + Real.exp (refinedLog (Real.sqrt M)) := by |
| 55 | + set m := Real.sqrt M |
| 56 | + let ρ := 24 / m ^ (5 / 32 : ℝ) |
| 57 | + obtain ⟨hl, hρ, hρ₁, hρl, hsize⟩ := refinement_weight_bounds hm hn |
| 58 | + refine (Erdos530Gap103.leaf_count_of_level C hl hρ hρ₁ hρl).trans (Real.exp_le_exp.mpr ?_) |
| 59 | + have hm₀ : 0 < m := lt_of_lt_of_le (by norm_num) hm |
| 60 | + have hlog : Real.log ρ = Real.log 24 - (5 / 32) * Real.log m := by |
| 61 | + rw [show ρ = 24 / m ^ (5 / 32 : ℝ) from rfl, |
| 62 | + Real.log_div (by norm_num) (Real.rpow_pos_of_pos hm₀ _).ne', Real.log_rpow hm₀] |
| 63 | + calc |
| 64 | + ρ * C.card * (1 - Real.log ρ) ≤ 48 * m ^ (27 / 32 : ℝ) * (1 - Real.log ρ) := |
| 65 | + mul_le_mul_of_nonneg_right hsize (by linarith [Real.log_nonpos hρ.le hρ₁]) |
| 66 | + _ ≤ refinedLog m := by |
| 67 | + rw [refinedLog, mul_right_comm, mul_right_comm (24 : ℝ)] |
| 68 | + apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg hm₀.le _) |
| 69 | + rw [hlog] |
| 70 | + linarith only [Real.one_sub_inv_le_log_of_pos (show (0 : ℝ) < 24 by norm_num)] |
| 71 | + |
| 72 | +/-- Every Sidon subset follows a leaf whose recorded and live vertices are disjoint |
| 73 | +and lie in the container. Its recorded set has at most `64 m^(27/32)` vertices. -/ |
| 74 | +theorem refined_leaf {M : ℕ} {C I : Finset ℕ} (hm : (2 : ℝ) ^ 256 ≤ Real.sqrt M) |
| 75 | + (hn : (C.card : ℝ) ≤ 2 * Real.sqrt M) (hI : I ⊆ C) (hsid : IsSidon (I : Set ℕ)) : |
| 76 | + let L := (follow C (level532 (Real.sqrt M)) I).1.leaf |
| 77 | + L ∈ Erdos530Gap103.leaves C (level532 (Real.sqrt M)) ∧ L.follows I ∧ |
| 78 | + L.fixed ∪ L.live ⊆ C ∧ Disjoint L.fixed L.live ∧ |
| 79 | + (L.fixed.card : ℝ) ≤ 64 * Real.sqrt M ^ (27 / 32 : ℝ) := by |
| 80 | + classical |
| 81 | + set m := Real.sqrt M |
| 82 | + obtain ⟨hl, _, _, hρl, hsize⟩ := refinement_weight_bounds hm hn |
| 83 | + obtain ⟨_, _, hfollows, hinside, hdisj, _⟩ := refinement_path C I (level532 m) hl hI hsid |
| 84 | + refine ⟨mem_image.mpr ⟨I, mem_filter.mpr ⟨mem_powerset.mpr hI, hsid⟩, rfl⟩, |
| 85 | + hfollows, hinside, hdisj, ?_⟩ |
| 86 | + exact ((Erdos530Gap103.fixed_card_le_of_level hl hρl hI hsid).trans hsize).trans |
| 87 | + (mul_le_mul_of_nonneg_right (by norm_num : (48 : ℝ) ≤ 64) (by positivity)) |
| 88 | + |
| 89 | +end ErdosSwarm.Erdos530Gap78 |