Documentation

CslibFrontier.Logics.Propositional.Semantics

Algebraic semantics of propositions #

A valuation v : Atom → α of the atoms in a Heyting algebra α extends to every proposition (Cslib.Logic.PL.Proposition.eval): falsum is ⊥, conjunction is ⊓, disjunction is ⊔ and implication is the Heyting implication ⇨. Negation ¬A, defined as A → ⊥, is then the pseudo-complement A ⇨ ⊥. Heyting algebras are the algebraic models of intuitionistic propositional logic and Boolean algebras those of classical logic.

Truth tables are the instance α = Bool, whose equations are the Bool simp lemmas below. Mathlib's Prop is another instance: a Heyting algebra constructively and a Boolean algebra classically. The soundness of Frege proofs (Cslib.Logic.PL.Frege.IsProof.eval) and the Tseitin transformation (Cslib.Logic.PL.Proposition.tseitinCNF) are stated with the Bool instance.

Main definitions #

Main results #

def Cslib.Logic.PL.Proposition.eval {Atom : Type u_1} {α : Type u_2} [HeytingAlgebra α] (v : Atom → α) :
Proposition Atom → α

The value of a proposition in a Heyting algebra under a valuation v of its atoms.

def Cslib.Logic.PL.Proposition.atoms {Atom : Type u_1} :
Proposition Atom → List Atom

All atom occurrences appearing in a proposition.

theorem Cslib.Logic.PL.Proposition.eval_congr {Atom : Type u_1} {α : Type u_2} [HeytingAlgebra α] {v w : Atom → α} {A : Proposition Atom} (h : ∀ x ∈ A.atoms, v x = w x) :
eval v A = eval w A

Evaluating a proposition depends only on the values assigned to its atoms.

Truth tables #

@[simp]
theorem Cslib.Logic.PL.Proposition.eval_atom_bool {Atom : Type u_1} (v : Atom → Bool) (x : Atom) :
eval v (atom x) = v x
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_falsum_bool {Atom : Type u_1} (v : Atom → Bool) :
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_bot_bool {Atom : Type u_1} (v : Atom → Bool) :
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_and_bool {Atom : Type u_1} (v : Atom → Bool) (A B : Proposition Atom) :
eval v (A.and B) = (eval v A && eval v B)
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_or_bool {Atom : Type u_1} (v : Atom → Bool) (A B : Proposition Atom) :
eval v (A.or B) = (eval v A || eval v B)
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_imp_bool {Atom : Type u_1} (v : Atom → Bool) (A B : Proposition Atom) :
eval v (A.imp B) = (!eval v A || eval v B)

Propositions #

@[simp]
theorem Cslib.Logic.PL.Proposition.eval_atom_prop {Atom : Type u_1} (v : Atom → Prop) (x : Atom) :
eval v (atom x) = v x
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_falsum_prop {Atom : Type u_1} (v : Atom → Prop) :
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_and_prop {Atom : Type u_1} (v : Atom → Prop) (A B : Proposition Atom) :
eval v (A.and B) = (eval v A ∧ eval v B)
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_or_prop {Atom : Type u_1} (v : Atom → Prop) (A B : Proposition Atom) :
eval v (A.or B) = (eval v A ∨ eval v B)
@[simp]
theorem Cslib.Logic.PL.Proposition.eval_imp_prop {Atom : Type u_1} (v : Atom → Prop) (A B : Proposition Atom) :
eval v (A.imp B) = (eval v A → eval v B)
theorem Cslib.Logic.PL.Proposition.eval_prop_iff_eval_bool {Atom : Type u_1} (v : Atom → Prop) (A : Proposition Atom) [DecidablePred v] :
eval v A ↔ eval (fun (x : Atom) => decide (v x)) A = true

Truth tables decide propositions over Prop, classically: a proposition holds under a valuation in Prop exactly when it is true under the Boolean valuation that decides each atom.

theorem Cslib.Logic.PL.Proposition.eval_prop_of_forall_eval_bool {Atom : Type u_1} (A : Proposition Atom) (h : ∀ (w : Atom → Bool), eval w A = true) (v : Atom → Prop) :
eval v A

A truth-table tautology holds under every valuation in Prop. The proof decides each atom classically, so this is a statement about classical logic.