Documentation

CslibFrontier.Computability.Complexity.Classes.DP

The difference class DP #

DP is the class of intersections of an NP language and a coNP language, equivalently differences of two NP languages Papadimitriou. The definition takes intersections of languages; it does not require a language to belong to both NP and coNP. Completeness uses polynomial-time many-one reductions and arbitrary injective instance encodings.

The complement class coDP consists of unions of an NP and a coNP language; its union and reduction closure are immediate duals of the DP results.

Main definitions #

Main results #

References #

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

The class of languages expressible as the intersection of an NP and a coNP language Papadimitriou.

@[reducible, inline]
abbrev Cslib.Complexity.DPHard {α : Type} (enc : α ↪ List Bool) (A : Set α) :

Every DP language, over any injective binary encoding, reduces to this language.

@[reducible, inline]
abbrev Cslib.Complexity.DPComplete {α : Type} (enc : α ↪ List Bool) (A : Set α) :

DP membership and hardness under polynomial-time many-one reductions.

theorem Cslib.Complexity.polyTimeHard_DP_iff {α : Type} {enc : α ↪ List Bool} {A : Set α} :
PolyTimeHard (@DP) enc A ↔ DPHard enc A

Hardness for the class DP is DPHard.

theorem Cslib.Complexity.polyTimeComplete_DP_iff {α : Type} {enc : α ↪ List Bool} {A : Set α} :

Completeness for the class DP is DPComplete.

theorem Cslib.Complexity.mem_DP_iff_diff {α : Type} {enc : α ↪ List Bool} {A : Set α} :
A ∈ DP enc ↔ ∃ B ∈ NP enc, ∃ C ∈ NP enc, A = B \ C

DP is exactly the differences of two NP languages.

theorem Cslib.Complexity.inter_mem_DP {α : Type} {enc : α ↪ List Bool} {A B : Set α} (hA : A ∈ DP enc) (hB : B ∈ DP enc) :
A ∩ B ∈ DP enc

DP is closed under intersection.

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

DP is closed under polynomial-time reductions.

theorem Cslib.Complexity.NPComplete.dpComplete_prod {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (hA : NPComplete encA A) (hB : coNPComplete encB B) :

An NP-complete problem paired with a coNP-complete problem is DP-complete. The two reductions are computed independently and their outputs are paired.

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

The complement of the difference class DP.

theorem Cslib.Complexity.mem_coDP {α : Type} {enc : α ↪ List Bool} {A : Set α} :
A ∈ coDP enc ↔ Aᶜ ∈ DP enc
theorem Cslib.Complexity.compl_mem_coDP_iff {α : Type} {enc : α ↪ List Bool} {A : Set α} :
Aᶜ ∈ coDP enc ↔ A ∈ DP enc
theorem Cslib.Complexity.mem_coDP_iff_union {α : Type} {enc : α ↪ List Bool} {A : Set α} :
A ∈ coDP enc ↔ ∃ B ∈ NP enc, ∃ C ∈ coNP enc, A = B ∪ C

coDP consists of unions of an NP language and a coNP language.

theorem Cslib.Complexity.union_mem_coDP {α : Type} {enc : α ↪ List Bool} {A B : Set α} (hA : A ∈ coDP enc) (hB : B ∈ coDP enc) :
A ∪ B ∈ coDP enc

Union closure is dual to intersection closure of DP.

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

Polynomial-time reductions preserve coDP.