Solution (source code)

= Solution

A <linear code> of length $n$ and rank $k$ is a $k$-dimensional <linear subspace> of $\mathbb F_2^n$. The <Hamming weight> of a vector counts its nonzero coordinates. Thus the sum of the coefficients of the <weight enumerator> is the number of codewords:
$$
\boxed{W_C(1,1)=2^k}.
$$
Since the zero vector is the unique word of weight zero, $W_C(0,1)=1$. Symmetry of the enumerator therefore implies $W_C(1,0)=1$. Conversely $W_C(1,0)=1$ means that the all-one vector $\mathbf1$ belongs to $C$. Translation $x\mapsto x+\mathbf1$ is then a bijection of $C$ which replaces weight $j$ by $n-j$, proving the <polynomial> symmetry. For length zero the same conclusion holds with the unique empty vector.

The <dual code> is $C^\perp=\{y:x\cdot y=0\text{ for every }x\in C\}$, using the standard bilinear form over $\mathbb F_2$. If $y\in C^\perp$, each summand of the character sum equals one. Otherwise choose $x_0\in C$ with $x_0\cdot y=1$; replacing $x$ by $x+x_0$ permutes the summands and reverses their sign. The sum equals its own negative and must be zero. Consequently
$$
\boxed{\sum_{x\in C}(-1)^{x\cdot y}=2^k\mathbf1_{\{y\in C^\perp\}}}.
$$
This is <character orthogonality> for the additive <group> of the code.