Dual code (source code)

= Dual code
{title2=$C^\perp$}
{wiki}

For a <linear code> $C\subseteq\mathbb F_q^n$, the <dual code> is the <orthogonal complement>
$$
C^\perp=\{v\in\mathbb F_q^n:\textstyle\sum_{i=1}^{n}v_i c_i=0\text{ for every }c\in C\}
$$
under the standard bilinear <bilinear form>. If $C$ has <dimension> $k$, the <dual code> has <dimension> $n-k$ and $(C^\perp)^\perp=C$, because this <bilinear form> is nondegenerate.

The independent rows of a <parity-check matrix> for $C$ form a <basis> of $C^\perp$, so that <matrix> is a <generator matrix> for the <dual code>. If a check <matrix> has redundant rows, its rows still span the <dual code> but are not themselves a <basis>. For example, the <dual code> of the length-$n$ binary <even-weight binary code> is the <repetition code> spanned by the all-one word.