Langlib

Langlib.Utilities.ClosurePredicates

Abstract Closure Predicates for Language Classes #

This file defines predicates capturing common closure properties of language classes.

A language class P : Language α → Prop is closed under an operation if applying the operation to languages in P yields another language in P.

For same-alphabet operations (union, intersection, complement, concatenation, Kleene star, reversal, intersection/quotient with regular), closedness is expressed as a property of P : Language α → Prop.

For cross-alphabet operations (string homomorphism, ε-free homomorphism), closedness is expressed as a property of an alphabet-indexed predicate isP : ∀ {α : Type*}, Language α → Prop.

Main definitions #

def ClosedUnderUnion {α : Type u_1} (P : Language αProp) :

A language class is closed under union.

Equations
Instances For
    def ClosedUnderIntersection {α : Type u_1} (P : Language αProp) :

    A language class is closed under intersection.

    Equations
    Instances For
      def ClosedUnderComplement {α : Type u_1} (P : Language αProp) :

      A language class is closed under complement.

      Equations
      Instances For
        def ClosedUnderConcatenation {α : Type u_1} (P : Language αProp) :

        A language class is closed under concatenation.

        Equations
        Instances For
          def ClosedUnderKleeneStar {α : Type u_1} (P : Language αProp) :

          A language class is closed under Kleene star.

          Equations
          Instances For
            def ClosedUnderReverse {α : Type u_1} (P : Language αProp) :

            A language class is closed under language reversal.

            Equations
            Instances For

              A language class is closed under intersection with regular languages.

              Equations
              Instances For
                def ClosedUnderRightQuotient {α : Type u_1} (P : Language αProp) :

                A language class is closed under right quotient (with any language from the same class).

                Equations
                Instances For

                  A language class is closed under right quotient with regular languages.

                  Equations
                  Instances For
                    def ClosedUnderHomomorphism (isP : {α : Type} → [Fintype α] → Language αProp) :

                    A finite-alphabet-indexed language class is closed under string homomorphism.

                    Here isP is a predicate on languages that is uniform across finite alphabets. Note: Language.homomorphicImage works in universe Type, so isP ranges over Type.

                    Equations
                    Instances For
                      def ClosedUnderEpsFreeHomomorphism (isP : {α : Type} → [Fintype α] → Language αProp) :

                      A finite-alphabet-indexed language class is closed under ε-free string homomorphism.

                      Equations
                      Instances For
                        def ClosedUnderInverseHomomorphism (isP : {α : Type} → [Fintype α] → Language αProp) :

                        A finite-alphabet-indexed language class is closed under inverse string homomorphism.

                        The inverse homomorphic image of L : Language β under h : α → List β is { w : List α | w.flatMap h ∈ L }. Both alphabets are finite, matching the finite-alphabet convention used by the other cross-alphabet closure predicates.

                        Equations
                        Instances For
                          def ClosedUnderSubstitution (isP : {α : Type} → [Fintype α] → Language αProp) :

                          A finite-alphabet-indexed language class is closed under substitution.

                          Both alphabets are finite, matching the finite-alphabet convention used by the TM-recognizability bridge and the other cross-alphabet closure predicates.

                          Equations
                          Instances For

                            Strictness from property mismatch #

                            theorem strict_subset_of_subset_different_property {α : Type u_1} {P Q : Language αProp} {X : (Language αProp)Prop} (hsub : ∀ (L : Language α), P LQ L) (hX_iff : ∀ {R S : Language αProp}, (∀ (L : Language α), R L S L)X RX S) (hPX : X P) (hQnotX : ¬X Q) :

                            If P ⊆ Q, P has a class property X, Q does not, and X is invariant under pointwise equivalence of language classes, then the inclusion P ⊆ Q is strict.

                            The invariance hypothesis is necessary: an arbitrary predicate transformer X : (Language α → Prop) → Prop need not be transportable from P to an extensionally equal class.