| | @@ -0,0 +1,227 @@ |
| 1 | +# Erdős #530 in Lean: the plan for 77/78 (`visible_gap_78`) |
| 2 | + |
| 3 | +**Target** (`Plan.lean`, last theorem): |
| 4 | + |
| 5 | +```lean |
| 6 | +theorem visible_gap_78 : |
| 7 | + ∀ N : ℕ, 2 ^ 720 ≤ N → (Erdos530FC.ell N : ℝ) < (77 / 78) * Real.sqrt N |
| 8 | +``` |
| 9 | + |
| 10 | +`Erdos530FC.ell` is the Formal Conjectures `ℓ` used by `visible_gap_103`. |
| 11 | + |
| 12 | +**Status of every claim here.** Nothing in this directory is Lean-checked beyond the |
| 13 | +fact that `Plan.lean` *compiles*: every new lemma is `sorry`. The math is proved on paper in |
| 14 | +`experiments/erdos530/upper-smaller-k2/NOTES.md` (Theorems 1–2, row `R = 32`), and it uses |
| 15 | +`upper-new-cover/`, `upper-deletion-constant/` §4 (Theorem 5) and `upper-threshold/` §5 |
| 16 | +(Lemma 2). Its finite part is a computation (`check.py` there). `Plan.lean` is **not** |
| 17 | +imported from `ErdosSwarm.lean`, because the axiom check rejects `sorry`. Check it with |
| 18 | +`lake env lean ErdosSwarm/Erdos530Gap78/Plan.lean` after `lake build`. When the last |
| 19 | +`sorry` is gone, rename it to `Assembly.lean`, add a `Main.lean` and import both, as was |
| 20 | +done for 102/103 (commit c993bde). |
| 21 | + |
| 22 | +## One change from the note: the tail |
| 23 | + |
| 24 | +Note §3 bounds the tail with the martingale Lemma 4 of `upper-deletion-constant/`. That |
| 25 | +lemma is not in Lean. The plan uses the **graph exponential moment** instead: |
| 26 | +`upper-threshold/NOTES.md` §5 Lemma 2, submitted in Lean as t-74d6da052f |
| 27 | +(`graph_exponential_moment`, `ErdosSwarm/Erdos530Gap/GraphMoment.lean`, under review). It |
| 28 | +uses Markov's inequality at the tilt `y = 1.0003`, retention `q = 1 − δ` and `δ = 0.036925` |
| 29 | +(the note's value). |
| 30 | + |
| 31 | +The per-pair log tail is `−(k − 64 m^{27/32}) log y + α log(A²/B) + n log(B/A)`. It is affine |
| 32 | +in `(α, n)`. The admissible region comes from the interval bound, (7) for |
| 33 | +`λ ∈ [λ₀, 1/100]` and the outer width `1 + 7τ`. It is a polygon with vertices |
| 34 | +`(1 + 52m^{-1/8}, 1 + 96λ₀)`, `(1 − λ₀, 1 + 96λ₀)` and `(1 − λ*, 1 + 7τ)`, where |
| 35 | +`λ* = 7τ/96`. `experiments/erdos530/upper-smaller-k2/tail78_check.py` (80-digit decimal |
| 36 | +arithmetic, log in `tail78_check.log`) checks two things at `m = 2^360`: |
| 37 | + |
| 38 | +* `max over vertices (main/m) + (B_m + 24m^{-5/32}(1 + (5/16)log m)) = −1.43·10⁻⁹ < 0`. Times |
| 39 | + `m` this is about `−3.4·10⁹⁹ < −log 4`, so the union over every cover member and refined |
| 40 | + pair is below `1/4`. |
| 41 | +* `(31/32)² < (1 − δ − η)(77/78)²` with `η = 10⁻⁹`, with room `6.25·10⁻⁵`. |
| 42 | + |
| 43 | +All error terms decrease in `m` (note §3), so the check at `2^360` covers all `m ≥ 2^360`. |
| 44 | +`B4` must still prove this decrease in Lean, as `Erdos530Gap103/Parameters.lean` does for |
| 45 | +the 102/103 row. The exact-size step is the 102/103 one: `P(large) < 1/4`, and |
| 46 | +`P(short) < 1/4` by `bernoulli_card_hoeffding` at `ηN/2`. |
| 47 | + |
| 48 | +## How the lemmas imply the target |
| 49 | + |
| 50 | +In the order of `visible_gap_78_of_inputs` (B5): |
| 51 | + |
| 52 | +1. Put `M = host78 N = ⌊N/(1 − δ − η)⌋`, `m = √M ≥ 2^360`, `k = seedSize M τ`. |
| 53 | +2. `cover_7_of_inputs` (A4) gives `𝒞`. Its log count is at most `coverLog + recordLog`, its |
| 54 | + members have size at most `(1 + 7τ)m`, and it covers every Sidon set of size `≥ k`. |
| 55 | +3. In `C ∈ 𝒞`, `refined_leaf` and `refined_count` (B2) give leaves `(F, U)` with |
| 56 | + `|F| ≤ 64m^{27/32}` and at most `exp(refinedLog m)` of them. The accepted `leaf_census` |
| 57 | + at level `⌈m^{5/32}⌉` gives the graph `G` on `U`, and its degree and quadruple bounds are |
| 58 | + the hypotheses `hedges`, `hquads` of `graph_size_96`. |
| 59 | +4. `α(G) ≤ (1 + 52m^{-1/8})m` follows from the accepted `card_le_of_few_additiveQuadruples`. |
| 60 | + `graph_size_96` (B3) gives `|U| < (1 + 96λ)m` whenever `α(G) ≥ (1 − λ)m`, and |
| 61 | + `|U| ≤ |C| ≤ (1 + 7τ)m` always holds. These are exactly the hypotheses of `pair_tail_78`. |
| 62 | +5. For each leaf, a surviving Sidon set of size `≥ k` gives `α(G_q) ≥ k − |F|`. |
| 63 | + `indep_tail` (B1) bounds the probability by `y^{−(k−64m^{27/32})}(A²/B)^α(B/A)^n`. |
| 64 | +6. `finite_union_bound` over `𝒞 ×` leaves, then `pair_tail_78` (B4), give |
| 65 | + `P(large) < 1/4`. `short_probability` (copy from 102/103) gives `P(short) < 1/4`. |
| 66 | +7. Some outcome is neither large nor short. The accepted `trim_survivors` and |
| 67 | + `ell_lt_of_host` then give `ℓ(N) < (77/78)√N`. |
| 68 | + |
| 69 | +Stage 1 alone (A1–A5) already gives **`visible_gap_89`** (`88/89` at `2^720`). It uses the |
| 70 | +`K = 7` cover with the accepted canonical `container_tail` and `entropy_and_error_103` |
| 71 | +(same `gap`, `tail`, `reserve`, `δ = (τ + g)/(1 − 7τ)`). It is a milestone that improves on |
| 72 | +102/103 before any of stage 2. Arithmetic (by hand, exact): |
| 73 | +`Erdos530Gap103.delta = 20842/484375 = (τ + g)/(1 − 35τ/4)` gives |
| 74 | +`τ + g = 20842·93/(484375·128)`, so `δ₇ = (τ + g)·32/25 = 31263/781250 ≈ 0.0400166`. |
| 75 | +Then `(1 − δ₇ − 10⁻⁹)(88/89)² ≈ 0.938532 > (31/32)² = 0.938477`. The `container_tail` |
| 76 | +side condition `(1 − 2δ) + δ(1 + 7τ) + err + tail ≤ 1 − τ` is `δ(1 − 7τ) ≥ τ + g`, an equality. |
| 77 | + |
| 78 | +## Reused unchanged (accepted, imported) |
| 79 | + |
| 80 | +From `Erdos530Gap103`: `incidence` (the incidence lemma, constants `(1/3, 18, 183)`), |
| 81 | +`exceptional_card_32` and `initialFamily` (the initial row), `leaf_census`, `leaf_count` |
| 82 | +(as a model), `entropy_and_error_103`, `tau`, `coord`, `iso`, `isoR`, `host`, |
| 83 | +`adjacentPairs`, `edgeFreeQuadruples`, `leaves`, `recordLog`, and the `rounding` and |
| 84 | +`missing_energy` proofs (as templates). |
| 85 | + |
| 86 | +From `Erdos530Gap`: `container_tail`, `bernoulli_card_hoeffding`, `trim_survivors`, |
| 87 | +`ell_lt_of_host`, `finite_union_bound`, `deletionLaw`, `deleted`, `containsSidon`, |
| 88 | +`seedSize`, `coverLog`, `card_le_of_few_additiveQuadruples`, `Refinement.follow`, |
| 89 | +`signed_collision_le` (model for B3c), and the `Window*` chain (model for B3d). |
| 90 | + |
| 91 | +**What changes.** |
| 92 | + |
| 93 | +* **Kernel.** `(q, H, β) = (24, 5, 3/10)`, not `(24, 7, 8/25)`. |
| 94 | +* **Score.** Complementary endpoint weights (`score`, note (1)) replace `W/2 + v`. There is |
| 95 | + no charge term in `second_occurrence`. |
| 96 | +* **Grid test.** Per-block charges, every admissible peak and both orientations, with margin |
| 97 | + `15/1000`. The 102/103 test used one charge per centre. |
| 98 | +* **Exceptional coefficient.** `s = 7.999` gives `K = 7` instead of `35/4`. |
| 99 | +* **Tail.** The deletion tail is now the exponential moment over refined pairs at level |
| 100 | + `⌈m^{5/32}⌉`, not the canonical `container_tail`. |
| 101 | + |
| 102 | +## The lemmas |
| 103 | + |
| 104 | +Line numbers refer to `Plan.lean`. Estimates are in agent turns (about one hour each) for a |
| 105 | +member who knows the 102/103 files. "Deps" lists what must be accepted first. |
| 106 | + |
| 107 | +| Brief | Lemma (`Plan.lean`) | Source | Deps | Estimate | |
| 108 | +|---|---|---|---|---| |
| 109 | +| A1 | `second_occurrence` (l. 94) | note §1 (1), sum before (2) | — | 2 turns (~350 lines; model `Erdos530Gap103/Charging.lean`) | |
| 110 | +| A2 | `missing_energy` (l. 112) | note §1, display before (2) | — | 1 turn (generalise `Erdos530Gap103.missing_energy` over a decreasing even kernel; then instantiate both kernels) | |
| 111 | +| A3a | `rounding` (l. 150) | note §2 ¶1–3 | — | 2–3 turns (energy part reuses the 103 common-rounding identity once generalised over the kernel; the score part is new: floor/ceiling bound `q|y−a| ≥ r−2`, monotone profile) | |
| 112 | +| A3b | `grid_lower` (l. 165) | note §2 (3), `check.py` | — | **the risk**: see "Certificate" below; 4–8 turns split A3b-0…A3b-4 | |
| 113 | +| A3c | `seed_lower` (l. 175) | note §2 last ¶ | A3a, A3b | ½ turn (model `Erdos530Gap103/SeedLower.lean`) | |
| 114 | +| A4 | `few_outsiders_of_inputs` (l. 196), `cover_7_of_inputs` (l. 215) | note §1–2, Theorem 1 | A1–A3 (as inputs) | 2 turns (copy of `Erdos530Gap103.few_outsiders_of_inputs` / `cover_35_4_of_inputs`; the identity isometry for vertices with no double occurrence; arithmetic `s + ε − 1 + R/m < 7`) | |
| 115 | +| A5 | `visible_gap_89_of_inputs` (l. 231) | note §3 (canonical deletion) | A4 | 1 turn (host part of `visible_gap_103_of_inputs` with `K = 7`, new `δ = 31263/781250`) | |
| 116 | +| B1 | `indep_tail` (l. 241) | upper-threshold §5 Lemma 2 + Markov | t-74d6da052f | 1–2 turns (transfer `deletionLaw`'s measure to the subset sum `∑_S q^|S|(1−q)^{n−|S|}`; Markov on `y^α`) | |
| 117 | +| B2 | `refined_count` (l. 261), `refined_leaf` (l. 270) | upper-deletion-constant §4 (6) | — | 1–2 turns (generalise `leaf_count`/`Recorded.lean` from level `⌈m^{1/8}⌉` to any `L ≥ 3`, then instantiate `⌈m^{5/32}⌉`) | |
| 118 | +| B3 | `graph_size_96` (l. 283) | upper-deletion-constant §4, Theorem 5 (7) | — | **8–12 turns**, split B3a–B3e below | |
| 119 | +| B4 | `pair_tail_78` (l. 314) | note §3 + `tail78_check.py` | — | 2 turns (vertex reduction of the affine form; error monotonicity from `m = 2^360` as in `Erdos530Gap103/Parameters.lean`; `norm_num` on rational bounds, with `Real.log_two_gt_d9`/`Real.log_two_lt_d9` and `Real.add_one_le_exp`-type bounds for `log y`, `log(A²/B)`, `log(B/A)`) | |
| 120 | +| B5 | `visible_gap_78_of_inputs` (l. 342) | note §3 | all | 2 turns (the 7 steps above; `short_probability` copied with `host78`) | |
| 121 | + |
| 122 | +### B3, split |
| 123 | + |
| 124 | +`graph_size_96` is Theorem 5 of `upper-deletion-constant/NOTES.md` §4. Its hypotheses are |
| 125 | +the conclusions of `leaf_census` at level `L`. It splits into: |
| 126 | + |
| 127 | +* **B3a** (8): `∑_{d>0} C(r_A(d), 2) ≤ |A| + 3 e(A)` for any finite `A ⊆ ℕ`, where `e(A)` |
| 128 | + counts additive quadruples. This is pure combinatorics. Starter-sized, 1 turn. |
| 129 | +* **B3b** (9)–(10): `e(U) ≤ 40 m^{69/32}`, `∑ r_U(d)² ≤ 246 m^{69/32}`, |
| 130 | + `∑ r_U^+(y)² ≤ 496 m^{69/32}`, and `∑_{x∈U\S} R_S(x) ≤ 568 m^{29/16}` for an |
| 131 | + independent `S`. These use B3a, the edge count `hedges` and the quadruple count `hquads`. |
| 132 | + 2 turns. |
| 133 | +* **B3c** (11): the signed count for a seed with repeated differences. It generalises the |
| 134 | + accepted `Erdos530Gap.signed_collision_le` (Sidon seeds) to `Q₀ = ∑ W(d/λM)(1 − r_S(d))`, |
| 135 | + with error `18000 m^{29/16}`. 2 turns. |
| 136 | +* **B3d** (12): the uniform window transfer with signed multiplicities, at the `R = 100, |
| 137 | + s = 48`, `r = 1/100` row (3,201 cases, least squared margin `51034/1000`). First check |
| 138 | + whether the accepted `Window*` chain (`WindowEnergy.energy_add_missing_le`, |
| 139 | + `WindowCertificate`) is stated for Sidon seeds only. If it is, generalise its Sidon step to |
| 140 | + the window identity with `r_S`, and add the smoothing bound `∫ f² ≤ 1 + 10⁻³ λ`. The |
| 141 | + allowance `r = 1/100` may need its own certificate rows. 3–4 turns. |
| 142 | +* **B3e**: the random selection of `B` (mean `b₀`, `E b(b−1) ≤ b₀²`, done by averaging as in |
| 143 | + `Erdos530Gap103.incidence`), the contradiction with (11), and the reflection |
| 144 | + `a ↦ M + 1 − a` for the right half. 1–2 turns. |
| 145 | + |
| 146 | +## Certificate: how the finite checker enters Lean (A3b) |
| 147 | + |
| 148 | +The 102/103 grid certificate is `Erdos530Gap103/GridData/C00…C12` plus `GridCheck`, |
| 149 | +`GridBridge` and `GridQuadratic`. It has **one charge vector per centre** (385 vectors, |
| 150 | +16-bit hex). The kernel evaluates `gridCheck` with `decide +kernel`, about 200 s per |
| 151 | +32-centre shard and 40 kernel-minutes in total. |
| 152 | + |
| 153 | +The 77/78 checker (`upper-smaller-k2/check.py`) is different. It subdivides the admissible |
| 154 | +peaks of each centre into blocks, and it proposes a fresh charge vector by projected gradient |
| 155 | +whenever the centre's vector fails a block. **Measured this turn** |
| 156 | +(`experiments/erdos530/upper-smaller-k2/count_vectors.py`, log `count_vectors.log`; run |
| 157 | +`python3 -I count_vectors.py check.py 0 1 2 5 10 20 40 60 80 100 120 150 200 250 300 350 384` |
| 158 | +from that folder; 17 sampled centres in 0…384) shows |
| 159 | +599 blocks and **706 integer products `G a`**, about **37 charge vectors per centre**. That |
| 160 | +is about 14,500 vectors for the full row (the note reports 14,550 blocks). Stored and |
| 161 | +checked like 102/103, that would be about 50 MB of Lean source and about 25 kernel-hours. |
| 162 | +That is not acceptable for `check.sh`. |
| 163 | + |
| 164 | +So `grid_lower` is brought into Lean by `decide +kernel` on a **verified table**, but in a |
| 165 | +new format. The checked statement is (3): `u^T G u + 2 Z^T u ≥ 2 A l − a^T G a` for |
| 166 | +`l = min_j [(G a)_j + Z_j]`. The algebra in `Erdos530Gap103/GridQuadratic.lean` is reused |
| 167 | +unchanged. Only the table and the boolean checker are new. |
| 168 | + |
| 169 | +* **A3b-0 (experiment, do first).** Change the generator to cut the number of distinct |
| 170 | + products. Options, in order of preference: |
| 171 | + 1. Keep one base vector `a_i` per centre, and certify each failing block with |
| 172 | + `a_i + δ` where `δ` is supported near the peak. Then `G(a_i + δ) = G a_i + G δ`, and |
| 173 | + `G` is banded (half-width `qH = 120`), so a block costs `O(|supp δ| · 240)`, not a full |
| 174 | + product. |
| 175 | + 2. Share vectors across neighbouring centres. One vector can be tried on all blocks of |
| 176 | + centres `i ± c`. |
| 177 | + 3. Use the reflection `j ↦ 768 − j` (centres `385…768`) and the zero-profile row for far |
| 178 | + peaks, which check.py already does. |
| 179 | + |
| 180 | + **Acceptance criterion:** a certificate of total kernel time at most 60 min on one core |
| 181 | + (measured with Python's integer replay times the 102/103 ratio), and the full row passing |
| 182 | + with margin `> 32 + 15/1000`. |
| 183 | +* **A3b-1.** `gridCheck78` in Lean (`Nat`/`Int` only), with the node scores `nodeScore` |
| 184 | + floored to multiples of `2^{-24}` and integer tent products as in `GridCheck.lean`. 1–2 turns. |
| 185 | +* **A3b-2.** `GridBridge78`: `gridCheck78 i blocks = true` gives (3) for every admissible |
| 186 | + peak in each block. The interval-of-`r` bound (`e_{max(0,l)}` and full weight for |
| 187 | + `h < 0`) is proved here. 2 turns. |
| 188 | +* **A3b-3.** The data shards (`GridData78/*.lean`, generator in |
| 189 | + `experiments/erdos530/grid-certificate-78/`) and `grid_cells78`. 1 turn once A3b-0 is done. |
| 190 | +* **A3b-4.** `grid_lower` from A3b-2/3, with the reflection for `i > 384` and the |
| 191 | + `(31 − 10⁻⁵)` mass step of `grid_lower_of_certificate`. 1 turn. |
| 192 | + |
| 193 | +The other finite inputs use `norm_num` on rationals: the constants `(1/3, 18, 183)` |
| 194 | +(already in `incidence`), the comparison in (2) at `m = 2^240`, `s + ε − 1 + R/m < 7`, the |
| 195 | +whole of B4 after reduction to `m = 2^360`, and the squared comparison |
| 196 | +`(31/32)² < (1 − δ − η)(77/78)²`. No `native_decide` anywhere. |
| 197 | + |
| 198 | +## Briefs the operator can open as tasks |
| 199 | + |
| 200 | +Each brief names its lemma in `Plan.lean`. Its criterion is that the lemma's exact |
| 201 | +statement (copied from `Plan.lean`, closed by an `example` through `import ErdosSwarm`) is |
| 202 | +proved in a new file imported from `ErdosSwarm.lean`, with `scripts/check.sh` passing, no |
| 203 | +`sorry`/`native_decide`, and nothing in `Results.lean`. |
| 204 | + |
| 205 | +1. **A1** `second_occurrence`: new file `Erdos530Gap78/Charging.lean`. It defines |
| 206 | + `kernel`, `profile`, `psi`, `score`, `missingWeight` (move them from `Plan.lean` into |
| 207 | + `Erdos530Gap78/Data.lean` first, unchanged). |
| 208 | +2. **A2** `missing_energy` for the new kernel. *Starter-friendly* if split as A2a |
| 209 | + (generalise the 103 proof over a decreasing even kernel with knots on the mesh) and A2b |
| 210 | + (instantiate). |
| 211 | +3. **A3a** `rounding`. |
| 212 | +4. **A3b-0** the certificate experiment above (offline, Python; no Lean). Submit the |
| 213 | + generator, its log and the measured kernel-time estimate. |
| 214 | +5. **A3b-1 … A3b-4** after A3b-0 is accepted. |
| 215 | +6. **A3c** `seed_lower` after A3a and A3b. |
| 216 | +7. **A4** `few_outsiders_of_inputs` + `cover_7_of_inputs` (with A1–A3 as `inputs`; it can |
| 217 | + start at once). |
| 218 | +8. **A5** `visible_gap_89_of_inputs`, with A4 as input. It can start at once. |
| 219 | +9. **B1** `indep_tail`, after t-74d6da052f is accepted. |
| 220 | +10. **B2** `refined_count` + `refined_leaf`. |
| 221 | +11. **B3a**, a *starter* (pure combinatorics), then **B3b**, **B3c**, **B3d**, **B3e**. |
| 222 | +12. **B4** `pair_tail_78`. |
| 223 | +13. **B5** `visible_gap_78_of_inputs`. It can start at once, with every other lemma as |
| 224 | + `inputs`. |
| 225 | + |
| 226 | +The `inputs` structures (`OutsiderInputs`, `CoverInputs`, `Inputs`) let A4, A5 and B5 be |
| 227 | +proved before their inputs, as was done for 102/103. |