Lax765601.MealyComposition
Mealy machines are closed under composition
concepts/Lax765601/MealyComposition.lean · lax-765601
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 15 of the paper of lax-157538, Transducers
Theorem
If and are computed by Mealy machines, then so is their composition (Theorem A.1.3 of Transducers). The proof is a product construction: the composed machine runs both machines in lockstep, feeding each output letter of the first to the second, so its state space is the product of the two state spaces.
Lean source view on GitHub
| 1 | import Lax765601.MealyMachine |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Mealy machines are closed under composition |
| 6 | type: theorem |
| 7 | --- |
| 8 | If and are computed by Mealy machines, then |
| 9 | so is their composition (Theorem |
| 10 | A.1.3 of *Transducers*). The proof is a product construction: the composed |
| 11 | machine runs both machines in lockstep, feeding each output letter of the first |
| 12 | to the second, so its state space is the product of the two state spaces. |
| 13 | |
| 14 | # Formalization notes |
| 15 | |
| 16 | The book writes the composition as , first then ; in Lean it is |
| 17 | `g ∘ f`. The intermediate alphabet is required to be finite, as in the closure |
| 18 | under composition of `CompositionClosure`; nothing is assumed of the outer |
| 19 | alphabets. |
| 20 | -/ |
| 21 | |
| 22 | namespace Lax765601.MealyComposition |
| 23 | |
| 24 | open Lax765601.MealyMachine |
| 25 | |
| 26 | /-- The composition of two functions computed by Mealy machines is computed by a |
| 27 | Mealy machine. -/ |
| 28 | axiom isMealy_comp {A B C : Type} [Finite B] {f : List A → List B} {g : List B → List C} |
| 29 | (hf : IsMealy f) (hg : IsMealy g) : IsMealy (g ∘ f) |
| 30 | |
| 31 | end Lax765601.MealyComposition |
| 32 |
Formalization notes
The book writes the composition as , first then ; in Lean it is . The intermediate alphabet is required to be finite, as in the closure under composition of ; nothing is assumed of the outer alphabets.
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments