Elgot–Mezei composition #
Feeding a right-to-left transducer the output of a left-to-right one gives a bimachine: the left automaton is the first machine, and the right automaton carries the map taking a state of the first machine to the state the second reaches over the image of the suffix. We show that a right-subsequential function after a left-subsequential one is bimachine-computable as soon as the composite preserves the empty word — the composition half of [EM65]'s decomposition theorem ([Sak09], Cor. V.2.5) — and, by the reversal symmetry of bimachines, that so is a left-subsequential function after a right-subsequential one. The decomposition half, that every rational function factors this way ([Sak09], Th. V.2.2), is not formalized here.
Main definitions #
SubsequentialTransducer.rightComp: the bimachine runningT₂right-to-left over the output ofT₁
Main theorems #
IsRightSubsequential.isBimachineComputable_comp,IsLeftSubsequential.isBimachineComputable_comp: a composite of two contradirectional subsequential functions is bimachine-computable, in either order
Implementation notes #
The empty-word hypothesis is not an artifact of the construction: Bimachine.run [] = [],
so a composite whose flushes emit anything on the empty input is computed by no bimachine
at all.
[UPSTREAM] candidate: Mathlib.Computability.Bimachine.
TODO #
- The decomposition half: every bimachine-computable function is a right-subsequential function after a left-subsequential one.
- The letter-to-letter refinement:
MealyafterMealygives a length-preserving bimachine (IsLengthPreservingBimachineComputable).
T₂.rightComp T₁ is the bimachine reading T₁ left to right and T₂ right to left
over T₁'s output. Its right state is the map sending the T₁-state entering the suffix
to the T₂-state over the image of that suffix, T₁'s flush already consumed; the two
flags mark the ends of the input, where T₂'s flush and the image of T₁'s flush are
emitted.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Each cell emits the reverse of what T₂ produces over the reversed image of the
input, its whole run at the left end and its emission alone, without the flush, elsewhere.
The bimachine computes the composite on every nonempty input — the empty word is the only obstruction.
The bimachine computes T₂.runRight ∘ T₁.run, given that the composite preserves the
empty word.
Elgot–Mezei composition. A right-subsequential function after a left-subsequential one is bimachine-computable, as soon as the composite preserves the empty word (as every bimachine-computable function does).
In the synchronous case a Mealy machine run right to left over the output of another
is a bimachine, with no side condition since both passes preserve the empty word.
Elgot–Mezei composition, mirrored. A left-subsequential function after a right-subsequential one is bimachine-computable, as soon as the composite preserves the empty word. Its reverse conjugate is the composition the other way round.
In the synchronous mirror case a Mealy machine run left to right over the right-to-left
pass of another is a bimachine.