Documentation

CategorialAlgebras.Preliminaries.Word

Words, positions and valuations #

Words are List S; length, concatenation, occurrences and change of alphabet use List.length, List.append, List.count and List.map. A family indexed by a word always has one entry for each Fin w.length. Variables are positions, retaining their sorts.

Families and positional variables #

@[reducible, inline]
abbrev CategorialAlgebras.Word.Family {S : Type u} (A : S → Type w) (w : List S) :

Families $A_w$ indexed by the letters of a word $w$.

Equations
Instances For
    def CategorialAlgebras.Word.MappedVariables {S : Type u} {T : Type v} (φ : S → T) (w : List S) (t : T) :

    Positions of $w$ sorted by the images of their letters under $\varphi$. This is a cast-free presentation of the variables of w.map φ.

    Equations
    Instances For
      @[reducible, inline]
      abbrev CategorialAlgebras.Word.Variables {S : Type u} (w : List S) (t : S) :

      The sorted set $\downarrow w$ of positions of each sort in $w$.

      Equations
      Instances For
        def CategorialAlgebras.Word.mappedVariable {S : Type u} {T : Type v} (φ : S → T) (w : List S) (j : Fin w.length) :
        MappedVariables φ w (φ (w.get j))

        The variable at a specified position of $w$, after changing sorts.

        Equations
        Instances For
          @[reducible, inline]
          abbrev CategorialAlgebras.Word.position {S : Type u} (w : List S) (j : Fin w.length) :
          Variables w (w.get j)

          The variable at a specified position of $w$.

          Equations
          Instances For
            def CategorialAlgebras.Word.mappedVariablesEquiv {S : Type u} {T : Type v} (φ : S → T) (w : List S) (t : T) :

            The cast-free translated positions are equivalent to the positions of the mapped word.

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

              Valuations #

              def CategorialAlgebras.Word.valuation {S : Type u} {T : Type v} {φ : S → T} {w : List S} {A : T → Type z} (a : Family (fun (s : S) => A (φ s)) w) :

              A family determines the valuation sending each position to its entry.

              Equations
              Instances For
                @[simp]
                theorem CategorialAlgebras.Word.valuation_variable {S : Type u} {T : Type v} {φ : S → T} {w : List S} {A : T → Type z} (a : Family (fun (s : S) => A (φ s)) w) (j : Fin w.length) :
                valuation a (φ (w.get j)) (mappedVariable φ w j) = a j

                Evaluating a family valuation at a position returns that entry.

                def CategorialAlgebras.Word.valuationEquiv {S : Type u} {T : Type v} (φ : S → T) (w : List S) (A : T → Type z) :
                SortedSet.Map (MappedVariables φ w) A ≃ Family (fun (s : S) => A (φ s)) w

                Valuations of the positions are equivalent to families indexed by the word.

                Formally weaker than the informal statement. Informally, the positional variables of a word are also identified with standard variables; the library uses positional variables throughout and does not need that identification.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem CategorialAlgebras.Word.valuation_equiv_natural {S : Type u} {T : Type v} (φ : S → T) (w : List S) {A : T → Type w} {B : T → Type z} (f : SortedSet.Map A B) (a : SortedSet.Map (MappedVariables φ w) A) :
                  ((valuationEquiv φ w B) fun (t : T) (x : MappedVariables φ w t) => f t (a t x)) = fun (j : Fin w.length) => f (φ (w.get j)) ((valuationEquiv φ w A) a j)

                  The valuation-family equivalence is natural in its target sorted set.