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 #
dist 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.dist' C
: A computable version ofdist 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.
The Hamming distance of a code C
is the minimum Hamming distance between any two distinct
elements of the code.
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
.
Equations
Instances For
Equations
Equations
Equations
Instances For
Equations
Instances For
The distance from a vector u
to a code C
is the minimum Hamming distance between u
and any element of C
.
Equations
Instances For
Equations
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
The set of possible distances δf
between distinct codewords in a code C
.
- TODO: This allows us to express distance in non-ℝ, which is quite convenient.
Extending to
(E)Dist
forces this intoℝ
; give some thought.
Equations
Instances For
A generalisation of distFromCode
for an arbitrary distance function δf
.
Equations
Instances For
Computable version of the distance from a vector u
to a code C
, assuming C
is a Fintype
.
Equations
Instances For
Equations
Instances For
δᵣ(u,v)
denotes the relative Hamming distance between vectors u
and v
.
Equations
Instances For
The range of the relative Hamming distance is well-defined.
The range of the relative Hamming distance function is finite.
The set of possible distances between distinct codewords in a code.
Equations
Instances For
The set of possible distances between distinct codewords in a code is a subset of the range of the relative Hamming distance function.
The set of possible distances between distinct codewords in a code is a finite set.
The minimum relative Hamming distance of a code.
Equations
Instances For
δᵣ C
denotes the minimum relative Hamming distance of a code C
.
Equations
Instances For
The range set of possible relative Hamming distances from a vector to a code is a subset of the range of the relative Hamming distance function.
The set of possible relative Hamming distances from a vector to a code is a finite set.
Equations
The relative Hamming distance from a vector to a code.
Equations
Instances For
δᵣ(w,C)
denotes the relative Hamming distance between a vector w
and a code C
.
Equations
Instances For
The relative Hamming distances between a vector and a codeword is in the range of the relative Hamming distance function.
Singleton bound for arbitrary codes
Linear code defined by left multiplication by its generator matrix.
Equations
Instances For
Linear code defined by right multiplication by a 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
Equations
Instances For
The dimension of a linear code.
Equations
Instances For
The length of a linear code.
Equations
Instances For
The rate of a linear code.
Equations
Instances For
ρ LC
is the rate of the linear code LC
.
Uses &
to make the notation non-reserved, allowing ρ
to also be used as a variable name.
Equations
Instances For
The minimum taken over the weight of codewords in a linear code.
Equations
Instances For
The min distance of a linear code equals the minimum of the weights of non-zero codewords.
The interleaving of a linear code LC
over index set ι
is the submodule spanned by
ι × n
-matrices whose rows are elements of LC
.
Equations
Instances For
Singleton bound for linear codes
A computable version of the Hamming distance of a linear code LC
.