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
- is_longest_word_run_of_constantFor any constant word y on Fin n with 1 ≤ n, the interval [0, n) is a longest run of y.
- 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_1534_binary_length_two_one_deletionFor every binary word y of length 2 (y : Fin 2 → Fin 2), the one-deletion hinge sums at thresholds r = 1 and r = 2 satisfy…
- is_word_run_of_constantFor any constant word y on Fin n with 1 ≤ n, the full interval [0, n) is a run of y.
- 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…
- op_1534_ternary_length_two_one_deletionFor every ternary word y of length 2 (y : Fin 2 → Fin 3), the one-deletion hinge sums at thresholds r = 1 and r = 2 satisfy…
- qary_all_zero_word_is_constantFor any alphabet size q with 1 ≤ q and length n, the all-zero word qary_all_zero_word q n hq is a constant word.
- decidable_is_constant_wordDecidability instance for the predicate that a word on Fin n over a type with decidable equality is constant.
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