This question relates to exercise 10.25 of Nielsen & Chuang's Quantum Computation and Quantum Information.
Let $C$ be a linear code. Show that if $x \in C^\bot$, then $$\sum\limits_{y \in C} (-1)^{x \cdot y} = |C| \quad \text{if } x \in C^\bot$$ otherwise, $$\sum\limits_{y \in C} (-1)^{x \cdot y} = 0 \quad \text{if } x \not\in C^\bot$$
My attempt
The fact that $$\sum\limits_{y \in C} (-1)^{x \cdot y} = |C|$$ when $x \in C^\bot$ is rather very straightforward. $x \cdot y = 0$ by definition. Therefore we are summing $1$, $|C|$ times.
For when $x \not\in C^\bot$, the situation is not trivial at all. We know for some $y \in C$, $y \cdot x = 1$ (we can assume we are working over $GF(2)$). However, there are $y'$s for which $y' \cdot x =0$. Simply take $y'$ to be the zero binary string. It is plausible to think that we can form a partition such that $$C_1 = \{y \in C | x \cdot y =0 \}$$ and $$C_2 = \{y \in C | x \cdot y =1 \}$$ The part that I am struggling to show is that $|C_1| = |C_2|$ (I hope this is true). Can someone let me know how can I show $|C_1| = |C_2|$?
Partition $C$ into pairs of the form $\{z,z+y\}$, where $y$ is that element of $C$ which has $y\cdot x=1$. One of the two elements of each pair is in $C_1$ and the other one is in $C_2$ because $(z+y)\cdot x= z\cdot x + y\cdot x = z \cdot x +1$.