# Break attempt on PAIRS(T, p) — research/a3-08-adjacent-pairs.js Job #2, lane `adversarial`, snapshot `main`. Author rung: **measured** for every enumeration below; **proven** is claimed only for the two hypotheses, which are one line of algebra each. ## Caveat first, and the open gap The formula was not refuted. What I can say is narrower than "it is right": at folds 31 and 37 an enumeration that shares no code path with the derivation agrees with it exactly, and the two hypotheses the derivation uses without stating are both load-bearing and both currently satisfied at every call site in the file. The statement as written in the header is incomplete, not wrong. One validator in the file (`brutePairs`) has an off-by-one that is unreachable on this tile family for a reason nobody wrote down; if the tile family ever changes, it fires. ## 1. Fold 31, by a method that shares nothing with the derivation The file's section [6] reports three numbers at fold 31 — `PREDICT`, `E2 copy`, `kill-graph edges`. All three consume the multiplicity argument or the gap criterion, so their agreement does not test it. `brutePairs` (E1), the only position walk in the file, is applied to folds 7..29 only. `fold31.c` closes that gap: - T_23 is built from the **definition** — every r in [0, 23#) with r and r+2 coprime to 23# — by a direct sieve over all 223,092,870 residues. It does not call the file's `buildTiles()` and does not use the fold recursion. - T_29 is streamed from T_23 by the same definitional condition mod 29. - The pair count walks all 31 x 214,708,725 = 6,657,970,475 slots of the pre-deletion new tile in position order and asks of each slot only whether 31 deletes it (r = 0 or -2 mod 31). No gap criterion, no multiplicity argument, no copy intersection, no histogram. - The prediction is computed afterwards from a gap histogram the same program builds, so the two sides share no code. | quantity | independent walk | file section [6] | |---|---|---| | D(T_29) | 214,708,725 | 214,708,725 | | W(T_29) | 6,469,693,230 | 6,469,693,230 | | G2 | 258 | 258 | | wrap gap | 42 | 42 | | count(60), count(126), count(186) | 7,815,766 / 205,068 / 2,090 | same | | **pairs, enumerated** | **8,025,014** | — (not enumerated in the file at this fold) | | **pairs, predicted** | **8,025,014** | 8,025,014 | | kills | 429,417,450 = 2D | 429,417,450 | | run spectrum | 1:413380422 2:7999018 3:12992 4:4 | identical | | L | 4 | 4 | Wall time 8.7 s, peak RSS about 0.5 GB, single core. **Falsifier for this section:** any rerun of `fold31.c` that prints a `pairs` different from `8025014`, or different from what the formula gives on its own histogram. ## 2. Fold 37 on T_31 — an independent check of reading [6b] Reading [6b] of the file is the one number in it that comes from a separate detached run (`--t31`, 2,543 s, "28 of its 31 progress lines elided"), so it is the least independently checked number in the document. `fold37.c` reproduces it by the same criterion-free position walk, over all 37 x 6,226,553,025 = 230,382,461,925 slots, with T_31 streamed from a T_23 built from the definition. | quantity | independent walk | reading [6b] | |---|---|---| | D(T_31) | 6,226,553,025 | 6,226,553,025 | | W(T_31) | 200,560,490,130 | 200,560,490,130 | | G2 | 348 | 348 | | wrap gap | 42 | 42 | | count(72) | 109,884,182 | 109,884,182 | | count(150) | 4,937,476 | 4,937,476 | | count(222) | 26,366 | 26,366 | | count(294) | 46 | 46 | | **pairs, enumerated** | **114,874,436** | — (not enumerated at this fold) | | **pairs, predicted** | **114,874,436** | 114,874,436 | | kills | 12,453,106,050 = 2D | 12,453,106,050 | | run spectrum | 1:12223428142 2:114732724 3:70532 4:216 | identical | | L | 4 | 4 | Wall time 273.2 s (20.5 s to stream the tile, 252.4 s for the 37 passes), peak RSS about 6.6 GB, single core. The file's own detached run took 2,543 s. Every published figure of [6b] that this program computes independently agrees; I did not recompute the run-word census (`72+150 x 35098` etc.), only the spectrum it aggregates to. **Falsifier for this section:** a rerun of `fold37.c` printing anything other than `pairs = 114874436` and the spectrum above. ## 3. Where the multiplicity argument actually breaks The header proves the weights with: "Over the p copies the residue r_i + kw of that slot runs over ALL of Z/p exactly once." Two hypotheses are used and neither is written down. Both fail loudly, not marginally. ### (H1) gcd(W, p) = 1 If q divides W then w = W mod q = 0, every copy of a slot carries the same residue, and the "runs over all of Z/p" step is false. Since T_x by construction has no slot at 0 or -2 mod q for any q <= x, the true count is 0, while the formula returns the histogram sum: | tile | q | true pairs | formula | true kills | 2D | |---|---|---|---|---|---| | T_7 | 3 | 0 | 30 | 0 | 30 | | T_7 | 5 | 0 | 14 | 0 | 30 | | T_7 | 7 | 0 | 10 | 0 | 30 | | T_11 | 3 | 0 | 270 | 0 | 270 | | T_11 | 5 | 0 | 126 | 0 | 270 | | T_11 | 7 | 0 | 86 | 0 | 270 | | T_11 | 11 | 0 | 10 | 0 | 270 | The kill law "every old slot loses exactly 2 of its p copies" fails with it. ### (H2) p does not divide 4 The criterion's four ordered choices need 0 and -2 distinct, and +2 and -2 distinct. - **p = 2**: {0, -2} collapses to the 1-set {0}. Each slot dies in one copy, not two, and a gap = 0 (mod 2) is realised once, not twice. The formula returns twice the truth (synthetic tile W = 105, step 6: formula 34, truth 17; kills 18 against 2D = 36). - **p = 4**: +2 = -2, so both off-diagonal transfers fire on the same gap class and a gap = 2 (mod 4) is realised twice, not once. The formula returns half the truth (W = 105 step 6: formula 17, truth 34; W = 143 step 6: 23 against 46; W = 1001 step 14: 71 against 142). The kill law survives here, only the pair weights are wrong. - **p = 3** is fine: {0, -2} = {0, 1} mod 3 is still a 2-set with distinct transfers, and the formula holds on synthetic tiles with gcd(W, 3) = 1 (W = 143 step 6: 47 = 47; W = 1001 step 14: 72 = 72). Neither p = 2 nor p = 3 is reachable from this tile family, since 2 and 3 divide every W — they are excluded twice over, by (H1) as well as (H2). p = 4 is not prime and never a fold. ## 4. The identity is stronger than the header claims Under (H1) and (H2), nothing else is used. Not primality of p, not "the next prime", not the grain, not the primorial modulus, not multiples of 6: - 271 random cyclic sets S in Z/W, W in [200, 600), density 0.15, p in {5,...,23} with gcd(W, p) = 1: **0 disagreements**. - Composite p coprime to W, folded against T_5: p = 49, 77, 91, 119, 121, 143, 169 — all hold. - Twin tiles folded by a prime that is not the next prime: T_5, T_7, T_11 against every prime up to 101 — all hold. Suggested statement, replacing "fold T_x by the next prime p": > For any S contained in Z/W and any p >= 3 with gcd(W, p) = 1 and p not dividing 4, the number > of cyclically adjacent pairs of the p-fold of S that are both deleted by the 2-set {0, -2} > mod p is 2 * sum_{d = 0 (mod p)} c(d) + sum_{d = +-2 (mod p)} c(d), where c is the cyclic gap > histogram of S. Rung: **measured** at the scale tested; the derivation is a two-line argument and the step it needs is exactly invertibility of w, so **proven** is defensible once (H1) and (H2) are written into the statement. I am claiming the lower rung. ## 5. Every application in the file is inside the hypotheses All 20 call sites of `predictPairs`, `killGraph`, `copyPairs`, `brutePairs`, `streamAnalyse` and `qualifyingSet` were checked: - `pairTable` (line 265) walks `FOLDS` and takes `tiles[FOLDS.indexOf(p)]`, which pairs each tile with its **next** prime: (T5,7), (T7,11), (T11,13), (T13,17), (T17,19), (T19,23), (T23,29). gcd = 1 throughout. - The [8] and [8b] sweeps (lines 519, 542) carry `if (x >= p) continue`, so p > x always and p cannot divide W = x#. - `streamAnalyse` is called only as (T23, 29, 0, 31) and (T23, 29, 31, 37) — increasing primes. - [4], [8c], [9] all reuse `pairTable` rows. So **there is no application outside the hypotheses**, and this is not a refutation. The `x >= p` guard is what saves the sweeps, and it is not commented as a hypothesis check. ## 6. A real defect, in a validator, currently unreachable `brutePairs` closes the cyclic seam of the new tile with ```js if (prevDel) { pairs++; bump(run + headRun); } // cyclic seam of the NEW tile ``` `prevDel` is the deletion state of the **last** slot. The pair (last, first) is a double kill only if the **first** slot is also dead, which the branch never checks. It therefore overcounts by exactly 1 whenever the last slot is dead and the first is alive. Smallest cases found by exhaustive search over W <= 40, p in {5,7,11,13}: | W | p | S | brutePairs | correct | |---|---|---|---|---| | 6 | 5 | [1, 4] | 3 | 2 | | 6 | 5 | [2, 4] | 2 | 1 | | 6 | 5 | [1, 2, 4] | 3 | 2 | | 6 | 5 | [1, 3, 4] | 3 | 2 | **Why it never fires on T_x, and why that is luck the file does not record.** W-1 is in T_x for every x: W-1 = -1 and (W-1)+2 = W+1 = 1 modulo every q dividing W, so neither is 0. Hence the largest slot of T_x is W-1, the last slot of the pre-deletion new tile is (W-1) + (p-1)W = pW - 1 = -1 (mod p), and -1 lies in {0, -2} only if p divides 1. So `prevDel` is 0 at the seam for every fold of every T_x, and E1's agreement with PREDICT at folds 7..29 is real rather than accidental — but it rests on an invariant that is nowhere stated. My fold-31 walk confirms it directly: `firstDel = 0, lastDel = 0`. Related, same character: `aPlus(p)` runs `let a = 2; while (a % 6 !== 0) a += p;`. For p = 3 the sequence is 2, 5, 8, 11, ... and never 0 mod 6, so the loop does not terminate. Unreachable because `sweepP` starts at 7 and `FOLDS` at 7, but it hangs rather than throws. ## 7. Closed form against the raw criterion `qualifyingSet(p, G2)` returns three progressions mod 6p. Compared against a raw scan of every multiple of 6 up to G2 keeping d with d = 0 (weight 2) or d = +-2 (weight 1) mod p, over 122 (tile, p) pairs — T_5, T_7, T_11, T_13 against every prime in [7, 149] exceeding x: **0 disagreements**, weights included. The closed form is correct wherever gcd(p, 6) = 1, which is the same condition `aPlus` needs to terminate. At fold 31 it gives {60 w1, 126 w1, 186 w2, 246} of which {60, 126, 186} are present, matching [6]. ## 8. What the patch changes `a3-08.patch` (unified diff against the served file) does three things and changes no output: 1. Writes (H1) and (H2) into the header under THE MULTIPLICITY, with the failure numbers, and records that every call site satisfies them and that the identity needs nothing else. 2. Adds the `firstDel` guard to `brutePairs`'s seam branch, with a comment giving the counterexample and the W-1 invariant that makes the branch unreachable here. 3. Makes `aPlus` throw on gcd(p, 6) > 1 instead of looping forever. `node patched.js` reproduces `node a3-08-adjacent-pairs.js` line for line apart from the timing lines — see the recipe. The embedded OUTPUT block is therefore still accurate and was not touched. ## Sources - `research/a3-08-adjacent-pairs.js`, snapshot `main`, served at `https://dev.solveathome.org/projects/twin-primes/docs/research/a3-08-adjacent-pairs.js`, SHA-256 of the copy I fetched: see `hashes.a3-08-adjacent-pairs.js` in the return. Read in full; the header (lines 1-69), `brutePairs` (132-152), `copyPairs` (159-171), `makeKillMachine` (177-207), `qualifyingSet`/`aPlus` (106-116), `streamAnalyse` (416-443) and all call sites cited above. - `CLAUDE.md`, snapshot `main`, served at the same docs root; read for the calibration ladder and the register rules applied here. - Reading [6b] quoted in section 2 is the embedded OUTPUT block of the same script file, lines 832-1064, which the file states was produced by a separate detached run. - No local or restricted source was used. Everything above is reproducible from the served script plus the two programs in this return.