Monotone 3-SAT
AbbreviationMonotone 3-SAT instances#✓fully proved
A monotone 3-SAT instance is a pair \((n, \varphi)\) of a natural number \(n\), the number of variables, and a CNF formula \(\varphi\).
abbrev MonotoneThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
abbrev CNF := List CNFClause
CSLibExt/Logics/Propositional/CNF/Basic.lean:33
Uses 1 · Used by 3
DefinitionWell-formed monotone 3-SAT instances#✓fully proved
A monotone 3-SAT instance \((n, \varphi)\) is well formed when every clause of the CNF formula \(\varphi\) is a list of exactly three literals (repetitions allowed), each with a variable below \(n\), and the literals of each clause are all positive or all negative.
def WellFormed (i : MonotoneThreeSatInstance) : Prop :=
(∀ clause ∈ i.2, clause.length = 3 ∧ (∀ l ∈ clause, l.1 < i.1) ∧
((∀ l ∈ clause, l.2 = true) ∨ (∀ l ∈ clause, l.2 = false)))
abbrev MonotoneThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
WantedExt/Complexity/NPComplete/MonotoneThreeSatWanted.lean:46
Uses 3 · Used by 1
DefinitionSatisfiable monotone 3-SAT instances#✓fully proved
A monotone 3-SAT instance \((n, \varphi)\) is feasible when there is a list of \(n\) truth values \(a_0, \dots, a_{n-1}\) such that the assignment sending each variable \(x < n\) to \(a_x\) and every variable \(x \ge n\) to false satisfies the CNF formula \(\varphi\).
def MonotoneThreeSatFeasible
(i : MonotoneThreeSatInstance) : Prop :=
∃ assign : List Bool, assign.length = i.1 ∧
Cslib.Logic.PL.CNF.Satisfies (fun x => assign.getD x false) i.2
abbrev MonotoneThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
WantedExt/Complexity/NPComplete/MonotoneThreeSatWanted.lean:46
def Satisfies (assignment : Nat → Bool) (formula : CNF) : Prop :=
∀ clause ∈ formula, CNFClause.Satisfies assignment clause
CSLibExt/Logics/Propositional/CNF/Semantics.lean:71
Uses 3 · Used by 1
DefinitionMONOTONE 3-SAT as a decision problem#✓fully proved
The decision problem MONOTONE 3-SAT 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 clause of \(\varphi\) is a list of exactly three literals (repetitions allowed), every literal of \(\varphi\) has a variable below \(n\), the literals of each clause are all positive or all negative, and some assignment of truth values to the variables \(0, \dots, n-1\), with every other variable false, satisfies \(\varphi\). Bitstrings that do not decode are rejected.
noncomputable def monotoneThreeSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MonotoneThreeSatInstance) x with
| some i => decide (WellFormed i ∧ MonotoneThreeSatFeasible i)
| 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 MonotoneThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
WantedExt/Complexity/NPComplete/MonotoneThreeSatWanted.lean:46
def WellFormed (i : MonotoneThreeSatInstance) : Prop :=
(∀ clause ∈ i.2, clause.length = 3 ∧ (∀ l ∈ clause, l.1 < i.1) ∧
((∀ l ∈ clause, l.2 = true) ∨ (∀ l ∈ clause, l.2 = false)))
WantedExt/Complexity/NPComplete/MonotoneThreeSatWanted.lean:49
def MonotoneThreeSatFeasible
(i : MonotoneThreeSatInstance) : Prop :=
∃ assign : List Bool, assign.length = i.1 ∧
Cslib.Logic.PL.CNF.Satisfies (fun x => assign.getD x false) i.2
WantedExt/Complexity/NPComplete/MonotoneThreeSatWanted.lean:54
Uses 14 · Used by 1
TheoremMONOTONE 3-SAT is NP-complete#●ready to prove
The decision problem MONOTONE 3-SAT belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to MONOTONE 3-SAT.
public theorem_wanted monotoneThreeSat_npComplete :
monotoneThreeSatDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L monotoneThreeSatDec
noncomputable def monotoneThreeSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := MonotoneThreeSatInstance) x with
| some i => decide (WellFormed i ∧ MonotoneThreeSatFeasible i)
| none => false
WantedExt/Complexity/NPComplete/MonotoneThreeSatWanted.lean:61
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
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
- T. J. Schaefer, "The complexity of satisfiability problems", Proceedings of the Tenth Annual ACM Symposium on Theory of Computing (STOC 1978), ACM, 1978, 216-226 (dichotomy theorem).
Uses 5
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.