Documentation

LeanPool.StallingsFolding.InverseAutomaton

Finite inverse automata and subgroup membership #

A finite graph with inverse-labelled edges and at most one outgoing edge of each label from each vertex is represented by its partial transition map. This file proves that the labels of loops at a chosen basepoint form a subgroup of the free group, and that membership in this subgroup is exactly a finite traversal test on the canonical reduced word.

@[reducible, inline]

A letter in the rank-two free group, with a Boolean recording orientation.

Equations
Instances For
    @[reducible, inline]

    A word in the signed generators a, b, a⁻¹, and b⁻¹.

    Equations
    Instances For
      @[reducible, inline]

      The free group on two generators.

      Equations
      Instances For

        Reverse the orientation of a letter.

        Equations
        Instances For

          The inverse word, obtained by reversing and inverting its letters.

          Equations
          Instances For

            Interpret a signed word as an element of the free group.

            Equations
            Instances For

              Interpret one signed generator as an element of the free group.

              Equations
              Instances For
                @[simp]
                @[simp]
                structure Stallings.InverseAutomaton (V : Type u_1) :
                Type u_1

                A deterministic graph whose edges come in inverse-labelled pairs.

                The transition function is partial: none means that no edge with that label leaves the given vertex.

                • base : V

                  The vertex at which accepted loops start and end.

                • next : V → Letter → Option V

                  The target of a labelled edge, when that edge exists.

                • inverse_next {v : V} {x : Letter} {w : V} : self.next v x = some w → self.next w (letterInv x) = some v
                Instances For
                  def Stallings.InverseAutomaton.run {V : Type u_1} (G : InverseAutomaton V) (v : V) :
                  Word → Option V

                  Execute a word from a starting state, stopping if a required edge is absent.

                  Equations
                  Instances For
                    @[simp]
                    theorem Stallings.InverseAutomaton.run_nil {V : Type u_1} (G : InverseAutomaton V) (v : V) :
                    G.run v [] = some v
                    inductive Stallings.InverseAutomaton.Walk {V : Type u_1} (G : InverseAutomaton V) :
                    V → Word → V → Prop

                    A labelled path in an inverse automaton.

                    Instances For
                      theorem Stallings.InverseAutomaton.run_eq_some_iff_walk {V : Type u_1} (G : InverseAutomaton V) {v z : V} {w : Word} :
                      G.run v w = some z ↔ G.Walk v w z

                      The executable traversal returns an endpoint exactly when the corresponding path exists.

                      theorem Stallings.InverseAutomaton.Walk.append {V : Type u_1} (G : InverseAutomaton V) {v u t : V} {w₁ w₂ : Word} (h₁ : G.Walk v w₁ u) (h₂ : G.Walk u w₂ t) :
                      G.Walk v (w₁ ++ w₂) t

                      Concatenate two paths whose endpoints match.

                      theorem Stallings.InverseAutomaton.Walk.invRev {V : Type u_1} (G : InverseAutomaton V) {v u : V} {w : Word} (h : G.Walk v w u) :
                      G.Walk u (wordInv w) v

                      Reversing a path and inverting every label gives the reverse path.

                      theorem Stallings.InverseAutomaton.run_append {V : Type u_1} (G : InverseAutomaton V) (v : V) (u z : Word) :
                      G.run v (u ++ z) = (G.run v u).bind fun (t : V) => G.run t z

                      Traversal distributes over concatenation of words.

                      theorem Stallings.InverseAutomaton.run_success_cancel {V : Type u_1} (G : InverseAutomaton V) (v : V) (pre suffix : Word) (x : Letter) {z : V} (h : G.run v (pre ++ x :: letterInv x :: suffix) = some z) :
                      G.run v (pre ++ suffix) = some z

                      A successful traversal remains successful after cancelling a letter pair.

                      theorem Stallings.InverseAutomaton.run_success_of_red_step {V : Type u_1} (G : InverseAutomaton V) (v : V) {w z : Word} (h : FreeGroup.Red.Step w z) {t : V} (hRun : G.run v w = some t) :
                      G.run v z = some t

                      A successful traversal remains successful under one free-reduction step.

                      theorem Stallings.InverseAutomaton.run_success_of_red {V : Type u_1} (G : InverseAutomaton V) (v : V) {w z : Word} (h : FreeGroup.Red w z) {t : V} (hRun : G.run v w = some t) :
                      G.run v z = some t

                      A successful traversal remains successful after any sequence of free reductions.

                      theorem Stallings.InverseAutomaton.run_success_of_reduction {V : Type u_1} (G : InverseAutomaton V) (v : V) (w : Word) {t : V} (hRun : G.run v w = some t) :

                      A successful traversal remains successful on the canonical reduced word.

                      The subgroup represented by all loops at the basepoint.

                      Equations
                      Instances For

                        Membership in the loop subgroup is decided by traversing the canonical reduced word.

                        Equations
                        Instances For

                          Executable subgroup-membership test for a finite inverse automaton.

                          Equations
                          Instances For