Langlib

Langlib.Classes.Indexed.Basics.FiniteAlphabet

Finite terminal support for indexed languages #

Every indexed grammar has finitely many rules, and every rule has a finite right-hand side. Therefore each generated word uses only terminals from a finite set syntactically present in the grammar. This file packages that fact as a finite-alphabet restriction theorem.

The terminals appearing in an indexed production rule.

Equations
Instances For

    The finite terminal support syntactically mentioned by an indexed grammar.

    Equations
    Instances For
      def IndexedGrammarFiniteAlphabet.restrictRhsOfSupported {T N F : Type} (S : Finset T) (rhs : List (IRhsSymbol T N F)) (h : rhsSupported S rhs) :
      List (IRhsSymbol { t : T // t S } N F)
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The same indexed grammar, with terminals restricted to the finite set appearing in rules.

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

            A derivation from the start symbol mentions only terminals syntactically present in the indexed grammar's rules.

            Every word generated by an indexed grammar is supported by the finite terminal set occurring in its rules.

            Restrict a language to words over a finite terminal set.

            Equations
            Instances For

              The restricted indexed grammar generates exactly the finite-alphabet restriction.

              Any indexed grammar language is an image of an indexed language over a finite subtype of its terminal alphabet.

              Any ε-free indexed grammar language is an image of an ε-free indexed language over a finite subtype of its terminal alphabet.

              theorem is_Indexed_exists_finiteAlphabet_Indexed_image {T : Type} {L : Language T} (hL : is_Indexed L) :
              ∃ (S : Finset T) (L' : Language { t : T // t S }), is_Indexed L' (Language.map fun (t : { t : T // t S }) => t) L' = L

              Every indexed language is equivalent to an indexed language over a finite terminal subtype.

              theorem is_Indexed_exists_fintype_alphabet_Indexed_image {T : Type} {L : Language T} (hL : is_Indexed L) :
              ∃ (A : Type) (x : Fintype A) (x : DecidableEq A) (L' : Language A) (f : AT), is_Indexed L' (Language.map f) L' = L

              Every indexed language is equivalent to an indexed language over some finite terminal alphabet. The finite alphabet is represented as a type carrying Fintype and DecidableEq, together with a terminal map into the original alphabet.

              theorem is_Indexed_noEpsilon_exists_finiteAlphabet_Indexed_noEpsilon_image {T : Type} {L : Language T} (hL : is_Indexed_noEpsilon L) :
              ∃ (S : Finset T) (L' : Language { t : T // t S }), is_Indexed_noEpsilon L' (Language.map fun (t : { t : T // t S }) => t) L' = L

              Every ε-free indexed language is equivalent to an ε-free indexed language over a finite terminal subtype.

              Every ε-free indexed language is equivalent to an ε-free indexed language over some finite terminal alphabet.

              theorem is_Indexed_of_finiteAlphabet_Indexed_image {T : Type} {S : Finset T} {L' : Language { t : T // t S }} (hL' : is_Indexed L') :
              is_Indexed ((Language.map fun (t : { t : T // t S }) => t) L')

              The inclusion image of an indexed language over a finite subtype is indexed over the ambient alphabet.

              theorem is_Indexed_iff_exists_finiteAlphabet_Indexed_image {T : Type} {L : Language T} :
              is_Indexed L ∃ (S : Finset T) (L' : Language { t : T // t S }), is_Indexed L' (Language.map fun (t : { t : T // t S }) => t) L' = L

              A language is indexed iff it is the inclusion image of an indexed language over a finite terminal subtype.

              theorem is_Indexed_iff_exists_fintype_alphabet_Indexed_image {T : Type} {L : Language T} :
              is_Indexed L ∃ (A : Type) (x : Fintype A) (x : DecidableEq A) (L' : Language A) (f : AT), is_Indexed L' (Language.map f) L' = L

              A language is indexed iff it is the image of an indexed language over some finite terminal alphabet.

              theorem is_Indexed_finite_terminal_support {T : Type} {L : Language T} (hL : is_Indexed L) :
              ∃ (S : Finset T), wL, tw, t S

              Every indexed language has finite terminal support.