For a linear code , its dual code is
The standard bilinear form is nondegenerate. The map obtained by restricting the dot-product functional to is surjective: extend a functional from a basis of to a basis of , then use the nondegenerate dot product to represent it. Its kernel is . The rank-nullity theorem therefore gives
The first proposed description of the dual code is false without self-orthogonality. At length three take . It has the specified dimension, but
whereas contains and , neither of which is in . The natural corrected statement is the odd-length binary self-orthogonal dual extension: if also , every word of has even Hamming weight, the all-ones word lies in but not in , and dimensions then give .
For a binary self-dual code, for every . In , this equals , so every codeword has even Hamming weight. Thus for all , giving . The dimension identity yields , so is even. Alternatively and itself gives evenness. Hence the second assertion is true.
For every , use
This linear code has dimension , and . Therefore ; both have dimension , so equality holds. This constructs a binary self-dual code at every even length. Conversely the dimension identity already proves every self-dual length- linear code has dimension .
For a nonbinary example, over take . Its generator has self-product in , so . Both are one-dimensional, proving