Documentation

CslibFrontier.Computability.Complexity.Classes.TFNP.CoNP

Total search problems, NP-hardness, and NP = coNP #

A total FNP search problem (Cslib.Complexity.TFNP) is unlikely to be NP-hard, because any polynomial-time reduction from an NP-hard decision problem to a TFNP relation collapses NP to coNP ([MP91]; [Pap07], Section 2.2, p. 32).

This module formalizes this barrier at three levels of generality:

  1. Universal-property reductions ([Pap07], Section 2.2, p. 32): if R ∈ FNP encB (in particular R ∈ TFNP encB) and polynomial-time maps f : α → β and P : α × List Bool → Bool satisfy ∀ a, a ∈ A ↔ ∀ w, R (f a) w → P (a, w) = true, then A ∈ coNP encA (mem_coNP_of_forall_rel_iff), because an existential witness w with R (f a) w ∧ P (a, w) = false certifies a ∉ A. Totality of R is not needed here because the biconditional itself guarantees a counterexample w whenever a ∉ A. Hence if A is NP-hard, then NP = coNP for every encoding (NP_eq_coNP_of_NPHard_forall_rel_iff).
  2. Single-query total search reductions: if R ∈ TFNP encB and polynomial-time maps f and P satisfy ∀ a w, R (f a) w → (P (a, w) = true ↔ a ∈ A), then A ∈ NP encA ∩ coNP encA (mem_NP_inter_coNP_of_total_search_decides), so NP-hardness of A implies NP = coNP (NP_eq_coNP_of_NPHard_total_search_decides).
  3. Adaptive multi-query polynomial-time Turing reductions to TFNP ([MP91]): an AdaptiveSearchReduction makes steps(|encA a|) adaptive queries to any oracle returning solutions of R ∈ TFNP encB, maintaining a polynomially bounded bit-string state and deciding A regardless of which valid solutions the oracle returns. Guessing and verifying the full sequence of oracle answers puts A ∈ NP encA ∩ coNP encA (AdaptiveSearchReduction.mem_NP_inter_coNP), so an NP-hard problem with an AdaptiveSearchReduction to any R ∈ TFNP encB collapses NP = coNP (NP_eq_coNP_of_NPHard_adaptiveSearchReduction).

For the specialization of these barriers to two-player rational Nash equilibria (BimatrixCode.BimatrixNash), see CslibFrontier.GameTheory.Bimatrix.CoNPBarrier.

Main definitions #

Main results #

References #

Collapse from an NP-hard problem in coNP #

theorem Cslib.Complexity.NP_eq_coNP_of_NPHard_mem_coNP {α : Type} {encA : α ↪ List Bool} {A : Set α} (hHard : NPHard encA A) (hco : A ∈ coNP encA) {γ : Type} (encC : γ ↪ List Bool) :
NP encC = coNP encC

An NP-hard problem in coNP implies NP = coNP, for every encoding of instances.

Universal-property and single-query reductions to TFNP #

