Documentation

Complexitylib.Models.FiniteAutomaton.OneWayLiveness.Internal.Network

One-way-liveness proof: Network #

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

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

@[reducible, inline]

Edges of all crossing and stay candidates, together with all outward slots. Every outward slot is an edge to its own external leaf.

Equations
Instances For
    @[reducible, inline]

    All cell incidences, together with the external boundary incidences.

    Equations
    Instances For

      The left or right endmarker position.

      Equations
      Instances For

        Locate an oriented incidence in its cell, or at its external leaf.

        Equations
        Instances For

          Recover the edge and endpoint corresponding to an incidence.

          Equations
          Instances For

            Identify edge endpoints with the full set of incidences.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[reducible, inline]

              A complete proposed successor, including its source and target state.

              Equations
              Instances For
                noncomputable def Complexity.FiniteAutomaton.CellNetwork.sourceAttach {Q Alpha : Type} (M : Machine Alpha Q) (b : Symbol Alpha) (k : Key Q) :

                Attach an enabled transition to its source state; otherwise leave it unattached.

                Equations
                Instances For
                  theorem Complexity.FiniteAutomaton.CellNetwork.sourceAttach_eq_state {Q Alpha : Type} (M : Machine Alpha Q) (b : Symbol Alpha) (k : Key Q) (p : Q) :
                  sourceAttach M b k = Sum.inl p ↔ k.2.1 = p ∧ M.transition p b = some (k.2.2, k.1)
                  def Complexity.FiniteAutomaton.CellNetwork.testSlot {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) :

                  The external test slot connecting the initial state to the selected final state.

                  Equations
                  Instances For
                    noncomputable def Complexity.FiniteAutomaton.CellNetwork.localVertex {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (b : Symbol Alpha) :

                    Attach enabled transitions and designated test ports to their local states.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[reducible, inline]

                      Local vertices in each cell, together with the external test ports.

                      Equations
                      Instances For
                        noncomputable def Complexity.FiniteAutomaton.CellNetwork.decorate {Q Alpha : Type} (M : Machine Alpha Q) (w : List Alpha) :
                        Fin (w.length + 2) × Key Q ⊕ Bool × Slot Q → Vertex Q w.length

                        Map source keys and external incidences into the global vertex set.

                        Equations
                        Instances For
                          noncomputable def Complexity.FiniteAutomaton.CellNetwork.destination {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) :
                          Edge Q w.length → Vertex Q w.length

                          The target vertex of a transition or external boundary edge.

                          Equations
                          Instances For
                            noncomputable def Complexity.FiniteAutomaton.CellNetwork.graph {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) :

                            The functional graph encoding the machine run and its test ports.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def Complexity.FiniteAutomaton.CellNetwork.wholeVertex {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) :

                              The graph vertex associated with each cell or boundary incidence.

                              Equations
                              Instances For
                                theorem Complexity.FiniteAutomaton.CellNetwork.graph_vertex {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) (d : Edge Q w.length × Bool) :
                                (graph M finish w).vertex d = wholeVertex M finish w (edgeInc Q w.length d)

                                The same local cyclic orders are used at every occurrence of a symbol.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Complexity.FiniteAutomaton.CellNetwork.wholePerm_pow {Q Alpha : Type} (w : List Alpha) (r : Symbol Alpha → Equiv.Perm (Incidence Q)) (n : ℕ) (i : Fin (w.length + 2)) (j : Incidence Q) :
                                  (wholePerm w r ^ n) (Sum.inl (i, j)) = Sum.inl (i, (r (scanned w i) ^ n) j)
                                  noncomputable def Complexity.FiniteAutomaton.CellNetwork.orders {Q Alpha : Type} (M : Machine Alpha Q) [Fintype Q] (finish : Q) (b : Symbol Alpha) :

                                  Choose a cyclic order for every local-vertex incidence fiber.

                                  Equations
                                  Instances For
                                    noncomputable def Complexity.FiniteAutomaton.CellNetwork.wholeOrder {Q Alpha : Type} (M : Machine Alpha Q) [Fintype Q] (finish : Q) (w : List Alpha) :

                                    Combine the local cyclic incidence orders over the whole input.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      noncomputable def Complexity.FiniteAutomaton.CellNetwork.graphOrder {Q Alpha : Type} (M : Machine Alpha Q) [Fintype Q] (finish : Q) (w : List Alpha) :
                                      (graph M finish w).Rotation

                                      Transport the incidence order to a rotation system on graph edge endpoints.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Complexity.FiniteAutomaton.CellNetwork.graphOrder_apply {Q Alpha : Type} (M : Machine Alpha Q) [Fintype Q] (finish : Q) (w : List Alpha) (d : Edge Q w.length × Bool) :
                                        edgeInc Q w.length ((graphOrder M finish w).perm d) = (wholeOrder M finish w).perm (edgeInc Q w.length d)

                                        State configurations embed without identifying any added leaves.

                                        Equations
                                        Instances For
                                          theorem Complexity.FiniteAutomaton.CellNetwork.graph_step_from_state {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) (c : Machine.Config w) (v : Vertex Q w.length) :
                                          (graph M finish w).Step (stateVertex w c) v ↔ ∃ (c' : Machine.Config w), v = stateVertex w c' ∧ M.Step w c c'
                                          theorem Complexity.FiniteAutomaton.CellNetwork.graph_reach_state {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) (c c' : Machine.Config w) :
                                          (graph M finish w).Reach (stateVertex w c) (stateVertex w c') ↔ Relation.ReflTransGen (M.Step w) c c'
                                          theorem Complexity.FiniteAutomaton.CellNetwork.graph_terminal {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) (t : Machine.Config w) (ht : M.transition t.2 (scanned w t.1) = none) (e : Edge Q w.length) :
                                          (graph M finish w).src e ≠ stateVertex w t
                                          theorem Complexity.FiniteAutomaton.CellNetwork.test_destination {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) (s : Bool) :
                                          (graph M finish w).dst (Sum.inr (Sum.inr (s, testSlot M finish))) = stateVertex w (outCell w.length s, if s = true then finish else M.initial)
                                          theorem Complexity.FiniteAutomaton.CellNetwork.test_step {Q Alpha : Type} (M : Machine Alpha Q) (finish : Q) (w : List Alpha) (s : Bool) :
                                          (graph M finish w).Step (Sum.inr (s, testSlot M finish)) (stateVertex w (outCell w.length s, if s = true then finish else M.initial))