Documentation

Complexitylib.Classes.NP.CoNP

coNP: structural theory and coNP-completeness #

This file develops the elementary structural theory of coNP on top of the definition coNP = complClass NP from Complexitylib.Classes.NP:

The headline application is SAT.coNPComplete_compl_language (the complement of SAT is coNP-complete), in Complexitylib/SAT/CookLevin/Corollaries.lean.

Complements and membership #

@[simp]

Complementation swaps NP and coNP: Lᶜ ∈ coNP ↔ L ∈ NP. (The companion direction L ∈ coNP ↔ Lᶜ ∈ NP is mem_complClass.)

P is contained in coNP. A language decidable in deterministic polynomial time has its complement decidable in deterministic polynomial time (P_compl), hence in NP.

P is contained in NP ∩ coNP (Arora–Barak, discussion after Definition 2.20). Whether the containment is strict is open.

Reductions dualize #

theorem Complexity.MapReducesPoly.compl {L₁ L₂ : Language} (h : L₁ ≤ₚ L₂) :
L₁ ≤ₚ L₂

Karp reductions dualize to complements. The same polynomial-time function that reduces L₁ to L₂ also reduces L₁ᶜ to L₂ᶜ, since x ∈ L₁ ↔ f x ∈ L₂ gives x ∉ L₁ ↔ f x ∉ L₂.

coNP-hardness and coNP-completeness #

coNP-hardness. L is coNP-hard when every language in coNP reduces to L in polynomial time.

Equations
Instances For

    coNP-completeness. L is coNP-complete when it is in coNP and coNP-hard.

    Equations
    Instances For
      theorem Complexity.coNPHard.of_reduction {L₁ L₂ : Language} (h₁ : coNPHard L₁) (h₂ : L₁ ≤ₚ L₂) :

      coNP-hardness transfers forward along a polynomial-time many-one reduction.

      theorem Complexity.coNPComplete.of_mem_of_reduction {L₁ L₂ : Language} (h₁ : coNPHard L₁) (hmem : L₂ coNP) (h₂ : L₁ ≤ₚ L₂) :

      A language in coNP is coNP-complete when a coNP-hard language reduces to it.

      theorem Complexity.coNPComplete.transfer {L₁ L₂ : Language} (h₁ : coNPComplete L₁) (hmem : L₂ coNP) (h₂ : L₁ ≤ₚ L₂) :

      coNP-completeness transfers forward along a polynomial-time reduction once membership of the target language in coNP is known.

      Completeness dualizes #

      The complement of an NP-hard language is coNP-hard: any L' ∈ coNP has L'ᶜ ∈ NP, so L'ᶜ ≤ₚ L, and dualizing gives L' ≤ₚ Lᶜ.

      The complement of a coNP-hard language is NP-hard.

      The complement of an NP-complete language is coNP-complete (Arora–Barak, Definition 2.20 and the surrounding discussion).

      The complement of a coNP-complete language is NP-complete.

      P = NP collapses NP and coNP #

      If P = NP then NP = coNP. Under P = NP the class NP inherits closure under complement from P (P_compl), and a class closed under complement equals its complement class.

      If NP ≠ coNP then P ≠ NP. The standard route to P ≠ NP through the (believed stronger) separation of NP from coNP.