theorem Cslib.Complexity.mem_coNP_of_forall_rel_iff {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {R : β → List Bool → Prop} (hR : R ∈ FNP encB) {f : α → β} (hf : Turing.MultiTapeTM.ComputableInPolyTime f encA encB) {P : α × List Bool → Bool} (hP : Turing.MultiTapeTM.ComputableInPolyTime P (Turing.MultiTapeTM.encPair encA Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hiff : ∀ (a : α), a ∈ A ↔ ∀ (w : List Bool), R (f a) w → P (a, w) = true) :
A ∈ coNP encA

Universal-property reduction into FNP / TFNP puts A in coNP ([Pap07], Section 2.2, p. 32): if R ∈ FNP encB and polynomial-time maps f and P satisfy ∀ a, a ∈ A ↔ ∀ w, R (f a) w → P (a, w) = true, then A ∈ coNP encA.

theorem Cslib.Complexity.NP_eq_coNP_of_NPHard_forall_rel_iff {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {R : β → List Bool → Prop} (hHard : NPHard encA A) (hR : R ∈ FNP encB) {f : α → β} (hf : Turing.MultiTapeTM.ComputableInPolyTime f encA encB) {P : α × List Bool → Bool} (hP : Turing.MultiTapeTM.ComputableInPolyTime P (Turing.MultiTapeTM.encPair encA Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hiff : ∀ (a : α), a ∈ A ↔ ∀ (w : List Bool), R (f a) w → P (a, w) = true) {γ : Type} (encC : γ ↪ List Bool) :
NP encC = coNP encC

If an NP-hard problem reduces via a universal property to an FNP (in particular TFNP) search problem, then NP = coNP ([Pap07], Section 2.2, p. 32).

theorem Cslib.Complexity.mem_NP_inter_coNP_of_total_search_decides {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {R : β → List Bool → Prop} (hR : R ∈ TFNP encB) {f : α → β} (hf : Turing.MultiTapeTM.ComputableInPolyTime f encA encB) {P : α × List Bool → Bool} (hP : Turing.MultiTapeTM.ComputableInPolyTime P (Turing.MultiTapeTM.encPair encA Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hdec : ∀ (a : α) (w : List Bool), R (f a) w → (P (a, w) = true ↔ a ∈ A)) :
A ∈ NP encA ∧ A ∈ coNP encA

Single-query total-search reduction puts A in NP ∩ coNP ([MP91]): if R ∈ TFNP encB and polynomial-time f and P decide A from any solution of R (f a), then A ∈ NP encA and A ∈ coNP encA.

theorem Cslib.Complexity.NP_eq_coNP_of_NPHard_total_search_decides {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {R : β → List Bool → Prop} (hHard : NPHard encA A) (hR : R ∈ TFNP encB) {f : α → β} (hf : Turing.MultiTapeTM.ComputableInPolyTime f encA encB) {P : α × List Bool → Bool} (hP : Turing.MultiTapeTM.ComputableInPolyTime P (Turing.MultiTapeTM.encPair encA Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hdec : ∀ (a : α) (w : List Bool), R (f a) w → (P (a, w) = true ↔ a ∈ A)) {γ : Type} (encC : γ ↪ List Bool) :
NP encC = coNP encC

If an NP-hard problem has a single-query polynomial-time reduction to a TFNP search problem, then NP = coNP.

Adaptive multi-query polynomial-time Turing reductions to TFNP #

def Cslib.Complexity.replayState {α : Type} (init : α → List Bool) (update : (α × List Bool) × List Bool → List Bool) (a : α) (ws : List (List Bool)) :

The final state reached by replaying a sequence of oracle answers ws from an initial state init a via transition update.

def Cslib.Complexity.IsValidOracleTrace {α β : Type} (R : β → List Bool → Prop) (init : α → List Bool) (query : α × List Bool → β) (update : (α × List Bool) × List Bool → List Bool) (a : α) (ws : List (List Bool)) :

Predicate stating that ws is a valid sequence of oracle answers to R along the replay starting from init a with query map query and state transition update.

structure Cslib.Complexity.AdaptiveSearchReduction {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (R : β → List Bool → Prop) :

A polynomial-time adaptive Turing reduction from a decision problem A to a search relation R ([MP91]): starting from init a, the reduction executes steps(|encA a|) rounds, maintaining a bit-string state of length at most stateBound(|encA a|). In each round it computes a query query (a, s), receives any valid solution w with R (query (a, s)) w, updates s ↦ update ((a, s), w), and after all rounds outputs finish (a, s), which correctly decides a ∈ A for every valid oracle answer sequence.

theorem Cslib.Complexity.AdaptiveSearchReduction.mem_NP_inter_coNP {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {R : β → List Bool → Prop} (red : AdaptiveSearchReduction encA encB A R) (hR : R ∈ TFNP encB) :
A ∈ NP encA ∧ A ∈ coNP encA

Adaptive multi-query polynomial-time Turing reductions to TFNP place A in NP ∩ coNP ([MP91]).

theorem Cslib.Complexity.NP_eq_coNP_of_NPHard_adaptiveSearchReduction {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {R : β → List Bool → Prop} (hHard : NPHard encA A) (hR : R ∈ TFNP encB) (red : AdaptiveSearchReduction encA encB A R) {γ : Type} (encC : γ ↪ List Bool) :
NP encC = coNP encC

Megiddo–Papadimitriou theorem ([MP91]): if an NP-hard decision problem has a polynomial-time adaptive Turing reduction to a TFNP search problem, then NP = coNP for every encoding.