While this submission is a draft, it cannot be used by other submissions.

#DNF

Lax859101.CountingDnf · concepts/Lax859101/CountingDnf.lean · lax-859101

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural 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
    7 concepts; 13 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.Algebra.BigOperators.Ring.Finset
    2import Mathlib.Algebra.Order.BigOperators.Group.Finset
    3import Mathlib.Data.Fintype.BigOperators
    4import Mathlib.SetTheory.Cardinal.Finite
    5import Mathlib.Algebra.Group.Action.Defs
    6import Mathlib.Tactic.Ring
    7import Mathlib.Order.PiLex
    8import Mathlib.Data.Prod.Lex
    9import Mathlib.Data.Fintype.EquivFin
    10import Mathlib.ModelTheory.Order
    11import Mathlib.ModelTheory.Semantics
    12import Mathlib.ModelTheory.Complexity
    13import Mathlib.Tactic.FinCases
    14import Mathlib.Logic.Equiv.Fin.Basic
    15import Mathlib.Data.Fintype.Lattice
    16import Mathlib.Data.Finite.Sigma
    17import Mathlib.Order.Lattice.Nat
    18import Mathlib.Data.Set.Card
    19import Mathlib.Data.Fintype.Pigeonhole
    20import Mathlib.Dynamics.FixedPoints.Basic
    21import Mathlib.ModelTheory.Syntax
    22import Mathlib.Data.Fintype.Card
    23import Lax366625.CountingSat
    24import Lax904597.Sat
    25import Lax366625.CountingProblems
    26
    27/-!
    28---
    29title: #DNF
    30type: definition
    31---
    32An instance of the CNF vocabulary of the NP core is read as a DNF formula,
    33its clauses being the terms. A model is a set of variables that makes every
    34literal of some term true. #DNF counts the models.
    35-/
    36
    37namespace Lax859101.CountingDnf
    38
    39open Lax366625.CountingSat Lax904597.Sat
    40
    41open FirstOrder
    42
    43open Language Structure
    44
    45section Models
    46
    47variable (A : Type) [sat.Structure A]
    48
    49/-- The set `ν` of true variables is a model of the DNF formula: it makes every
    50literal of some term true, and consists of variables of the formula. -/
    51def 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
    56end Models
    57
    58open Lax366625.CountingProblems
    59
    60/-- **#DNF**, as a counting problem. -/
    61noncomputable def SharpDNF : CountingProblem Lax904597.Sat.sat :=
    62 CountingProblem.ofFun fun A _ =>
    63 Nat.card {ν : A → Prop // DnfModel A ν}
    64
    65end Lax859101.CountingDnf
    66

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…