Documentation

TauCeti.InformationTheory.Coding.GeneratorParityCheck

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 #

@[simp]
theorem Matrix.checkedBy_eq_euclideanDual_generatedBy {F : Type u_1} {ι : Type u_2} {ρ : Type u_3} [Field F] [Fintype ι] [Fintype ρ] (H : Matrix ρ ι F) :

The code checked by a matrix is the Euclidean dual of the code generated by its rows.

theorem Matrix.checkedBy_eq_iff_generatedBy_eq {F : Type u_1} {ι : Type u_2} {ρ : Type u_3} [Field F] [Fintype ι] {σ : Type u_4} [Fintype ρ] [Fintype σ] (H : Matrix ρ ι F) (H' : Matrix σ ι F) :

Two matrices check the same code exactly when their rows span the same code.

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.

theorem Matrix.generatedBy_isSelfDual_of_mul_transpose_eq_zero_and_card_le {F : Type u_1} {ι : Type u_2} {ρ : Type u_3} [Field F] [Fintype ι] [Fintype ρ] (G : Matrix ρ ι F) (hgram : G * G.transpose = 0) (hdim : Fintype.card ι ≤ 2 * G.rank) :

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.

theorem TauCeti.LinearCode.isParityCheckMatrix_of_basis_euclideanDual {F : Type u_1} {ι : Type u_2} {ρ : Type u_3} [Field F] [Fintype ι] {C : LinearCode F ι} (b : Module.Basis ρ F ↥(Submodule.euclideanDual C)) :
C.IsParityCheckMatrix (Matrix.of fun (r : ρ) => ↑(b r))

The matrix whose rows are the vectors of a basis of the Euclidean dual of C is a parity-check matrix for C.

theorem TauCeti.LinearCode.exists_isParityCheckMatrix {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] (C : LinearCode F ι) :

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.