Documentation

CslibFrontier.Computability.Complexity.Classes.PH.Reduction

Reduction and bounded-quantifier closure of the polynomial hierarchy #

Each level Σₖ and Πₖ of the polynomial hierarchy, and PH itself, is closed downward under polynomial-time many-one reductions (Cslib.Complexity.PolyTimeReducible.mem_SigmaP, Cslib.Complexity.PolyTimeReducible.mem_PiP, Cslib.Complexity.PolyTimeReducible.mem_PH). A reduction f maps an instance a to f a, whose encoded length is bounded by a polynomial q in |enc a|; the pull-back verifier quantifies over certificate blocks for length q |enc a| and cuts each block to the length expected for |encB (f a)| (Cslib.Complexity.truncateBlocks).

Combining reduction closure with Cslib.Complexity.mem_SigmaP_of_exists closes Σₖ (k ≥ 1) under existential quantification over words of any unary polynomial-time length N a (Cslib.Complexity.mem_SigmaP_of_exists_length), and by quantifier duality closes Πₖ (k ≥ 1) under universal quantification (Cslib.Complexity.mem_PiP_of_forall_length).

Main results #

References #

theorem Cslib.Complexity.PolyTimeReducible.mem_SigmaP {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {k : ℕ} {A : Set α} {B : Set β} (h : PolyTimeReducible enc encB A B) (hB : B ∈ SigmaP k encB) :
A ∈ SigmaP k enc

Σₖ is closed under polynomial-time reductions. The verifier for A quantifies over certificate blocks of length p (q |enc a|), for a polynomial upper bound q on |encB (f a)|, and cuts each block to p |encB (f a)| before running the verifier of B.

theorem Cslib.Complexity.PolyTimeReducible.mem_PiP {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {k : ℕ} {A : Set α} {B : Set β} (h : PolyTimeReducible enc encB A B) (hB : B ∈ PiP k encB) :
A ∈ PiP k enc

Πₖ is closed under polynomial-time reductions, by quantifier duality.

theorem Cslib.Complexity.PolyTimeReducible.mem_PH {α β : Type} {enc : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeReducible enc encB A B) (hB : B ∈ PH encB) :
A ∈ PH enc

PH is closed under polynomial-time reductions.

Σₖ is closed under existential quantification of computed unary polynomial-time length, for k ≥ 1. Cutting certificates to N y.1 reduces to a fixed polynomial block length, where Cslib.Complexity.mem_SigmaP_of_exists merges the quantifier with the first block of B.

theorem Cslib.Complexity.mem_PiP_of_forall_length {α : Type} {enc : α ↪ List Bool} {k : ℕ} (hk : 1 ≤ k) {N : α → ℕ} (hN : Turing.MultiTapeTM.ComputableInPolyTime N enc Turing.MultiTapeTM.encUnary) {C : Set (α × List Bool)} (hC : C ∈ PiP k (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits)) :
{a : α | ∀ (w : List Bool), w.length = N a → (a, w) ∈ C} ∈ PiP k enc

Πₖ is closed under universal quantification of computed unary polynomial-time length, for k ≥ 1, by quantifier duality from Cslib.Complexity.mem_SigmaP_of_exists_length.

Σₖ on pairs is closed under existentially extending the word, for k ≥ 1: if C is in Σₖ, so is the set of (a, s) with some u of computed length N (a, s) and (a, s ++ u) ∈ C.

Πₖ on pairs is closed under universally extending the word, for k ≥ 1: if C is in Πₖ, so is the set of (a, s) with (a, s ++ u) ∈ C for every u of computed length N (a, s).

Hardness and completeness for Σₖ, Πₖ and PH #

@[reducible, inline]
abbrev Cslib.Complexity.SigmaPHard {β : Type u_1} (k : ℕ) (encB : β ↪ List Bool) (B : Set β) :

Every problem in Σₖ, with any encoding of its instances, reduces to B in polynomial time.

@[reducible, inline]
abbrev Cslib.Complexity.SigmaPComplete {β : Type} (k : ℕ) (encB : β ↪ List Bool) (B : Set β) :

B is in Σₖ and every problem in Σₖ reduces to it in polynomial time.

@[reducible, inline]
abbrev Cslib.Complexity.PiPHard {β : Type u_1} (k : ℕ) (encB : β ↪ List Bool) (B : Set β) :

Every problem in Πₖ, with any encoding of its instances, reduces to B in polynomial time.

@[reducible, inline]
abbrev Cslib.Complexity.PiPComplete {β : Type} (k : ℕ) (encB : β ↪ List Bool) (B : Set β) :

B is in Πₖ and every problem in Πₖ reduces to it in polynomial time.

@[reducible, inline]
abbrev Cslib.Complexity.PHHard {β : Type u_1} (encB : β ↪ List Bool) (B : Set β) :

Every problem in PH, with any encoding of its instances, reduces to B in polynomial time Arora and Barak, Claim 5.7.

@[reducible, inline]
abbrev Cslib.Complexity.PHComplete {β : Type} (encB : β ↪ List Bool) (B : Set β) :

B is in PH and every problem in PH reduces to it in polynomial time Arora and Barak, Claim 5.7.

theorem Cslib.Complexity.phComplete_iff {β : Type} {encB : β ↪ List Bool} {B : Set β} :
PHComplete encB B ↔ B ∈ PH encB ∧ ∀ {α : Type} (enc : α ↪ List Bool), ∀ A ∈ PH enc, PolyTimeReducible enc encB A B
theorem Cslib.Complexity.SigmaPComplete.compl {β : Type} {encB : β ↪ List Bool} {B : Set β} {k : ℕ} (h : SigmaPComplete k encB B) :

The complement of a Σₖ-complete problem is Πₖ-complete.

theorem Cslib.Complexity.PiPComplete.compl {β : Type} {encB : β ↪ List Bool} {B : Set β} {k : ℕ} (h : PiPComplete k encB B) :

The complement of a Πₖ-complete problem is Σₖ-complete.

@[simp]
theorem Cslib.Complexity.sigmaPHard_one_iff {β : Type u_1} {encB : β ↪ List Bool} {B : Set β} :
SigmaPHard 1 encB B ↔ NPHard encB B

Σ₁-hardness coincides with NP-hardness.

@[simp]
theorem Cslib.Complexity.sigmaPComplete_one_iff {β : Type} {encB : β ↪ List Bool} {B : Set β} :
SigmaPComplete 1 encB B ↔ NPComplete encB B

Σ₁-completeness coincides with NP-completeness.

@[simp]
theorem Cslib.Complexity.piPHard_one_iff {β : Type u_1} {encB : β ↪ List Bool} {B : Set β} :
PiPHard 1 encB B ↔ coNPHard encB B

Π₁-hardness coincides with coNP-hardness.

@[simp]
theorem Cslib.Complexity.piPComplete_one_iff {β : Type} {encB : β ↪ List Bool} {B : Set β} :
PiPComplete 1 encB B ↔ coNPComplete encB B

Π₁-completeness coincides with coNP-completeness.