Documentation

MyProject.Hom

Morphisms between DFAs #

This file defines morphisms between DFAs, which are bundled functions between the state spaces that respect the transition function, start state, and accept states of the DFAs.

We then define a partial order on AccessibleFinDFAs where M ≤ N iff there exists a surjective morphism from N.toDFA to M.toDFA.

Main definitions #

Main theorems #

Notation #

Blueprint #

structure DFA.Hom {α : Type u} {σ₁ : Type v} {σ₂ : Type w} (M : DFA α σ₁) (N : DFA α σ₂) :
Type (max v w)

A morphism of DFAs from M to N.

  • toFun : σ₁σ₂

    Underlying function map from states of M to states of N.

  • map_start : self.toFun M.start = N.start

    The function preserves the start state.

  • map_accept (q : σ₁) : q M.accept self.toFun q N.accept

    The function preserves the set of accepting states.

  • map_step (q : σ₁) (w : List α) : self.toFun (M.evalFrom q w) = N.evalFrom (self.toFun q) w

    The function preserves state transitions.

Instances For

    M →ₗ N denotes the type of DFA.Hom M N.

    Equations
    Instances For
      theorem DFA.Hom.pres_lang {α : Type u} {σ₁ : Type v} {σ₂ : Type w} {M : DFA α σ₁} {N : DFA α σ₂} (f : M →ₗ N) :

      A morphism of DFAs preserves the accepted language.

      def DFA.Hom.refl {α : Type u} {σ₁ : Type v} (M : DFA α σ₁) :
      M →ₗ M

      The identity morphism on a DFA.

      Equations
      • DFA.Hom.refl M = { toFun := id, map_start := , map_accept := , map_step := }
      Instances For
        structure DFA.Equiv {α : Type u} {σ₁ : Type v} {σ₂ : Type w} (M : DFA α σ₁) (N : DFA α σ₂) :
        Type (max v w)

        An equivalence of DFAs is a bijective morphism.

        Instances For

          M ≃ₗ N denotes the type of DFA.Equiv M N.

          Equations
          Instances For
            def DFA.Equiv.refl {α : Type u} {σ₁ : Type v} (M : DFA α σ₁) :
            M ≃ₗ M

            The identity equivalence on a DFA.

            Equations
            Instances For

              Surjective Morphisms of AccessibleFinDFAs #

              structure AccessibleFinDFA.HomSurj {α : Type u} {σ₁ : Type v} {σ₂ : Type w} (M : AccessibleFinDFA α σ₁) (N : AccessibleFinDFA α σ₂) extends M.toDFA →ₗ N.toDFA :
              Type (max v w)

              A surjective morphism between the underlying DFAs of AccessibleFinDFAs.

              Instances For
                def AccessibleFinDFA.HomSurj.toDFAHom {α : Type u} {σ₁ : Type v} {σ₂ : Type w} {M : AccessibleFinDFA α σ₁} {N : AccessibleFinDFA α σ₂} (f : M N) :

                Forget the surjectivity proof and view HomSurj as a DFA morphism.

                Equations
                Instances For

                  Partial Order on AccessibleFinDFAs #

                  def AccessibleFinDFA.le {α : Type u} {σ₁ : Type v} {σ₂ : Type w} (M : AccessibleFinDFA α σ₁) (N : AccessibleFinDFA α σ₂) :

                  The preorder on AccessibleFinDFAs: M ≤ N iff there is a surjective morphism N ↠ M.

                  Equations
                  Instances For

                    M ≤ N denotes the proposition le M N.

                    Equations
                    Instances For
                      theorem AccessibleFinDFA.le_refl {α : Type u} {σ₁ : Type v} (M : AccessibleFinDFA α σ₁) :
                      M M

                      Reflexivity of the preorder on AccessibleFinDFAs.

                      theorem AccessibleFinDFA.le_trans {α : Type u} {σ₁ : Type v} {σ₂ : Type w} {σ₃ : Type u_1} {M : AccessibleFinDFA α σ₁} {N : AccessibleFinDFA α σ₂} {O : AccessibleFinDFA α σ₃} (h₁ : M N) (h₂ : N O) :
                      M O

                      Transitivity of the preorder on AccessibleFinDFAs.

                      theorem AccessibleFinDFA.le_antisymm {α : Type u} {σ₁ : Type v} {σ₂ : Type w} (M : AccessibleFinDFA α σ₁) (N : AccessibleFinDFA α σ₂) (h₁ : M N) (h₂ : N M) :

                      Antisymmetry of the preorder up to equivalence of the underlying DFAs.

                      def AccessibleFinDFA.IsMinimal {α : Type u} {σ₁ : Type v} (M : AccessibleFinDFA α σ₁) :

                      An AccessibleFinDFA is minimal if every smaller DFA is equivalent to it.

                      Equations
                      Instances For