Lax132576.WeightedPrecomposition
Weighted automata are closed under pre-composition with rational functions
concepts/Lax132576/WeightedPrecomposition.lean · lax-132576
No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 62 of the paper of lax-157538, Transducers
Theorem
For every semiring , the composition
of a rational function with a function computed by a weighted automaton is computed by a weighted automaton (Lemma B.3.5 of Transducers). The automaton for is first made unambiguous and ε-free (Lemmas B.2.4 and B.2.5), so that its unique run aligns with the runs of the automaton for in a product construction whose transitions carry, as weight, the sum of the weights of the runs of over the output of one transition of .
Lean source view on GitHub
| 1 | import Lax132576.RationalFunctions |
| 2 | import Lax132576.WeightedAutomata |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Weighted automata are closed under pre-composition with rational functions |
| 7 | type: theorem |
| 8 | --- |
| 9 | For every semiring , the composition |
| 10 | |
| 11 | of a rational function with a function computed by a weighted automaton |
| 12 | is computed by a weighted automaton (Lemma B.3.5 of *Transducers*). The |
| 13 | automaton for is first made unambiguous and ε-free (Lemmas B.2.4 and |
| 14 | B.2.5), so that its unique run aligns with the runs of the automaton for |
| 15 | in a product construction whose transitions carry, as weight, the sum of the |
| 16 | weights of the runs of over the output of one transition of . |
| 17 | |
| 18 | # Formalization notes |
| 19 | |
| 20 | The semiring is arbitrary (mathlib's `Semiring`); both alphabets are assumed |
| 21 | finite, as the unambiguous automaton needs. |
| 22 | -/ |
| 23 | |
| 24 | namespace Lax132576.WeightedPrecomposition |
| 25 | |
| 26 | open Lax132576.RationalFunctions Lax132576.WeightedAutomata |
| 27 | |
| 28 | /-- Pre-composing a weighted function with a rational function gives a weighted |
| 29 | function. -/ |
| 30 | axiom isWeighted_comp_of_isRationalFun {A B S : Type} [Finite A] [Finite B] [Semiring S] |
| 31 | {f : List A → List B} {h : List B → S} (hf : IsRationalFun f) (hh : IsWeighted h) : |
| 32 | IsWeighted (h ∘ f) |
| 33 | |
| 34 | end Lax132576.WeightedPrecomposition |
| 35 |
Formalization notes
The semiring is arbitrary (mathlib's ); both alphabets are assumed finite, as the unambiguous automaton needs.
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