| | @@ -1,4 +1,5 @@ |
| 1 | 1 | import ErdosSwarm.Erdos530Gap103.Main |
| 2 | +import ErdosSwarm.Erdos530Gap78.Rounding |
| 2 | 3 | |
| 3 | 4 | /-! |
| 4 | 5 | # Proof plan for the 77/78 upper bound in Erdős #530 |
| | @@ -40,50 +41,7 @@ noncomputable section |
| 40 | 41 | |
| 41 | 42 | set_option exponentiation.threshold 1024 |
| 42 | 43 | |
| 43 | | −/- ## Constants and definitions of `upper-smaller-k2/NOTES.md` §1 -/ |
| 44 | | − |
| 45 | | −/-- The deficit `τ = 1/32` (shared with the 102/103 row). -/ |
| 46 | | −abbrev tau : ℝ := Erdos530Gap103.tau |
| 47 | | − |
| 48 | | −/-- The covering coefficient of Theorem 1 of the note. -/ |
| 49 | | −def K : ℝ := 7 |
| 50 | | − |
| 51 | | −/-- The exceptional coefficient `s = 7999/1000` of §1. -/ |
| 52 | | −def sCoef : ℝ := 7999 / 1000 |
| 53 | | − |
| 54 | | −/-- The allowance `ε = 1/1250` of §1 (as in the 102/103 row). -/ |
| 55 | | −def eps : ℝ := 1 / 1250 |
| 56 | | − |
| 57 | | −/-- The kernel `W` of §1 (`q = 24`, `H = 5`, `β = 3/10`): a tent of width `5` and area |
| 58 | | −`7/10` plus a tent of width `1/24` and area `3/10`. -/ |
| 59 | | −def kernel (y : ℝ) : ℝ := |
| 60 | | − 7 / 10 / 5 * max 0 (1 - |y| / 5) + 3 / 10 * 24 * max 0 (1 - 24 * |y|) |
| 61 | | − |
| 62 | | −/-- Heights (in thousandths) of the left endpoint profile at `j/2`, `j = 0, …, 8`. -/ |
| 63 | | −def profileHeights : List ℝ := [1000, 650, 463, 330, 228, 146, 77, 16, 0] |
| 64 | | − |
| 65 | | −/-- The left endpoint profile: linear interpolation of `profileHeights`, zero from `4` on |
| 66 | | −and left of `0`. -/ |
| 67 | | −def profile (y : ℝ) : ℝ := |
| 68 | | − if y < 0 ∨ 4 ≤ y then 0 |
| 69 | | − else |
| 70 | | − (profileHeights.getD ⌊2 * y⌋₊ 0 * (1 - (2 * y - ⌊2 * y⌋₊)) + |
| 71 | | − profileHeights.getD (⌊2 * y⌋₊ + 1) 0 * (2 * y - ⌊2 * y⌋₊)) / 1000 |
| 72 | | − |
| 73 | | −/-- `ψ` on `[0, 32]`: the profile and its reflection; zero outside. -/ |
| 74 | | −def psi (y : ℝ) : ℝ := if 0 ≤ y ∧ y ≤ 32 then profile y + profile (32 - y) else 0 |
| 75 | | − |
| 76 | | −/-- The score (1) of an incidence of the outsider at `t` with the seed point at `y`, whose |
| 77 | | −transported seed point is `gy`: complementary endpoint weights when `gy` is in the host, |
| 78 | | −the full kernel weight otherwise. -/ |
| 79 | | −def score (t y gy : ℝ) : ℝ := |
| 80 | | − if 0 ≤ gy ∧ gy ≤ 32 then kernel (y - t) / 2 * (1 + psi t - psi gy) else kernel (y - t) |
| 81 | | − |
| 82 | | −/-- `Q` of §1 for the new kernel: the weight of the positive integers that are not |
| 83 | | −differences of `S`. -/ |
| 84 | | −def missingWeight (M : ℕ) (S : Finset ℕ) : ℝ := |
| 85 | | − ∑ d ∈ (Icc 1 M).filter (fun d => ∀ a ∈ S, ∀ a' ∈ S, ((a : ℤ) - a').natAbs ≠ d), |
| 86 | | − kernel (32 * (d : ℝ) / M) |
| 44 | +/- The constants and definitions of §1 are in `Data.lean`. -/ |
| 87 | 45 | |
| 88 | 46 | /- ## Stage 1, lemma 1: charging (§1, equation (1) and the sum before (2)) -/ |
| 89 | 47 | |
| | @@ -116,47 +74,9 @@ theorem missing_energy {M : ℕ} {S : Finset ℕ} (hM : 0 < M) (hS : S ⊆ host |
| 116 | 74 | (M : ℝ) / 32 + S.card * kernel 0 := by |
| 117 | 75 | sorry |
| 118 | 76 | |
| 119 | | −/- ## Stage 1, lemma 3: the lower bound at every centre (§2) -/ |
| 120 | | − |
| 121 | | −/-- The kernel at the grid difference `n` (mesh `1/24`). -/ |
| 122 | | −def gridWeight (n : ℤ) : ℝ := kernel ((n : ℝ) / 24) |
| 123 | | − |
| 124 | | −/-- `f_i`: the least value of `ψ` at the host nodes `i − 1, i, i + 1`. -/ |
| 125 | | −def fLow (i : ℤ) : ℝ := |
| 126 | | − min (if 1 ≤ i then psi (((i - 1 : ℤ) : ℝ) / 24) else 1) |
| 127 | | − (min (psi ((i : ℝ) / 24)) (if i + 1 ≤ 768 then psi (((i + 1 : ℤ) : ℝ) / 24) else 1)) |
| 128 | | − |
| 129 | | −/-- `e_r`: the left profile at `max(0, r − 2)/24`. -/ |
| 130 | | −def eProf (r : ℤ) : ℝ := profile (((max 0 (r - 2) : ℤ) : ℝ) / 24) |
| 131 | | − |
| 132 | | −/-- The node score of §2 at node `j` for the centre `i` and the peak `peak`: `none` is the |
| 133 | | −row with zero profile; `some (right, k)` is a profile at the rounded endpoint `k`, extending |
| 134 | | −rightward (`right`) or leftward. Exterior nodes (`r < 0`) get the full weight. -/ |
| 135 | | −def nodeScore (i : ℤ) (peak : Option (Bool × ℤ)) (j : ℤ) : ℝ := |
| 136 | | − match peak with |
| 137 | | − | none => gridWeight (j - i) * (1 + fLow i) / 2 |
| 138 | | − | some (right, k) => |
| 139 | | − let r := if right then j - k else k - j |
| 140 | | − if r < 0 then gridWeight (j - i) else gridWeight (j - i) * (1 + fLow i - eProf r) / 2 |
| 141 | | − |
| 142 | | −/-- The peaks allowed by `g(t) ∈ [0, 32]`: `k ≤ i` rightward, `k ≥ i` leftward. -/ |
| 143 | | −def Admissible (i : ℤ) : Option (Bool × ℤ) → Prop |
| 144 | | − | none => True |
| 145 | | − | some (right, k) => if right then k ≤ i else i ≤ k |
| 146 | | − |
| 147 | | −/-- **Brief A3a (rounding).** The common rounding `j = ⌊24 y + V⌋` with one uniform `V` |
| 148 | | −keeps the expected grid energy and lowers the expected score; some `V` does at least as |
| 149 | | −well as the mean. Analogue of `Erdos530Gap103.rounding`. -/ |
| 150 | | −theorem rounding {ι : Type*} (S : Finset ι) (y : ι → ℝ) {w : ℝ} (hw : 0 ≤ w) |
| 151 | | − (hy : ∀ a ∈ S, y a ∈ Set.Ioo (0 : ℝ) 32) {t : ℝ} (ht : t ∈ Set.Ioo (0 : ℝ) 32) |
| 152 | | − (neg : Bool) (r : ℝ) (hgt : Erdos530Gap103.isoR neg r t ∈ Set.Icc (0 : ℝ) 32) : |
| 153 | | − ∃ (J : ι → ℤ) (i : ℤ) (peak : Option (Bool × ℤ)), |
| 154 | | − (∀ a ∈ S, J a ∈ Icc (0 : ℤ) 768) ∧ i ∈ Icc (0 : ℤ) 768 ∧ Admissible i peak ∧ |
| 155 | | − w ^ 2 * ∑ a ∈ S, ∑ a' ∈ S, gridWeight (J a - J a') + |
| 156 | | − 2 * sCoef * w * ∑ a ∈ S, nodeScore i peak (J a) ≤ |
| 157 | | − w ^ 2 * ∑ a ∈ S, ∑ a' ∈ S, kernel (y a - y a') + |
| 158 | | − 2 * sCoef * w * ∑ a ∈ S, score t (y a) (Erdos530Gap103.isoR neg r (y a)) := by |
| 159 | | − sorry |
| 77 | +/- ## Stage 1, lemma 3: the lower bound at every centre (§2) |
| 78 | + |
| 79 | +The grid definitions and the proof of `rounding` (A3a) are in `Rounding.lean`. -/ |
| 160 | 80 | |
| 161 | 81 | /-- **Brief A3b (grid certificate).** For every centre, every admissible peak (all |
| 162 | 82 | translates and both orientations, and the zero-profile row), every nonnegative grid mass of |