Documentation

Linglib.Logic.Orthologic.Basic

Orthologic #

[UPSTREAM] candidate.

This file defines orthologic, the logic of ortholattices, and proves Goldblatt's least orthologic sound and complete for them. An orthologic is a consequence relation on formulas built from ⊤, ¬ and ∧ satisfying Goldblatt's ten rules, and its Lindenbaum–Tarski algebra, formulas modulo interderivability, is an ortholattice. Evaluating in that algebra under the canonical valuation shows that a consequence holding in every ortholattice is derivable, following Holliday and Mandelkern's presentation.

Main definitions #

Main results #

Implementation notes #

The Lindenbaum–Tarski algebra is Antisymmetrization F (· ≤ ·) for the consequence preorder, mathlib's free functor from preorders to partial orders, so the quotient and its order come for free. It is built once for any orthologic, and the epistemic orthologic of Logic/Orthologic/EpistemicOrthologic.lean reuses it.

References #

Syntax #

inductive Orthologic.Formula (Var : Type u_1) :
Type u_1

Formulas of orthologic over a variable type Var, with disjunction and falsum defined ([HM24] Definition 3.9).

Instances For
    def Orthologic.Formula.or {Var : Type u_1} (φ ψ : Formula Var) :

    Disjunction is De Morgan's φ ∨ ψ := ¬(¬φ ∧ ¬ψ).

    Equations
    Instances For
      def Orthologic.Formula.bot {Var : Type u_1} :

      Falsum is ¬⊤.

      Equations
      Instances For

        The proof system #

        inductive Orthologic.Derivable {Var : Type u_1} :
        Formula Var → Formula Var → Prop

        Consequence φ ⊢ ψ in the least orthologic is generated by Goldblatt's ten rules: ⊤-introduction, reflexivity, the two ∧-projections, double-negation introduction and elimination, non-contradiction φ ∧ ¬φ ⊢ ψ, cut, ∧-introduction, and contraposition ([HM24] Definition 3.12).

        Instances For
          def Orthologic.«term_⊢_» :
          Lean.TrailingParserDescr

          Consequence φ ⊢ ψ in the least orthologic is generated by Goldblatt's ten rules: ⊤-introduction, reflexivity, the two ∧-projections, double-negation introduction and elimination, non-contradiction φ ∧ ¬φ ⊢ ψ, cut, ∧-introduction, and contraposition ([HM24] Definition 3.12).

          Equations
          • Orthologic.«term_⊢_» = Lean.ParserDescr.trailingNode `Orthologic.«term_⊢_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊢ ") (Lean.ParserDescr.cat `term 51))
          Instances For

            Orthologics and their Lindenbaum–Tarski algebras #

            class Orthologic.IsOrthologic (F : Type u_1) [Preorder F] [Top F] [Min F] [Compl F] :

            A consequence preorder on formulas with ⊤, ⊓ and ᶜ is an orthologic when it satisfies Goldblatt's rules, reflexivity and cut being the preorder axioms. On Formula Var this is the notion of an orthologic of [HM24] Definition 3.12.

            • le_top (φ : F) : φ ≤ ⊤
            • inf_le_left (φ ψ : F) : φ ⊓ ψ ≤ φ
            • inf_le_right (φ ψ : F) : φ ⊓ ψ ≤ ψ
            • le_compl_compl (φ : F) : φ ≤ φᶜᶜ
            • compl_compl_le (φ : F) : φᶜᶜ ≤ φ
            • inf_compl_le (φ ψ : F) : φ ⊓ φᶜ ≤ ψ
            • le_inf {φ ψ χ : F} : φ ≤ ψ → φ ≤ χ → φ ≤ ψ ⊓ χ
            • compl_le_compl {φ ψ : F} : φ ≤ ψ → ψᶜ ≤ φᶜ
            Instances
              @[reducible, inline]
              abbrev Orthologic.LindenbaumTarski (F : Type u_1) [Preorder F] :
              Type u_1

              The Lindenbaum–Tarski algebra of a consequence preorder is the type of formulas modulo interderivability, the Antisymmetrization of the preorder. It is an ortholattice when the preorder is an orthologic.

              Equations
              Instances For
                def Orthologic.IsOrthologic.sup {F : Type u_1} [Min F] [Compl F] (φ ψ : F) :
                F

                Disjunction is De Morgan's φ ∨ ψ := ¬(¬φ ∧ ¬ψ).

                Equations
                Instances For
                  theorem Orthologic.IsOrthologic.inf_mono {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] {φ φ' ψ ψ' : F} (h₁ : φ ≤ φ') (h₂ : ψ ≤ ψ') :
                  φ ⊓ ψ ≤ φ' ⊓ ψ'
                  theorem Orthologic.IsOrthologic.le_sup_left {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] (φ ψ : F) :
                  φ ≤ sup φ ψ
                  theorem Orthologic.IsOrthologic.le_sup_right {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] (φ ψ : F) :
                  ψ ≤ sup φ ψ
                  theorem Orthologic.IsOrthologic.sup_le {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] {φ ψ χ : F} (h₁ : φ ≤ χ) (h₂ : ψ ≤ χ) :
                  sup φ ψ ≤ χ
                  theorem Orthologic.IsOrthologic.sup_mono {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] {φ φ' ψ ψ' : F} (h₁ : φ ≤ φ') (h₂ : ψ ≤ ψ') :
                  sup φ ψ ≤ sup φ' ψ'
                  theorem Orthologic.LindenbaumTarski.mk_le_mk {F : Type u_1} [Preorder F] {φ ψ : F} :
                  toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) φ ≤ toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) ψ ↔ φ ≤ ψ

                  ⟦φ⟧ ≤ ⟦ψ⟧ in the Lindenbaum–Tarski algebra iff φ ≤ ψ.

                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instMin {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :
                  Equations
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instMax {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :
                  Equations
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instCompl {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :
                  Equations
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instTop {F : Type u_1} [Preorder F] [Top F] :
                  Equations
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instBot {F : Type u_1} [Preorder F] [Top F] [Compl F] :
                  Equations
                  @[simp]
                  theorem Orthologic.LindenbaumTarski.mk_inf {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] (φ ψ : F) :
                  toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) (φ ⊓ ψ) = toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) φ ⊓ toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) ψ
                  @[simp]
                  theorem Orthologic.LindenbaumTarski.mk_compl {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] (φ : F) :
                  toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) φᶜ = (toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) φ)ᶜ
                  @[simp]
                  theorem Orthologic.LindenbaumTarski.mk_top {F : Type u_1} [Preorder F] [Top F] :
                  toAntisymmetrization (fun (x1 x2 : F) => x1 ≤ x2) ⊤ = ⊤
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instLattice {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :
                  Lattice (LindenbaumTarski F)
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instBoundedOrder {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :
                  BoundedOrder (LindenbaumTarski F)
                  Equations
                  @[instance_reducible]
                  instance Orthologic.LindenbaumTarski.instInvolutiveCompl {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :
                  Equations
                  instance Orthologic.LindenbaumTarski.instIsOrtholattice {F : Type u_1} [Preorder F] [Top F] [Min F] [Compl F] [IsOrthologic F] :

                  The Lindenbaum–Tarski algebra of an orthologic is an ortholattice.

                  The least orthologic #

                  @[instance_reducible]
                  instance Orthologic.Formula.instTop {Var : Type u_1} :
                  Top (Formula Var)

                  The connectives share the symbols of the lattice operations, as in [HM24].

                  Equations
                  @[instance_reducible]
                  instance Orthologic.Formula.instMin {Var : Type u_1} :
                  Min (Formula Var)
                  Equations
                  @[instance_reducible]
                  instance Orthologic.Formula.instCompl {Var : Type u_1} :
                  Compl (Formula Var)
                  Equations
                  @[instance_reducible]
                  instance Orthologic.Formula.instPreorder {Var : Type u_1} :
                  Preorder (Formula Var)

                  Consequence in the least orthologic is a preorder, reflexivity and cut.

                  Equations

                  Evaluation, soundness and completeness #

                  def Orthologic.Formula.eval {Var : Type u_1} {L : Type u_2} [Lattice L] [BoundedOrder L] [InvolutiveCompl L] (v : Var → L) :
                  Formula Var → L

                  The value of a formula in an ortholattice under a valuation v : Var → L ([HM24] Definition 3.10).

                  Equations
                  Instances For
                    @[simp]
                    theorem Orthologic.Formula.eval_top {Var : Type u_1} {L : Type u_2} [Lattice L] [BoundedOrder L] [InvolutiveCompl L] (v : Var → L) :
                    eval v ⊤ = ⊤
                    @[simp]
                    theorem Orthologic.Formula.eval_var {Var : Type u_1} {L : Type u_2} [Lattice L] [BoundedOrder L] [InvolutiveCompl L] (v : Var → L) (p : Var) :
                    eval v (var p) = v p
                    @[simp]
                    theorem Orthologic.Formula.eval_compl {Var : Type u_1} {L : Type u_2} [Lattice L] [BoundedOrder L] [InvolutiveCompl L] (v : Var → L) (φ : Formula Var) :
                    eval v φᶜ = (eval v φ)ᶜ
                    @[simp]
                    theorem Orthologic.Formula.eval_inf {Var : Type u_1} {L : Type u_2} [Lattice L] [BoundedOrder L] [InvolutiveCompl L] (v : Var → L) (φ ψ : Formula Var) :
                    eval v (φ ⊓ ψ) = eval v φ ⊓ eval v ψ
                    theorem Orthologic.sound {Var : Type u_1} {L : Type u_2} [Lattice L] [BoundedOrder L] [InvolutiveCompl L] [IsOrtholattice L] {φ ψ : Formula Var} (h : Derivable φ ψ) (v : Var → L) :

                    Derivable consequences hold in every ortholattice under every valuation ([HM24] Theorem 3.13, soundness).

                    The canonical valuation into the Lindenbaum–Tarski algebra sends p to its class.

                    Equations
                    Instances For
                      theorem Orthologic.Formula.eval_canonicalVal {Var : Type u_1} (φ : Formula Var) :
                      eval canonicalVal φ = toAntisymmetrization (fun (x1 x2 : Formula Var) => x1 ≤ x2) φ

                      Under the canonical valuation every formula evaluates to its own class.

                      theorem Orthologic.complete {Var : Type u} {φ ψ : Formula Var} (h : ∀ {L : Type u} [inst : Lattice L] [inst_1 : BoundedOrder L] [inst_2 : InvolutiveCompl L] [IsOrtholattice L] (v : Var → L), Formula.eval v φ ≤ Formula.eval v ψ) :
                      Derivable φ ψ

                      A consequence holding in every ortholattice under every valuation is derivable, by evaluating in the Lindenbaum–Tarski algebra under the canonical valuation ([HM24] Theorem 3.13, completeness). Ortholattices in Var's universe suffice.

                      theorem Orthologic.derivable_iff {Var : Type u} {φ ψ : Formula Var} :
                      Derivable φ ψ ↔ ∀ {L : Type u} [inst : Lattice L] [inst_1 : BoundedOrder L] [inst_2 : InvolutiveCompl L] [IsOrtholattice L] (v : Var → L), Formula.eval v φ ≤ Formula.eval v ψ

                      Derivability is consequence in every ortholattice ([HM24] Theorem 3.13).