# Linear code

A code of fixed length $n$ over a finite field $F$ which forms a subspace of the vector space $F^n$.
A linear code of rank $r$ may be represented by a generator matrix, an $(r \times n)$ matrix whose rows form a set of linearly independent code words. A generator matrix can be put in the form $G = (I_r | G_1)$ by row operations, showing that a linear code is necessarily a systematic code. The components of the code word corresponding to the columns of $G_1$ may be referred to as check digits.
A linear code $C$ has a dual code $C^\perp$ consisting of all vectors in $F^n$ orthogonal to every element of $C$ with respect to the bilinear form $(x,y) = \sum_{i=1}^n x_i y_i$. This is a linear code of rank $(n-r)$, and a basis for $C^\perp$ is a set of parity check vectors: a generator matrix for $C^\perp$ is a parity check matrix.