Synchronous (letter) left-subsequential functions #
A Mealy machine is a deterministic left-to-right transducer emitting exactly one
output symbol per input symbol — the synchronous case, length-preserving by
construction. Its output coordinate i is a function of the input prefix [0..i], so
the class is cleanly characterised by the OutputDependsOn footprint
(SideDeterminacy.lean): IsLetterLeftSubsequential f → ∀ i, LeftDetermined f i, hence
right-myopic.
This is the characterisation the block IsLeftSubsequential (Subsequential.lean)
lacks: a length-preserving block transducer can delay output (emit [] then [x,y]),
so output coordinate 0 depends on input position 1 — not prefix-determined. The
synchronous restriction is what makes the dependency-footprint view line up with the
machine view.
Main definitions #
Mealy— synchronous one-symbol-per-step transducer;runis length-preserving.IsLetterLeftSubsequential— computed by a finite-stateMealy.
Main results #
Mealy.runFrom_getElem?— outputiis(step (state-after-prefix) (input i)).2.IsLetterLeftSubsequential.leftDetermined/.isRightMyopic— synchronous left-subsequential maps are prefix-determined, hence right-myopic.
Todo #
- The Myhill–Nerode converse:
(∀ i, LeftDetermined f i) ∧ finite prefix-congruence ⟹ IsLetterLeftSubsequential f(build the transducer from the prefix-congruence quotient).
State reached after consuming a prefix.
Equations
- T.stateAfter x✝ [] = x✝
- T.stateAfter x✝ (x_2 :: xs) = T.stateAfter (T.step x✝ x_2).1 xs
Instances For
The coordinate characterization: output i is the step output at
(state after the prefix [0..i-1], input i).
Flag machines #
The recurring one-sided-trigger shape (the Mealy counterpart of Bimachine.ofFlags):
the state is the one-bit "some earlier symbol satisfies p" flag, so stateAfter
computes List.any and each output cell sees the flag over its strict prefix. Scanned
right-to-left (reverse, run, reverse), the cell sees the flag over its strict suffix
(ofFlag_run_reverse_getElem?).
The Mealy machine whose state is the monotone flag "a symbol satisfying p has
occurred".
Equations
- Subregular.Mealy.ofFlag p out = { initial := false, step := fun (b : Bool) (a : α) => (b || p a, out b a) }
Instances For
Coordinates of a flag machine scanned right-to-left: cell i sees the flag over its
strict suffix.
Transfer a Mealy along a state-space equivalence σ ≃ τ, preserving run.
Mirrors SFST.transferEquiv; the use case is bringing a Type* finite state down to
Fin (Fintype.card σ) : Type 0 so a universe-polymorphic machine can witness the
Type 0-state existential of IsLetterLeftSubsequential.
Equations
Instances For
The transferred machine computes the same string function.
The synchronous left-subsequential class: computed by a finite-state Mealy.
Equations
- Subregular.IsLetterLeftSubsequential f = ∃ (σ : Type) (x : Fintype σ) (T : Subregular.Mealy σ α β), T.run = f
Instances For
Constructor lemma: every finite-state Mealy witnesses
IsLetterLeftSubsequential for its run. The state σ is accepted at arbitrary
Type* and brought down to Fin (Fintype.card σ) : Type 0 via transferEquiv and
Fintype.equivFin, so bounded-window ISL/OSL states at the alphabet's universe can
witness the predicate (mirrors SFST.isLeftSubsequential).
Forward footprint bridge. A letter-left-subsequential map is left-determined at
every coordinate — output i depends only on the prefix {k | k ≤ i}. (The block
IsLeftSubsequential lacks this, by delayed output.)
A synchronous left-subsequential map is right-myopic — it has no look-ahead.
Myhill–Nerode converse #
f is letter-left-subsequential as soon as it admits a finite-state, left-congruent
summary that determines its output — the constructive direction of Myhill–Nerode. The
finite state plays the role of the prefix-congruence's quotient; δ/out are the
induced transition and output. (The natural Nerode congruence, when of finite index, is
one such summary — that instantiation is the Todo above.)
Myhill–Nerode converse (constructive). A length-preserving f with a finite
state : List α → σ that is left-congruent (hδ) and determines f's output at each
position (hout) is letter-left-subsequential.