Documentation

Complexity.Logics.Propositional.ClauseSet.Basic

Clause sets #

A clause set is a finite set of clauses, each a finite set of literals: the set-based form of a formula in conjunctive normal form, in which the order and repetition of clauses and literals do not matter. Set operations on clauses (subclauses, differences) are what the sparsification lemma works with. A formula in conjunctive normal form and its clause set have the same solutions (CNF.sat_toClauseSet_iff), and a clause set is the clause set of a formula listing its clauses (ClauseSet.eval_toCNF_eq_true_iff).

Main definitions #

References #

There are two literals for each variable.

@[reducible, inline]
abbrev Cslib.Logic.PL.ClauseSet (V : Type u_2) :
Type u_2

A clause set: a finite set of clauses, each a finite set of literals. A clause is satisfied when one of its literals is true; a clause set when all of its clauses are.

Instances For
    def Cslib.Logic.PL.ClauseSet.Sat {V : Type u_1} (ψ : ClauseSet V) (x : V → Bool) :

    x satisfies every clause of ψ.

    Instances For
      @[instance_reducible]
      instance Cslib.Logic.PL.ClauseSet.instDecidableSat {V : Type u_1} (ψ : ClauseSet V) (x : V → Bool) :
      Decidable (ψ.Sat x)

      The solutions of a clause set.

      Instances For
        @[simp]
        theorem Cslib.Logic.PL.ClauseSet.mem_solutions {V : Type u_1} [DecidableEq V] [Fintype V] {ψ : ClauseSet V} {x : V → Bool} :
        x ∈ ψ.solutions ↔ ψ.Sat x

        The number of clauses of ψ mentioning the variable v.

        Instances For

          The clause set of a formula in conjunctive normal form.

          Instances For
            theorem Cslib.Logic.PL.CNF.sat_toClauseSet_iff {V : Type u_1} [DecidableEq V] (φ : CNF V) (x : V → Bool) :

            A formula in conjunctive normal form and its clause set have the same solutions.

            theorem Cslib.Logic.PL.CNF.exists_card_le_of_mem_toClauseSet {V : Type u_1} [DecidableEq V] {φ : CNF V} {C : Finset (Literal V)} (hC : C ∈ φ.toClauseSet) :
            ∃ c ∈ φ, C.card ≤ List.length c

            A clause of the clause set of a formula has at most as many literals as the clause it comes from.

            noncomputable def Cslib.Logic.PL.ClauseSet.toCNF {V : Type u_1} (ψ : ClauseSet V) :
            CNF V

            A formula listing the clauses of a clause set.

            Instances For
              theorem Cslib.Logic.PL.ClauseSet.eval_toCNF_eq_true_iff {V : Type u_1} (ψ : ClauseSet V) (x : V → Bool) :

              The formula of a clause set accepts exactly its solutions.

              theorem Cslib.Logic.PL.ClauseSet.length_le_of_mem_toCNF {V : Type u_1} {ψ : ClauseSet V} {k : ℕ} (hk : ∀ C ∈ ψ, C.card ≤ k) {c : Clause V} (hc : c ∈ ψ.toCNF) :

              The clauses of the formula of a clause set have at most as many literals as its clauses.

              The formula of a clause set has as many clauses mentioning v as the clause set.