Documentation

CslibFrontier.Computability.Complexity.Classes.ParityP

The class parity-P #

⊕P is the parity operator applied to P (Cslib.Complexity.ParityP) Papadimitriou and Zachos, Arora and Barak, Section 17.4: L ∈ ⊕P when, for a polynomial p and a function V : α × List Bool → Bool computable in polynomial time on inputs encPair enc encBits (a, w) = frame (enc a) ++ w, a ∈ L exactly when an odd number of the strings w of length p (enc a).length have V (a, w) = true (Cslib.Complexity.mem_ParityP). Equivalently, L consists of the instances where some function in #P is odd (Cslib.Complexity.mem_ParityP_iff_exists_SharpP).

⊕P is closed under complement (Cslib.Complexity.compl_mem_ParityP): the verifier Cslib.Complexity.succVerifier V accepts the string of falses and the strings true :: w with V (a, w) = true, so it accepts exactly one string more than V, one bit longer (Cslib.Complexity.acceptCount_succVerifier), by counting words by their first bit (Cslib.BitString.card_filter_ofFn_succ).

Main definitions #

Main results #

References #

Counting accepted strings #

The word test accepting one word more than g, one bit longer: the word of falses, and true :: w for every word w accepted by g.

Instances For
    def Cslib.Complexity.succVerifier {α : Type} (V : α × List Bool → Bool) (x : α × List Bool) :

    The verifier accepting one string more than V, one bit longer: the string of falses, and true :: w for every w with V (a, w) = true.

    Instances For
      theorem Cslib.Complexity.acceptCount_succVerifier {α : Type} (V : α × List Bool → Bool) (a : α) (n : ℕ) :
      acceptCount (succVerifier V) a (n + 1) = acceptCount V a n + 1

      One more accepted string: succVerifier V accepts exactly one string of length n + 1 more than V accepts strings of length n.

      theorem Cslib.Complexity.acceptCount_succTest {α : Type} (g : List Bool → Bool) (a : α) (n : ℕ) :
      acceptCount (fun (x : α × List Bool) => succTest g x.2) a (n + 1) = acceptCount (fun (x : α × List Bool) => g x.2) a n + 1

      One more accepted word: succTest g accepts exactly one word of length n + 1 more than g accepts words of length n.

      theorem Cslib.Complexity.odd_acceptCount_succVerifier_iff {α : Type} (V : α × List Bool → Bool) (a : α) (n : ℕ) :

      The parity of one more accepted string is the opposite parity.

      The class #

      def Cslib.Complexity.ParityP {α : Type} (enc : α ↪ List Bool) :
      Set (Set α)

      The class ⊕P: the parity operator applied to P. A problem L is in ⊕P when, for a polynomial p and a polynomial-time V, a ∈ L exactly when an odd number of the strings w of length p (enc a).length have V (a, w) = true (mem_ParityP) Papadimitriou and Zachos, Arora and Barak, Section 17.4.

      Instances For
        theorem Cslib.Complexity.mem_ParityP_iff_exists_SharpP {α : Type} {enc : α ↪ List Bool} {L : Set α} :
        L ∈ ParityP enc ↔ ∃ f ∈ SharpP enc, ∀ (a : α), a ∈ L ↔ Odd (f a)

        ⊕P through #P: a problem is in ⊕P exactly when it is the set of instances where some function in #P is odd.

        theorem Cslib.Complexity.compl_mem_ParityP {α : Type} {enc : α ↪ List Bool} {L : Set α} (hL : L ∈ ParityP enc) :

        ⊕P is closed under complement: succVerifier accepts one more string.

        theorem Cslib.Complexity.P_subset_ParityP {α : Type} {enc : α ↪ List Bool} :
        P enc ⊆ ParityP enc

        P ⊆ ⊕P: a decider accepts the empty string or nothing.