Documentation

Cslib.Logics.Modal.Lean.Basic

Modal Logic for Lean #

This module develops the interplay between modal logic and Lean's propositional language, in order to enable the use of modal logic to reason about standard Lean relations using Prop.

@[reducible, inline]
abbrev Cslib.Logic.Modal.Model.ofPredicates {α : Type u_1} (r : ααProp) :
Model α (αProp)

Given a relation r on α, constructs the modal model whose worlds are elements of α and whose atoms are Lean predicates on α (α → Prop).

Valuation checks that a world satisfies a predicate. For example, under Model.ofPredicates r, □P at a : α means that P a' holds at every a' such that r a a'.

Equations
Instances For
    @[reducible, inline]
    abbrev Cslib.Logic.Modal.Model.ofContainers {α : Type u_1} {β : Type u_2} [Membership α β] (r : ααProp) :
    Model α β

    Given a relation r on α and a container type β for α (Membership α β), constructs the modal model whose worlds are elements of α and whose atoms are of type β.

    Valuation is membership. For example, under Model.ofContainers r, □b at a : α means that a' ∈ b holds for every a' such that r a a'.

    Equations
    Instances For
      @[reducible, inline]
      abbrev Cslib.Logic.Modal.Model.ofSets {α : Type u_1} (r : ααProp) :
      Model α (Set α)

      Abbreviation for Model.ofContainers where the container type is a Set.

      Equations
      Instances For
        theorem Cslib.Logic.Modal.Model.ofSets_eq_ofPredicates {α : Type u_1} (r : ααProp) :

        The set model and predicate model of a relation are definitionally equal.

        Models of Lean predicates #

        theorem Cslib.Logic.Modal.Satisfies.ofPredicates_atom_iff {α : Type u_1} {a : α} {P : αProp} (r : ααProp) :
        { m := Model.ofPredicates r, w := a, φ := Proposition.atom P } P a

        Under Model.ofPredicates r, an atomic proposition P holds at a iff P a.

        theorem Cslib.Logic.Modal.Satisfies.ofPredicates_preserves_iff {α : Type u_1} {P : αProp} (r : ααProp) :
        (∀ (a : α), { m := Model.ofPredicates r, w := a, φ := HasImp.imp (Proposition.atom P) (HasBox.box (Proposition.atom P)) }) Relation.Preserves r P

        Under Model.ofPredicates r, P → □P is an axiom iff r preserves P.

        @[reducible, inline]
        abbrev Cslib.Logic.Modal.Proposition.Equiv.OfPredicates {α : Type u_1} (r : ααProp) (φ₁ φ₂ : Proposition (αProp)) :

        Logical equivalence under Model.ofPredicates r.

        Equations
        Instances For
          @[reducible, inline]
          abbrev Cslib.Logic.Modal.Proposition.Equiv.OfContainers {α : Type u_1} {β : Type u_2} [Membership α β] (r : ααProp) (φ₁ φ₂ : Proposition β) :

          Logical equivalence under Model.ofContainers r.

          Equations
          Instances For

            Logically equivalent propositions under Equiv.OfPredicates r have the same denotation in the Lean modal model induced by ofPredicates r.

            theorem Cslib.Logic.Modal.Proposition.equivOfContainers_denotation_eq {β : Type u_1} {α : Type u_2} [Membership α β] {r : ααProp} {φ₁ φ₂ : Proposition β} :

            Logically equivalent propositions under Equiv.OfContainers r have the same denotation in the Lean modal model induced by ofContainers r.

            theorem Cslib.Logic.Modal.Proposition.equivOfPredicates_and {α : Type u_1} {r : ααProp} {P Q : αProp} :
            Congruence.r (Equiv.OfPredicates r) (atom fun (a : α) => P a Q a) (HasAnd.and (atom P) (atom Q))

            Pointwise conjunction of Lean predicates is logically equivalent to their modal conjunction in the Lean modal model induced by r.

            theorem Cslib.Logic.Modal.Proposition.ofContainers_inf_equiv {α : Type u_1} {β : Type u_2} [Membership α β] [Min β] (r : ααProp) (p q : β) (h : ∀ (x : α), x pq x p x q) :

            Under Equiv.OfContainers r, if membership in the infimum of two containers is equivalent to membership in both containers, then atomic infimum is logically equivalent to modal conjunction.

            theorem Cslib.Logic.Modal.Satisfies.ofPredicates_preserves_reflTransGen {α : Type u_1} {r : ααProp} {P : αProp} (h : ∀ (a : α), { m := Model.ofPredicates r, w := a, φ := HasImp.imp (Proposition.atom P) (HasBox.box (Proposition.atom P)) }) (a : α) :

            Invariants are preserved by the reflexive and transitive closure of the accessibility relation.