In computational complexity theory, the polynomial hierarchy (sometimes called the polynomial-time hierarchy) is a hierarchy of complexity classes that generalize the classes NP and co-NP.Arora and Barak, 2009, pp.97 Each class in the hierarchy is contained within PSPACE.
The hierarchy can be defined using oracle machines or alternating Turing machines.
It is a resource-bounded counterpart to the arithmetical hierarchy and analytical hierarchy from mathematical logic.
The union of the classes in the hierarchy is denoted PH.
Classes within the hierarchy have complete problems (with respect to polynomial-time reductions) which ask if quantified Boolean formulae hold, for formulae with restrictions on the quantifier order.
It is known that equality between classes on the same level or consecutive levels in the hierarchy would imply a "collapse" of the hierarchy to that level.
Definitions
There are multiple equivalent definitions of the classes of the polynomial hierarchy.
Oracle definition
For the oracle definition of the polynomial hierarchy, define
\Delta_0^\mathsf{P} := \Sigma_0^\mathsf{P} := \Pi_0^\mathsf{P} := \mathsf{P},
where P is the set of decision problems solvable in polynomial time.
Then for i ≥ 0 define
\Delta_{i+1}^\mathsf{P} := \mathsf{P}^{\Sigma_i^\mathsf{P}}
\Sigma_{i+1}^\mathsf{P} := \mathsf{NP}^{\Sigma_i^\mathsf{P}}
\Pi_{i+1}^\mathsf{P} := \mathsf{coNP}^{\Sigma_i^\mathsf{P}}
where \mathsf{P}^{\rm A} is the set of decision problems solvable in polynomial time by a Turing machine augmented by an oracle for some complete problem in class A; the classes \mathsf{NP}^{\rm A} and \mathsf{coNP}^{\rm A} are defined analogously.
For example,  \Sigma_1^\mathsf{P} = \mathsf{NP}, \Pi_1^\mathsf{P} = \mathsf{coNP} , and  \Delta_2^\mathsf{P} = \mathsf{P^{NP}}  is the class of problems solvable in polynomial time with an oracle for some NP-complete problem.Completeness in the Polynomial-Time Hierarchy A Compendium, M. Schaefer, C. Umans Quantified boolean formulae definition
For the existential/universal definition of the polynomial hierarchy, let  be a language (i.e. a decision problem, a subset of {0,1}*), let  be a polynomial, and define
\exists^p L := \left\{ x \in \{0,1\}^* \ \left| \ \left( \exists w \in \{0,1\}^{\leq p(|x|)} \right) \langle x,w \rangle \in L \right. \right\},
where \langle x,w \rangle \in \{0,1\}^* is some standard encoding of the pair of binary strings x and w as a single binary string.
L represents a set of ordered pairs of strings, where the first string x is a member of \exists^p L, and the second string w is a "short" (|w| \leq p(|x|) ) witness testifying that x is a member of \exists^p L.
In other words, x \in \exists^p L if and only if there exists a short  witness w such that  \langle x,w \rangle \in L .
Similarly, define
\forall^p L := \left\{ x \in \{0,1\}^* \ \left| \ \left( \forall w \in \{0,1\}^{\leq p(|x|)} \right) \langle x,w \rangle \in L \right. \right\}
Note that De Morgan's laws hold:  \left( \exists^p L \right)^{\rm c} = \forall^p L^{\rm c}  and  \left( \forall^p L \right)^{\rm c} = \exists^p L^{\rm c} , where Lc is the complement of L.
Let  be a class of languages.
Extend these operators to work on whole classes of languages by the definition
\exists^\mathsf{P} \mathcal{C} := \left\{\exists^p L \ | \ p \text{ is a polynomial and } L \in \mathcal{C} \right\}
\forall^\mathsf{P} \mathcal{C} := \left\{\forall^p L \ | \ p \text{ is a polynomial and } L \in \mathcal{C} \right\}
Again, De Morgan's laws hold:  \mathsf{co} \exists^\mathsf{P} \mathcal{C} = \forall^\mathsf{P} \mathsf{co} \mathcal{C}  and  \mathsf{co} \forall^\mathsf{P} \mathcal{C} = \exists^\mathsf{P} \mathsf{co} \mathcal{C} , where \mathsf{co}\mathcal{C} = \left\{ L^c | L \in \mathcal{C} \right\}.
The classes NP and co-NP can be defined as  \mathsf{NP} = \exists^\mathsf{P} \mathsf{P} , and  \mathsf{coNP} = \forall^\mathsf{P} \mathsf{P} , where P is the class of all feasibly (polynomial-time) decidable languages.
The polynomial hierarchy can be defined recursively as
\Sigma_0^\mathsf{P} := \Pi_0^\mathsf{P} := \mathsf{P}
\Sigma_{k+1}^\mathsf{P} := \exists^\mathsf{P} \Pi_k^\mathsf{P}
\Pi_{k+1}^\mathsf{P} := \forall^\mathsf{P} \Sigma_k^\mathsf{P}
Note that  \mathsf{NP} = \Sigma_1^\mathsf{P} , and  \mathsf{coNP} = \Pi_1^\mathsf{P} .
This definition reflects the close connection between the polynomial hierarchy and the arithmetical hierarchy, where R and RE play roles analogous to P and NP, respectively.
The analytic hierarchy is also defined in a similar way to give a hierarchy of subsets of the real numbers.
Alternating Turing machines definition
An alternating Turing machine is a non-deterministic Turing machine with non-final states partitioned into existential and universal states.
It is eventually accepting from its current configuration if: it is in an existential state and can transition into some eventually accepting configuration; or, it is in a universal state and every transition is into some eventually accepting configuration; or, it is in an accepting state.Arora and Barak, pp.99–100
We define \Sigma_k^\mathsf{P} to be the class of languages accepted by an alternating Turing machine in polynomial time such that the initial state is an existential state and every path the machine can take swaps at most k – 1 times between existential and universal states.
We define \Pi_k^\mathsf{P} similarly, except that the initial state is a universal state.Arora and Barak, pp.100
If we omit the requirement of at most k – 1 swaps between the existential and universal states, so that we only require that our alternating Turing machine runs in polynomial time, then we have the definition of the class AP, which is equal to PSPACE.Arora and Barak, pp.100 Relations between classes in the polynomial hierarchy
250px|thumb|right|Commutative diagram equivalent to the polynomial time hierarchy.
The arrows denote inclusion.
The union of all classes in the polynomial hierarchy is the complexity class PH.
The definitions imply the relations:
\Sigma_i^\mathsf{P} \subseteq \Delta_{i+1}^\mathsf{P} \subseteq \Sigma_{i+1}^\mathsf{P}
\Pi_i^\mathsf{P} \subseteq \Delta_{i+1}^\mathsf{P} \subseteq \Pi_{i+1}^\mathsf{P}
\Sigma_i^\mathsf{P} = \mathsf{co}\Pi_{i}^\mathsf{P}
Unlike the arithmetic and analytic hierarchies, whose inclusions are known to be proper, it is an open question whether any of these inclusions are proper, though it is widely believed that they all are.
If any \Sigma_k^\mathsf{P} = \Sigma_{k+1}^\mathsf{P}, or if any \Sigma_k^\mathsf{P} = \Pi_{k}^\mathsf{P}, then the hierarchy collapses to level k: for all i > k, \Sigma_i^\mathsf{P} = \Sigma_k^\mathsf{P}.Arora and Barak, 2009, Theorem 5.4 In particular, we have the following implications involving unsolved problems:
P = NP if and only if P = PH.
If NP = co-NP then NP = PH.
(co-NP is \Pi_1^\mathsf{P}.)
The case in which NP = PH is also termed as a collapse of the PH to the second level.
The case P = NP corresponds to a collapse of PH to P.
The question of collapse to the first level is generally thought to be extremely difficult.
Most researchers do not believe in a collapse, even to the second level.
Relationships to other classes
The polynomial hierarchy is an analogue (at much lower complexity) of the exponential hierarchy and arithmetical hierarchy.
It is known that PH is contained within PSPACE, but it is not known whether the two classes are equal.
One useful reformulation of this problem is that PH = PSPACE if and only if second-order logic over finite structures gains no additional power from the addition of a transitive closure operator.
If the polynomial hierarchy has any complete problems, then it has only finitely many distinct levels.
Since there are PSPACE-complete problems, we know that if PSPACE = PH, then the polynomial hierarchy must collapse, since a PSPACE-complete problem would be a \Sigma_{k}^\mathsf{P}-complete problem for some k.Arora and Barak, 2009, Claim 5.5
Each class in the polynomial hierarchy contains \leq_{\rm m}^\mathsf{P}-complete problems (problems complete under polynomial-time many-one reductions).
Furthermore, each class in the polynomial hierarchy is closed under \leq_{\rm m}^\mathsf{P}-reductions: meaning that for a class  in the hierarchy and a language L \in \mathcal{C}, if A \leq_{\rm m}^\mathsf{P} L, then A \in \mathcal{C} as well.
These two facts together imply that if K_i is a complete problem for \Sigma_{i}^\mathsf{P}, then \Sigma_{i+1}^\mathsf{P} = \mathsf{NP}^{K_i}, and \Pi_{i+1}^\mathsf{P} = \mathsf{coNP}^{K_i}.
For instance, \Sigma_{2}^\mathsf{P} = \mathsf{NP}^\mathsf{SAT}.
In other words, if a language is defined based on some oracle in , then we can assume that it is defined based on a complete problem for .
Complete problems therefore act as "representatives" of the class for which they are complete.
The Sipser–Lautemann theorem states that the class BPP is contained in the second level of the polynomial hierarchy.
Kannan's theorem states that for any k, \Sigma_2 is not contained in SIZE(nk).
Toda's theorem states that the polynomial hierarchy is contained in P#P. Problems
See also
EXPTIME
Exponential hierarchy
Arithmetic hierarchy
References
General references
A. R. Meyer and L. J. Stockmeyer.
The Equivalence Problem for Regular Expressions with Squaring Requires Exponential Space.
In Proceedings of the 13th IEEE Symposium on Switching and Automata Theory, pp.
125–129, 1972.
The paper that introduced the polynomial hierarchy.
L. J. Stockmeyer.
The polynomial-time hierarchy.
Theoretical Computer Science, vol.3, pp.
1–22, 1976.
C. Papadimitriou.
Computational Complexity.
Addison-Wesley, 1994.
Chapter 17.
Polynomial hierarchy, pp.
409–438.
Section 7.2: The Polynomial Hierarchy, pp.
161–167.
Citations
