Draft — mutable and not usable as a dependency; its citation marks the draft state.

Transducers, Part C: Regular Functions, Two-Way Transducers and Streaming String Transducers

lax-916827·formalized by Mikołaj Bojańczyk·Aristotle (Harmonic)·created 2026-09-07·GitHub @2fb96b2·Lean v4.30.0 epoch · mathlib c5ea00351c28

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this submission may be incorrect.

No flags have been submitted.

    Community review

    Flag this submission

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    Abstract

    Sections 1–3 of Part C of the book Transducers (M. Bojańczyk) as concepts and proofs: the regular functions, defined as the compositions of rational functions with map reverse and map duplicate, and their two machine models, deterministic two-way transducers and streaming string transducers. The Lean development is Aristotle's formalisation of the book, re-presented in the archive's form; it requires the Part A and Part B submissions.

    The definition-concepts are the regular functions (C.0.1), two-way transducers (C.2.1) with their run semantics, codes of two-way transducers, the string representation of the reachable configuration graph of a two-way transducer, streaming string transducers (C.3.1), and snake graphs with their outputs and widths.

    The theorem-concepts are the numbered results: continuity and closure under composition of the regular functions (C.1.1), continuity of reversal, duplication (C.1.2) and map lifting (C.1.3), decidable equivalence of regular functions given by two-way transducers (C.1.4), continuity of two-way transducers (C.2.2, Rabin–Scott and Shepherdson) with the two lemmas on the configuration graph (C.2.3, C.2.4), closure of two-way transducers under composition (C.2.5, Chytil–Jákl) and under pre-composition with Mealy machines and rational functions (C.2.6, C.2.7), the theorem that two-way transducers compute exactly the regular functions (C.2.8, C.2.9, as two implications and their conjunction), the closure properties of regular functions under map lifting, concatenation and conditionals (C.2.10), the sum of two regular functions (C.2.11, corrected on the empty input), the snake lemma (C.2.12, for every width), and the equivalence of streaming string transducers with the regular functions (C.3.2, Alur–Černý, as two implications and their conjunction). All are proved.

    The decidability of equivalence is proved not by the book's reduction to weighted automata but by an explicit bound from the crossing-sequence decomposition of a two-way run and Schützenberger's rank criterion; the book's reduction is formalised as well, and the two agree. Conjecture C.1.5 is not formalised. The exercises are not part of this submission.

    In the paper

    Concepts

    Concept map

    Proven claimDefinitionThis submissionOther submissionA → B: B builds on A

    Proofs

    Proof networkview on GitHub

    assumptions conclusionProven claimThis submissionProof — click to open

    Lean sources for these proofs: proofs/ on GitHub

    Proof code is not displayed; the archive records each proof's checked relationship between claims.

    Related submissions

    Submission map

    This submissionOther submissionA → B: B's concepts build on AA → B: only B's proofs build on A

    Cite this

    @misc{lax-916827,
      author = {Mikołaj Bojańczyk and Aristotle (Harmonic)},
      title = {Transducers, Part C: Regular Functions, Two-Way Transducers and Streaming String Transducers},
      year = {2026},
      howpublished = {Lax Archive, lax-916827},
      url = {https://laxarchive.org/lax-916827/},
      note = {draft},
    }

    References

    1. John C. Shepherdson. The Reduction of Two-Way Automata to One-Way Automata. IBM Journal of Research and Development 3(2):198–200, 1959. doi:10.1147/rd.32.0198
    2. Michal P. Chytil and Vojtěch Jákl. Serial Composition of 2-Way Finite-State Transducers and Simple Programs on Strings. In Automata, Languages and Programming (ICALP 1977) 52:135–147, 1977. doi:10.1007/3-540-08342-1_11
    3. Rajeev Alur and Pavol Černý. Expressiveness of Streaming String Transducers. In IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2010) 8:1–12, 2010. doi:10.4230/LIPIcs.FSTTCS.2010.1
    4. Mikołaj Bojańczyk. Transducers. 2026. Book in preparation; sources at r̆lhttps://github.com/bojanczyk/transducer-book.

    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

    Loading discussion…