Documentation

Cslib.Computability.Languages.LanguageHom

Language homomorphism #

structure Language.Hom (α : Type u_3) (β : Type u_4) :
Type (max u_3 u_4)

A language homomorphism from α to β is a map from List α to List β which preserves the empty word [] and concatenation (· ++ ·).

Instances For
    theorem Language.Hom.ext_iff {α : Type u_3} {β : Type u_4} {x y : Hom α β} :
    x = y x.toFun = y.toFun
    theorem Language.Hom.ext {α : Type u_3} {β : Type u_4} {x y : Hom α β} (toFun : x.toFun = y.toFun) :
    x = y
    @[instance_reducible]
    instance Language.instFunLikeHomList {α : Type u_1} {β : Type u_2} :
    FunLike (Hom α β) (List α) (List β)

    This is to support the function application notation for language homomorphisms.

    Equations
    theorem Language.Hom.ext_iff' {α : Type u_1} {β : Type u_2} (f f' : Hom α β) :
    f = f' ∀ (as : List α), f as = f' as
    @[simp]
    theorem Language.Hom.map_nil {α : Type u_1} {β : Type u_2} (f : Hom α β) :
    f [] = []
    @[simp]
    theorem Language.Hom.map_append {α : Type u_1} {β : Type u_2} (f : Hom α β) (as as' : List α) :
    f (as ++ as') = f as ++ f as'
    theorem Language.Hom.map_cons {α : Type u_1} {β : Type u_2} (f : Hom α β) (a : α) (as : List α) :
    f (a :: as) = f [a] ++ f as
    def Language.Hom.liftAux {α : Type u_1} {β : Type u_2} (f : αList β) :
    Hom α β

    This auxiliary function should not be used outside this file. Instead, use the equivalence lift below.

    Equations
    Instances For
      theorem Language.Hom.liftAux_eq_flatMap {α : Type u_1} {β : Type u_2} (f : αList β) :
      theorem Language.Hom.listAux_left_inv {α : Type u_1} {β : Type u_2} (f : αList β) :
      (fun (f : Hom α β) (a : α) => f [a]) (liftAux f) = f
      theorem Language.Hom.listAux_right_inv {α : Type u_1} {β : Type u_2} (f : Hom α β) :
      (liftAux fun (a : α) => f [a]) = f
      def Language.Hom.lift {α : Type u_1} {β : Type u_2} :
      (αList β) Hom α β

      An equivalence from f : α → List β to Hom α β, whose forward direction can be used to define language homomorphisms conveniently.

      Equations
      Instances For
        theorem Language.Hom.lift_eq_flatMap {α : Type u_1} {β : Type u_2} (f : αList β) :

        lift.toFun is in fact List.flatMap.

        def Language.image {α : Type u_1} {β : Type u_2} (f : List αList β) (l : Language α) :

        The image of a language under a function f, which need not be a language homomorphism.

        Equations
        Instances For
          def Language.preimage {α : Type u_1} {β : Type u_2} (f : List αList β) (l : Language β) :

          The preimage of a language under a function f, which need not be a language homomorphism.

          Equations
          Instances For
            @[simp]
            theorem Language.mem_image {α : Type u_1} {β : Type u_2} (f : List αList β) (l : Language α) (bs : List β) :
            bs image f l asl, f as = bs
            @[simp]
            theorem Language.mem_preimage {α : Type u_1} {β : Type u_2} (f : List αList β) (l : Language β) (as : List α) :
            as preimage f l f as l
            theorem Language.image_singleton {α : Type u_1} {β : Type u_2} (f : List αList β) (as : List α) :
            image f {as} = {f as}
            @[simp]
            theorem Language.image_zero {α : Type u_1} {β : Type u_2} (f : List αList β) :
            image f 0 = 0
            theorem Language.image_add {α : Type u_1} {β : Type u_2} (f : List αList β) (l1 l2 : Language α) :
            image f (l1 + l2) = image f l1 + image f l2
            theorem Language.image_iSup {α : Type u_1} {β : Type u_2} (f : List αList β) {I : Type u_3} (l : ILanguage α) :
            image f (⨆ (i : I), l i) = ⨆ (i : I), image f (l i)

            The following distributive laws for the image operation requires the function f to be a language homomorphism.

            theorem Language.image_one {α : Type u_1} {β : Type u_2} (f : Hom α β) :
            image (⇑f) 1 = 1
            theorem Language.image_mul {α : Type u_1} {β : Type u_2} (f : Hom α β) (l1 l2 : Language α) :
            image (⇑f) (l1 * l2) = image (⇑f) l1 * image (⇑f) l2
            theorem Language.image_pow {α : Type u_1} {β : Type u_2} (f : Hom α β) (l : Language α) (n : ) :
            image (⇑f) (l ^ n) = image (⇑f) l ^ n
            theorem Language.image_kstar {α : Type u_1} {β : Type u_2} (f : Hom α β) (l : Language α) :
            image (⇑f) (KStar.kstar l) = KStar.kstar (image (⇑f) l)