Documentation

CslibFrontier.Logics.Propositional.ClauseSet.Satisfiable

Satisfiability of clause sets #

A clause set is satisfiable when some assignment satisfies all of its clauses (ClauseSet.Satisfiable). Over a finite type of variables this is decidable, and it agrees with satisfiability of a formula listing the clauses, and a formula with satisfiability of its clause set (ClauseSet.satisfiable_toCNF_iff, CNF.satisfiable_toClauseSet_iff). Satisfaction of unions, insertions, images and indexed unions of clause sets is characterized clause by clause, and renaming the variables along an injective map preserves satisfiability (ClauseSet.satisfiable_relabel), as for formulas (CNF.satisfiable_relabel).

Main definitions #

Main results #

Some assignment satisfies every clause of ψ.

Instances For

    A clause set is satisfiable exactly when a formula listing its clauses is.

    A formula is satisfiable exactly when its clause set is.

    Satisfaction of combined clause sets #

    @[simp]
    theorem Cslib.Logic.PL.ClauseSet.sat_union_iff {V : Type u_1} {x : V → Bool} [DecidableEq V] {ψ φ : ClauseSet V} :
    (ψ ∪ φ).Sat x ↔ ψ.Sat x ∧ φ.Sat x

    An assignment satisfies a union exactly when it satisfies both parts.

    @[simp]
    theorem Cslib.Logic.PL.ClauseSet.sat_insert_iff {V : Type u_1} {x : V → Bool} [DecidableEq V] {C : Finset (Literal V)} {ψ : ClauseSet V} :
    (insert C ψ).Sat x ↔ (∃ l ∈ C, x l.1 = l.2) ∧ ψ.Sat x

    An assignment satisfies insert C ψ exactly when it satisfies the clause C and ψ.

    @[simp]
    theorem Cslib.Logic.PL.ClauseSet.sat_singleton_iff {V : Type u_1} {x : V → Bool} {C : Finset (Literal V)} :
    {C}.Sat x ↔ ∃ l ∈ C, x l.1 = l.2

    An assignment satisfies a single clause exactly when it makes one of its literals true.

    @[simp]
    theorem Cslib.Logic.PL.ClauseSet.sat_empty {V : Type u_1} {x : V → Bool} :

    Every assignment satisfies the empty clause set.

    theorem Cslib.Logic.PL.ClauseSet.sat_image_iff {V : Type u_1} {ι : Type u_3} {x : V → Bool} [DecidableEq V] {s : Finset ι} {f : ι → Finset (Literal V)} :
    Sat (Finset.image f s) x ↔ ∀ i ∈ s, ∃ l ∈ f i, x l.1 = l.2

    An assignment satisfies the clauses f i for i ∈ s exactly when it satisfies each.

    theorem Cslib.Logic.PL.ClauseSet.sat_biUnion_iff {V : Type u_1} {ι : Type u_3} {x : V → Bool} [DecidableEq V] {s : Finset ι} {f : ι → ClauseSet V} :
    Sat (s.biUnion f) x ↔ ∀ i ∈ s, (f i).Sat x

    An assignment satisfies an indexed union exactly when it satisfies each part.

    Relabelling #

    def Cslib.Logic.PL.ClauseSet.relabel {V : Type u_1} {W : Type u_2} [DecidableEq W] (f : V → W) (ψ : ClauseSet V) :

    Rename the variables of a clause set along f.

    @[simp]
    theorem Cslib.Logic.PL.ClauseSet.sat_relabel_iff {V : Type u_1} {W : Type u_2} [DecidableEq W] (f : V → W) (ψ : ClauseSet V) (σ : W → Bool) :
    (relabel f ψ).Sat σ ↔ ψ.Sat (σ ∘ f)

    σ satisfies ψ.relabel f exactly when σ ∘ f satisfies ψ.

    theorem Cslib.Logic.PL.ClauseSet.satisfiable_relabel {V : Type u_1} {W : Type u_2} [DecidableEq W] {f : V → W} (hf : Function.Injective f) (ψ : ClauseSet V) :

    Relabelling along an injective map preserves satisfiability. An assignment of the new variables restricts to the old ones, and an assignment of the old variables extends along f.

    theorem Cslib.Logic.PL.ClauseSet.relabel_union {V : Type u_1} {W : Type u_2} [DecidableEq W] [DecidableEq V] (f : V → W) (ψ φ : ClauseSet V) :
    relabel f (ψ ∪ φ) = relabel f ψ ∪ relabel f φ

    Relabelling commutes with unions.

    theorem Cslib.Logic.PL.ClauseSet.card_relabel_le {V : Type u_1} {W : Type u_2} [DecidableEq W] (f : V → W) (ψ : ClauseSet V) :

    Relabelling does not add clauses; it may merge some.

    @[simp]
    theorem Cslib.Logic.PL.ClauseSet.mem_relabel {V : Type u_1} {W : Type u_2} [DecidableEq W] {f : V → W} {ψ : ClauseSet V} {C : Finset (Literal W)} :
    C ∈ relabel f ψ ↔ ∃ C' ∈ ψ, Finset.image (Prod.map f id) C' = C

    The clauses of ψ.relabel f are the images of the clauses of ψ.

    theorem Cslib.Logic.PL.ClauseSet.card_le_of_mem_relabel {V : Type u_1} {W : Type u_2} [DecidableEq W] {f : V → W} {ψ : ClauseSet V} {k : ℕ} (hψ : ∀ C ∈ ψ, C.card ≤ k) {C : Finset (Literal W)} (hC : C ∈ relabel f ψ) :
    C.card ≤ k

    Relabelling does not widen clauses: if every clause of ψ has at most k literals, so does every clause of ψ.relabel f.