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

Lax765601.StateTransformations

State transformations of a pre-automaton

concepts/Lax765601/StateTransformations.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

    Definition

    A pre-automaton is a deterministic finite automaton without designated initial and accepting states: an input alphabet AA, a state space QQ and a family of state transformations δa:QQ\delta_a : Q \to Q, one for each letter aAa \in A (Section A.2 of Transducers). The state transformation δw\delta_w of an input string ww is the composition of the state transformations of its letters, in the order in which they are read.

    The state transformation transducer of a pre-automaton is the Mealy machine of type A(QQ)A^* \to (Q \to Q)^* whose nn-th output letter is the state transformation of the first nn input letters. It is the object that the proof of the Krohn–Rhodes theorem decomposes (Lemma A.2.5).

    A pre-automaton satisfies the stabilisation condition (*) of Lemma A.2.11 if for every state transformation δ\delta that arises from some input string, the sequence of powers δ1,δ2,\delta^1, \delta^2, \ldots eventually stabilises on a single state transformation. This is the condition on a minimal Mealy machine that characterises aperiodicity.

    Lean source view on GitHub

    1import Mathlib.Logic.Function.Iterate
    2import Lax765601.MealyMachine
    3
    4/-!
    5---
    6title: State transformations of a pre-automaton
    7type: definition
    8---
    9A *pre-automaton* is a deterministic finite automaton without designated initial
    10and accepting states: an input alphabet AA, a state space QQ and a family of
    11*state transformations* δa:QQ\delta_a : Q \to Q, one for each letter aAa \in A
    12(Section A.2 of *Transducers*). The state transformation δw\delta_w of an input
    13string ww is the composition of the state transformations of its letters, in
    14the order in which they are read.
    15
    16The *state transformation transducer* of a pre-automaton is the Mealy machine of
    17type A(QQ)A^* \to (Q \to Q)^* whose nn-th output letter is the state
    18transformation of the first nn input letters. It is the object that the proof of
    19the Krohn–Rhodes theorem decomposes (Lemma A.2.5).
    20
    21A pre-automaton satisfies the *stabilisation condition* (*) of Lemma A.2.11 if
    22for every state transformation δ\delta that arises from some input string, the
    23sequence of powers δ1,δ2,\delta^1, \delta^2, \ldots eventually stabilises on a single
    24state transformation. This is the condition on a minimal Mealy machine that
    25characterises aperiodicity.
    26
    27# Formalization notes
    28
    29A pre-automaton is just its transition function `δ : Q → A → Q`; no structure is
    30introduced. `strTrans δ w` is the state transformation of the string `w`, a
    31left fold of `δ` along `w`, so that the letters act in reading order. The
    32transition function of the state transformation transducer stores the state
    33transformation of the prefix read so far as its state and outputs it after every
    34letter, as the book describes; its state space `Q → Q` is finite when `Q` is.
    35`f^[n]` is the `n`-th iterate of `f`.
    36-/
    37
    38namespace Lax765601.StateTransformations
    39
    40open Lax765601.MealyMachine
    41
    42/-- The state transformation of an input string, for the pre-automaton `δ`: the
    43letters act one after the other, in reading order. -/
    44def strTrans {A Q : Type} (δ : Q → A → Q) (w : List A) : Q → Q := fun q => w.foldl δ q
    45
    46/-- The stabilisation condition (*) of Lemma A.2.11: for every state
    47transformation `δ_w` arising from an input string, the sequence of its powers
    48`δ_w¹, δ_w², …` eventually stabilises. -/
    49def TransAperiodic {A Q : Type} (δ : Q → A → Q) : Prop :=
    50 ∀ w : List A, ∃ N : ℕ, ∀ n ≥ N, (strTrans δ w)^[n] = (strTrans δ w)^[N]
    51
    52/-- The state transformation transducer of a pre-automaton: the Mealy machine
    53whose `n`-th output letter is the state transformation of the first `n` input
    54letters. -/
    55def stateTransTransducer {A Q : Type} (δ : Q → A → Q) : Mealy A (Q → Q) (Q → Q) where
    56 init := id
    57 step := fun t a => (fun q => δ (t q) a, fun q => δ (t q) a)
    58
    59end Lax765601.StateTransformations
    60

    Formalization notes

    A pre-automaton is just its transition function δ:QAQδ : Q → A → Q; no structure is introduced. strTransδwstrTrans δ w is the state transformation of the string ww, a left fold of δδ along ww, so that the letters act in reading order. The transition function of the state transformation transducer stores the state transformation of the prefix read so far as its state and outputs it after every letter, as the book describes; its state space QQQ → Q is finite when QQ is. f[n]f^[n] is the nn-th iterate of ff.

    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…