Documentation

Complexitylib.Models.FiniteAutomaton.OneWayLiveness.Internal.PathNFA

One-way-liveness proof: PathNFA #

Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a. Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/Automata/PathNFA.lean

Module and namespace names, imports, and formatting are adapted to complexitylib. The machine definitions are shared through Models.FiniteAutomaton.Defs.

A nondeterministic automaton on an arbitrary state type.

Instances For
    @[reducible, inline]

    A position on the endmarked word and a nondeterministic control state.

    Equations
    Instances For
      def Complexity.FiniteAutomaton.NMachineOn.Step {Alpha Q : Type} (M : NMachineOn Alpha Q) (w : List Alpha) (c c' : Config w) :

      One nondeterministic transition on the scanned input symbol.

      Equations
      Instances For
        def Complexity.FiniteAutomaton.NMachineOn.Accepts {Alpha Q : Type} (M : NMachineOn Alpha Q) (positive : Bool) (w : List Alpha) :

        Existence of a finite run reaching an accepting control state.

        Equations
        Instances For
          def Complexity.FiniteAutomaton.NMachineOn.relabel {Alpha Q : Type} (M : NMachineOn Alpha Q) {n : ℕ} (e : Q ≃ Fin n) :
          NMachine Alpha n

          Number the states using an equivalence, preserving transitions and endmarkers.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Complexity.FiniteAutomaton.NMachineOn.relabel_accepts {Alpha Q : Type} (M : NMachineOn Alpha Q) {n : ℕ} (e : Q ≃ Fin n) (positive : Bool) (w : List Alpha) :
            (M.relabel e).Accepts positive w ↔ M.Accepts positive w
            theorem Complexity.FiniteAutomaton.NMachineOn.relabel_noLeft {Alpha Q : Type} (M : NMachineOn Alpha Q) {n : ℕ} (e : Q ≃ Fin n) (hm : ∀ (q : Q) (b : Symbol Alpha) (q' : Q), (q', Move.left) ∉ M.transition q b) :
            @[reducible, inline]

            none is the initial state. Boolean states are accept and reject.

            Equations
            Instances For
              @[reducible, inline]

              A path state recording the current relation-product endpoint.

              Equations
              Instances For
                @[reducible, inline]

                The distinguished accepting state of the relation-product automaton.

                Equations
                Instances For

                  Choose a start vertex, follow relation edges, and accept at the right endmarker.

                  Equations
                  Instances For

                    The one-way endmarker automaton for nonempty relation products.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Complexity.FiniteAutomaton.PathNFA.product_path {H : Type} (w : List (BRel H)) (a b : H) :
                      w.prod.holds a b ↔ ∃ (p : ℕ → H), p 0 = a ∧ p w.length = b ∧ ∀ (i : ℕ) (hi : i < w.length), w[i].holds (p i) (p (i + 1))

                      A numbered path through a product, extended arbitrarily after its endpoint.

                      The accumulated product on every prefix reached by a path state.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Complexity.FiniteAutomaton.PathNFA.scanned_letter_data {H : Type} (w : List (BRel H)) (i : Fin (w.length + 2)) (R : BRel H) (hs : scanned w i = Symbol.letter R) :
                        ∃ (hi : ↑i - 1 < w.length), w[↑i - 1] = R
                        theorem Complexity.FiniteAutomaton.PathNFA.good_step {H : Type} (w : List (BRel H)) (c c' : NMachineOn.Config w) (hg : Good w c) (hs : machine.Step w c c') :
                        Good w c'
                        theorem Complexity.FiniteAutomaton.small_nfa (h : ℕ) :
                        ∃ (N : NMachine (Alphabet h) (h + 3)), N.NoLeft ∧ ∀ (positive : Bool), N.Recognizes positive (oneWayLiveness h)

                        The explicit path automaton has h+3 states, including the unused rejector. It accepts only after at least two transitions, so both conventions agree.