Documentation

CslibFrontier.Probability.RankDecoder.Native

Native realization of the integer-rank decoder #

The decoder retains its original input, its selected prefix, and a residual rank. Each round queries one left-child mass, appends one bit, and possibly subtracts the mass from the rank. The residual rank never increases. Polynomially many rounds therefore keep polynomial workspace and the oracle's common exponential time factor in the original input.

The resource theorem does not require nonnegative-real probabilities, additivity of masses, or a valid initial rank. Those are separate hypotheses of the distribution theorems in RankDecoder.

Main definitions #

Main results #

@[reducible, inline]

The original input is retained alongside the selected prefix and residual rank.

@[reducible, inline]

The input retained throughout the decoder loop.

@[reducible, inline]

The output prefix selected so far.

@[reducible, inline]

The residual integer rank within the selected subtree.

A framed input, followed by the raw prefix and binary residual rank.

def Cslib.BitString.RankDecoder.step {α : Type} (mass : α → List Bool → ℕ) (depth : α → ℕ) (s : State α) :

One binary split, with an unchanged state once the requested output length is reached.

@[simp]
theorem Cslib.BitString.RankDecoder.step_input {α : Type} (mass : α → List Bool → ℕ) (depth : α → ℕ) (s : State α) :
(step mass depth s).input = s.input
theorem Cslib.BitString.RankDecoder.step_rank_le {α : Type} (mass : α → List Bool → ℕ) (depth : α → ℕ) (s : State α) :
(step mass depth s).rank ≤ s.rank

A residual rank cannot increase, including when the initial rank is invalid.

@[simp]
theorem Cslib.BitString.RankDecoder.iterate_step_input {α : Type} (mass : α → List Bool → ℕ) (depth : α → ℕ) (n : ℕ) (s : State α) :
((step mass depth)^[n] s).input = s.input
theorem Cslib.BitString.RankDecoder.iterate_step_prefix {α : Type} (mass : α → List Bool → ℕ) (depth : α → ℕ) (a : α) (pre : List Bool) (rank n : ℕ) (hn : pre.length + n ≤ depth a) :
((step mass depth)^[n] (a, pre, rank)).prefix = pre ++ decode (mass a) n pre rank

The prefix accumulated by the loop is the recursive decoder's output, appended to the initial prefix. The depth condition guarantees that each requested split is active.

A native realization of the decoder, using one supplied left-child mass computation in each of depth a rounds. The oracle receives the retained input, current prefix and residual rank.

Polynomially many adaptive prefix queries preserve the oracle's exponential time factor in the original input and polynomial workspace. The initial rank may be exponentially large: only its polynomial-time binary production is required. No mass law or rank-validity premise is used.