Proof of the MacWilliams identity for binary codes
A discrete Fourier transform over the binary n-tuples turns a sum over the code into a sum over its dual; applied to the function that records the weight of a word it gives the identity. The argument is given in full for q = 2.
Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01
AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.
Let C⊆F2n be linear.
Step 1: a sum over C of signs. For u∈F2n,
c∈C∑(−1)u⋅c={∣C∣0u∈C⊥,u∈/C⊥.
If u∈C⊥ every term is 1. Otherwise pick c0∈C with u⋅c0=1;
the substitution c↦c+c0 permutes C and multiplies the sum by −1, so the
sum is zero.
Step 2: transform of the weight function. Fix numbers x,y and let
f(u)=xn−wt(u)ywt(u)=∏i=1nf1(ui)
with f1(0)=x, f1(1)=y. For v∈F2n define
f^(v)=∑u∈F2n(−1)u⋅vf(u). The sum factorises over
coordinates:
f^(v)=i=1∏n(x+(−1)viy)=(x+y)n−wt(v)(x−y)wt(v).
Step 3: combine. Summing f^ over the code and exchanging the order of
summation,
by Step 1. The left side is WC(x+y,x−y) by Step 2 and the right side is
∣C∣WC⊥(x,y). Since this holds for all numbers x,y, it is an
identity of polynomials.
Holds when
Proved here for q=2. The general case replaces the sign (−1)u⋅v by a nontrivial additive character of Fq and is given in Huffman and Pless.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
Steps 1-3 re-derived (character sum over a linear code, coordinate-wise factorisation of the transform of x^(n-wt) y^wt, exchange of summation). Numerical check: |C| W_(C-dual)(x,y) = W_C(x+y, x-y) verified exactly for 50 random binary linear codes (n <= 8) at three integer points each, and the [7,4,3] Hamming / [7,3,4] simplex weight distributions enumerated. Crossref metadata of MacWilliams 1963 (BSTJ 42(1) 79-94) matched. Huffman-Pless (general q) not opened; the proof itself is only claimed for q = 2.
Revision history
2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10
Current revision 0a7e85cd09a088a9. Source file knowledge/records/proof/macwilliams-identity.md in the content repository (readable there once it is public).