abbrev
definition
Assignment
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.Complexity.SAT.CNF on GitHub at line 25.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
BooleanCircuitWithEval -
CircuitDecides -
CircuitLedgerCert -
CircuitSeparation -
CircuitWithEvalDecides -
moat_width_unsat -
moat_zero_sat -
clause_unchanged_by_flip -
flipBit -
flipBit_flipBit -
flipBit_ne -
flipBit_other -
jcostDegree -
jcostDegree_nonneg -
jcostEdgeWeight -
jcostEdgeWeight_le_clauses -
jcostEdgeWeight_le_varDegree_prop -
jcostEdgeWeight_nonneg -
jcostEdgeWeight_symm -
literal_unchanged_by_flip -
PvsNPDissolution -
Assignment -
Clause -
CNFFormula -
CNFFormula -
CNFFormula -
Literal -
RSATSeparation -
satJCost -
satJCost_nonneg -
satJCost_zero_iff -
sat_reaches_zero -
sat_recognition_time_bound -
unsat_cost_lower_bound -
unsat_positive_jcost -
bp_step_sound -
clauseUnit_correct -
compatible -
compatible_setVar -
consistent
formal source
22deriving Repr
23
24/-- Total assignments for `n` variables. -/
25abbrev Assignment (n : Nat) := Var n → Bool
26
27/-- Evaluate a literal under an assignment. -/
28def evalLit {n} (a : Assignment n) : Lit n → Bool
29 | .pos v => a v
30 | .neg v => ! (a v)
31
32/-- Evaluate a clause (OR over its literals). Empty clause = false. -/
33def evalClause {n} (a : Assignment n) (C : Clause n) : Bool :=
34 C.any (fun l => evalLit a l)
35
36/-- Evaluate a CNF (AND over its clauses). Empty CNF = true. -/
37def evalCNF {n} (a : Assignment n) (φ : CNF n) : Bool :=
38 φ.clauses.all (fun C => evalClause a C)
39
40/-- Satisfiable CNF. -/
41def Satisfiable {n} (φ : CNF n) : Prop :=
42 ∃ a : Assignment n, evalCNF a φ = true
43
44/-- Uniquely satisfiable CNF. -/
45def UniqueSolution {n} (φ : CNF n) : Prop :=
46 ∃! (a : Assignment n), evalCNF a φ = true
47
48end SAT
49end Complexity
50end IndisputableMonolith