AFTD Auto-Formalizing Theoretical Domains

is_constant_word

deforiginal

A word y on the finite index set Fin n is constant if all its symbols are equal, that is, y i = y j for all i and j in Fin n.

Statement

def is_constant_word {n : ℕ} {α : Type*} (y : Fin n → α) : Prop
Related work
folklore
Verified
11 Nov 2026
Axioms
none listed
Used by 8

Read back from the Lean

Given a natural number $n$, a type $\alpha$, and a sequence (or word) $y : \mathrm{Fin}\ n \to \alpha$, is_constant_word y asserts that for all indices $i, j : \mathrm{Fin}\ n$, $y(i) = y(j)$ (i.e., every pair of entries in $y$ is equal).

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

/-- A word on Fin n is constant if all its symbols are equal. -/
def is_constant_word {n : ℕ} {α : Type*} (y : Fin n → α) : Prop := ∀ i j : Fin n, y i = y j
See it in the graphDiscuss this resultChallenge it