Documentation

Complexitylib.Classes.PH

The polynomial hierarchy #

This file defines the polynomial hierarchy via certificate quantifiers, following the quantified-formula definition (Arora–Barak Definition 5.4, stated over the library's pair codec): polyExistsLang p L holds of x when some witness w of length at most p.eval |x| puts the encoded pair pair x w in L, and polyForallLang p L requires this of every such witness. Lifting these to class operators gives the levels SigmaP 0 = P, SigmaP (n + 1) = polyExistsClass (PiP n), PiP n = complClass (SigmaP n), and their union PH.

The level inclusions SigmaP n ⊆ SigmaP (n + 1) and PiP n ⊆ PiP (n + 1) need one computational fact: decoding the first component of a canonical pair is polynomial-time computable (pairFst_mem_FP, from Complexitylib.Classes.P.Pairing), so every result in this file is unconditional.

Main definitions #

Main results #

TODO #

Witness quantifiers on languages #

The language of inputs x admitting a witness w of length at most p.eval |x| such that the encoded pair pair x w lies in L.

Equations
Instances For

    The language of inputs x such that every witness w of length at most p.eval |x| puts the encoded pair pair x w in L.

    Equations
    Instances For
      @[simp]

      Membership in polyExistsLang unfolds to a bounded existential.

      @[simp]

      Membership in polyForallLang unfolds to a bounded universal.

      Complementing a bounded existential yields a bounded universal over the complement: some-witness failure is all-witness exclusion.

      Complementing a bounded universal yields a bounded existential over the complement.

      Quantifier operators on classes #

      The class of languages expressible as a polynomially-bounded existential over some language of C.

      Equations
      Instances For

        The class of languages expressible as a polynomially-bounded universal over some language of C.

        Equations
        Instances For

          polyExistsClass is monotone in the base class.

          polyForallClass is monotone in the base class.

          Class-level quantifier duality: the complement class of a bounded existential class is the bounded universal class over the complement class.

          Class-level quantifier duality: the complement class of a bounded universal class is the bounded existential class over the complement class.

          Base inclusions #

          Every language of P is a bounded existential over P: take the zero witness bound, so the only witness is [], and decide pair x [] by decoding the first component and running the original decider.

          Every language of P is a bounded universal over P: with the zero witness bound the only witness is [], decided as in P_subset_polyExistsClass_P.

          The hierarchy #

          The Σ levels of the polynomial hierarchy: SigmaP 0 = P and SigmaP (n + 1) is a bounded existential over the complement class of SigmaP n (that is, over PiP n).

          Equations
          Instances For

            The Π levels of the polynomial hierarchy: PiP n is the complement class of SigmaP n.

            Equations
            Instances For

              The polynomial hierarchy: the union of all Σ levels.

              Equations
              Instances For
                @[simp]

                The zeroth Σ level is P.

                @[simp]

                The complement class of a Σ level is the corresponding Π level.

                @[simp]

                The complement class of a Π level is the corresponding Σ level.

                @[simp]

                The zeroth Π level is P, since P is closed under complement.

                Recursion law for Σ levels: SigmaP (n + 1) is a bounded existential over PiP n.

                Recursion law for Π levels: PiP (n + 1) is a bounded universal over SigmaP n.

                The first Σ level is the bounded existential closure of P — the certificate form of NP.

                The first Π level is the bounded universal closure of P — the certificate form of coNP.

                Level inclusions #

                Each Σ level is contained in the next.

                theorem Complexity.PiP_subset_PiP_succ (n : ) :
                PiP nPiP (n + 1)

                Each Π level is contained in the next.

                PH #

                theorem Complexity.mem_PH_iff {L : Language} :
                L PH ∃ (n : ), L SigmaP n

                Membership in PH is membership in some Σ level.

                Every Σ level is contained in the hierarchy.

                P is contained in the polynomial hierarchy.