Subsequential Functions and Finite-State Transducers #
A function f : List α → List β is subsequential when it is computed
by a deterministic finite-state transducer with state-based final output
@cite{mohri-1997}. Subsequential functions form a proper subclass of the
regular relations (= rational functions) and a proper superclass of the
Output Strictly Local class @cite{aksenova-rawski-graf-heinz-2020}.
The class comes in left and right variants depending on whether
the FST consumes input left-to-right or right-to-left
@cite{meinhardt-mai-bakovic-mccollum-2024}. The right-subsequential
class equals the image of the left-subsequential class under input/output
reversal: f ∈ R-Subseq ↔ (List.reverse ∘ f ∘ List.reverse) ∈ L-Subseq.
Main definitions #
Direction—.leftor.right; orientation of the FST scan.SFST σ α β— a deterministic finite-state transducer with state spaceσ, input alphabetα, output alphabetβ, total transition emitting an output block, plus a state-indexedfinalOutputemitted on termination.SFST.run— left-to-right pass: input → output.SFST.runRight— right-to-left pass viaList.reverse-conjugation.IsSubsequential d f— predicate witness-style: someSFSTcomputesfunder directiond.
What this file does NOT cover #
- Finite-state minimisation, canonical forms, equivalence of SFSTs (Choffrut 1979, Mohri 1997 §5).
- Two-way subsequential functions (extended class for some reduplication patterns, Dolatian-Heinz 2020).
- p-subsequential functions (Mohri 1997 footnote 7) — handle variation/optionality with multiple outputs per input.
Direction of FST scan #
Direction (left or right) controls whether an FST consumes its input
head-first (left scan) or tail-first via List.reverse conjugation
(right scan). The two scan modes give rise to distinct function classes
isomorphic under reversal but not equal as subclasses of the regular
functions over un-reversed strings.
Re-exported from Core/Direction.lean so the classification predicates
below can use .left/.right unqualified.
A subsequential finite-state transducer with state space σ,
input alphabet α, output alphabet β. The scan is total deterministic
— step always returns a next state and an output block — and the FST
emits finalOutput on terminating in any state.
This is the standard subsequential model of @cite{mohri-1997}: a
deterministic FST with state-final outputs, computing partial functions
extended to total functions on List α. We model totality by requiring
step to be total; partial subsequential functions can be encoded by
adding a none/sink state.
- initial : σ
The starting state from which scans begin.
- step : σ → α → σ × List β
Total deterministic transition: at each state, on each input symbol, move to a next state and emit a (possibly empty) output block.
- finalOutput : σ → List β
Output emitted upon terminating in a given state.
Instances For
Run the FST starting from a given state, accumulating output. The
scan walks left-to-right, emitting each transition's output block, and
finally appends the terminating state's finalOutput.
Equations
Instances For
Right-subsequential application: reverse the input, run the FST left-to-right, then reverse the output. The standard "right-to-left scan" interpretation.
Instances For
Walk an SFST over an input list without appending the final-state output. Returns the terminating state and the concatenation of all transition outputs along the way.
Useful as a building block for product constructions (e.g. composition closure): the consumer FST may need to see only the transition outputs of the producer, not the producer's final flush.
Equations
Instances For
The relationship between runFrom and runOnList: runFrom is
runOnList followed by appending the final-state output.
runOnList distributes over input concatenation: walking on xs ++ ys
equals walking on xs then on ys from the resulting state, with
outputs concatenated.
runFrom distributes over input concatenation: walking on xs ++ ys
equals walking the prefix via runOnList (no final emission yet), then
running runFrom from the resulting state on ys (which DOES include
the final emission).
Composition #
Subsequential functions are closed under composition (Mohri 1997 §3, back to Schützenberger and Choffrut). This is the load-bearing fact that makes the Heinz-Lai 2013 Weakly Deterministic class definition work (compositions of two subsequentials).
Construction: the product SFST with state σ_f × σ_g threads both
machines, where the consumer FST T_g walks over each output block
emitted by the producer FST T_f.
Compose two SFSTs: T_f : SFST σ_f α β and T_g : SFST σ_g β γ
yield an SFST σ_f × σ_g → α → γ whose run computes T_g.run ∘ T_f.run.
State threading: each input symbol triggers one T_f step (which may
emit a multi-symbol β block); T_g then walks through that block via
runOnList, advancing its state. The combined finalOutput runs
T_f.finalOutput through T_g (including T_g's own final flush).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compose's runFrom agrees with sequential runFroms. The product
SFST compose Tg Tf walks Tf over the input from s.1, threading
each emitted block through Tg from s.2.
Universe-level constraint on classification predicates #
The witness-style predicates below restrict alphabet binders to Type 0
rather than Type*. The reason: ∃ σ : Type, ∃ T : SFST σ α β, …
requires σ's universe to be fixed at definition site (a σ at
universe w plus alphabets at universes u, v would force the body
into universe max u v w, which Prop accepts only with ULift/PLift
boilerplate). Phonological alphabets are concrete inductive types at
Type 0, so the constraint is non-binding for current consumers; if a
Type* consumer ever appears, lift via ULift or duplicate predicates
at the needed universe rather than universe-polymorphising in place.
A function f : List α → List β is left-subsequential iff some
SFST computes it via left-to-right scan.
Equations
- Core.Computability.Subregular.Function.IsLeftSubsequential f = ∃ (σ : Type), ∃ (T : Core.Computability.Subregular.Function.SFST σ α β), T.run = f
Instances For
A function f : List α → List β is right-subsequential iff some
SFST computes it via right-to-left scan (runRight).
Equations
- Core.Computability.Subregular.Function.IsRightSubsequential f = ∃ (σ : Type), ∃ (T : Core.Computability.Subregular.Function.SFST σ α β), T.runRight = f
Instances For
A function f : List α → List β is subsequential in direction d
iff some SFST computes it via the corresponding scan direction. The
audit-recommended Direction-parameterised form (rather than separate
Left/Right files); concrete claims should typically use one of
IsLeftSubsequential / IsRightSubsequential directly for clarity.
Equations
Instances For
Reverse-conjugation lemma: a function is Right-Subsequential iff
its reverse-conjugate is Left-Subsequential. The two classes are
isomorphic via the involution f ↦ List.reverse ∘ f ∘ List.reverse.
Subsequential functions are closed under composition (Mohri 1997 §3, originally Schützenberger and Choffrut). The load-bearing fact that makes the Heinz-Lai 2013 Weakly Deterministic class definition work as the composition of two subsequential functions reading from opposite directions.