3-SAT with bounded occurrences
AbbreviationBounded-occurrence 3-SAT instances#✓fully proved
A bounded-occurrence 3-SAT instance is a pair \((n, \varphi)\) of a natural number \(n\), the number of variables, and a CNF formula \(\varphi\).
abbrev BoundedOccurrenceThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
abbrev CNF := List CNFClause
CSLibExt/Logics/Propositional/CNF/Basic.lean:33
Uses 1 · Used by 3
DefinitionWell-formed bounded-occurrence 3-SAT instances#✓fully proved
A bounded-occurrence 3-SAT instance \((n, \varphi)\) is well formed when every clause of \(\varphi\) is a list of exactly three literals, not necessarily distinct, every literal of \(\varphi\) has a variable less than \(n\), and for every variable \(v < n\) at most four of the literals in the clauses of \(\varphi\), counted with multiplicity and with either polarity, have variable \(v\).
def WellFormed (i : BoundedOccurrenceThreeSatInstance) : Prop :=
(∀ clause ∈ i.2, clause.length = 3 ∧ ∀ l ∈ clause, l.1 < i.1) ∧
∀ v < i.1, (i.2.flatten.filter (fun l => l.1 == v)).length ≤ 4
abbrev BoundedOccurrenceThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
WantedExt/Complexity/NPComplete/BoundedOccurrenceThreeSatWanted.lean:48
Uses 3 · Used by 1
DefinitionSatisfiable bounded-occurrence 3-SAT instances#✓fully proved
A bounded-occurrence 3-SAT instance \((n, \varphi)\) is satisfiable when there is a list \((a_0, \dots, a_{n-1})\) of booleans such that \(\varphi\) is satisfied by the assignment sending each variable \(x < n\) to \(a_x\) and every variable \(x \ge n\) to false.
def BoundedOccurrenceThreeSatFeasible
(i : BoundedOccurrenceThreeSatInstance) : Prop :=
∃ assign : List Bool, assign.length = i.1 ∧
Cslib.Logic.PL.CNF.Satisfies (fun x => assign.getD x false) i.2
abbrev BoundedOccurrenceThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
WantedExt/Complexity/NPComplete/BoundedOccurrenceThreeSatWanted.lean:48
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
Definition3-SAT with bounded occurrences as a decision problem#✓fully proved
The decision problem 3-SAT WITH BOUNDED OCCURRENCES accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding of bounded-occurrence 3-SAT instances, to an instance that is well formed and satisfiable; it rejects every other bitstring, including every bitstring that does not decode.
noncomputable def boundedOccurrenceThreeSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := BoundedOccurrenceThreeSatInstance) x with
| some i => decide (WellFormed i ∧ BoundedOccurrenceThreeSatFeasible 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 BoundedOccurrenceThreeSatInstance := ℕ × Cslib.Logic.PL.CNF
WantedExt/Complexity/NPComplete/BoundedOccurrenceThreeSatWanted.lean:48
def WellFormed (i : BoundedOccurrenceThreeSatInstance) : Prop :=
(∀ clause ∈ i.2, clause.length = 3 ∧ ∀ l ∈ clause, l.1 < i.1) ∧
∀ v < i.1, (i.2.flatten.filter (fun l => l.1 == v)).length ≤ 4
WantedExt/Complexity/NPComplete/BoundedOccurrenceThreeSatWanted.lean:51
def BoundedOccurrenceThreeSatFeasible
(i : BoundedOccurrenceThreeSatInstance) : Prop :=
∃ assign : List Bool, assign.length = i.1 ∧
Cslib.Logic.PL.CNF.Satisfies (fun x => assign.getD x false) i.2
WantedExt/Complexity/NPComplete/BoundedOccurrenceThreeSatWanted.lean:56
Uses 14 · Used by 1
Theorem3-SAT WITH BOUNDED OCCURRENCES is NP-complete#●ready to prove
The decision problem 3-SAT WITH BOUNDED OCCURRENCES over bitstrings belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted boundedOccurrenceThreeSat_npComplete :
boundedOccurrenceThreeSatDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L boundedOccurrenceThreeSatDec
noncomputable def boundedOccurrenceThreeSatDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := BoundedOccurrenceThreeSatInstance) x with
| some i => decide (WellFormed i ∧ BoundedOccurrenceThreeSatFeasible i)
| none => false
WantedExt/Complexity/NPComplete/BoundedOccurrenceThreeSatWanted.lean:63
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
- M. R. Garey and D. S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness (1979), 3-SAT with bounded occurrences; C. A. Tovey, "A simplified NP-complete satisfiability problem" (1984).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.