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

Lax314295.KTypes

The k-type of a string

concepts/Lax314295/KTypes.lean · lax-314295

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

    The kk-type of a string (Definition C.4.12 of Transducers) is defined by induction on kk: the 00-type of every string is the same, and the (k+1)(k+1)-type of ww is the set of triples

    {(k-type of w1,  a,  k-type of w2)w=w1aw2}\{(\text{$k$-type of } w_1,\; a,\; \text{$k$-type of } w_2) \mid w = w_1\, a\, w_2\}

    over all factorisations of ww around one of its letters. Two strings have the same kk-type if and only if they satisfy the same first-order sentences of quantifier rank at most kk (Lemma C.4.13); kk-types refine, are a congruence for concatenation and are aperiodic (Lemma C.4.15), which is what makes the first-order definable languages the aperiodic ones (Theorem C.4.11).

    Lean source view on GitHub

    1import Mathlib.Data.Set.Basic
    2
    3/-!
    4---
    5title: The k-type of a string
    6type: definition
    7---
    8The *kk-type* of a string (Definition C.4.12 of *Transducers*) is defined by
    9induction on kk: the 00-type of every string is the same, and the
    10(k+1)(k+1)-type of ww is the set of triples
    11{(k-type of w1,  a,  k-type of w2)w=w1aw2}\{(\text{$k$-type of } w_1,\; a,\; \text{$k$-type of } w_2) \mid w = w_1\, a\, w_2\}
    12over all factorisations of ww around one of its letters. Two strings have the
    13same kk-type if and only if they satisfy the same first-order sentences of
    14quantifier rank at most kk (Lemma C.4.13); kk-types refine, are a congruence
    15for concatenation and are aperiodic (Lemma C.4.15), which is what makes the
    16first-order definable languages the aperiodic ones (Theorem C.4.11).
    17
    18# Formalization notes
    19
    20`TpType A k` is the type of `k`-types, `Unit` for `k = 0` and sets of triples
    21for `k + 1`, and `tp k w` the `k`-type of `w`. Over a finite alphabet there are
    22finitely many `k`-types for every `k`, which is not part of the definition.
    23-/
    24
    25namespace Lax314295.KTypes
    26
    27/-- The type of `k`-types over the alphabet `A`. -/
    28def TpType (A : Type) : ℕ → Type
    29 | 0 => Unit
    30 | k + 1 => Set (TpType A k × A × TpType A k)
    31
    32/-- The `k`-type of a string: trivial for `k = 0`, and for `k + 1` the set of
    33triples `(tp k w₁, a, tp k w₂)` over the factorisations `w = w₁ a w₂`. -/
    34def tp {A : Type} : (k : ℕ) → List A → TpType A k
    35 | 0, _ => ()
    36 | k + 1, w =>
    37 {t : TpType A k × A × TpType A k |
    38 ∃ (w₁ : List A) (a : A) (w₂ : List A), w = w₁ ++ a :: w₂ ∧ t = (tp k w₁, a, tp k w₂)}
    39
    40end Lax314295.KTypes
    41

    Formalization notes

    TpTypeAkTpType A k is the type of kk-types, UnitUnit for k=0k = 0 and sets of triples for k+1k + 1, and tpkwtp k w the kk-type of ww. Over a finite alphabet there are finitely many kk-types for every kk, which is not part of the definition.

    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…