The polynomial hierarchy, coNP and PH
Lax564036.Hierarchy · concepts/Lax564036/Hierarchy.lean · lax-564036
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The levels of the polynomial hierarchy are defined by logics. Level 0 is polynomial time: is PTIME and is coPTIME. For , is the class of decision problems definable by a second-order sentence with alternating blocks of second-order quantifiers, the first existential, over a first-order kernel, and the class of those definable with the first block universal; these are the levels of the hierarchy by the theorems of Fagin and Stockmeyer. In particular is NP, and coNP is , the problems definable in universal second-order logic. Hardness for each level is the cofinal hardness of the NP core, under relativized ordered first-order reductions.
PH is the union of the levels: a problem is in PH when it is in for some , and PH-hard when it is hard for every level.
Concept map
Lean source view on GitHub
| 1 | import Lax904597.Problems |
| 2 | import Lax904597.SecondOrder |
| 3 | import Lax904597.Classes |
| 4 | import Lax535992.ClassPTIME |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: The polynomial hierarchy, coNP and PH |
| 9 | type: definition |
| 10 | --- |
| 11 | The levels of the polynomial hierarchy are defined by logics. Level 0 is |
| 12 | polynomial time: is PTIME and is coPTIME. For |
| 13 | , is the class of decision problems definable by a |
| 14 | second-order sentence with alternating blocks of second-order |
| 15 | quantifiers, the first existential, over a first-order kernel, and |
| 16 | the class of those definable with the first block universal; |
| 17 | these are the levels of the hierarchy by the theorems of Fagin and |
| 18 | Stockmeyer. In particular is NP, and coNP is , the |
| 19 | problems definable in universal second-order logic. Hardness for each level |
| 20 | is the cofinal hardness of the NP core, under relativized ordered |
| 21 | first-order reductions. |
| 22 | |
| 23 | PH is the union of the levels: a problem is in PH when it is in |
| 24 | for some , and PH-hard when it is hard for every level. |
| 25 | -/ |
| 26 | |
| 27 | namespace Lax564036.Hierarchy |
| 28 | |
| 29 | open Lax904597.Problems Lax904597.SecondOrder Lax904597.Classes Lax535992.ClassPTIME |
| 30 | |
| 31 | /-- The level `Σₖᵖ` of the polynomial hierarchy: polynomial time at level `0`, |
| 32 | and the problems definable with `k` alternating blocks of second-order |
| 33 | quantifiers, existential first, above. -/ |
| 34 | def SigmaP : ℕ → ComplexityClass |
| 35 | | 0 => PTIME |
| 36 | | k + 1 => sigmaLevel k |
| 37 | |
| 38 | /-- The level `Πₖᵖ` of the polynomial hierarchy: the complements of polynomial |
| 39 | time problems at level `0`, and the problems definable with `k` alternating |
| 40 | blocks of second-order quantifiers, universal first, above. -/ |
| 41 | def PiP : ℕ → ComplexityClass |
| 42 | | 0 => coPTIME |
| 43 | | k + 1 => ComplexityClass.ofMem fun P => PiSODefinable (k + 1) P |
| 44 | |
| 45 | /-- **coNP** is `Π₁ᵖ`: the problems definable in universal second-order |
| 46 | logic. -/ |
| 47 | def coNP : ComplexityClass := PiP 1 |
| 48 | |
| 49 | /-- **PH**, the polynomial hierarchy: the union of its levels. A problem is |
| 50 | PH-hard when it is hard for every level. -/ |
| 51 | def PH : ComplexityClass where |
| 52 | Mem P := ∃ k, (SigmaP k).Mem P |
| 53 | Hard P := ∀ k, (SigmaP k).Hard P |
| 54 | |
| 55 | end Lax564036.Hierarchy |
| 56 |
Used by
Lax564036.AlternatingMachineCompleteLax564036.AlternatingMachineInvarianceLax564036.CoNPClosureLax564036.DPClosureLax564036.DPInclusionsLax564036.HierarchyDualityLax564036.HierarchyInclusionsLax564036.PolynomialTimeInHierarchyLax564036.QbfCompleteLax564036.QuantifiedBooleanFormulasInvarianceLax564036.SatUnsatDPCompleteLax564036.SatUnsatInvarianceLax564036.TautCoNPCompleteLax564036.TautologyInvarianceLax564036.ThreeDnfTautCoNPCompleteLax564036.ThreeDnfTautologyInvariance
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments