Lax194892.ForComposition
For-transducers are closed under composition
concepts/Lax194892/ForComposition.lean · lax-194892
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 159 of the paper of lax-157538, Transducers
Theorem
The functions computed by for-transducers are closed under composition (Lemma D.1.4 of Transducers). The second program is run on the output of the first, in prenex form: an output position of the first program is a tuple of loop variables of its prenex form, so a loop of the second program over output positions becomes a block of loops over input positions, and its tests on output letters become the loop-free body of the first program.
Lean source view on GitHub
| 1 | import Lax194892.ForTransducers |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: For-transducers are closed under composition |
| 6 | type: theorem |
| 7 | --- |
| 8 | The functions computed by for-transducers are closed under composition |
| 9 | (Lemma D.1.4 of *Transducers*). The second program is run on the output of the |
| 10 | first, in prenex form: an output position of the first program is a tuple of |
| 11 | loop variables of its prenex form, so a loop of the second program over output |
| 12 | positions becomes a block of loops over input positions, and its tests on |
| 13 | output letters become the loop-free body of the first program. |
| 14 | |
| 15 | # Formalization notes |
| 16 | |
| 17 | Stated over any alphabets. |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax194892.ForComposition |
| 21 | |
| 22 | open Lax194892.ForTransducers |
| 23 | |
| 24 | /-- The composition of two functions computed by for-transducers is computed by a |
| 25 | for-transducer. -/ |
| 26 | axiom isForTransducer_comp {A B C : Type} {f : List A → List B} {g : List B → List C} |
| 27 | (hf : IsForTransducer f) (hg : IsForTransducer g) : IsForTransducer (g ∘ f) |
| 28 | |
| 29 | end Lax194892.ForComposition |
| 30 |
Formalization notes
Stated over any 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