Relative Distances for Codes #
This module contains relative Hamming distance, relative distance-to-code, and the finite-range/computable variants used by the coding-theory development.
Instances For
δᵣ(u,v) denotes the relative Hamming distance between vectors u and v.
Instances For
The relative Hamming distance from a vector to a code, defined as the infimum
of all relative distances from u to codewords in C.
The type is ENNReal (ℝ≥0∞) to correctly handle the case C = ∅.
For case of Nonempty C, we can use relDistFromCode (δᵣ') for smaller value range in
ℚ≥0, which is equal to this definition.
Instances For
δᵣ(u,C) denotes the relative distance from u to C. This is the main standard definition
used in statements. The NNRat version of it is δᵣ'(u, C).
Instances For
This follows proof strategy from exists_closest_codeword_of_Nonempty_Code. However, it's NOT
used to construct pickRelClosestCodeword_of_Nonempty_Code.
Note that this gives the same codeword as pickClosestCodeword_of_Nonempty_Code.
Instances For
Relative distance version of closeToCode_iff_closeToCodeword_of_minDist.
If the distance to a code is at most δ, then there exists a codeword within distance δ.
NOTE: can we make this shorter using relDistFromCode_eq_distFromCode_div?
A word u is close to a code C within an absolute error bound e if and only if
it is close within the equivalent relative error bound e / n.
A word u is relatively close to a code C within an relative error bound δ if and only if
it is relatively close within the equivalent absolute error bound ⌊δ * n⌋.
The equivalence between the two lowerbound of upperBound in Nat and NNReal context.
In which, upperBound is viewed as the size of an agreement set S (e.g. between two words,
or between a word to a code, ...).
Specifically, n - ⌊δ * n⌋ ≤ (upperBound : ℕ) ↔ (1 - δ) * n ≤ (upperBound : ℝ≥0).
This lemma is useful for jumping back-and-forth between absolute distance and relative distance
realms, especially when we work with an agreement set. For example, it can be used after simping
with closeToWord_iff_exists_agreementCols and relCloseToWord_iff_exists_agreementCols.
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.
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.
Instances For
δᵣ C denotes the minimum relative Hamming distance of a code C.
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.
Computable version of the relative Hamming distance from a vector w to a finite
non-empty code C. This one is intended to mimic the definition of distFromCode'.
However, we don't have ENNRat (ℚ≥0∞) (as counterpart of ENat (ℕ∞) in distFromCode')
so we require [Nonempty C].
TODO: define ENNRat (ℚ≥0∞) so we can migrate both relDistFromCode
and relDistFromCode' to ℚ≥0∞
Instances For
δᵣ'(w,C) denotes the relative Hamming distance between a vector w and a code C.
This is a different statement of the generic definition δᵣ(w,C).