[Math] Prove that a code is linear

coding-theory

Show that the repetition code of order r (i.e. each bit of the original word is sent r times) is a linear code. Determine a generating matrix and a check matrix of this code.

So we have a $(r*k,k)$ linear code. The generating matrix is trivial. For example:

$G_{k=2} = \begin{array}{cccc} 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \end{array}$

But how exactly do I prove that this code is linear? Is it enough to say that there always exists a generating matrix?

Best Answer

It's sufficient to find a generating matrix.

A linear code is usually defined as a subspace of $F^n$ for some field $F$ (since you're talking about bits, you can take $F = \mathbb{F}_2 = \{0,1\}$). The code $C$ generated by a generating matrix $G$ is the span of the rows of $G$. The span of a set of vectors in $F^n$ is a subspace of $F^n$, so $C$ is a linear code.