Langlib

Langlib.Classes.RecursivelyEnumerable.Closure.Bijection

RE Closure Under Terminal Bijection #

This file proves closure of recursively enumerable languages under bijective renaming of terminals.

The key construction is bijection_grammar, which maps terminals in all rule components via an equivalence π : T₁ ≃ T₂. The main result bijection_grammar_language shows that this grammar generates exactly the π-image of the original language. This is then used by the context-free and context-sensitive bijection proofs via commutativity with their respective embeddings.

Main declarations #

def map_symbol {T₁ T₂ N : Type} (π : T₁ T₂) :
symbol T₁ Nsymbol T₂ N

Map a symbol along a terminal equivalence, leaving nonterminals unchanged.

Equations
Instances For
    def map_symbol_inv {T₁ T₂ N : Type} (π : T₁ T₂) :
    symbol T₂ Nsymbol T₁ N

    Map a symbol back along the inverse equivalence.

    Equations
    Instances For
      def map_symbol_fn {T₁ T₂ N : Type} (f : T₁T₂) :
      symbol T₁ Nsymbol T₂ N

      Map terminals along an arbitrary function, leaving nonterminals unchanged.

      Equations
      Instances For
        @[simp]
        theorem map_symbol_fn_comp {T₁ T₂ N : Type} (f : T₁T₂) (g : T₂T₁) (s : symbol T₁ N) :
        @[simp]
        theorem map_symbol_fn_leftInverse {T₁ T₂ N : Type} {f : T₁T₂} {g : T₂T₁} (hfg : Function.LeftInverse g f) (s : symbol T₁ N) :
        @[simp]
        theorem map_symbol_inv_map_symbol {T₁ T₂ N : Type} (π : T₁ T₂) (s : symbol T₁ N) :
        @[simp]
        theorem map_symbol_map_symbol_inv {T₁ T₂ N : Type} (π : T₁ T₂) (s : symbol T₂ N) :
        def bijection_grule {T₁ T₂ N : Type} (π : T₁ T₂) (r : grule T₁ N) :
        grule T₂ N

        Map an unrestricted grammar rule along a terminal equivalence.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def bijection_grammar {T₁ T₂ : Type} (g : grammar T₁) (π : T₁ T₂) :
          grammar T₂

          Map an unrestricted grammar along a terminal equivalence.

          Equations
          Instances For
            def map_grammar {T₁ T₂ : Type} (g : grammar T₁) (f : T₁T₂) :
            grammar T₂

            Map an unrestricted grammar along an arbitrary terminal map.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem bijection_grammar_language {T₁ T₂ : Type} (g : grammar T₁) (π : T₁ T₂) :

              The bijection grammar generates exactly the π-image of the original language. This is the core result from which all class-specific bijection closure theorems are derived.

              theorem map_grammar_language_of_leftInverse {T₁ T₂ : Type} (g : grammar T₁) {f : T₁T₂} {g' : T₂T₁} (hfg : Function.LeftInverse g' f) :

              If g is a left inverse of f, mapping an unrestricted grammar along f generates exactly the Language.map f image of the original language.

              theorem RE_of_map_injective_RE {T₁ T₂ : Type} [Nonempty T₁] {f : T₁T₂} (hf : Function.Injective f) (L : Language T₁) :
              is_RE Lis_RE ((Language.map f) L)

              RE languages are closed under injective terminal maps.

              theorem RE_of_bijemap_RE {T₁ T₂ : Type} (π : T₁ T₂) (L : Language T₁) :
              is_RE Lis_RE (L.bijemapLang π)

              The class of RE languages is closed under bijective terminal renaming.

              theorem RE_of_bijemap_RE_rev {T₁ T₂ : Type} (π : T₁ T₂) (L : Language T₁) :
              is_RE (L.bijemapLang π)is_RE L

              The converse direction.

              @[simp]
              theorem RE_bijemap_iff_RE {T₁ T₂ : Type} (π : T₁ T₂) (L : Language T₁) :

              A language is RE iff its image under a bijection of terminal alphabets is RE.