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

Lax765601.Derivatives

Derivatives of a string-to-string function

concepts/Lax765601/Derivatives.lean · lax-765601

definition

Loading review…

Sign in with ORCID

Community review

Flags

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

No flags have been submitted.

    Community review

    Flag this concept

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

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    In the paper

    Definition

    A derivative of a length preserving string-to-string function f:ABf : A^* \to B^* is a function of the form

    f(w_)  :  v    f(wv) with the first w letters of the output removed,f(w\_) \;:\; v \;\mapsto\; f(wv) \text{ with the first } |w| \text{ letters of the output removed},

    for some input string ww (Section A.2.3 of Transducers). The derivative is the output that ff still produces after having read ww; for a function computed by a Mealy machine it is determined by the state reached after reading ww, which is the observation behind the Myhill–Nerode lemma for Mealy machines (Lemma A.2.10): a function is computed by a Mealy machine if and only if it is letter-to-letter, its nn-th output letter depends only on the first nn input letters, and it has finitely many derivatives. The minimal Mealy machine of such a function has the derivatives as its states.

    Lean source view on GitHub

    1import Mathlib.Data.List.Basic
    2
    3/-!
    4---
    5title: Derivatives of a string-to-string function
    6type: definition
    7---
    8A *derivative* of a length preserving string-to-string function f:ABf : A^* \to B^*
    9is a function of the form
    10f(w_)  :  v    f(wv) with the first w letters of the output removed,f(w\_) \;:\; v \;\mapsto\; f(wv) \text{ with the first } |w| \text{ letters of the output removed},
    11for some input string ww (Section A.2.3 of *Transducers*). The derivative is the
    12output that ff still produces *after* having read ww; for a function computed
    13by a Mealy machine it is determined by the state reached after reading ww, which
    14is the observation behind the Myhill–Nerode lemma for Mealy machines (Lemma
    15A.2.10): a function is computed by a Mealy machine if and only if it is
    16letter-to-letter, its nn-th output letter depends only on the first nn input
    17letters, and it has finitely many derivatives. The minimal Mealy machine of such
    18a function has the derivatives as its states.
    19
    20# Formalization notes
    21
    22`deriv f w v` drops the first `w.length` letters of `f (w ++ v)`. An earlier
    23edition of the book wrote `f(w\_)(v) = f(wv)` without removing the output
    24produced while reading `w`; with that reading even the identity function has
    25infinitely many derivatives and Lemma A.2.10 fails, so the definition above is
    26the one the book now prints and the one its proof uses. No length preservation
    27is required of `f` for the definition to make sense.
    28-/
    29
    30namespace Lax765601.Derivatives
    31
    32/-- The derivative `f(w_)` of `f`: the output `f` produces after having read `w`,
    33namely `v ↦ f (w v)` with the first `|w|` letters of the output removed. -/
    34def deriv {A B : Type} (f : List A → List B) (w : List A) : List A → List B :=
    35 fun v => (f (w ++ v)).drop w.length
    36
    37end Lax765601.Derivatives
    38

    Formalization notes

    derivfwvderiv f w v drops the first w.lengthw.length letters of f(w++v)f (w ++ v). An earlier edition of the book wrote f(w_)(v)=f(wv)f(w\_)(v) = f(wv) without removing the output produced while reading ww; with that reading even the identity function has infinitely many derivatives and Lemma A.2.10 fails, so the definition above is the one the book now prints and the one its proof uses. No length preservation is required of ff for the definition to make sense.

    Builds on

    none

    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…