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. BinCounter turns such an
index into a fixed-width binary counter; this module identifies that counter
with the coin string SubsetNP names, and relates counting coin strings to
counting their indices.
Main definitions #
Complexity.coinEquiv— coin strings and their indices are in bijection
Main results #
Complexity.toList_coinOfIndex— the counter is the coin stringSubsetNPnamesComplexity.binValLE_toList— the value of a coin string is its indexComplexity.card_filter_coinIndex— counting coin strings is counting indices
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
theorem
Complexity.card_filter_coinIndex
(T : ℕ)
(Q : ℕ → Prop)
[DecidablePred Q]
:
{ρ : Fin T → Bool | Q (PCPVerifier.coinIndex ρ)}.card = (Finset.filter Q (Finset.range (2 ^ T))).card
Counting coin strings is counting indices.