Nearest-codeword decoding #
A decoder chooses a message whose encoded word is closest to the received word in Hamming
distance. No injectivity is required; when the encoder is injective this is ordinary decoding
of its image code. nearestMessages keeps all minimizers, including ties.
The decoder predicate, existence theorem and left-inverse theorem were extracted unchanged
from CslibFrontier.Probability.BitString.BinarySymmetricChannel.
Main definitions #
Cslib.BitString.IsNearestDecoder: a deterministic nearest-codeword decoder.Cslib.BitString.nearestMessages: the finite set of minimizing messages.
Main results #
Cslib.BitString.exists_isNearestDecoder: finite nonempty message sets admit a decoder.Cslib.BitString.IsNearestDecoder.leftInverse: injective codewords decode correctly.Cslib.BitString.IsNearestDecoder.mem_nearestMessages: the chosen message is a minimizer.
theorem Cslib.BitString.exists_isNearestDecoder {ι : Type u_1} {M : Type u_2} [Fintype ι] [Finite M] [Nonempty M] (E : M → ι → Bool) :
∃ (D : (ι → Bool) → M), IsNearestDecoder E D
Every code with finitely many messages has a nearest-codeword decoder.
theorem Cslib.BitString.IsNearestDecoder.leftInverse {ι : Type u_1} {M : Type u_2} [Fintype ι] {E : M → ι → Bool} {D : (ι → Bool) → M} (hD : IsNearestDecoder E D) (hE : Function.Injective E) :
A nearest-codeword decoder of an injective code decodes every codeword correctly.
theorem Cslib.BitString.IsNearestDecoder.mem_nearestMessages {ι : Type u_1} {M : Type u_2} [Fintype ι] [Fintype M] {E : M → ι → Bool} {D : (ι → Bool) → M} (hD : IsNearestDecoder E D) (y : ι → Bool) :
D y ∈ nearestMessages E y
The deterministic decoder chooses a member of the complete tie set.
theorem Cslib.BitString.hammingDist_eq_of_mem_nearestMessages {ι : Type u_1} {M : Type u_2} [Fintype ι] [Fintype M] {E : M → ι → Bool} {y : ι → Bool} {m m' : M} (hm : m ∈ nearestMessages E y) (hm' : m' ∈ nearestMessages E y) :
All nearest messages are at the same distance.