Not-all-equal SAT
Lax799700.NaeSat · concepts/Lax799700/NaeSat.lean · lax-799700
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
NOT-ALL-EQUAL SAT: is there a truth assignment giving every clause both a true and a false literal? It lives on the vocabulary of SAT, and only its notion of satisfaction differs (NAEProper), which is closed under flipping the assignment. That symmetry is what the hardness proof uses: adding one fresh variable, positive in every clause, turns a satisfying assignment into a not-all-equal one and back, once the fresh variable is normalized to false. The fresh variable is picked out as the minimum of its copy of the universe, so the reduction from SAT is an ordered first-order reduction. Membership is by an existential second-order definition, SAT's kernel conjoined with its mirror image.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Mathlib.Data.Set.Finite.Lemmas |
| 2 | import Mathlib.Tactic.FinCases |
| 3 | import Mathlib.Order.PiLex |
| 4 | import Mathlib.Data.Prod.Lex |
| 5 | import Mathlib.Data.Fintype.EquivFin |
| 6 | import Mathlib.ModelTheory.Order |
| 7 | import Mathlib.ModelTheory.Semantics |
| 8 | import Mathlib.ModelTheory.Complexity |
| 9 | import Mathlib.Logic.Equiv.Fin.Basic |
| 10 | import Mathlib.Data.Finite.Sigma |
| 11 | import Mathlib.Data.Fintype.Lattice |
| 12 | import Mathlib.ModelTheory.Syntax |
| 13 | import Mathlib.Data.Set.Card |
| 14 | import Lax904597.Sat |
| 15 | import Lax904597.Classes |
| 16 | import Lax799700.Problems |
| 17 | |
| 18 | /-! |
| 19 | --- |
| 20 | title: Not-all-equal SAT |
| 21 | type: theorem |
| 22 | --- |
| 23 | NOT-ALL-EQUAL SAT: is there a truth assignment giving every clause both a |
| 24 | true and a false literal? It lives on the vocabulary of SAT, and only its |
| 25 | notion of satisfaction differs (NAEProper), which is closed under |
| 26 | flipping the assignment. That symmetry is what the hardness proof uses: |
| 27 | adding one fresh variable, positive in every clause, turns a satisfying |
| 28 | assignment into a not-all-equal one and back, once the fresh variable is |
| 29 | normalized to false. The fresh variable is picked out as the minimum of |
| 30 | its copy of the universe, so the reduction from SAT is an ordered |
| 31 | first-order reduction. Membership is by an existential second-order |
| 32 | definition, SAT's kernel conjoined with its mirror image. |
| 33 | |
| 34 | -/ |
| 35 | |
| 36 | namespace Lax799700.NaeSat |
| 37 | |
| 38 | open Lax904597.Sat |
| 39 | |
| 40 | open FirstOrder |
| 41 | |
| 42 | open Language Structure Lax904597.SecondOrder.SOBlock BoundedFormula |
| 43 | |
| 44 | section Semantics |
| 45 | |
| 46 | variable {A : Type} [sat.Structure A] |
| 47 | |
| 48 | /-- An assignment is *not-all-equal proper* when every clause contains both a |
| 49 | true and a false literal. -/ |
| 50 | def NAEProper (ν : A → Prop) : Prop := |
| 51 | ∀ c : A, RelMap satIsClause ![c] → |
| 52 | (∃ x : A, (RelMap satPosIn ![c, x] ∧ ν x) ∨ (RelMap satNegIn ![c, x] ∧ ¬ν x)) ∧ |
| 53 | ∃ x : A, (RelMap satPosIn ![c, x] ∧ ¬ν x) ∨ (RelMap satNegIn ![c, x] ∧ ν x) |
| 54 | |
| 55 | end Semantics |
| 56 | |
| 57 | section Problem |
| 58 | |
| 59 | variable (A : Type) [sat.Structure A] |
| 60 | |
| 61 | /-- A `Language.sat`-structure is not-all-equal satisfiable if some assignment |
| 62 | gives every clause both a true and a false literal. -/ |
| 63 | def NAESatisfiable : Prop := ∃ ν : A → Prop, NAEProper ν |
| 64 | |
| 65 | end Problem |
| 66 | |
| 67 | open Lax904597.Problems Lax904597.Classes Lax799700.Problems |
| 68 | |
| 69 | /-- The property `NAESatisfiable` is isomorphism-invariant. -/ |
| 70 | axiom naeSatisfiable_iso : ∀ {A B : Type} [Lax904597.Sat.sat.Structure A] [Lax904597.Sat.sat.Structure B], |
| 71 | (A ≃[Lax904597.Sat.sat] B) → (NAESatisfiable A ↔ NAESatisfiable B) |
| 72 | |
| 73 | /-- The problem NAESAT: does the structure satisfy `NAESatisfiable`? -/ |
| 74 | def NAESAT : DecisionProblem Lax904597.Sat.sat := |
| 75 | DecisionProblem.ofPred NAESatisfiable |
| 76 | |
| 77 | /-- The yes-instances of NAESAT are exactly the structures satisfying |
| 78 | `NAESatisfiable`. -/ |
| 79 | axiom naeSat_iff : ∀ (A : Type) [Lax904597.Sat.sat.Structure A], NAESAT A ↔ NAESatisfiable A |
| 80 | |
| 81 | /-- NAESAT is NP-complete. -/ |
| 82 | axiom naeSat_NP_complete : NP.Complete NAESAT |
| 83 | |
| 84 | end Lax799700.NaeSat |
| 85 |
Used by
From Mathlib
Mathlib.Data.Finite.SigmaMathlib.Data.Fintype.EquivFinMathlib.Data.Fintype.LatticeMathlib.Data.Prod.LexMathlib.Data.Set.CardMathlib.Data.Set.Finite.LemmasMathlib.Logic.Equiv.Fin.BasicMathlib.ModelTheory.ComplexityMathlib.ModelTheory.OrderMathlib.ModelTheory.SemanticsMathlib.ModelTheory.SyntaxMathlib.Order.PiLexMathlib.Tactic.FinCases
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments