\section{Linear Codes}

\begin{definition}[Linear Code]
	An $(n,k)$ \textit{linear code} of a finite field $\F$ is a $k$-dimensional subspace $V$ of the vector space
	\[ \F^n = \underbrace{\F \oplus \F \oplus \dots \oplus \F}_\text{$n$ copies} \]
	over $\F$. The members of $V$ are called the \textit{code words}. When $\F$ is $\Z_2$, the code is called \textit{binary}.
\end{definition}

\begin{definition}[Hamming Distance, Hamming Weight]
	The \textit{Hamming distance} between two vectors in $\F^n$ is the number of components in which they differ. The \textit{Hamming weight} of a vector is the number of nonzero components of the vector. The \textit{Hamming weight} of a linear code is the minimum weight of any nonzero vector in the code.
\end{definition}

\begin{theorem}[Properties of Hamming Distance and Hamming Weight]
	For any vectors $u$, $v$ and $w$, $d(u,v) \leq d(u,w) + d(w,v)$ and $d(u,v) = \text{wt}(u-v)$.
\end{theorem}

\begin{theorem}[Correcting Capability of a Linear Code]
	If the Hamming weight of a linear code is at least $2t + 1$, then the code can correct any $t$ or fewer errors. Alternatively, the same code can detect any $2t$ or fewer errors.
\end{theorem}
