Documentation

Complexitylib.Classes.PCP.Internal.CoinEnum

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 #

theorem Complexity.zeroBlockFn_mem_FP {a : List BoolList Bool} (ha : a FP) :
(fun (z : List Bool) => List.replicate (a z).length false) FP

A block of zeros as wide as a computed string.

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
    theorem Complexity.coinStr_eq {t c : } (h : c < 2 ^ t) :
    theorem Complexity.coinStr_mem_FP {t c : List Bool} (ht : (fun (z : List Bool) => List.replicate (t z) true) FP) (hc : (fun (z : List Bool) => List.replicate (c z) true) FP) :
    (fun (z : List Bool) => coinStr (t z) (c z)) FP

    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.

    noncomputable def Complexity.coinEquiv (T : ) :
    Fin (2 ^ T) (Fin TBool)

    Coin strings and their indices are in bijection.

    Equations
    Instances For

      Counting coin strings is counting indices.