One-way-liveness proof: Wiring #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/Automata/Wiring.lean
Module and namespace names, imports, and formatting are adapted to complexitylib.
The machine definitions are shared through Models.FiniteAutomaton.Defs.
A perfect matching of ports, represented by a symmetric fixed-point-free relation.
- link : P → P → Prop
The symmetric relation pairing the ports.
Instances For
An assignment obeys all wire equalities.
Equations
- a.Compatible color = ∀ (x y : P), a.link x y → color x = color y
Instances For
Two-color constraints remember an entire matching, not just rank or connectivity among one side of its ports.
A finite connected graph with degrees at most two has at most two leaves. The proof uses the degree-sum formula and the edge-count bound for a connected graph.
In a finite connected graph of maximum degree two, a leaf has exactly one other leaf.
Passing to a connected component preserves every vertex degree.
Maximum degree two makes the reachable boundary pairing unique, even when other connected components are cycles.
Contract all path components onto their boundary. The degree assumptions are precisely degree one at the exposed ports and degree zero or two elsewhere. Closed components disappear.
Equations
Instances For
Edge-compatible colors are constant along any finite path.
Every compatible boundary coloring extends through the wiring. This justifies replacing a cell's wiring by its boundary matching.
Keep the two copies of the interface separate and join them by edges. This subdivision avoids parallel edges without changing boundary paths.
Instances For
Embed the external ports into the disjoint union of two glued diagrams.
Equations
Instances For
Boolean boundary behavior composes as ordinary relational composition.
The perfect matching given by a fixed-point-free involution.
Equations
- Complexity.FiniteAutomaton.Pairing.ofInvolution f hf hn = { link := fun (x y : P) => f x = y, symm := ⋯, irrefl := ⋯, unique := ⋯ }
Instances For
A rectangular permutation diagram; arbitrary equivalences also allow renumbering finite port sets without changing the underlying diagram.
Equations
Instances For
The pairing that connects each left port to its equal right port.
Equations
Instances For
The Boolean equality semantics is faithful even for a single pair.