OAI/Combinatorics/Automata/Wiring.lean
48 declarations, 0 contain sorry, 0 declared as axioms
- structure
OAI.OneWayLiveness.Pairingline 7 - def
OAI.OneWayLiveness.Pairing.mateline 15 - lemma
OAI.OneWayLiveness.Pairing.mate_linkline 16 - lemma
OAI.OneWayLiveness.Pairing.eq_mateline 17 - lemma
OAI.OneWayLiveness.Pairing.mate_involutiveline 19 - lemma
OAI.OneWayLiveness.Pairing.mate_neline 22 - lemma
OAI.OneWayLiveness.Pairing.link_iffline 25 - instance
OAI.OneWayLiveness.Pairing.(instance at line 27)line 27 - def
OAI.OneWayLiveness.Pairing.Compatibleline 36Source documentation
An assignment obeys all wire equalities.
def Compatible {C : Type*} (color : P → C) : Prop := … - def
OAI.OneWayLiveness.Pairing.connectedline 40Source documentation
The equivalence relation whose classes are the pairs.
def connected (x y : P) : Prop := x = y ∨ a.link x y
- lemma
OAI.OneWayLiveness.Pairing.connected_reflline 42 - lemma
OAI.OneWayLiveness.Pairing.connected_symmline 43 - lemma
OAI.OneWayLiveness.Pairing.connected_transline 47 - def
OAI.OneWayLiveness.Pairing.testColorline 55 - lemma
OAI.OneWayLiveness.Pairing.testColor_selfline 59 - lemma
OAI.OneWayLiveness.Pairing.compatible_testColorline 63 - lemma
OAI.OneWayLiveness.Pairing.eq_of_compatibleline 76Source documentation
Two-color constraints remember an entire matching, not just rank or connectivity among one side of its ports.
lemma eq_of_compatible {b : Pairing P} (h : ∀ c : P → Bool, a.Compatible c ↔ b.Compatible c) : a = b := by …Mentions: OAI.OneWayLiveness.Pairing
- lemma
OAI.OneWayLiveness.FiniteWiring.leaves_card_le_twoline 102Source documentation
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.
lemma leaves_card_le_two [DecidableRel G.Adj] (hc : G.Connected) (hd : ∀ v, G.degree v ≤ 2) : (Finset.univ.filter fun v => G.degree v = 1).card ≤ 2 := by … - lemma
OAI.OneWayLiveness.FiniteWiring.unique_other_leafline 123Source documentation
In a finite connected graph of maximum degree two, a leaf has exactly one other leaf.
lemma unique_other_leaf [DecidableRel G.Adj] (hc : G.Connected) (hd : ∀ v, G.degree v ≤ 2) (x : V) (hx : G.degree x = 1) : ∃! y : V, y ≠ x ∧ G.degree y = 1 := by … - lemma
OAI.OneWayLiveness.FiniteWiring.component_degreeline 146Source documentation
Passing to a connected component preserves every vertex degree.
lemma component_degree [DecidableRel G.Adj] (C : G.ConnectedComponent) [Fintype C] [DecidableRel C.toSimpleGraph.Adj] (v : C) : C.toSimpleGraph.degree v = G.degree v.val := by … - lemma
OAI.OneWayLiveness.FiniteWiring.unique_reachable_leafline 162Source documentation
Maximum degree two makes the reachable boundary pairing unique, even when other connected components are cycles.
lemma unique_reachable_leaf [DecidableRel G.Adj] (hd : ∀ v, G.degree v ≤ 2) (x : V) (hx : G.degree x = 1) : ∃! y : V, y ≠ x ∧ G.degree y = 1 ∧ G.Reachable x y := by … - def
OAI.OneWayLiveness.FiniteWiring.boundaryPairingline 194Source documentation
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.
noncomputable def boundaryPairing {P : Type*} (port : P ↪ V) [DecidableRel G.Adj] (hd : ∀ v, G.degree v ≤ 2) (hb : ∀ v, G.degree v = 1 ↔ ∃ p, port p = v) : Pairing P where …Mentions: OAI.OneWayLiveness.Pairing
- lemma
OAI.OneWayLiveness.FiniteWiring.color_eq_of_reachableline 215Source documentation
Edge-compatible colors are constant along any finite path.
lemma color_eq_of_reachable {C : Type*} (color : V → C) (hc : ∀ x y, G.Adj x y → color x = color y) {x y : V} (h : G.Reachable x y) : color x = color y := by … - lemma
OAI.OneWayLiveness.FiniteWiring.coloring_extensionline 225Source documentation
Every compatible boundary coloring extends through the wiring. This justifies replacing a cell's wiring by its boundary matching.
lemma coloring_extension {P : Type*} (port : P ↪ V) [DecidableRel G.Adj] (hd : ∀ v, G.degree v ≤ 2) (hb : ∀ v, G.degree v = 1 ↔ ∃ p, port p = v) (color : P → Bool) : (boundaryPairing G port hd hb).Compatible color ↔ ∃ c : V → Bool, (∀ p, c (port p) = color p) ∧ ∀ x y, G.Adj x y → c x = c y := by … - def
OAI.OneWayLiveness.Pairing.glueAdjline 267 - def
OAI.OneWayLiveness.Pairing.glueGraphline 277Source documentation
Keep the two copies of the interface separate and join them by edges. This subdivision avoids parallel edges without changing boundary paths.
def glueGraph (a : Pairing (A ⊕ B)) (b : Pairing (B ⊕ C)) : SimpleGraph ((A ⊕ B) ⊕ (B ⊕ C)) where …
Mentions: OAI.OneWayLiveness.Pairing
- def
OAI.OneWayLiveness.Pairing.outerline 291 - instance
OAI.OneWayLiveness.Pairing.glueDecline 299 - lemma
OAI.OneWayLiveness.Pairing.glue_degree_LLline 304 - lemma
OAI.OneWayLiveness.Pairing.glue_degree_RRline 315 - lemma
OAI.OneWayLiveness.Pairing.glue_degree_LRline 326 - lemma
OAI.OneWayLiveness.Pairing.glue_degree_RLline 337 - lemma
OAI.OneWayLiveness.Pairing.glue_degree_le_twoline 348 - lemma
OAI.OneWayLiveness.Pairing.glue_boundaryline 356 - def
OAI.OneWayLiveness.Pairing.composeline 370 - lemma
OAI.OneWayLiveness.Pairing.compose_compatibleline 376Source documentation
Boolean boundary behavior composes as ordinary relational composition.
lemma compose_compatible (f : A → Bool) (g : C → Bool) : (compose a b).Compatible (Sum.elim f g) ↔ ∃ k : B → Bool, a.Compatible (Sum.elim f k) ∧ b.Compatible (Sum.elim k g) := by …Mentions: OAI.OneWayLiveness.Pairing.compose, OAI.OneWayLiveness.Pairing.Compatible
- def
OAI.OneWayLiveness.Pairing.ofInvolutionline 416 - def
OAI.OneWayLiveness.Pairing.transportline 422 - def
OAI.OneWayLiveness.Pairing.bijectionline 437Source documentation
A rectangular permutation diagram; arbitrary equivalences also allow renumbering finite port sets without changing the underlying diagram.
def bijection (e : A ≃ B) : Pairing (A ⊕ B) := …
Mentions: OAI.OneWayLiveness.Pairing
- def
OAI.OneWayLiveness.Pairing.identityline 441 - lemma
OAI.OneWayLiveness.Pairing.bijection_compatibleline 443 - lemma
OAI.OneWayLiveness.Pairing.identity_compatibleline 459 - lemma
OAI.OneWayLiveness.Pairing.ext_colorsline 464 - lemma
OAI.OneWayLiveness.Pairing.connected_of_color_eqline 474Source documentation
The Boolean equality semantics is faithful even for a single pair.
lemma connected_of_color_eq (a : Pairing P) (x y : P) (h : ∀ c : P → Bool, a.Compatible c → c x = c y) : a.connected x y := by …Mentions: OAI.OneWayLiveness.Pairing
- lemma
OAI.OneWayLiveness.Pairing.link_of_color_eqline 480 - lemma
OAI.OneWayLiveness.Pairing.compose_assocline 486 - lemma
OAI.OneWayLiveness.Pairing.identity_composeline 493 - lemma
OAI.OneWayLiveness.Pairing.compose_identityline 498