Documentation

CategorialAlgebras.Preliminaries.Derivor

Derivors #

A derivor changes sorts and interprets each operation as a term in the translated positions of its input word. It transforms free algebras, translates terms, and commutes with substitution. Many-sorted signatures of fixed sort and symbol universes form a category.

structure CategorialAlgebras.Derivor {S : Type u} {T : Type u'} (sig : Signature S) (tau : Signature T) :
Type (max (max (max u u') v) v')

A derivor sends sorts to sorts and symbols to terms in the corresponding positions.

  • sortMap : S → T

    The map of sorts.

  • image {a : List S} {s : S} : sig a s → Term tau (Word.MappedVariables self.sortMap a) (self.sortMap s)

    The term interpreting each symbol, with one variable for each input position.

Instances For

    Transformed algebras and translation #

    theorem CategorialAlgebras.Derivor.ext {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} {c d : Derivor sig tau} (h : c.sortMap = d.sortMap) (hi : @image S T sig tau c ≍ @image S T sig tau d) :
    c = d

    Equality of derivors is equality of the sort maps and of their dependent symbol images.

    def CategorialAlgebras.Derivor.transformed {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) (X : T → Type w) :

    The transformed free algebra interprets symbols by substituting into their images.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def CategorialAlgebras.Derivor.substHom {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : T → Type w} {Y : T → Type x} (f : SortedSet.Map X (Term tau Y)) :

      Substitution is a homomorphism between the transformed free algebras.

      Formally stronger than the informal statement. Informally, it is stated for the substitution of a family of terms for the positional variables of a word; here it holds for every substitution between sorted sets of variables.

      Equations
      Instances For
        def CategorialAlgebras.Derivor.translateHom {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : S → Type w} {Y : T → Type x} (f : (s : S) → X s → Term tau Y (c.sortMap s)) :

        Algebraic extension of an assignment of translated terms to the source variables.

        Equations
        Instances For
          def CategorialAlgebras.Derivor.translate {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : S → Type w} {Y : T → Type x} (f : (s : S) → X s → Term tau Y (c.sortMap s)) {s : S} (t : Term sig X s) :
          Term tau Y (c.sortMap s)

          Translation of a term with an arbitrary assignment for its variables.

          Equations
          Instances For
            @[simp]
            theorem CategorialAlgebras.Derivor.translate_var {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : S → Type w} {Y : T → Type x} (f : (s : S) → X s → Term tau Y (c.sortMap s)) {s : S} (a : X s) :
            c.translate f (Term.var a) = f s a

            Translation sends a variable to its assigned translated term.

            @[simp]
            theorem CategorialAlgebras.Derivor.translate_app {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : S → Type w} {Y : T → Type x} (f : (s : S) → X s → Term tau Y (c.sortMap s)) {a : List S} {s : S} (σ : sig a s) (t : Word.Family (Term sig X) a) :
            c.translate f (Term.app σ t) = Term.substFamily (fun (j : Fin a.length) => c.translate f (t j)) (c.image σ)

            Translation substitutes the translated arguments in the image of an operation.

            theorem CategorialAlgebras.Derivor.subst_translate {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : S → Type w} {Y : T → Type x} {Z : T → Type y} (f : (s : S) → X s → Term tau Y (c.sortMap s)) (g : SortedSet.Map Y (Term tau Z)) {s : S} (t : Term sig X s) :
            Term.subst g (c.translate f t) = c.translate (fun (s : S) (x : X s) => Term.subst g (f s x)) t

            Target substitutions commute with translation by substituting in its variable assignment.

            theorem CategorialAlgebras.Derivor.translate_subst {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {X : S → Type w} {Y : S → Type x} {Z : T → Type y} (f : SortedSet.Map X (Term sig Y)) (g : (s : S) → Y s → Term tau Z (c.sortMap s)) {s : S} (t : Term sig X s) :
            c.translate g (Term.subst f t) = c.translate (fun (s : S) (x : X s) => c.translate g (f s x)) t

            Translating a source substitution translates all the terms assigned to variables.

            def CategorialAlgebras.Derivor.positionMap {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {R : Type y} (φ : R → S) (a : List R) (s : S) :

            Translate a context of positions along the sort map, preserving each position.

            Equations
            Instances For
              def CategorialAlgebras.Derivor.translateWord {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) (a : List S) {s : S} (t : Term sig (Word.Variables a) s) :

              Translation $c^\sharp$ on the positional variables of a word.

              Equations
              Instances For
                @[simp]
                theorem CategorialAlgebras.Derivor.translate_word_var {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) (a : List S) (j : Fin a.length) :

                Word translation preserves the variable at each position.

                theorem CategorialAlgebras.Derivor.translate_word_app {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) (a : List S) {b : List S} {s : S} (σ : sig b s) (t : Word.Family (Term sig (Word.Variables a)) b) :
                c.translateWord a (Term.app σ t) = Term.substFamily (fun (j : Fin b.length) => c.translateWord a (t j)) (c.image σ)

                Word translation has the operation equation specified by substitution in symbol images.

                @[reducible, inline]
                abbrev CategorialAlgebras.Derivor.identity {S : Type u} (sig : Signature S) :
                Derivor sig sig

                The identity derivor interprets a symbol by applying it to its positional variables.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[reducible, inline]
                  abbrev CategorialAlgebras.Derivor.comp {S : Type u} {T : Type u'} {U : Type u''} {sig : Signature S} {tau : Signature T} {ups : Signature U} (c : Derivor sig tau) (d : Derivor tau ups) :
                  Derivor sig ups

                  The composite interprets each source symbol by translating its first image.

                  Equations
                  Instances For

                    Substitution and composition laws #

                    theorem CategorialAlgebras.Derivor.translate_subst_family {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {R : Type y} {φ : R → S} {a : List R} {X : S → Type w} {Y : T → Type x} (q : Word.Family (fun (r : R) => Term sig X (φ r)) a) (f : (s : S) → X s → Term tau Y (c.sortMap s)) {s : S} (t : Term sig (Word.MappedVariables φ a) s) :
                    c.translate f (Term.substFamily q t) = Term.substFamily (fun (j : Fin a.length) => c.translate f (q j)) (c.translate (c.positionMap φ a) t)

                    Translation commutes with a substitution specified by a family of terms.

                    theorem CategorialAlgebras.Derivor.translate_word_subst_family {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {a b : List S} (q : Word.Family (Term sig (Word.Variables b)) a) {s : S} (t : Term sig (Word.Variables a) s) :

                    Translation on word variables commutes with substitutions specified by families.

                    theorem CategorialAlgebras.Derivor.translate_comp {S : Type u} {T : Type u'} {U : Type u''} {sig : Signature S} {tau : Signature T} {ups : Signature U} (c : Derivor sig tau) (d : Derivor tau ups) {X : S → Type w} {Y : T → Type x} {Z : U → Type y} (f : (s : S) → X s → Term tau Y (c.sortMap s)) (g : (t : T) → Y t → Term ups Z (d.sortMap t)) {s : S} (t : Term sig X s) :
                    (c.comp d).translate (fun (s : S) (x : X s) => d.translate g (f s x)) t = d.translate g (c.translate f t)

                    Translation by a composite is successive translation by its two derivors.

                    theorem CategorialAlgebras.Derivor.translate_identity {S : Type u} {sig : Signature S} {X : S → Type w} {Y : S → Type x} (f : SortedSet.Map X (Term sig Y)) {s : S} (t : Term sig X s) :

                    Translation by the identity derivor is ordinary substitution of its variable assignment.

                    @[simp]
                    theorem CategorialAlgebras.Derivor.translate_word_identity {S : Type u} {sig : Signature S} (a : List S) {s : S} (t : Term sig (Word.Variables a) s) :

                    The identity derivor fixes all terms in positional variables.

                    theorem CategorialAlgebras.Derivor.translate_symbol {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) {a : List S} {s : S} (σ : sig a s) :
                    c.translateWord a (Term.app σ fun (j : Fin a.length) => Term.var (Word.position a j)) = c.image σ

                    Translating the generic application of a symbol gives its image under the derivor.

                    @[simp]
                    theorem CategorialAlgebras.Derivor.identity_comp {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) :
                    (identity sig).comp c = c

                    The identity derivor is a left identity for composition.

                    @[simp]
                    theorem CategorialAlgebras.Derivor.comp_identity {S : Type u} {T : Type u'} {sig : Signature S} {tau : Signature T} (c : Derivor sig tau) :
                    c.comp (identity tau) = c

                    The identity derivor is a right identity for composition.

                    theorem CategorialAlgebras.Derivor.comp_assoc {S : Type u} {T : Type u'} {U : Type u''} {V : Type u'''} {sig : Signature S} {tau : Signature T} {ups : Signature U} {xi : Signature V} (c : Derivor sig tau) (d : Derivor tau ups) (e : Derivor ups xi) :
                    (c.comp d).comp e = c.comp (d.comp e)

                    Composition of derivors is associative.

                    @[instance_reducible]

                    Many-sorted signatures and derivors form a category at fixed sort and symbol universes.

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