Documentation

Complexity.Foundations.Data.BitString.CoverCoding

Cover's enumerative coding for weight-bounded Boolean words #

Cover's lexicographic rank (Cslib.BitString.coverRank) and greedy threshold decoder (Cslib.BitString.coverDecode) establish an explicit bijection between words z : Fin q → Bool of Hamming weight at most e and indices below the Hamming-ball size B(q, e) = ∑ j ∈ range (e + 1), q.choose j (Cslib.BitString.ballSize).

Main definitions #

Main results #

References #

def Cslib.BitString.coverRank {q : ℕ} :
ℕ → (Fin q → Bool) → ℕ

Cover's lexicographic rank of a word z : Fin q → Bool among words of weight at most e.

Instances For

    Cover's greedy threshold decoder recovering a word z : Fin q → Bool of weight at most e from its rank t < ballSize q e.

    Instances For
      theorem Cslib.BitString.coverRank_lt_ballSize {q : ℕ} (e : ℕ) (z : Fin q → Bool) (hz : weight z ≤ e) :

      Every word z : Fin q → Bool of weight at most e has coverRank e z < ballSize q e.

      Every decoded word coverDecode q e t has Hamming weight at most e.

      @[simp]
      theorem Cslib.BitString.coverRank_coverDecode {q e t : ℕ} (ht : t < ballSize q e) :
      coverRank e (coverDecode q e t) = t

      Ranking a decoded word coverDecode q e t for t < ballSize q e recovers t.

      @[simp]
      theorem Cslib.BitString.coverDecode_coverRank {q e : ℕ} (z : Fin q → Bool) (hz : weight z ≤ e) :
      coverDecode q e (coverRank e z) = z

      Decoding the rank coverRank e z of a word z : Fin q → Bool with weight z ≤ e recovers z.