Coding Theory — Core Definitions #
This file provides the foundational definitions for coding theory over a finite
alphabet α.
Main Definitions #
Codeword n α: a vector of lengthnover alphabetα, i.e.Fin n → α.Code n α: a code of block-lengthnoverα, i.e. aFinset (Codeword n α).Linear_Code C G: predicate asserting thatCis the image of the linear map given by generator matrixG.Linear_Code' C m: existential variant —Cis the image of somen×mgenerator matrix.qaryEntropy q p: the q-ary entropy functionH_q(p).hamming_distance c₁ c₂: Hamming distance between two codewords.distance C d: predicate asserting thatdis the minimum distance of codeC.rate C: the rate of codeC(base-|α|logarithm of|C|over block length).weight c: Hamming weight of a codewordc.hamming_ball l c: the Hamming ball of radiuslcentred atc.
Main Results #
dist_le_length: the minimum distance of a code is at most its block length.
A codeword of block-length n over alphabet α. Concretely, a function Fin n → α.
Equations
- CodingTheory.Codeword n α = (Fin n → α)
Instances For
The all-zeros codeword.
Equations
Instances For
A code of block-length n over α: a finite set of codewords.
Equations
Instances For
A code C is linear with generator matrix G : Fin n × Fin m → α if C is
exactly the image of the linear map G · -.
Equations
- CodingTheory.Codeword.Linear_Code C G = ((∀ (c' : CodingTheory.Codeword m α), G.mulVec c' ∈ C) ∧ ∀ c ∈ C, ∃ (c' : CodingTheory.Codeword m α), c = G.mulVec c')
Instances For
Existential variant of Linear_Code: C is the image of some n×m generator matrix.
Equations
- CodingTheory.Codeword.Linear_Code' C m = ∃ (G : Matrix (Fin n) (Fin m) α), (∀ (c' : CodingTheory.Codeword m α), G.mulVec c' ∈ C) ∧ ∀ c ∈ C, ∃ (c' : CodingTheory.Codeword m α), c = G.mulVec c'
Instances For
The q-ary entropy function H_q(p) = p·log_q(q-1) - p·log_q(p) - (1-p)·log_q(1-p).
Equations
Instances For
The Hamming distance between two codewords.
Equations
- c1.hamming_distance c2 = hammingDist c1 c2
Instances For
distance C d holds when d is the minimum Hamming distance of code C: there exist
two distinct codewords at distance exactly d, and no two distinct codewords are closer.
Equations
- CodingTheory.Codeword.distance C d = ((∃ x ∈ C, ∃ y ∈ C, x ≠ y ∧ x.hamming_distance y = d) ∧ ∀ z ∈ C, ∀ w ∈ C, z ≠ w → z.hamming_distance w ≥ d)
Instances For
The rate of a code: log_{|α|}(|C|) / n.
Equations
- CodingTheory.Codeword.rate C = Real.log ↑(Finset.card C) / (↑n * Real.log ↑(Fintype.card α))
Instances For
The Hamming weight of a codeword: its distance from the all-zeros word.
Equations
Instances For
max_size n d A asserts that A is the maximum size of any code of block-length n and
minimum distance d.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Hamming ball of radius l centred at codeword c: the set of codewords within
Hamming distance l of c.
Equations
- CodingTheory.Codeword.hamming_ball l c = {c' : CodingTheory.Codeword n α | c'.hamming_distance c ≤ l}.toFinset