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.
Edges of all crossing and stay candidates, together with all outward slots. Every outward slot is an edge to its own external leaf.
Equations
- Complexity.FiniteAutomaton.CellNetwork.Edge Q n = (Fin (n + 1) × Complexity.FiniteAutomaton.CellNetwork.Slot Q ⊕ Fin (n + 2) × Q × Q ⊕ Bool × Complexity.FiniteAutomaton.CellNetwork.Slot Q)
Instances For
All cell incidences, together with the external boundary incidences.
Equations
Instances For
Locate an oriented incidence in its cell, or at its external leaf.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.FiniteAutomaton.CellNetwork.edgeInc Q n (Sum.inl (j, slot), b) = if (slot.1 ^^ b) = true then Sum.inl (j.castSucc, Sum.inl (true, slot)) else Sum.inl (j.succ, Sum.inl (false, slot))
- Complexity.FiniteAutomaton.CellNetwork.edgeInc Q n (Sum.inr (Sum.inl (i, pq)), b) = Sum.inl (i, Sum.inr (pq, b))
Instances For
Recover the edge and endpoint corresponding to an incidence.
Equations
- Complexity.FiniteAutomaton.CellNetwork.incEdge Q n (Sum.inl (i, Sum.inl (false, slot))) = if h : ↑i = 0 then (Sum.inr (Sum.inr (false, slot)), true) else (Sum.inl (⟨↑i - 1, ⋯⟩, slot), slot.1)
- Complexity.FiniteAutomaton.CellNetwork.incEdge Q n (Sum.inl (i, Sum.inl (true, slot))) = if h : ↑i = n + 1 then (Sum.inr (Sum.inr (true, slot)), true) else (Sum.inl (⟨↑i, ⋯⟩, slot), !slot.1)
- Complexity.FiniteAutomaton.CellNetwork.incEdge Q n (Sum.inl (i, Sum.inr (pq, b))) = (Sum.inr (Sum.inl (i, pq)), b)
- Complexity.FiniteAutomaton.CellNetwork.incEdge Q n (Sum.inr (s, slot)) = (Sum.inr (Sum.inr (s, slot)), false)
Instances For
A complete proposed successor, including its source and target state.
Equations
Instances For
The incidence associated with the source of a potential transition.
Equations
- Complexity.FiniteAutomaton.CellNetwork.sourceInc Q (Complexity.FiniteAutomaton.Move.left, p, q) = Sum.inl (false, false, p, q)
- Complexity.FiniteAutomaton.CellNetwork.sourceInc Q (Complexity.FiniteAutomaton.Move.stay, p, q) = Sum.inr ((p, q), false)
- Complexity.FiniteAutomaton.CellNetwork.sourceInc Q (Complexity.FiniteAutomaton.Move.right, p, q) = Sum.inl (true, true, p, q)
Instances For
Attach an enabled transition to its source state; otherwise leave it unattached.
Equations
- Complexity.FiniteAutomaton.CellNetwork.sourceAttach M b k = if M.transition k.2.1 b = some (k.2.2, k.1) then Sum.inl k.2.1 else Sum.inr (Complexity.FiniteAutomaton.CellNetwork.sourceInc Q k)
Instances For
Only the side facing away from the input is outward.
Equations
Instances For
The external test slot connecting the initial state to the selected final state.
Instances For
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
An edge is uniquely determined by the cell, move and states of its source proposal, or by its outward slot.
Equations
- Complexity.FiniteAutomaton.CellNetwork.edgeKey Q n (Sum.inl (j, true, p, q)) = Sum.inl (j.castSucc, Complexity.FiniteAutomaton.Move.right, p, q)
- Complexity.FiniteAutomaton.CellNetwork.edgeKey Q n (Sum.inl (j, false, p, q)) = Sum.inl (j.succ, Complexity.FiniteAutomaton.Move.left, p, q)
- Complexity.FiniteAutomaton.CellNetwork.edgeKey Q n (Sum.inr (Sum.inl (i, p, q))) = Sum.inl (i, Complexity.FiniteAutomaton.Move.stay, p, q)
- Complexity.FiniteAutomaton.CellNetwork.edgeKey Q n (Sum.inr (Sum.inr z)) = Sum.inr z
Instances For
Local vertices in each cell, together with the external test ports.
Equations
Instances For
Map source keys and external incidences into the global vertex set.
Equations
Instances For
The target vertex of a transition or external boundary edge.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.FiniteAutomaton.CellNetwork.destination M finish w (Sum.inl (j, true, _p, q)) = Sum.inl (j.succ, Sum.inl q)
- Complexity.FiniteAutomaton.CellNetwork.destination M finish w (Sum.inl (j, false, _p, q)) = Sum.inl (j.castSucc, Sum.inl q)
- Complexity.FiniteAutomaton.CellNetwork.destination M finish w (Sum.inr (Sum.inl (i, _p, q))) = Sum.inl (i, Sum.inl q)
Instances For
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
The graph vertex associated with each cell or boundary incidence.
Equations
- Complexity.FiniteAutomaton.CellNetwork.wholeVertex M finish w (Sum.inl (i, j)) = Sum.inl (i, Complexity.FiniteAutomaton.CellNetwork.localVertex M finish (Complexity.FiniteAutomaton.scanned w i) j)
- Complexity.FiniteAutomaton.CellNetwork.wholeVertex M finish w (Sum.inr z) = Sum.inr z
Instances For
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
Choose a cyclic order for every local-vertex incidence fiber.
Equations
Instances For
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
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
State configurations embed without identifying any added leaves.