Basics of Coding Theory #
We define a general code C
to be a subset of n → R
for some finite index set n
and some
target type R
.
We can then specialize this notion to various settings. For [CommSemiring R]
, we define a linear
code to be a linear subspace of n → R
. We also define the notion of generator matrix and
(parity) check matrix.
Main Definitions #
codeDist C
: The Hamming distance of a codeC
, defined as the infimum (inℕ∞
) of the Hamming distances between any two distinct elements ofC
. This is noncomputable.codeDist' C
: A computable version ofcodeDist C
, assumingC
is aFintype
.
We define the block length, rate, and distance of C
. We prove simple properties of linear codes
such as the singleton bound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Hamming distance of a code C
is the minimum Hamming distance between any two distinct
elements of the code.
cd
We formalize this as the infimum sInf
over all d : ℕ
such that there exist u v : n → R
in the
code with u ≠ v
and hammingDist u v ≤ d
. If none exists, then we define the distance to be 0
.
Instances For
Equations
- instEDistForall_arkLib = { edist := fun (u v : n → R) => ↑Δ₀(u, v) }
Equations
- instDistForall_arkLib = { dist := fun (u v : n → R) => ↑Δ₀(u, v) }
Equations
- eCodeDistNew C = C.einfsep
Instances For
Equations
- codeDistNew C = C.infsep
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The distance from a vector u
to a code C
is the minimum Hamming distance between u
and any element of C
.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Computable version of the Hamming distance of a code C
, assuming C
is a Fintype
.
The return type is ℕ∞
since we use Finset.min
.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Computable version of the distance from a vector u
to a code C
, assuming C
is a Fintype
.
Equations
- Δ₀'(u, C) = (Finset.image (fun (v : ↑C) => Δ₀(u, ↑v)) Finset.univ).min
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Define a linear code from its generator matrix
Equations
Instances For
Define a linear code from its (parity) check matrix
Equations
Instances For
The Hamming distance of a linear code can also be defined as the minimum Hamming norm of a non-zero vector in the code
Instances For
A computable version of the Hamming distance of a linear code C
.
Equations
- linearCodeDist' C = (Finset.image (fun (v : ↥C) => ‖↑v‖₀) {v : ↥C | v ≠ 0}).min
Instances For
The interleaving of a linear code C
over index set ι
is the submodule spanned by
ι × n
-matrices whose rows are elements of C
.
Equations
Instances For
Equations
- «term_^⋈_» = Lean.ParserDescr.trailingNode `«term_^⋈_» 20 0 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "^⋈") (Lean.ParserDescr.cat `term 0))
Instances For
Equations
- «term_⋈_» = Lean.ParserDescr.trailingNode `«term_⋈_» 20 0 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "⋈") (Lean.ParserDescr.cat `term 0))
Instances For
Singleton bound for arbitrary codes
Singleton bound for linear codes