#DNF
Lax859101.CountingDnf · concepts/Lax859101/CountingDnf.lean · lax-859101
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
An instance of the CNF vocabulary of the NP core is read as a DNF formula, its clauses being the terms. A model is a set of variables that makes every literal of some term true. #DNF counts the models.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.Algebra.BigOperators.Ring.Finset |
| 2 | import Mathlib.Algebra.Order.BigOperators.Group.Finset |
| 3 | import Mathlib.Data.Fintype.BigOperators |
| 4 | import Mathlib.SetTheory.Cardinal.Finite |
| 5 | import Mathlib.Algebra.Group.Action.Defs |
| 6 | import Mathlib.Tactic.Ring |
| 7 | import Mathlib.Order.PiLex |
| 8 | import Mathlib.Data.Prod.Lex |
| 9 | import Mathlib.Data.Fintype.EquivFin |
| 10 | import Mathlib.ModelTheory.Order |
| 11 | import Mathlib.ModelTheory.Semantics |
| 12 | import Mathlib.ModelTheory.Complexity |
| 13 | import Mathlib.Tactic.FinCases |
| 14 | import Mathlib.Logic.Equiv.Fin.Basic |
| 15 | import Mathlib.Data.Fintype.Lattice |
| 16 | import Mathlib.Data.Finite.Sigma |
| 17 | import Mathlib.Order.Lattice.Nat |
| 18 | import Mathlib.Data.Set.Card |
| 19 | import Mathlib.Data.Fintype.Pigeonhole |
| 20 | import Mathlib.Dynamics.FixedPoints.Basic |
| 21 | import Mathlib.ModelTheory.Syntax |
| 22 | import Mathlib.Data.Fintype.Card |
| 23 | import Lax366625.CountingSat |
| 24 | import Lax904597.Sat |
| 25 | import Lax366625.CountingProblems |
| 26 | |
| 27 | /-! |
| 28 | --- |
| 29 | title: #DNF |
| 30 | type: definition |
| 31 | --- |
| 32 | An instance of the CNF vocabulary of the NP core is read as a DNF formula, |
| 33 | its clauses being the terms. A model is a set of variables that makes every |
| 34 | literal of some term true. #DNF counts the models. |
| 35 | -/ |
| 36 | |
| 37 | namespace Lax859101.CountingDnf |
| 38 | |
| 39 | open Lax366625.CountingSat Lax904597.Sat |
| 40 | |
| 41 | open FirstOrder |
| 42 | |
| 43 | open Language Structure |
| 44 | |
| 45 | section Models |
| 46 | |
| 47 | variable (A : Type) [sat.Structure A] |
| 48 | |
| 49 | /-- The set `ν` of true variables is a model of the DNF formula: it makes every |
| 50 | literal of some term true, and consists of variables of the formula. -/ |
| 51 | def DnfModel (ν : A → Prop) : Prop := |
| 52 | (∃ c : A, RelMap satIsClause ![c] ∧ |
| 53 | ∀ x : A, (RelMap satPosIn ![c, x] → ν x) ∧ (RelMap satNegIn ![c, x] → ¬ν x)) ∧ |
| 54 | ∀ x : A, ν x → SatOccurs A x |
| 55 | |
| 56 | end Models |
| 57 | |
| 58 | open Lax366625.CountingProblems |
| 59 | |
| 60 | /-- **#DNF**, as a counting problem. -/ |
| 61 | noncomputable def SharpDNF : CountingProblem Lax904597.Sat.sat := |
| 62 | CountingProblem.ofFun fun A _ => |
| 63 | Nat.card {ν : A → Prop // DnfModel A ν} |
| 64 | |
| 65 | end Lax859101.CountingDnf |
| 66 |
Used by
Lax859101.AllSetsCompleteLax859101.AllSetsValuesLax859101.BipartiteCompleteLax859101.BipartiteValuesLax859101.ColoringCompleteLax859101.DnfCompleteLax859101.DnfValuesLax859101.NaeSatCompleteLax859101.NaeSatValuesLax859101.OneCallClosureLax859101.RestrictedSatCompleteLax859101.RestrictedSatValuesLax859101.SubtractiveClosure
From Mathlib
Mathlib.Algebra.BigOperators.Ring.FinsetMathlib.Algebra.Group.Action.DefsMathlib.Algebra.Order.BigOperators.Group.FinsetMathlib.Data.Finite.SigmaMathlib.Data.Fintype.BigOperatorsMathlib.Data.Fintype.CardMathlib.Data.Fintype.EquivFinMathlib.Data.Fintype.LatticeMathlib.Data.Fintype.PigeonholeMathlib.Data.Prod.LexMathlib.Data.Set.CardMathlib.Dynamics.FixedPoints.BasicMathlib.Logic.Equiv.Fin.BasicMathlib.ModelTheory.ComplexityMathlib.ModelTheory.OrderMathlib.ModelTheory.SemanticsMathlib.ModelTheory.SyntaxMathlib.Order.Lattice.NatMathlib.Order.PiLexMathlib.SetTheory.Cardinal.FiniteMathlib.Tactic.FinCasesMathlib.Tactic.Ring
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments