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

Lax916827.RegularSum

The sum of two regular functions on disjoint alphabets

concepts/Lax916827/RegularSum.lean · lax-916827

proven

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

    Evidence

    Each proof establishes this claim relative to its assumptions.

    In the paper

    Theorem

    For regular functions f1:A1B1f_1 : A_1^* \to B_1^* and f2:A2B2f_2 : A_2^* \to B_2^* with disjoint input and output alphabets, the function f1+f2f_1 + f_2 on (A1+A2)(A_1 + A_2)^* is regular (Claim C.2.11 of Transducers): it applies f1f_1 to the inputs using only letters of A1A_1, f2f_2 to those using only letters of A2A_2, and returns a fixed string \bot using both output alphabets otherwise. The claim is what the closure properties of Lemma C.2.10 rest on.

    Lean source view on GitHub

    1import Lax916827.RegularFunctions
    2
    3/-!
    4---
    5title: The sum of two regular functions on disjoint alphabets
    6type: theorem
    7---
    8For regular functions f1:A1B1f_1 : A_1^* \to B_1^* and f2:A2B2f_2 : A_2^* \to B_2^*
    9with disjoint input and output alphabets, the function f1+f2f_1 + f_2 on
    10(A1+A2)(A_1 + A_2)^* is regular (Claim C.2.11 of *Transducers*): it applies f1f_1
    11to the inputs using only letters of A1A_1, f2f_2 to those using only letters of
    12A2A_2, and returns a fixed string \bot using both output alphabets otherwise.
    13The claim is what the closure properties of Lemma C.2.10 rest on.
    14
    15# Formalization notes
    16
    17The claim as printed is false on the empty input: the empty string uses only
    18letters of A1A_1 and, at the same time, only letters of A2A_2, so the first two
    19requirements conflict unless f1(ε)f_1(\varepsilon) and f2(ε)f_2(\varepsilon) are both
    20empty. The statement therefore imposes the two requirements on *nonempty*
    21inputs only and leaves the value on the empty input unspecified, which is
    22harmless for the use the book makes of the claim, where the blocks are always
    23nonempty. The disjoint union of alphabets is `A₁ ⊕ A₂`, and the output
    24alphabets are assumed nonempty so that \bot exists.
    25-/
    26
    27namespace Lax916827.RegularSum
    28
    29open Lax916827.RegularFunctions
    30
    31/-- The sum `f₁ + f₂` of two regular functions on disjoint alphabets is regular,
    32with a bottom value on mixed inputs (and the two clauses required on nonempty
    33inputs). -/
    34axiom exists_isRegularFun_sum {A₁ A₂ B₁ B₂ : Type} [Finite A₁] [Finite A₂] [Finite B₁] [Finite B₂]
    35 [Nonempty B₁] [Nonempty B₂] {f₁ : List A₁ → List B₁} {f₂ : List A₂ → List B₂}
    36 (hf₁ : IsRegularFun f₁) (hf₂ : IsRegularFun f₂) :
    37 ∃ (bot : List (B₁ ⊕ B₂)) (F : List (A₁ ⊕ A₂) → List (B₁ ⊕ B₂)),
    38 (∃ b₁, Sum.inl b₁ ∈ bot) ∧ (∃ b₂, Sum.inr b₂ ∈ bot) ∧
    39 IsRegularFun F ∧
    40 (∀ u : List A₁, u ≠ [] → F (u.map Sum.inl) = (f₁ u).map Sum.inl) ∧
    41 (∀ u : List A₂, u ≠ [] → F (u.map Sum.inr) = (f₂ u).map Sum.inr) ∧
    42 (∀ w, (¬ ∃ u : List A₁, w = u.map Sum.inl) → (¬ ∃ u : List A₂, w = u.map Sum.inr) →
    43 F w = bot)
    44
    45end Lax916827.RegularSum
    46
    Show Proof

    Formalization notes

    The claim as printed is false on the empty input: the empty string uses only letters of A1A_1 and, at the same time, only letters of A2A_2, so the first two requirements conflict unless f1(ε)f_1(\varepsilon) and f2(ε)f_2(\varepsilon) are both empty. The statement therefore imposes the two requirements on nonempty inputs only and leaves the value on the empty input unspecified, which is harmless for the use the book makes of the claim, where the blocks are always nonempty. The disjoint union of alphabets is A1A2A₁ ⊕ A₂, and the output alphabets are assumed nonempty so that \bot exists.

    Used by

    none

    From Mathlib

    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…