Documentation

CategorialAlgebras.Preliminaries.Substitution

Substitutions #

A sorted assignment of terms to variables extends to a homomorphism between free algebras. Assignments given by a family use the valuation-family equivalence of word positions. The family API also allows positions whose sorts have been changed by a map.

General substitutions #

def CategorialAlgebras.Term.substHom {S : Type u} {sig : Signature S} {X : S → Type w} {Y : S → Type x} (f : SortedSet.Map X (Term sig Y)) :
(algebra sig X).Hom (algebra sig Y)

Substitution as a homomorphism of free algebras.

Equations
Instances For
    def CategorialAlgebras.Term.subst {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) :
    Term sig Y s

    Substitute $f_s(x)$ for every occurrence of the variable $x$.

    Equations
    Instances For
      @[simp]
      theorem CategorialAlgebras.Term.subst_var {S : Type u} {sig : Signature S} {X : S → Type w} {Y : S → Type x} (f : SortedSet.Map X (Term sig Y)) {s : S} (a : X s) :
      subst f (var a) = f s a

      Substitution on a variable is the assigned term.

      @[simp]
      theorem CategorialAlgebras.Term.subst_app {S : Type u} {sig : Signature S} {X : S → Type w} {Y : S → Type x} (f : SortedSet.Map X (Term sig Y)) {a : List S} {s : S} (σ : sig a s) (t : Word.Family (Term sig X) a) :
      subst f (app σ t) = app σ fun (j : Fin a.length) => subst f (t j)

      Substitution preserves operation nodes.

      @[simp]
      theorem CategorialAlgebras.Term.subst_id {S : Type u} {sig : Signature S} {X : S → Type w} {s : S} (t : Term sig X s) :
      subst (fun (x : S) (x_1 : X x) => var x_1) t = t

      Substitution of the variables themselves is the identity.

      theorem CategorialAlgebras.Term.subst_comp {S : Type u} {sig : Signature S} {X : S → Type w} {Y : S → Type x} {Z : S → Type y} (f : SortedSet.Map X (Term sig Y)) (g : SortedSet.Map Y (Term sig Z)) {s : S} (t : Term sig X s) :
      subst g (subst f t) = subst (fun (s : S) (x : X s) => subst g (f s x)) t

      Substitutions compose by substituting in their assigned terms.

      Substitutions specified by families #

      def CategorialAlgebras.Term.substFamily {S : Type u} {sig : Signature S} {X : S → Type w} {R : Type z} {φ : R → S} {a : List R} (q : Word.Family (fun (r : R) => Term sig X (φ r)) a) {s : S} (t : Term sig (Word.MappedVariables φ a) s) :
      Term sig X s

      Substitution specified by a family indexed by a word, possibly with changed sorts.

      Equations
      Instances For
        @[simp]
        theorem CategorialAlgebras.Term.subst_family_var {S : Type u} {sig : Signature S} {X : S → Type w} {R : Type z} {φ : R → S} {a : List R} (q : Word.Family (fun (r : R) => Term sig X (φ r)) a) (j : Fin a.length) :

        Family substitution sends the variable at position $j$ to the $j$th term.

        @[simp]
        theorem CategorialAlgebras.Term.subst_family_positions {S : Type u} {sig : Signature S} {R : Type z} {φ : R → S} {a : List R} {s : S} (t : Term sig (Word.MappedVariables φ a) s) :
        substFamily (fun (j : Fin a.length) => var (Word.mappedVariable φ a j)) t = t

        Substitution of the positional variables themselves fixes every term.

        theorem CategorialAlgebras.Term.subst_subst_family {S : Type u} {sig : Signature S} {X : S → Type w} {Y : S → Type x} {R : Type z} {φ : R → S} {a : List R} (q : Word.Family (fun (r : R) => Term sig X (φ r)) a) (g : SortedSet.Map X (Term sig Y)) {s : S} (t : Term sig (Word.MappedVariables φ a) s) :
        subst g (substFamily q t) = substFamily (fun (j : Fin a.length) => subst g (q j)) t

        Substituting after a family substitution substitutes in each member of the family.

        theorem CategorialAlgebras.Term.subst_family_comp {S : Type u} {sig : Signature S} {X : S → Type w} {a b : List S} (q : Word.Family (Term sig (Word.Variables b)) a) (r : Word.Family (Term sig X) b) {s : S} (t : Term sig (Word.Variables a) s) :
        substFamily r (substFamily q t) = substFamily (fun (j : Fin a.length) => substFamily r (q j)) t

        The composition rule $R^\sharp(Q^\sharp(P))=(R^\sharp(Q_j))_j^\sharp(P)$.