1-in-SAT
Lax799700.OneInSat · concepts/Lax799700/OneInSat.lean · lax-799700
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
EXACTLY-ONE SATISFIABILITY: is there a truth assignment giving every clause exactly one true literal? It lives on the vocabulary of SAT with its own notion of satisfaction (OneInProper). Membership is by an existential second-order definition, SAT's kernel plus uniqueness, one clause per pattern of signs; hardness is an ordered first-order reduction from 3SAT. The catalog states it at unrestricted width because it is the source for Exact Cover, where a 1-in-SAT instance becomes an exact cover with no gadget at all.
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 Lax799700.Common |
| 14 | import Lax904597.Sat |
| 15 | import Lax904597.Classes |
| 16 | import Lax799700.Problems |
| 17 | |
| 18 | /-! |
| 19 | --- |
| 20 | title: 1-in-SAT |
| 21 | type: theorem |
| 22 | --- |
| 23 | EXACTLY-ONE SATISFIABILITY: is there a truth assignment giving every |
| 24 | clause exactly one true literal? It lives on the vocabulary of SAT with |
| 25 | its own notion of satisfaction (OneInProper). Membership is by an |
| 26 | existential second-order definition, SAT's kernel plus uniqueness, one |
| 27 | clause per pattern of signs; hardness is an ordered first-order reduction |
| 28 | from 3SAT. The catalog states it at unrestricted width because it is the |
| 29 | source for Exact Cover, where a 1-in-SAT instance becomes an exact cover |
| 30 | with no gadget at all. |
| 31 | |
| 32 | -/ |
| 33 | |
| 34 | namespace Lax799700.OneInSat |
| 35 | |
| 36 | open Lax799700.Common Lax904597.Sat |
| 37 | |
| 38 | open FirstOrder |
| 39 | |
| 40 | open Language Structure Lax904597.SecondOrder.SOBlock |
| 41 | |
| 42 | section Semantics |
| 43 | |
| 44 | variable {A : Type} [sat.Structure A] |
| 45 | |
| 46 | /-- An assignment is *exactly-one proper* when every clause has exactly one |
| 47 | true literal occurrence. -/ |
| 48 | def OneInProper (ν : A → Prop) : Prop := |
| 49 | ∀ c : A, SatOcc.IsCl c → ∃ x s, SatOcc.OccIn c x s ∧ SatOcc.LitTrue ν x s ∧ |
| 50 | ∀ y t, SatOcc.OccIn c y t → SatOcc.LitTrue ν y t → y = x ∧ t = s |
| 51 | |
| 52 | end Semantics |
| 53 | |
| 54 | section Problem |
| 55 | |
| 56 | variable (A : Type) [sat.Structure A] |
| 57 | |
| 58 | /-- A `Language.sat`-structure is exactly-one satisfiable if some assignment |
| 59 | gives every clause exactly one true literal. -/ |
| 60 | def OneInSatisfiable : Prop := ∃ ν : A → Prop, OneInProper ν |
| 61 | |
| 62 | end Problem |
| 63 | |
| 64 | open Lax904597.Problems Lax904597.Classes Lax799700.Problems |
| 65 | |
| 66 | /-- The property `OneInSatisfiable` is isomorphism-invariant. -/ |
| 67 | axiom oneInSatisfiable_iso : ∀ {A B : Type} [Lax904597.Sat.sat.Structure A] [Lax904597.Sat.sat.Structure B], |
| 68 | (A ≃[Lax904597.Sat.sat] B) → (OneInSatisfiable A ↔ OneInSatisfiable B) |
| 69 | |
| 70 | /-- The problem OneInSAT: does the structure satisfy `OneInSatisfiable`? -/ |
| 71 | def OneInSAT : DecisionProblem Lax904597.Sat.sat := |
| 72 | DecisionProblem.ofPred OneInSatisfiable |
| 73 | |
| 74 | /-- The yes-instances of OneInSAT are exactly the structures satisfying |
| 75 | `OneInSatisfiable`. -/ |
| 76 | axiom oneInSat_iff : ∀ (A : Type) [Lax904597.Sat.sat.Structure A], OneInSAT A ↔ OneInSatisfiable A |
| 77 | |
| 78 | /-- OneInSAT is NP-complete. -/ |
| 79 | axiom oneInSat_NP_complete : NP.Complete OneInSAT |
| 80 | |
| 81 | end Lax799700.OneInSat |
| 82 |
Used by
none
From Mathlib
Mathlib.Data.Finite.SigmaMathlib.Data.Fintype.EquivFinMathlib.Data.Fintype.LatticeMathlib.Data.Prod.LexMathlib.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