Documentation

Complexity.Foundations.Data.BitString.Uhlig

Uhlig's recovery code #

Uhlig's two-copy construction stores bits x 0, …, x (M - 1) as the M + 1 adjacent sums x 0, x 0 ^^ x 1, …, x (M - 2) ^^ x (M - 1), x (M - 1). Sums of code positions are taken in the Boolean ring, where addition is exclusive or. Each bit is the sum of an initial segment of the code and also the sum of the complementary final segment. For two requests a and b, the smaller request uses the initial segment ending at its index and the larger request uses the final segment after its index. These recovery sets are disjoint even when a = b, so every code position serves at most one request.

The code is stated for sequences indexed by ℕ; only the value at M must vanish.

Main definitions #

Main results #

References #

Uhlig's code of a bit sequence: position 0 holds x 0 and position j + 1 holds x j ^^ x (j + 1).

Instances For
    theorem Cslib.BitString.Uhlig.sum_range_code (x : ℕ → Bool) (a : ℕ) :
    ∑ j ∈ Finset.range (a + 1), code x j = x a

    The code positions up to a sum to x a.

    theorem Cslib.BitString.Uhlig.sum_Ico_code {x : ℕ → Bool} {M a : ℕ} (hx : x M = false) (ha : a ≤ M) :
    ∑ j ∈ Finset.Ico (a + 1) (M + 1), code x j = x a

    If x M vanishes, the code positions after a, up to M, also sum to x a.

    With requests a and b, the first request uses position j when the requests are in order and j ≤ a, or out of order and a < j.

    Instances For

      With requests a and b, the second request uses position j when the requests are in order and b < j, or out of order and j ≤ b.

      Instances For

        No code position serves both requests, including when a = b.

        theorem Cslib.BitString.Uhlig.sum_first_code {x : ℕ → Bool} {M a : ℕ} (hx : x M = false) (ha : a < M) (b : ℕ) :
        ∑ j ∈ Finset.range (M + 1), (first a b j && code x j) = x a

        The first request recovers x a from its positions. The other index is arbitrary.

        theorem Cslib.BitString.Uhlig.sum_second_code {x : ℕ → Bool} {M b : ℕ} (hx : x M = false) (hb : b < M) (a : ℕ) :
        ∑ j ∈ Finset.range (M + 1), (second a b j && code x j) = x b

        The second request recovers x b from its positions. The other index is arbitrary.

        theorem Cslib.BitString.Uhlig.sum_first_code_route {Z : Type u_1} {h : Z → ℕ → Bool} {M a : ℕ} (hM : ∀ (z : Z), h z M = false) (ha : a < M) (b : ℕ) (z z' : Z) :
        ∑ j ∈ Finset.range (M + 1), (first a b j && code (h (if first a b j = true then z else z')) j) = h z a

        Route the first input z to the first request's positions and z' to all others. Then the first request recovers its bit of z.

        theorem Cslib.BitString.Uhlig.sum_second_code_route {Z : Type u_1} {h : Z → ℕ → Bool} {M b : ℕ} (hM : ∀ (z : Z), h z M = false) (hb : b < M) (a : ℕ) (z z' : Z) :
        ∑ j ∈ Finset.range (M + 1), (second a b j && code (h (if first a b j = true then z else z')) j) = h z' b

        With the same routing, the second request recovers its bit of z'.