Matrix presentations of linear codes #
A matrix presents a linear code in either of two complementary ways. A generator matrix presents
the span of its rows, implemented as the range of Matrix.vecMulLinear; a parity-check matrix
presents the kernel of Matrix.mulVecLin. This file defines both constructions and the predicates
saying that a matrix presents a specified code.
The API identifies membership with coefficient vectors or vanishing syndromes, computes both
dimensions from matrix rank, and characterizes compatibility of a generator and a parity-check
matrix by the matrix equation H * Gᵀ = 0. These facts are the linear-algebra interface used by
systematic presentations, dual codes, and exact verification of named finite codes.
Row indices carry no coordinate meaning: invertible row operations leave both codes unchanged, a
surjective row reindexing leaves the generated code unchanged, and the checked code depends only on
the row space. A coordinate equivalence e : ι' ≃ ι transports both codes along
LinearEquiv.funCongrLeft. The code checked by H is the orthogonal of the code generated by H
for the standard dot product, so a generator matrix of C is a parity-check matrix of the
Euclidean dual of C. A generator matrix with linearly independent rows is the same thing as a
basis of the code, and encoding by it identifies messages with codewords. Dependent rows of a
generator matrix may be deleted, and the systematic matrices [I | A] and [-Aᵀ | I] present the
same code, one by its rows and the other by its syndromes, also after the coordinates are
arranged by an equivalence ι ≃ ρ ⊕ τ singling out the information coordinates ρ.
Main definitions #
Matrix.generatedByis the row code of a matrix.Matrix.checkedByis the code with vanishing syndrome for a matrix.TauCeti.LinearCode.IsGeneratorMatrixandTauCeti.LinearCode.IsParityCheckMatrixrecord that either presentation gives a specified code.TauCeti.LinearCode.IsGeneratorMatrix.basisis the basis of a code formed by the rows of a generator matrix with linearly independent rows.
Main results #
Matrix.finrank_generatedByandMatrix.finrank_checkedBycompute both dimensions from the matrix rank.Matrix.checkedBy_eq_orthogonal_generatedBy: checking byHis orthogonality to the rows ofH.TauCeti.LinearCode.basisEquivFullRankGeneratorMatrix: bases of a code correspond to its generator matrices with linearly independent rows.TauCeti.LinearCode.IsGeneratorMatrix.encodingEquiv: such a generator matrix identifies messages with codewords bya ↦ a ᵥ* G.TauCeti.LinearCode.exists_isGeneratorMatrix: generator presentations with linearly independent rows exist.Matrix.generatedBy_one_fromCols_eq_checkedBy_fromCols_neg_transpose_one:[I | A]generates the code checked by[-Aᵀ | I].Matrix.exists_linearIndependent_generatedBy_submatrix: deleting dependent rows.
References #
- W. C. Huffman and V. Pless, Fundamentals of Error-Correcting Codes, Cambridge University Press, 2003, §§1.2–1.4 (generator and parity-check matrices, systematic form, syndromes).
A matrix is a generator matrix for C when its rows span C.
Instances For
A matrix is a parity-check matrix for C when C is its kernel.
Instances For
G is a generator matrix for C exactly when the code generated by G is C.
H is a parity-check matrix for C exactly when the code checked by H is C.
The row code of G lies in C exactly when every row of G lies in C.
Reindexing the coordinates along e transports the generated code along
LinearEquiv.funCongrLeft.
The code checked by a matrix depends only on its row space.
The systematic generator matrix [I | A] and the systematic parity-check matrix [-Aᵀ | I]
present the same code.
Systematic form relative to an information set: if the coordinates are split as ρ ⊕ τ by
e, with the information coordinates ρ, then [I | A] and [-Aᵀ | I] with columns arranged by
e still present the same code.
Deleting dependent rows: some linearly independent subfamily of the rows of G generates the
same code.
A matrix generates C exactly when every word of C has a coefficient vector and every
represented word belongs to C.
A matrix is a parity-check matrix for C exactly when vanishing of the syndrome
characterizes membership in C.
A generator matrix of C is a parity-check matrix of the Euclidean dual of C.
A full-row-rank generator matrix for C has one row per dimension of C.
Bases and generator matrices with linearly independent rows #
The rows of a generator matrix for C with linearly independent rows form a basis of C.
Instances For
The basis vectors given by a generator matrix are its rows.
Encoding by a generator matrix for C with linearly independent rows: the linear equivalence
between messages and codewords sending a message a to a ᵥ* G.
Instances For
Encoding multiplies the message by the generator matrix.
Decoding a codeword gives the unique message whose encoding is that codeword.
The matrix whose rows are the vectors of a basis of C is a generator matrix for C.
The matrix whose rows are the vectors of a basis has linearly independent rows.
Bases of C indexed by ρ correspond exactly to generator matrices for C with row type ρ
and linearly independent rows: a basis corresponds to the matrix whose rows are its vectors.
Instances For
The generator matrix attached to a basis has the basis vectors as its rows.
The basis attached to a generator matrix with linearly independent rows is formed by its rows.
Every finite-length linear code has a generator matrix with one row per dimension, and those rows are linearly independent.
A full-row-rank parity-check matrix for C has length - dim C rows.
A generator matrix and a parity-check matrix for the same code satisfy H * Gᵀ = 0.