#!/usr/bin/env python3 # job1647-wrap: "Leads: new statistic" (explore/discovery, lane formalize, NO route), 2026-09-17. # # QUESTION. The served tile T_x is a CYCLIC gap word (twin-admissible residues mod P_x); the served # instrument research/a3-08-adjacent-pairs.js computes the kill-graph spectrum "from the OLD gap word # alone (O(D), no fold)". Every retained census (#1632/#1633/#1634, the served [5b]/[6b] rows) reports # run counts and L as if the word were read from a fixed starting residue. # # THE STATISTIC (new): the WRAP-MERGE INDICATOR # admissible slot i <=> g_i mod p in {0, +2, -2} (support law, #1644/#856, triaged in #1646) # W_x(p, k) = 1 iff the tile's slots (k-1, k) are BOTH admissible: the only cyclic edge the linear # read starting at k cuts. Then R_lin(k) = R_cyc - W_x(p, k) and L_cyc = max(L_lin(k), a_k + b_k) # when W = 1 (a_k, b_k = first/last linear run lengths). # E_x(p) = #{admissible slots} = #kill-graph edges (out-degree <= 1 -> slot i <-> edge at slot i). # E is MULTISET-determined: E_x(p) = sum_v count(v) * [v mod p in {0, 2, p-2}], so a retained # gap-multiset census fixes E with no word; W and R need the word PINNED to its start, which neither # a multiset census nor any rotation-invariant census has. # # PRE-REGISTERED FALSIFIER (written before the first run of this script, and run below): # F1 E from the multiset == E counted directly on the word, for every tested (tile, p). # F2 for every rotation k of the word: R_lin(k) == R_cyc - W(k) (the defect is exactly W), so the # cyclic run count is rotation-invariant while the linear one is not. # F3 L_cyc == max(L_lin(k), a_k + b_k) when W(k) = 1 and == L_lin(k) otherwise, all rotations. # F4 (matched control) a REVERSAL of the word (same multiset, adjacency destroyed) leaves E fixed at # every p - E is the control-invariant part of the spectrum - while R/L are allowed to move; # one p where E moves refutes the multiset formula. # Scale: the defect is 0 or 1 run, i.e. visible at unit resolution at any rung; cost O(D) per prime, # ~0 CPU-h. No network. No timing on stdout (the artifact stays byte-reproducible). import json SIGMA = (0, -2) def primes_upto(n): s = [True] * (n + 1) s[0] = s[1] = False for i in range(2, int(n ** 0.5) + 1): if s[i]: for j in range(i * i, n + 1, i): s[j] = False return [i for i, ok in enumerate(s) if ok] def tile_word(small_primes): """Cyclic gap word of T_x: twin-admissible residues mod the primorial of small_primes.""" P = 1 for q in small_primes: P *= q res = [r for r in range(P) if r % 2 == 1 and all(r % q not in (0, q - 2) for q in small_primes)] n = len(res) return P, n, [(res[(i + 1) % n] - res[i]) % P for i in range(n)] def adm(w, p): return [(g % p) in (0, 2, p - 2) for g in w] def runs_cyclic(flags): """(#maximal cyclic runs, largest run size) - the rotation-invariant read.""" n = len(flags) if not any(flags): return 0, 1 starts = sum(1 for i in range(n) if flags[i] and not flags[i - 1]) return starts, max_run_cyclic(flags) def max_run_cyclic(flags): n = len(flags) if all(flags): return n best = cur = 0 for i in range(2 * n): cur = cur + 1 if flags[i % n] else 0 best = max(best, cur) return min(best, n) def runs_linear(flags): """(count, max size, first size, last size) of maximal True-runs, read from index 0.""" runs, cur = [], 0 for f in flags: if f: cur += 1 elif cur: runs.append(cur) cur = 0 if cur: runs.append(cur) return len(runs), (max(runs) if runs else 1), (runs[0] if runs else 0), (runs[-1] if runs else 0) def runs_linear_rot(flags, k): """Linear read of the same cyclic word starting at index k.""" n = len(flags) return runs_linear([flags[(k + j) % n] for j in range(n)]) def ROT_SAMPLE(D): """Pinned, reproducible rotation sample (the identity is checked on these; the run-count identity is an algebraic consequence of 'the linear read cuts exactly one cyclic edge', not a sampled fact).""" ks = sorted(set(list(range(min(D, 64))) + [D // 3, D // 2, D - 2, D - 1])) return [k for k in ks if 0 <= k < D] def multiset_edges(counts, p): return sum(c for v, c in counts.items() if (v % p) in (0, 2, p - 2)) def run_tile(name, small, plist): P, D, word = tile_word(small) counts = {} for g in word: counts[g] = counts.get(g, 0) + 1 rows, f1_bad, f2_bad, f3_bad = [], [], [], [] movers = [] for p in plist: f = adm(word, p) E = sum(f) E_ms = multiset_edges(counts, p) Rc, Lc = runs_cyclic(f) Rl, Ll, a, b = runs_linear(f) edges = [(f[i - 1] and f[i]) for i in range(D)] # admissible cyclic edge into slot i W0 = 1 if edges[0] else 0 rows.append({"p": p, "E_direct": E, "E_multiset": E_ms, "R_cyc": Rc, "R_lin_start0": Rl, "W_start0": W0, "L_cyc": Lc, "L_lin_start0": Ll, "edges_total": sum(edges), "rotations_with_merge": sum(edges), "linear_read_is_cyclic_at_p": (Rl == Rc)}) if E != E_ms: f1_bad.append(p) for k in ROT_SAMPLE(D): # F2/F3 over a pinned rotation sample Rk, Lk, ak, bk = runs_linear_rot(f, k) Wk = 1 if edges[k] else 0 if Rk != Rc + Wk: f2_bad.append((p, k)) if Lc != (max(Lk, ak + bk) if Wk else Lk): f3_bad.append((p, k)) if Rl != Rc: movers.append(p) rev = word[::-1] rev_bad = [p for p in plist if sum(adm(rev, p)) != sum(adm(word, p))] return {"tile": name, "P": P, "D": D, "primes_tested": len(plist), "rows": rows, "F1_multiset_equals_direct_bad": f1_bad, "F2_defect_identity_bad": f2_bad[:5], "F3_max_run_identity_bad": f3_bad[:5], "F4_reversal_changes_E_at": rev_bad, "rotation_sample_size": len(ROT_SAMPLE(D)), "primes_where_linear_read_differs_from_cyclic": movers, "primes_where_linear_read_understates_L": [r["p"] for r in rows if r["L_lin_start0"] < r["L_cyc"]], "ok": not (f1_bad or f2_bad or f3_bad or rev_bad)} def main(): plist = [p for p in primes_upto(1009) if p >= 5] t13 = run_tile("T13", (3, 5, 7, 11, 13), plist) t17 = run_tile("T17", (3, 5, 7, 11, 13, 17), [p for p in plist if p <= 263]) out = { "job": 1647, "question": "Is a retained (multiset / rotation-invariant) census enough to fix the kill-graph" " run spectrum, or is there a one-run defect that only the PINNED word decides?", "statistic": "W_x(p,k) = wrap-merge indicator (the single cyclic edge the linear read starting at k" " cuts): the cut SPLITS the one cyclic run through it, so R_lin(k) = R_cyc + W_x(p,k) and" " L_lin(k) < L_cyc exactly when the split run is the largest. E_x(p) = #edges is the" " multiset-determined part.", "preregistered_falsifier": ["F1 E(multiset) == E(direct) at every tested (tile,p)", "F2 R_lin(k) == R_cyc + W(k) for every rotation k, every p", "F3 L_cyc == max(L_lin(k), a_k+b_k) exactly when W(k)=1", "F4 reversal (matched control) leaves E fixed at every p"], "T13": t13, "T17": t17, "all_falsifier_checks_pass": bool(t13["ok"] and t17["ok"]), "not_claimed": ("nothing about the maximum level L at T23+ (that is #1634's word census); the" " support law is used, not reproved; no novelty or twin-prime claim; T19+ tiles" " not built here"), } print(json.dumps(out, indent=1, sort_keys=True)) if __name__ == "__main__": main()