While this submission is a draft, it cannot be used by other submissions.

Evaluation of unary chains in every sort

Lax369799.UnaryChains · concepts/Lax369799/UnaryChains.lean · lax-369799

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.

    Natural Language Statement

    Theorem

    A finite chain of unary letters followed by a value of any rank is evaluated by successive unary application. For a unary final letter this computes the semigroup value of a nonempty word.

    Concept map
    13 concepts; 2 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    Evidence

    This concept declares 2 statements. Each proof establishes one of them relative to its assumptions.

    2 word_evaluation proven

    Lean source view on GitHub

    1import Lax369799.UnaryComposition
    2import Lax369799.UnaryFactorization
    3
    4/-!
    5---
    6title: Evaluation of unary chains in every sort
    7type: theorem
    8---
    9A finite chain of unary letters followed by a value of any rank is
    10evaluated by successive unary application. For a unary final letter this
    11computes the semigroup value of a nonempty word.
    12-/
    13
    14namespace Lax369799.UnaryChains
    15open RankedSystems (RankedSet)
    16open FinitePresentations FiniteSyntacticAlgebra
    17
    18def path {A : RankedSet} {k n : ℕ} (w : Fin k → A 1) (a : A n) : FiniteSystem A n where
    19 size := k + 1
    20 graph := {
    21 label := Fin.lastCases ⟨n, a⟩ (fun i => ⟨1, w i⟩)
    22 initial := {0}
    23 root := ∅
    24 edge := fun v d t =>
    25 (∃ i : Fin k, v = i.castSucc ∧ d = 0 ∧ t = .inl i.succ) ∨
    26 (v = Fin.last k ∧ ∃ j : Fin n, d = j.val ∧ t = .inr j)
    27 direction_valid := by
    28 rintro v d t (⟨i, rfl, rfl, rfl⟩ | ⟨rfl, j, rfl, _⟩) <;> simp }
    29
    30axiom evaluation {A : RankedSet} (E : Algebra A) {k n : ℕ}
    31 (w : Fin k → A 1) (a : A n) :
    32 E.eval n (path w a) = (List.ofFn w).foldr (UnaryComposition.act E) a
    33
    34def word {A : RankedSet} (w : ℕ → A 1) (i k : ℕ) : FiniteSystem A 1 :=
    35 path (fun t : Fin k => w (i + t.val)) (w (i + k))
    36
    37axiom word_evaluation {A : RankedSet} (E : Algebra A) (w : ℕ → A 1) (i k : ℕ) :
    38 E.eval 1 (word w i k) = UnaryFactorization.block E w i (i + k + 1)
    39
    40end Lax369799.UnaryChains
    41
    Show ProofShow Proof

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…