| | @@ -0,0 +1,140 @@ |
| 1 | +import ErdosSwarm.Erdos530Gap75.Data |
| 2 | +import ErdosSwarm.Erdos530Gap78.Parameters |
| 3 | +import Batteries.Tactic.OpenPrivate |
| 4 | + |
| 5 | +/-! |
| 6 | +# The pair-tail estimate for the 74/75 upper bound in Erdős #530 (brief B4′) |
| 7 | + |
| 8 | +`pair_tail_75 : PairTail75`, the statement of `Erdos530Gap75/Plan.lean`: for `√M ≥ 2^360` |
| 9 | +the exponential-moment tail of an admissible pair `(α, n)`, times the number of containers |
| 10 | +and refined pairs, is less than `1/4`. Here the cover has width `1 + Kτ` with `K = 2999/500` |
| 11 | +and the deletion parameter is `δ = 0.03596` (`experiments/erdos530/upper-smaller-k3/NOTES.md` |
| 12 | +§4, numbers in `tail75_check.py`). |
| 13 | + |
| 14 | +The proof is that of `Erdos530Gap78.pair_tail_78` with new numerals. The logarithms of the |
| 15 | +tilt and of the two graph coefficients are enclosed by the cubic Taylor estimate |
| 16 | +`log_cubic_bounds` of `Erdos530Gap78/Parameters.lean`, and the graph-size hypothesis bounds |
| 17 | +the resulting affine function on the three ranges cut out by `λ = 4/10⁶` and |
| 18 | +`λ = Kτ/96 = 2999/1536000`. Its values at the three extreme points are below |
| 19 | +`−1.12·10⁻⁶·m`, `−1.40·10⁻⁶·m` and `−6.71·10⁻⁹·m`; the counts cost at most `5·10⁻¹⁰·m` |
| 20 | +(`Erdos530Gap103.entropy_and_error_103` and `scale_bounds`). The numerals are recomputed |
| 21 | +exactly by `experiments/erdos530/upper-smaller-k3/tail75_numerals.py`. |
| 22 | + |
| 23 | +The two private lemmas `log_cubic_bounds` and `scale_bounds` of the accepted file do not |
| 24 | +depend on `K` or `δ`; they are used through `open private`, so that file is not changed. |
| 25 | +-/ |
| 26 | + |
| 27 | +namespace ErdosSwarm.Erdos530Gap75 |
| 28 | + |
| 29 | +open ErdosSwarm.Erdos530Gap |
| 30 | +open ErdosSwarm.Erdos530Gap103 (tau recordLog) |
| 31 | +open ErdosSwarm.Erdos530Gap78 (refinedLog tilt) |
| 32 | + |
| 33 | +open private log_cubic_bounds scale_bounds from ErdosSwarm.Erdos530Gap78.Parameters |
| 34 | + |
| 35 | +noncomputable section |
| 36 | + |
| 37 | +set_option exponentiation.threshold 1024 |
| 38 | + |
| 39 | +private abbrev momentA : ℝ := |
| 40 | + let q := 1 - (delta : ℝ) |
| 41 | + 1 - q + q * tilt |
| 42 | + |
| 43 | +private abbrev momentB : ℝ := |
| 44 | + let q := 1 - (delta : ℝ) |
| 45 | + (1 - q) ^ 2 + (1 - (1 - q) ^ 2) * tilt |
| 46 | + |
| 47 | +/-- The cubic Taylor enclosures at `δ = 0.03596`: the coefficient of the negative term is |
| 48 | +rounded down and the two positive coefficients up, with common denominator `10¹¹`. -/ |
| 49 | +private theorem moment_log_bounds : |
| 50 | + 29995500 / 10 ^ 11 ≤ Real.log tilt ∧ |
| 51 | + Real.log (momentA ^ 2 / momentB) ≤ 27877319 / 10 ^ 11 ∧ |
| 52 | + Real.log (momentB / momentA) ≤ 1039701 / 10 ^ 11 := by |
| 53 | + have hy := log_cubic_bounds (z := tilt) (by norm_num [tilt]) (by norm_num [tilt]) |
| 54 | + have ha := log_cubic_bounds (z := momentA ^ 2 / momentB) |
| 55 | + (by norm_num [momentA, momentB, tilt, delta]) (by norm_num [momentA, momentB, tilt, delta]) |
| 56 | + have hb := log_cubic_bounds (z := momentB / momentA) |
| 57 | + (by norm_num [momentA, momentB, tilt, delta]) (by norm_num [momentA, momentB, tilt, delta]) |
| 58 | + exact ⟨le_trans (by norm_num [tilt]) hy.1, |
| 59 | + ha.2.trans (by norm_num [momentA, momentB, tilt, delta]), |
| 60 | + hb.2.trans (by norm_num [momentA, momentB, tilt, delta])⟩ |
| 61 | + |
| 62 | +/-- For `a/m ≥ 1 − 4/10⁶`, use the interval bound on `a`. For `a/m ≤ 1 − Kτ/96`, use the |
| 63 | +outer width `1 + Kτ = 1 + 2999/16000`. In between, set `λ = 1 − a/m`. -/ |
| 64 | +private theorem affine_tail {m a n : ℝ} (hm : 0 < m) (ha : a ≤ (1 + 1 / 1000) * m) |
| 65 | + (hn : n ≤ (1 + 2999 / 16000) * m) |
| 66 | + (hsize : ∀ lam : ℝ, 4 / 10 ^ 6 ≤ lam → lam ≤ 1 / 100 → |
| 67 | + (1 - lam) * m ≤ a → n < (1 + 96 * lam) * m) : |
| 68 | + -(31 / 32 - 1 / 10 ^ 9) * m * (29995500 / 10 ^ 11) + |
| 69 | + a * (27877319 / 10 ^ 11) + n * (1039701 / 10 ^ 11) ≤ -m / 10 ^ 9 := by |
| 70 | + by_cases htop : (1 - 4 / 10 ^ 6) * m ≤ a |
| 71 | + · have hw := hsize (4 / 10 ^ 6) le_rfl (by norm_num) htop |
| 72 | + linarith only [hm, ha, hw] |
| 73 | + by_cases hleft : a ≤ (1 - 2999 / 1536000) * m |
| 74 | + · linarith only [hm, hn, hleft] |
| 75 | + let lam := 1 - a / m |
| 76 | + have heq : (1 - lam) * m = a := by |
| 77 | + dsimp only [lam] |
| 78 | + rw [sub_sub_cancel, div_mul_cancel₀ _ hm.ne'] |
| 79 | + have hlo : 4 / 10 ^ 6 ≤ lam := by |
| 80 | + have h := (div_le_iff₀ hm).mpr (not_le.mp htop).le |
| 81 | + dsimp [lam] |
| 82 | + linarith only [h] |
| 83 | + have hhi : lam ≤ 2999 / 1536000 := by |
| 84 | + have h := (le_div_iff₀ hm).mpr (not_le.mp hleft).le |
| 85 | + dsimp [lam] |
| 86 | + linarith only [h] |
| 87 | + have hw := hsize lam hlo (hhi.trans (by norm_num)) heq.le |
| 88 | + linarith only [hm, not_le.mp hleft, heq, hw] |
| 89 | + |
| 90 | +/-- **B4′.** For every admissible pair at `√M ≥ 2^360`, the exponential-moment tail times |
| 91 | +the number of containers and refined pairs is less than `1/4`, with the cover width |
| 92 | +`1 + Kτ`, `K = 2999/500`, and `δ = 0.03596`. -/ |
| 93 | +theorem pair_tail_75 : PairTail75 := by |
| 94 | + intro M hm α n hα hn hsize |
| 95 | + set m := Real.sqrt (M : ℝ) |
| 96 | + change Real.exp (coverLog M tau + recordLog m + refinedLog m) * |
| 97 | + (tilt ^ (-((seedSize M tau : ℝ) - 64 * m ^ (27 / 32 : ℝ))) * |
| 98 | + (momentA ^ 2 / momentB) ^ α * (momentB / momentA) ^ n) < 1 / 4 |
| 99 | + have hm₁ : 1 ≤ m := le_trans (by norm_num) hm |
| 100 | + have hm₀ := zero_lt_one.trans_le hm₁ |
| 101 | + obtain ⟨herr, hfixed, hrefined⟩ := scale_bounds hm |
| 102 | + have ha := hα.trans (mul_le_mul_of_nonneg_right (add_le_add le_rfl herr) hm₀.le) |
| 103 | + have hn' : (n : ℝ) ≤ (1 + 2999 / 16000) * m := by |
| 104 | + norm_num [K, tau] at hn ⊢ |
| 105 | + exact hn |
| 106 | + have hmain := affine_tail hm₀ ha hn' hsize |
| 107 | + have hcounts : coverLog M tau + recordLog m + refinedLog m ≤ m / (2 * 10 ^ 9) := by |
| 108 | + have hc := (Erdos530Gap103.entropy_and_error_103 (M := M) hm).2 |
| 109 | + change coverLog M tau + recordLog m + refinementLog m < |
| 110 | + (Erdos530Gap103.tail ^ 2 - Erdos530Gap103.reserve) * m at hc |
| 111 | + have hr : 0 ≤ refinementLog m := by |
| 112 | + have hlog := Real.log_nonneg hm₁ |
| 113 | + unfold refinementLog |
| 114 | + positivity |
| 115 | + norm_num [Erdos530Gap103.tail, Erdos530Gap103.reserve] at hc |
| 116 | + linarith only [hc, hr, hrefined, hm₀] |
| 117 | + have hk : (1 - tau) * m ≤ (seedSize M tau : ℝ) := Nat.le_ceil _ |
| 118 | + rw [show 1 - tau = 31 / 32 by norm_num [tau]] at hk |
| 119 | + have hseed : (31 / 32 - 1 / 10 ^ 9) * m ≤ (seedSize M tau : ℝ) - 64 * m ^ (27 / 32 : ℝ) := by |
| 120 | + linarith only [hk, hfixed] |
| 121 | + obtain ⟨hy, hA, hB⟩ := moment_log_bounds |
| 122 | + have hseed₀ : 0 ≤ (31 / 32 - 1 / 10 ^ 9) * m := mul_nonneg (by norm_num) hm₀.le |
| 123 | + have hneg := mul_le_mul hseed hy (by norm_num) (hseed₀.trans hseed) |
| 124 | + have hlogA := mul_le_mul_of_nonneg_left hA (Nat.cast_nonneg α : 0 ≤ (α : ℝ)) |
| 125 | + have hlogB := mul_le_mul_of_nonneg_left hB (Nat.cast_nonneg n : 0 ≤ (n : ℝ)) |
| 126 | + have hy₀ : 0 < tilt := by norm_num [tilt] |
| 127 | + have hA₀ : 0 < momentA ^ 2 / momentB := by norm_num [momentA, momentB, tilt, delta] |
| 128 | + have hB₀ : 0 < momentB / momentA := by norm_num [momentA, momentB, tilt, delta] |
| 129 | + apply (Real.log_lt_log_iff (by positivity) (by norm_num)).mp |
| 130 | + rw [Real.log_mul (Real.exp_pos _).ne' (by positivity), Real.log_exp, |
| 131 | + Real.log_mul (by positivity) (pow_pos hB₀ n).ne', |
| 132 | + Real.log_mul (Real.rpow_pos_of_pos hy₀ _).ne' (pow_pos hA₀ α).ne', |
| 133 | + Real.log_rpow hy₀, Real.log_pow, Real.log_pow, |
| 134 | + show Real.log (1 / 4 : ℝ) = -Real.log 4 by rw [one_div, Real.log_inv]] |
| 135 | + have hfour := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 4) |
| 136 | + linarith only [hcounts, hmain, hneg, hlogA, hlogB, hm, hfour] |
| 137 | + |
| 138 | +end |
| 139 | + |
| 140 | +end ErdosSwarm.Erdos530Gap75 |