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

Lax765601.Aperiodicity

Aperiodic string-to-string functions

concepts/Lax765601/Aperiodicity.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 length preserving string-to-string function ff is aperiodic (Definition A.2.7 of Transducers) if for all input strings u,v,wu, v, w the last letter of

    f(uvnw)f(u v^n w)

    is the same for all sufficiently large nn. Aperiodicity says that the function cannot have periodic behaviour: the function on aa^* whose last output letter says whether the input has length at least two is aperiodic, while the one whose last letter gives the parity of the length is not. By the arbitrary choice of ww, the last kk output letters are eventually fixed as well, for every kk. Theorem A.2.8 shows that the aperiodic functions computed by Mealy machines are exactly the compositions of flip-flop machines.

    Lean source view on GitHub

    1import Mathlib.Data.List.Basic
    2
    3/-!
    4---
    5title: Aperiodic string-to-string functions
    6type: definition
    7---
    8A length preserving string-to-string function ff is *aperiodic* (Definition
    9A.2.7 of *Transducers*) if for all input strings u,v,wu, v, w the last letter of
    10f(uvnw)f(u v^n w)
    11is the same for all sufficiently large nn. Aperiodicity says that the function
    12cannot have periodic behaviour: the function on aa^* whose last output letter
    13says whether the input has length at least two is aperiodic, while the one whose
    14last letter gives the parity of the length is not. By the arbitrary choice of
    15ww, the last kk output letters are eventually fixed as well, for every kk.
    16Theorem A.2.8 shows that the aperiodic functions computed by Mealy machines are
    17exactly the compositions of flip-flop machines.
    18
    19# Formalization notes
    20
    21The last letter is taken as an element of `Option B`: the definition asks that the
    22sequence `n ↦ (f (u vⁿ w)).getLast?` be eventually constant, "no letter" being an
    23admissible constant value. This is a deliberate correction of the printed
    24definition, which asks for an actual output letter `b`: with `u = v = w = ε` —
    25allowed, since the printed side condition "`uvw` nonempty" constrains the input,
    26and a length preserving function maps `ε` to `ε` — there is no last letter at
    27all, so no function would be aperiodic as printed. With the `Option`-valued
    28reading the whole of Section A.2.3 goes through. The book's side conditions that
    29`f` be length preserving and that `uvw` be nonempty are not used and are dropped.
    30`npow v n` is the string `vⁿ`.
    31-/
    32
    33namespace Lax765601.Aperiodicity
    34
    35/-- The `n`-fold concatenation `vⁿ` of a string with itself. -/
    36def npow {A : Type} (v : List A) : ℕ → List A
    37 | 0 => []
    38 | n + 1 => v ++ npow v n
    39
    40/-- A string-to-string function is aperiodic if for all input strings `u, v, w` the
    41last letter of `f (u vⁿ w)` — as an element of `Option B`, so that "no letter" is
    42an admissible value — is the same for all sufficiently large `n`. -/
    43def Aperiodic {A B : Type} (f : List A → List B) : Prop :=
    44 ∀ u v w : List A, ∃ o : Option B, ∃ N : ℕ, ∀ n ≥ N, (f (u ++ npow v n ++ w)).getLast? = o
    45
    46end Lax765601.Aperiodicity
    47

    Formalization notes

    The last letter is taken as an element of OptionBOption B: the definition asks that the sequence n(f(uvnw)).getLast?n ↦ (f (u vⁿ w)).getLast? be eventually constant, "no letter" being an admissible constant value. This is a deliberate correction of the printed definition, which asks for an actual output letter bb: with u=v=w=εu = v = w = ε — allowed, since the printed side condition "uvwuvw nonempty" constrains the input, and a length preserving function maps εε to εε — there is no last letter at all, so no function would be aperiodic as printed. With the OptionOption-valued reading the whole of Section A.2.3 goes through. The book's side conditions that ff be length preserving and that uvwuvw be nonempty are not used and are dropped. npowvnnpow v n is the string vnvⁿ.

    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…