Generator matrices and parity-check matrices #
The rows of a matrix generate a linear code, while the same matrix checks the Euclidean dual of that code. This identifies the kernel presentation by a parity-check matrix with the orthogonal complement of its row space and makes conversion between generator and parity-check matrices literal: no transpose or choice of coordinates is needed.
For every finite-length code, a basis of its Euclidean dual therefore gives a full-row-rank parity-check matrix. The number of its rows is the codimension of the original code.
The conventions follow Huffman and Pless, Fundamentals of Error-Correcting Codes, Sections 1.2--1.4.
Main results #
Matrix.checkedBy_eq_euclideanDual_generatedByidentifies a matrix kernel with the orthogonal complement of its row space.LinearCode.isGeneratorMatrix_iff_isParityCheckMatrix_euclideanDualconverts generator matrices into parity-check matrices for the dual code.LinearCode.isParityCheckMatrix_of_basis_euclideanDual: a basis of the dual code gives a parity-check matrix, andLinearCode.exists_isParityCheckMatrixuses it to construct one with linearly independent rows.Matrix.generatedBy_isSelfOrthogonal_iff_mul_transpose_eq_zero: the code generated by the rows ofGis self-orthogonal exactly whenG * Gᵀ = 0;Matrix.generatedBy_isSelfDual_of_mul_transpose_eq_zero_and_card_leadds a dimension hypothesis to conclude that the generated code is self-dual.
The code generated by a matrix is self-orthogonal exactly when the rows of the matrix are
pairwise orthogonal, i.e. when G * Gᵀ = 0.
A matrix whose rows are pairwise orthogonal and which has half the ambient dimension as many independent rows generates a self-dual code.
A matrix generates C exactly when it checks the Euclidean dual of C.
A matrix checks C exactly when it generates the Euclidean dual of C.
The matrix whose rows are the vectors of a basis of the Euclidean dual of C is a
parity-check matrix for C.
Every finite-length linear code has a parity-check matrix whose rows form a basis of the Euclidean dual. Its row type has cardinality equal to the codimension of the code.