word_absorb_run
deforiginal
The word obtained from y : Fin n → α by changing every letter in the index interval [a', b') to c, leaving all letters outside the interval unchanged.
Statement
def word_absorb_run {n : ℕ} {α : Type*} (y : Fin n → α) (a' b' : ℕ) (c : α) : Fin n → α
- Related work
- folklore
- Verified
- 11 Nov 2026
- Axioms
- none listed
- Used by 2
- op_1537_binary_length_two_one_deletionFor any nonconstant binary word y : Fin 2 → Fin 2 of length 2, there exists a longest run [a, b) of y and an immediately adjacent run [a',…
- op_1537_ternary_length_two_one_deletionFor any nonconstant ternary word y : Fin 2 → Fin 3 of length 2, there exists a longest run [a, b) of y and an immediately adjacent run…
Read back from the Lean
Given a natural number n, a type α, a function y : Fin n → α, natural numbers a' and b', and a symbol c : α, word_absorb_run y a' b' c is the function Fin n → α that maps each index i : Fin n to c if a' ≤ i.val and i.val < b', and to y i otherwise.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- Replace all letters of word y in the interval [a', b') by the letter c. -/ def word_absorb_run {n : ℕ} {α : Type*} (y : Fin n → α) (a' b' : ℕ) (c : α) : Fin n → α := fun i => if a' ≤ i.val ∧ i.val < b' then c else y i