AFTD Auto-Formalizing Theoretical Domains

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

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
See it in the graphDiscuss this resultChallenge it