Documentation

CslibFrontier.Computability.Complexity.Classes.SharpP.Space

Exact counting in polynomial space #

Enumerate certificates with a fixed-width binary counter and keep the number accepted in a binary accumulator. The exponentially many iterations reuse their workspace: a certificate of length m needs m cells and its acceptance count has at most m + 1 bits. This is the usual polynomial-space simulation of counting [AB09]. The interactive-proof simulation counts its accepting coins with the same counter (Cslib.Complexity.Interaction.countAccepts).

Main definitions #

Main results #

References #

One round of the streaming count of the certificates that V accepts: test the current certificate, add the verdict to the accumulator and advance the binary counter.

Instances For
    def Cslib.Complexity.streamAcceptCount {α : Type} (V : α × List Bool → Bool) (a : α) (t : ℕ) :

    The number of certificates of length t that V accepts together with a, counted by running acceptCountStep over all 2 ^ t values of a t-bit binary counter. It equals acceptCount V a t (streamAcceptCount_eq_acceptCount) and needs only the counter and the accumulator as workspace.

    Instances For

      The streaming count of accepted certificates is acceptCount.

      Count the accepted certificates of a polynomial-time unary length in polynomial space. The result uses binary natural-number output, including when the certificate length is zero.

      Every #P function is computable in polynomial space when its output is written in binary.

      Every GapP function is computable in polynomial space with binary sign-magnitude output.