Linear code

Let ${\mathcal C}$ be a code over the field $F$. We say that ${\mathcal C}$ is linear if for any two $x, y \in {\mathcal C}$ and any element $\alpha \in F$ we have \begin{align} x - \alpha y \in {\mathcal C}. \label{equ:linearity} \end{align} Picking $x=y$ and $\alpha=1$ shows that the all-zero word must be a codeword. Picking $x$ to be the all-zero codeword and $\alpha$ arbitrary, shows that if $y \in {\mathcal C}$ then so is any multiple.

If $F=F_2$, i.e., if the code is binary then the condition \eqref{equ:linearity} simplifies to \begin{align*} x+y \in {\mathcal C}. \end{align*} In words, a binary code is linear if the sum of any two codewords is again a codeword.