Coin strings from their index #
A loop over the coin strings of a verifier receives its index in unary, since
that is the form a polynomial-time loop counter takes. This module turns such an
index into the coin string itself: the fixed-width binary counter of
SavitchBits is incremented that many times, starting from all zeros.
Nothing here is arithmetic on the index. bumpBits is the width-preserving
increment already proved polynomial-time for Savitch's theorem, and iterating a
polynomial-time step a polynomial number of times is iterate_mem_FP.
Main results #
Complexity.coinStr— the counter after that many incrementsComplexity.coinStr_mem_FP— in polynomial time, for any indexComplexity.toList_coinOfIndex— it is the coin stringSubsetNPnames
The width-t counter after c increments. Total: past 2 ^ t it wraps,
which never happens where it is used but keeps the function unconditional.
Equations
Instances For
The counter value in polynomial time. With the width and the index both supplied in unary, the counter is polynomial-time computable — with no bound on the index, so that the function is total where a loop guard has not yet been applied.
The counter is the coin string. SubsetNP indexes coin strings by their
little-endian binary value, which is exactly what the counter holds.
The index of the coin string an index names.
The value of a coin string is its index.
Coin strings and their indices are in bijection.
Equations
- Complexity.coinEquiv T = { toFun := Complexity.PCPVerifier.coinOfIndex, invFun := fun (ρ : Fin T → Bool) => ⟨Complexity.PCPVerifier.coinIndex ρ, ⋯⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
Counting coin strings is counting indices.