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

Lax765601.CompositionClosure

Closure of a family of functions under composition

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

    The transducer classes of the book are described by decomposition into primes: a class is the set of all finite compositions

    A0f1A1f2fnAnA_0^* \xrightarrow{f_1} A_1^* \xrightarrow{f_2} \cdots \xrightarrow{f_n} A_n^*

    of functions taken from some family of prime functions, with the intermediate alphabets finite. The book writes PP^* for this closure of a family PP under composition — the Kleene star of the family — as in Mealy=(ReversibleFlip-flop)\mathrm{Mealy} = (\mathrm{Reversible} \cup \mathrm{Flip\text{-}flop})^*, the Krohn–Rhodes theorem (Theorem A.2.2). The same idiom defines the rational functions from their primes (Theorem B.2.6), the regular functions (Definition C.0.1) and the polyregular functions (Definition D.0.1).

    Lean source view on GitHub

    1import Mathlib.Data.Finite.Defs
    2
    3/-!
    4---
    5title: Closure of a family of functions under composition
    6type: definition
    7---
    8The transducer classes of the book are described by *decomposition into primes*:
    9a class is the set of all finite compositions
    10A0f1A1f2fnAnA_0^* \xrightarrow{f_1} A_1^* \xrightarrow{f_2} \cdots \xrightarrow{f_n} A_n^*
    11of functions taken from some family of *prime* functions, with the intermediate
    12alphabets finite. The book writes PP^* for this closure of a family PP under
    13composition — the Kleene star of the family — as in
    14Mealy=(ReversibleFlip-flop)\mathrm{Mealy} = (\mathrm{Reversible} \cup \mathrm{Flip\text{-}flop})^*, the
    15Krohn–Rhodes theorem (Theorem A.2.2). The same idiom defines the rational
    16functions from their primes (Theorem B.2.6), the regular functions (Definition
    17C.0.1) and the polyregular functions (Definition D.0.1).
    18
    19# Formalization notes
    20
    21A *family* is a predicate on string-to-string functions indexed by the input and
    22output alphabets, `∀ (A B : Type), (List A → List B) → Prop`. The closure
    23`CompClosure P` is the least family containing `P`, the identity on every
    24alphabet, and closed under composition through a *finite* intermediate alphabet;
    25that finiteness is the constructor's instance argument `[Finite B]`, so that
    26"composition of primes" never passes through an infinite alphabet. Because the
    27closure is inductively defined, every statement of the form "every composition of
    28primes has property X" is proved by induction on the composition tree, and the
    29theorems of the book about a class defined this way are statements about the
    30closure, not about a syntactic list of factors.
    31-/
    32
    33namespace Lax765601.CompositionClosure
    34
    35/-- A family of string-to-string functions, indexed by the input and the output
    36alphabet. -/
    37abbrev Family : Type 1 := ∀ (A B : Type), (List A → List B) → Prop
    38
    39/-- The closure `P*` of a family `P` under composition: the identity functions, the
    40members of `P`, and the compositions `g ∘ f` of two members of the closure through
    41a finite intermediate alphabet. -/
    42inductive CompClosure (P : Family) : Family
    43 /-- A prime function belongs to the closure. -/
    44 | base {A B : Type} {f : List A → List B} : P A B f → CompClosure P A B f
    45 /-- The identity on every alphabet belongs to the closure. -/
    46 | protected id (A : Type) : CompClosure P A A _root_.id
    47 /-- The closure is closed under composition through a finite alphabet. -/
    48 | comp {A B C : Type} [Finite B] {f : List A → List B} {g : List B → List C} :
    49 CompClosure P A B f → CompClosure P B C g → CompClosure P A C (g ∘ f)
    50
    51/-- The union of two families. -/
    52def FamUnion (P Q : Family) : Family := fun A B f => P A B f ∨ Q A B f
    53
    54end Lax765601.CompositionClosure
    55

    Formalization notes

    A family is a predicate on string-to-string functions indexed by the input and output alphabets, (AB:Type),(ListAListB)Prop∀ (A B : Type), (List A → List B) → Prop. The closure CompClosurePCompClosure P is the least family containing PP, the identity on every alphabet, and closed under composition through a finite intermediate alphabet; that finiteness is the constructor's instance argument [FiniteB][Finite B], so that "composition of primes" never passes through an infinite alphabet. Because the closure is inductively defined, every statement of the form "every composition of primes has property X" is proved by induction on the composition tree, and the theorems of the book about a class defined this way are statements about the closure, not about a syntactic list of factors.

    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…