Doubly even code 2026-10-14
A binary linear code is doubly even when the Hamming weight of every codeword is divisible by four.
// Target: algebra.bigb
For a binary linear code , the linear functional records Hamming weight modulo two. Its kernel of a linear map is the even-weight subcode. If vanishes, this is all of ; otherwise rank-nullity theorem gives dimension . This also proves closure under addition without treating ordinary integer weight as a linear function.
The binary linear code known as the Hamming code of length seven is the kernel of a parity-check matrix whose columns are all the nonzero vectors of . Its dimension is four. No one-column or two-column sum vanishes, but some three-column sum does, so its minimum Hamming distance is three. The syndrome of a one-bit error is its column, uniquely identifying the erroneous position.
A linear subspace is self-orthogonal if for every . The standard bilinear form is nondegenerate, whence and . The condition with means every vector has even Hamming weight. Such a binary linear code gives the linear algebra behind the Eventown theorem.
A length-, dimension- binary linear code has full support when no coordinate vanishes on every codeword, equivalently when the union of the supports of a vector of all codewords covers every coordinate. Every coordinate is then a nonzero linear functional on the message vector space . Translation by a vector on which it is one pairs the zero and one fibers, so exactly codewords contribute one in that coordinate. Summing these contributions proves the formula. If there are nonzero columns in a full-rank generator matrix, the same argument gives instead.