Unsatisfiability
DefinitionUNSAT as a decision problem#✓fully proved
The UNSAT decision problem accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to a pair \((n, \varphi)\) of a natural number \(n\) and a CNF formula \(\varphi\) such that every variable occurring in \(\varphi\) is less than \(n\) and, for every assignment \(a\) of booleans to the variables \(0, \dots, n - 1\), the assignment that agrees with \(a\) below \(n\) and sends every variable \(v \ge n\) to false does not satisfy \(\varphi\).
noncomputable def unsatDec : MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := ℕ × Cslib.Logic.PL.CNF) x with
| some i => decide ((∀ clause ∈ i.2, ∀ l ∈ clause, l.1 < i.1) ∧
∀ assign : Fin i.1 → Bool,
¬ Cslib.Logic.PL.CNF.Satisfies
(fun v => if h : v < i.1 then assign ⟨v, h⟩ else false) i.2)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev CNF := List CNFClause
CSLibExt/Logics/Propositional/CNF/Basic.lean:33
def Satisfies (assignment : Nat → Bool) (formula : CNF) : Prop :=
∀ clause ∈ formula, CNFClause.Satisfies assignment clause
CSLibExt/Logics/Propositional/CNF/Semantics.lean:71
Uses 12 · Used by 1
TheoremUNSAT is coNP-complete#●ready to prove
The UNSAT decision problem lies in coNP, and every decision problem in coNP has a polynomial-time many-one reduction to it.
public theorem_wanted unsat_conp_complete :
unsatDec ∈ MetaMathlibExt.ComplexityTheory.coNP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.coNP →
Cslib.CookLevin.PolyManyOneRed L unsatDec
noncomputable def unsatDec : MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := ℕ × Cslib.Logic.PL.CNF) x with
| some i => decide ((∀ clause ∈ i.2, ∀ l ∈ clause, l.1 < i.1) ∧
∀ assign : Fin i.1 → Bool,
¬ Cslib.Logic.PL.CNF.Satisfies
(fun v => if h : v < i.1 then assign ⟨v, h⟩ else false) i.2)
| none => false
WantedExt/Complexity/KeyTheorems/UNSATCoNPCompleteWanted.lean:46
def coNP : DecisionComplexityClass :=
{ L | Lᶜ ∈ NP }
MathlibExt/Computability/Complexity.lean:207
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- S. A. Cook, "The complexity of theorem-proving procedures", Proceedings of the Third Annual ACM Symposium on Theory of Computing (STOC 1971), 151-158; L. A. Levin, "Universal search problems", Problems of Information Transmission 9 (1973), 265-266.
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.