Documentation

Linglib.Logic.Natural.Monotonicity.Defs

Marked types for the monotonicity calculus #

This file defines the type system of the [IMT17] monotonicity calculus: simple types over a set of base types, with each arrow marked as monotone (+), antitone (−), or unmarked (·).

Main declarations #

References #

Markings #

A monotonicity marking ([IMT17] Definition 3.1) is a sign: 1 (+, monotone), -1 (−, antitone) or 0 (·, no information), composing as signs multiply.

def NaturalLogic.MarkingLE (m m' : SignType) :

The information order on markings: + ⊑ · and − ⊑ ·.

Equations
Instances For
    @[instance_reducible]
    Equations
    theorem NaturalLogic.MarkingLE.refl (m : SignType) :
    theorem NaturalLogic.MarkingLE.trans {a b c : SignType} (h₁ : MarkingLE a b) (h₂ : MarkingLE b c) :
    theorem NaturalLogic.MarkingLE.antisymm {a b : SignType} (h₁ : MarkingLE a b) (h₂ : MarkingLE b a) :
    a = b
    theorem NaturalLogic.markingLE_zero (m : SignType) :
    def NaturalLogic.markingSup (m m' : SignType) :
    SignType

    The join in the information order: a marking with itself, · otherwise.

    Equations
    Instances For
      @[simp]
      theorem NaturalLogic.markingSup_self (m : SignType) :
      markingSup m m = m

      Marked types #

      inductive NaturalLogic.Ty (B : Type u_1) :
      Type u_1

      Simple types over base types B, with marked arrows ([IMT17] Definition 3.1): arr σ m τ is the type of m-behaved functions from σ to τ.

      • base {B : Type u_1} : B → Ty B
      • arr {B : Type u_1} : Ty B → SignType → Ty B → Ty B
      Instances For
        def NaturalLogic.instDecidableEqTy.decEq {B✝ : Type u_1} [DecidableEq B✝] (x✝ x✝¹ : Ty B✝) :
        Decidable (x✝ = x✝¹)
        Equations
        Instances For
          @[instance_reducible]
          instance NaturalLogic.instDecidableEqTy {B✝ : Type u_1} [DecidableEq B✝] :
          DecidableEq (Ty B✝)
          Equations
          inductive NaturalLogic.Ty.LE {B : Type u_1} :
          Ty B → Ty B → Prop

          The subtyping order ([IMT17] Definition 3.2): contravariant in domains, covariant in codomains and markings, so that every +- or −-typed function can also be considered ·-typed.

          Instances For
            @[instance_reducible]
            instance NaturalLogic.Ty.instLE {B : Type u_1} :
            LE (Ty B)
            Equations
            theorem NaturalLogic.Ty.LE.refl {B : Type u_1} (σ : Ty B) :
            σ.LE σ
            theorem NaturalLogic.Ty.LE.trans {B : Type u_1} {σ τ μ : Ty B} :
            σ.LE τ → τ.LE μ → σ.LE μ
            theorem NaturalLogic.Ty.LE.antisymm {B : Type u_1} {σ τ : Ty B} :
            σ.LE τ → τ.LE σ → σ = τ
            @[instance_reducible]
            instance NaturalLogic.Ty.instPartialOrder {B : Type u_1} :
            PartialOrder (Ty B)
            Equations
            • One or more equations did not get rendered due to their size.
            @[simp]
            theorem NaturalLogic.Ty.base_le_base {B : Type u_1} {b b' : B} :
            base b ≤ base b' ↔ b = b'
            @[simp]
            theorem NaturalLogic.Ty.not_base_le_arr {B : Type u_1} {b : B} {σ τ : Ty B} {m : SignType} :
            ¬base b ≤ σ.arr m τ
            @[simp]
            theorem NaturalLogic.Ty.not_arr_le_base {B : Type u_1} {b : B} {σ τ : Ty B} {m : SignType} :
            ¬σ.arr m τ ≤ base b
            @[simp]
            theorem NaturalLogic.Ty.arr_le_arr {B : Type u_1} {σ σ' τ τ' : Ty B} {m m' : SignType} :
            σ.arr m τ ≤ σ'.arr m' τ' ↔ σ' ≤ σ ∧ τ ≤ τ' ∧ MarkingLE m m'
            @[irreducible]
            instance NaturalLogic.Ty.decidableLE {B : Type u_1} [DecidableEq B] (σ τ : Ty B) :
            Decidable (σ ≤ τ)
            Equations

            Compatibility join and marking erasure #

            def NaturalLogic.Ty.sup? {B : Type u_1} [DecidableEq B] :
            Ty B → Ty B → Option (Ty B)

            The partial join of compatible types ([IMT17] Definition 3.3): defined when the two types share their unmarked skeleton and their domains exactly, joining the markings along the codomain spine.

            Equations
            Instances For
              @[simp]
              theorem NaturalLogic.Ty.sup?_self {B : Type u_1} [DecidableEq B] (σ : Ty B) :
              σ.sup? σ = some σ
              theorem NaturalLogic.Ty.le_of_mem_sup?_left {B : Type u_1} [DecidableEq B] {σ τ μ : Ty B} :
              σ.sup? τ = some μ → σ ≤ μ

              Both compatible types lie below their join.

              def NaturalLogic.Ty.unmark {B : Type u_1} :
              Ty B → Ty B

              Erase the markings along the codomain spine ([IMT17] Definition 3.3, their σ̂).

              Equations
              Instances For
                theorem NaturalLogic.Ty.le_unmark {B : Type u_1} (σ : Ty B) :
                σ ≤ σ.unmark

                Every type embeds into its marking erasure.