| | @@ -0,0 +1,187 @@ |
| 1 | +import ErdosSwarm.Erdos530Gap75.Parameters |
| 2 | + |
| 3 | +/-! |
| 4 | +# The pair-tail estimate at `m ≥ 2^256` for the 74/75 bound in Erdős #530 (brief C7) |
| 5 | + |
| 6 | +`pair_tail_75_512 : PairTail75At512`, the statement of `Erdos530Gap75/Plan.lean`: for |
| 7 | +`√M ≥ 2^256` the exponential-moment tail of an admissible pair `(α, n)`, times |
| 8 | +`exp (outerRate·m)` (the count allowed for the three-pass outer cover, `outerRate = |
| 9 | +1.4012·10⁻⁹`) and the number of refined pairs, is less than `1/4`. The cover width is |
| 10 | +`1 + Kτ`, `K = 2999/500`, and `δ = 0.03596`, as in `pair_tail_75` |
| 11 | +(`experiments/erdos530/upper-smaller-k3/NOTES.md` §4; numbers in `tail75_check.py`, second |
| 12 | +table). |
| 13 | + |
| 14 | +This is a statement about real numbers only. It is one input of the planned bound at |
| 15 | +`N ≥ 2^512`; the other one, the three-pass cover `Cover75At512`, is **not** proved, so |
| 16 | +`visible_gap_75` is still open in Lean. |
| 17 | + |
| 18 | +The proof is that of `pair_tail_75` with two changes. |
| 19 | + |
| 20 | +* The affine function of `(α, n)` is bounded by its value at the worst extreme point, |
| 21 | + `−6.7137·10⁻⁹·m`, instead of the `−10⁻⁹·m` that sufficed at `2^360` (`affine_tail_sharp`). |
| 22 | +* At `m = 2^256` the refined count is not negligible: `refinedLog m ≈ 1.2324·10⁻⁹·m`. With |
| 23 | + `y = m^(1/32) ≥ 2^8` it is `24·y^27·(1 + 10·log y)`, and the tangent of the logarithm at |
| 24 | + `2^8` gives `1 + 10·log y ≤ (57/256)·y`, hence `refinedLog m ≤ (24·57/2^40)·m < |
| 25 | + 1.25·10⁻⁹·m` (`scale_bounds_256`). |
| 26 | + |
| 27 | +So the logarithm of the product is at most `(−6.7 + 1.4012 + 1.25)·10⁻⁹·m < −4·10⁻⁹·m`. |
| 28 | + |
| 29 | +The enclosures `moment_log_bounds` of the three logarithms do not depend on the threshold; |
| 30 | +they are private in `Parameters.lean` and are used through `open private`, so that file is |
| 31 | +not changed. |
| 32 | +-/ |
| 33 | + |
| 34 | +namespace ErdosSwarm.Erdos530Gap75 |
| 35 | + |
| 36 | +open ErdosSwarm.Erdos530Gap |
| 37 | +open ErdosSwarm.Erdos530Gap103 (tau) |
| 38 | +open ErdosSwarm.Erdos530Gap78 (refinedLog tilt) |
| 39 | + |
| 40 | +open private momentA momentB moment_log_bounds from ErdosSwarm.Erdos530Gap75.Parameters |
| 41 | + |
| 42 | +noncomputable section |
| 43 | + |
| 44 | +set_option exponentiation.threshold 1024 |
| 45 | + |
| 46 | +/-- Uniform allowances at `m ≥ 2^256` for the interval bound, the fixed vertices and the |
| 47 | +refined-pair count. The last one is within one percent of the truth at `m = 2^256`. -/ |
| 48 | +private theorem scale_bounds_256 {m : ℝ} (hm : (2 : ℝ) ^ 256 ≤ m) : |
| 49 | + 52 * m ^ (-(1 / 8 : ℝ)) ≤ 1 / 1000 ∧ |
| 50 | + 64 * m ^ (27 / 32 : ℝ) ≤ m / 10 ^ 9 ∧ refinedLog m ≤ 125 / 10 ^ 11 * m := by |
| 51 | + have hm₁ : 1 ≤ m := le_trans (by norm_num) hm |
| 52 | + have hm₀ : 0 < m := lt_of_lt_of_le zero_lt_one hm₁ |
| 53 | + set y : ℝ := m ^ (1 / 32 : ℝ) with hy |
| 54 | + have hy₀ : 0 < y := Real.rpow_pos_of_pos hm₀ _ |
| 55 | + have hy32 : y ^ 32 = m := by |
| 56 | + rw [hy, ← Real.rpow_mul_natCast hm₀.le] |
| 57 | + norm_num |
| 58 | + have hy256 : (256 : ℝ) ≤ y := by |
| 59 | + apply le_of_pow_le_pow_left₀ (n := 32) (by decide) hy₀.le |
| 60 | + rw [hy32] |
| 61 | + exact le_trans (by norm_num) hm |
| 62 | + have hy27 : m ^ (27 / 32 : ℝ) = y ^ 27 := by |
| 63 | + rw [hy, ← Real.rpow_mul_natCast hm₀.le] |
| 64 | + norm_num |
| 65 | + have hy4 : m ^ (-(1 / 8 : ℝ)) = (y ^ 4)⁻¹ := by |
| 66 | + rw [hy, ← Real.rpow_mul_natCast hm₀.le, ← Real.rpow_neg hm₀.le] |
| 67 | + norm_num |
| 68 | + have hlogm : Real.log m = 32 * Real.log y := by |
| 69 | + rw [hy, Real.log_rpow hm₀] |
| 70 | + ring |
| 71 | + have hp4 : (256 : ℝ) ^ 4 ≤ y ^ 4 := pow_le_pow_left₀ (by norm_num) hy256 4 |
| 72 | + have hp5 : (256 : ℝ) ^ 5 ≤ y ^ 5 := pow_le_pow_left₀ (by norm_num) hy256 5 |
| 73 | + have hy27₀ : 0 < y ^ 27 := pow_pos hy₀ 27 |
| 74 | + have hy28₀ : 0 < y ^ 28 := pow_pos hy₀ 28 |
| 75 | + refine ⟨?_, ?_, ?_⟩ |
| 76 | + · rw [hy4, ← one_div] |
| 77 | + have h : 1 / y ^ 4 ≤ 1 / (256 : ℝ) ^ 4 := one_div_le_one_div_of_le (by norm_num) hp4 |
| 78 | + have h256 : 1 / (256 : ℝ) ^ 4 ≤ 1 / 52000 := by norm_num |
| 79 | + linarith only [h, h256] |
| 80 | + · rw [hy27, ← hy32, show y ^ 32 = y ^ 27 * y ^ 5 by ring] |
| 81 | + have h := mul_le_mul_of_nonneg_left hp5 hy27₀.le |
| 82 | + have h64 : (64 : ℝ) * 10 ^ 9 ≤ 256 ^ 5 := by norm_num |
| 83 | + have h' := mul_le_mul_of_nonneg_left h64 hy27₀.le |
| 84 | + linarith only [h, h'] |
| 85 | + · -- `log y ≤ log 256 + y / 256 − 1` and `log 256 = 8·log 2 < 5.5452`. |
| 86 | + have htan : Real.log (y / 256) ≤ y / 256 - 1 := |
| 87 | + Real.log_le_sub_one_of_pos (by positivity) |
| 88 | + rw [Real.log_div hy₀.ne' (by norm_num)] at htan |
| 89 | + have h256 : Real.log (256 : ℝ) = 8 * Real.log 2 := by |
| 90 | + rw [show (256 : ℝ) = 2 ^ (8 : ℕ) by norm_num, Real.log_pow] |
| 91 | + norm_num |
| 92 | + have hlog2 := Real.log_two_lt_d9 |
| 93 | + have hfactor : 1 + 5 / 16 * Real.log m ≤ 57 / 256 * y := by |
| 94 | + rw [hlogm] |
| 95 | + linarith only [htan, h256, hlog2, hy256] |
| 96 | + calc |
| 97 | + refinedLog m ≤ 24 * y ^ 27 * (57 / 256 * y) := by |
| 98 | + unfold refinedLog |
| 99 | + rw [hy27] |
| 100 | + gcongr |
| 101 | + _ = 24 * 57 / 256 * y ^ 28 := by ring |
| 102 | + _ ≤ 24 * 57 / 256 * (y ^ 28 * (y ^ 4 / 256 ^ 4)) := by |
| 103 | + have h1 : (1 : ℝ) ≤ y ^ 4 / 256 ^ 4 := by |
| 104 | + rw [le_div_iff₀ (by norm_num)] |
| 105 | + linarith only [hp4] |
| 106 | + have := mul_le_mul_of_nonneg_left h1 hy28₀.le |
| 107 | + linarith only [this] |
| 108 | + _ = 24 * 57 / 256 / 256 ^ 4 * y ^ 32 := by ring |
| 109 | + _ ≤ 125 / 10 ^ 11 * m := by |
| 110 | + rw [hy32] |
| 111 | + have : (24 * 57 / 256 / 256 ^ 4 : ℝ) ≤ 125 / 10 ^ 11 := by norm_num |
| 112 | + exact mul_le_mul_of_nonneg_right this hm₀.le |
| 113 | + |
| 114 | +/-- `affine_tail` of `Parameters.lean` with the value at the worst extreme point, |
| 115 | +`(a, n) = ((1 − Kτ/96)m, (1 + Kτ)m)`, which is `−6.7137·10⁻⁹·m`; the other extreme point |
| 116 | +has `−1.128·10⁻⁶·m`. -/ |
| 117 | +private theorem affine_tail_sharp {m a n : ℝ} (hm : 0 < m) (ha : a ≤ (1 + 1 / 1000) * m) |
| 118 | + (hn : n ≤ (1 + 2999 / 16000) * m) |
| 119 | + (hsize : ∀ lam : ℝ, 4 / 10 ^ 6 ≤ lam → lam ≤ 1 / 100 → |
| 120 | + (1 - lam) * m ≤ a → n < (1 + 96 * lam) * m) : |
| 121 | + -(31 / 32 - 1 / 10 ^ 9) * m * (29995500 / 10 ^ 11) + |
| 122 | + a * (27877319 / 10 ^ 11) + n * (1039701 / 10 ^ 11) ≤ -(67 / 10 ^ 10) * m := by |
| 123 | + by_cases htop : (1 - 4 / 10 ^ 6) * m ≤ a |
| 124 | + · have hw := hsize (4 / 10 ^ 6) le_rfl (by norm_num) htop |
| 125 | + linarith only [hm, ha, hw] |
| 126 | + by_cases hleft : a ≤ (1 - 2999 / 1536000) * m |
| 127 | + · linarith only [hm, hn, hleft] |
| 128 | + let lam := 1 - a / m |
| 129 | + have heq : (1 - lam) * m = a := by |
| 130 | + dsimp only [lam] |
| 131 | + rw [sub_sub_cancel, div_mul_cancel₀ _ hm.ne'] |
| 132 | + have hlo : 4 / 10 ^ 6 ≤ lam := by |
| 133 | + have h := (div_le_iff₀ hm).mpr (not_le.mp htop).le |
| 134 | + dsimp [lam] |
| 135 | + linarith only [h] |
| 136 | + have hhi : lam ≤ 2999 / 1536000 := by |
| 137 | + have h := (le_div_iff₀ hm).mpr (not_le.mp hleft).le |
| 138 | + dsimp [lam] |
| 139 | + linarith only [h] |
| 140 | + have hw := hsize lam hlo (hhi.trans (by norm_num)) heq.le |
| 141 | + linarith only [hm, not_le.mp hleft, heq, hw] |
| 142 | + |
| 143 | +/-- **C7.** For every admissible pair at `√M ≥ 2^256`, the exponential-moment tail times |
| 144 | +`exp (outerRate·√M)` and the number of refined pairs is less than `1/4`, with the cover |
| 145 | +width `1 + Kτ`, `K = 2999/500`, and `δ = 0.03596`. -/ |
| 146 | +theorem pair_tail_75_512 : PairTail75At512 := by |
| 147 | + intro M hm α n hα hn hsize |
| 148 | + set m := Real.sqrt (M : ℝ) |
| 149 | + change Real.exp (outerRate * m + refinedLog m) * |
| 150 | + (tilt ^ (-((seedSize M tau : ℝ) - 64 * m ^ (27 / 32 : ℝ))) * |
| 151 | + (momentA ^ 2 / momentB) ^ α * (momentB / momentA) ^ n) < 1 / 4 |
| 152 | + have hm₁ : 1 ≤ m := le_trans (by norm_num) hm |
| 153 | + have hm₀ := zero_lt_one.trans_le hm₁ |
| 154 | + obtain ⟨herr, hfixed, hrefined⟩ := scale_bounds_256 hm |
| 155 | + have ha := hα.trans (mul_le_mul_of_nonneg_right (add_le_add le_rfl herr) hm₀.le) |
| 156 | + have hn' : (n : ℝ) ≤ (1 + 2999 / 16000) * m := by |
| 157 | + norm_num [K, tau] at hn ⊢ |
| 158 | + exact hn |
| 159 | + have hmain := affine_tail_sharp hm₀ ha hn' hsize |
| 160 | + have hcounts : outerRate * m + refinedLog m ≤ 26512 / 10 ^ 13 * m := by |
| 161 | + norm_num [outerRate] |
| 162 | + linarith only [hrefined] |
| 163 | + have hk : (1 - tau) * m ≤ (seedSize M tau : ℝ) := Nat.le_ceil _ |
| 164 | + rw [show 1 - tau = 31 / 32 by norm_num [tau]] at hk |
| 165 | + have hseed : (31 / 32 - 1 / 10 ^ 9) * m ≤ (seedSize M tau : ℝ) - 64 * m ^ (27 / 32 : ℝ) := by |
| 166 | + linarith only [hk, hfixed] |
| 167 | + obtain ⟨hy, hA, hB⟩ := moment_log_bounds |
| 168 | + have hseed₀ : 0 ≤ (31 / 32 - 1 / 10 ^ 9) * m := mul_nonneg (by norm_num) hm₀.le |
| 169 | + have hneg := mul_le_mul hseed hy (by norm_num) (hseed₀.trans hseed) |
| 170 | + have hlogA := mul_le_mul_of_nonneg_left hA (Nat.cast_nonneg α : 0 ≤ (α : ℝ)) |
| 171 | + have hlogB := mul_le_mul_of_nonneg_left hB (Nat.cast_nonneg n : 0 ≤ (n : ℝ)) |
| 172 | + have hy₀ : 0 < tilt := by norm_num [tilt] |
| 173 | + have hA₀ : 0 < momentA ^ 2 / momentB := by norm_num [momentA, momentB, tilt, delta] |
| 174 | + have hB₀ : 0 < momentB / momentA := by norm_num [momentA, momentB, tilt, delta] |
| 175 | + apply (Real.log_lt_log_iff (by positivity) (by norm_num)).mp |
| 176 | + rw [Real.log_mul (Real.exp_pos _).ne' (by positivity), Real.log_exp, |
| 177 | + Real.log_mul (by positivity) (pow_pos hB₀ n).ne', |
| 178 | + Real.log_mul (Real.rpow_pos_of_pos hy₀ _).ne' (pow_pos hA₀ α).ne', |
| 179 | + Real.log_rpow hy₀, Real.log_pow, Real.log_pow, |
| 180 | + show Real.log (1 / 4 : ℝ) = -Real.log 4 by rw [one_div, Real.log_inv]] |
| 181 | + have hfour := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 4) |
| 182 | + have hbig : (10 : ℝ) ^ 10 ≤ m := le_trans (by norm_num) hm |
| 183 | + linarith only [hcounts, hmain, hneg, hlogA, hlogB, hbig, hfour] |
| 184 | + |
| 185 | +end |
| 186 | + |
| 187 | +end ErdosSwarm.Erdos530Gap75 |