Documentation

LeanPool.MatchingLogic.Sorted

MatchingLogic.Sorted #

A many-sorted finitary signature.

  • Srt : Type

    The type of sorts.

  • Sym : Type

    The type of operation symbols.

  • arity : self.Sym

    The number of arguments of each operation symbol.

  • argSort (σ : self.Sym) : Fin (self.arity σ)self.Srt

    The sort of each argument position.

  • resSort : self.Symself.Srt

    The result sort of each operation symbol.

Instances For
    inductive MatchingLogic.Sorted.MPattern (S : MSignature) (Var : Type) :
    S.SrtType

    Patterns, indexed by their sort. ex x s' φ binds x AT SORT s' inside a pattern φ of sort s; the bound sort need not be the sort of the body, and in Proposition 30 it is not.

    Instances For
      @[reducible, inline]
      abbrev MatchingLogic.Sorted.MPattern.nt {S : MSignature} {Var : Type} {s : S.Srt} (φ : MPattern S Var s) :
      MPattern S Var s

      Sorted negation.

      Equations
      Instances For
        @[reducible, inline]
        abbrev MatchingLogic.Sorted.MPattern.and {S : MSignature} {Var : Type} {s : S.Srt} (φ ψ : MPattern S Var s) :
        MPattern S Var s

        Sorted conjunction.

        Equations
        Instances For
          @[reducible, inline]
          abbrev MatchingLogic.Sorted.MPattern.orP {S : MSignature} {Var : Type} {s : S.Srt} (φ ψ : MPattern S Var s) :
          MPattern S Var s

          Sorted disjunction.

          Equations
          Instances For
            @[reducible, inline]
            abbrev MatchingLogic.Sorted.MPattern.iff {S : MSignature} {Var : Type} {s : S.Srt} (φ ψ : MPattern S Var s) :
            MPattern S Var s

            Sorted biconditional.

            Equations
            Instances For
              @[reducible, inline]
              abbrev MatchingLogic.Sorted.MPattern.al {S : MSignature} {Var : Type} {s : S.Srt} (x : Var) (s' : S.Srt) (φ : MPattern S Var s) :
              MPattern S Var s

              Sorted universal quantification.

              Equations
              Instances For

                A many-sorted model: a nonempty carrier per sort, and each symbol interpreted from its argument sorts to subsets of its result sort.

                Instances For
                  @[reducible, inline]
                  abbrev MatchingLogic.Sorted.MVal {S : MSignature} (M : MModel S) (Var : Type) :

                  A sorted valuation.

                  Equations
                  Instances For
                    noncomputable def MatchingLogic.Sorted.mupdate {S : MSignature} {Var : Type} (M : MModel S) (ρ : MVal M Var) (s' : S.Srt) (x : Var) (a : M.carrier s') :
                    MVal M Var

                    Updating a sorted valuation at one variable of one sort. This is the only place the sort indexing costs anything: the new value has sort s', so it can only be installed at sort s', and the equality has to be transported.

                    Equations
                    Instances For
                      def MatchingLogic.Sorted.MModel.app {S : MSignature} (M : MModel S) (σ : S.Sym) (A : (i : Fin (S.arity σ)) → Set (M.carrier (S.argSort σ i))) :
                      Set (M.carrier (S.resSort σ))

                      The pointwise extension of a symbol, at its sorts.

                      Equations
                      Instances For
                        theorem MatchingLogic.Sorted.mdenote_al {S : MSignature} {Var : Type} (M : MModel S) (ρ : MVal M Var) {s : S.Srt} (x : Var) (s' : S.Srt) (φ : MPattern S Var s) :
                        mdenote M ρ (MPattern.al x s' φ) = ⋂ (a : M.carrier s'), mdenote M (mupdate M ρ s' x a) φ

                        The denotation clause for sorted universal quantification.

                        theorem MatchingLogic.Sorted.MModel.app_eq_empty {S : MSignature} (M : MModel S) (σ : S.Sym) (A : (i : Fin (S.arity σ)) → Set (M.carrier (S.argSort σ i))) (i : Fin (S.arity σ)) (h : A i = ) :
                        M.app σ A =

                        A many-sorted symbol application is empty if one argument is empty.

                        def MatchingLogic.Sorted.MModel.Sat {S : MSignature} {Var : Type} (M : MModel S) {s : S.Srt} (φ : MPattern S Var s) :

                        M ⊨ φ: φ is total at its own sort under every valuation.

                        Equations
                        Instances For
                          def MatchingLogic.Sorted.MModel.SatSetHet {S : MSignature} {Var : Type} (M : MModel S) (Γ : Set ((s : S.Srt) × MPattern S Var s)) :

                          M ⊨ Γ for a HETEROGENEOUS theory: a set of sorted patterns, each total at its own sort. This is the paper's notion — nothing there requires the members of a theory to share a sort.

                          Equations
                          Instances For
                            def MatchingLogic.Sorted.MModel.SatSet {S : MSignature} {Var : Type} (M : MModel S) {s : S.Srt} (Γ : Set (MPattern S Var s)) :

                            M ⊨ Γ for a theory whose members all have one sort. A convenience: it is what Proposition 30 needs, since its Γ is a singleton of sort a. It is a special case of SatSetHet, not a different notion — satSetHet_homogeneous below records that.

                            Equations
                            Instances For
                              theorem MatchingLogic.Sorted.satSetHet_homogeneous {S : MSignature} {Var : Type} (M : MModel S) {s : S.Srt} (Γ : Set (MPattern S Var s)) :
                              M.SatSet Γ M.SatSetHet {p : (s : S.Srt) × MPattern S Var s | γΓ, p = s, γ}

                              The homogeneous notion is the heterogeneous one restricted to a single sort. Without this the restriction in SatSet would be silent, and an audit flagged exactly that.

                              def MatchingLogic.Sorted.MGlobalCons {S : MSignature} {Var : Type} { : S.Srt} (Γ : Set (MPattern S Var )) (φ : MPattern S Var ) :

                              Γ ⊨ φ, where Γ and φ may live at DIFFERENT sorts -- which is exactly the situation Proposition 30 exploits.

                              Equations
                              Instances For
                                def MatchingLogic.Sorted.MGlobalConsHet {S : MSignature} {Var : Type} (Γ : Set ((s : S.Srt) × MPattern S Var s)) { : S.Srt} (φ : MPattern S Var ) :

                                Global consequence from a heterogeneous theory.

                                Equations
                                Instances For

                                  The signature of Proposition 30 #

                                  Three sorts, b, a, c.

                                  Instances For
                                    @[instance_reducible]
                                    Equations

                                    Two symbols, f : ba and g : bc.

                                    Instances For
                                      @[instance_reducible]
                                      Equations
                                      @[reducible, inline]

                                      The signature of Proposition 30. Note NO symbol has an argument of sort a; that is what the non-derivability half will turn on.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        @[reducible, inline]
                                        abbrev MatchingLogic.Sorted.Γ3 {Var : Type} (x y : Var) :

                                        Γ = {∀x:b ∀y:b. f(x ∧ y)}, a theory of sort a.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          @[reducible, inline]
                                          abbrev MatchingLogic.Sorted.φ3 {Var : Type} (x y : Var) :

                                          φ = ∀x:b ∀y:b. (g(x) ↔ g(y)), a pattern of sort c.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Proposition 30, semantic half #

                                            @[reducible, inline]

                                            The singleton model used for satisfiability in Proposition 30.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              theorem MatchingLogic.Sorted.Γ3_satisfiable {Var : Type} (x y : Var) :
                                              ∃ (M : MModel S3), M.SatSet (Γ3 x y)

                                              Γ is satisfiable. Take every carrier a singleton and f, g total.

                                              theorem MatchingLogic.Sorted.Γ3_entails_φ3 {Var : Type} (x y : Var) (hxy : x y) :
                                              MGlobalCons (Γ3 x y) (φ3 x y)

                                              Γ ⊨ φ.

                                              The paper: if M_b had distinct r, s, the valuation with ρ(x) = r, ρ(y) = s gives ρ(x ∧ y) = ∅, and symbols propagate , so ρ(f(x ∧ y)) = ∅, which is not M_a because carriers are nonempty. Hence M_b is a singleton, every valuation sends x and y to the same element, and ρ(g(x) ↔ g(y)) = M_c for every ρ.