word_is_unary
def
A word over an alphabet is unary if it is a nonempty power of a single letter, that is, it is the repetition of some letter a for a positive number n of times.
Statement
def word_is_unary {α : Type*} (s : List α) : Prop
- Defined in
- arXiv:2610.39941 Section 5
- Verified
- 02 Nov 2026
- Axioms
- none listed
Read back from the Lean
For a type α and a list s : List α, word_is_unary s asserts that there exist an element a : α and a natural number n : ℕ such that s is equal to List.replicate n a (the list consisting of n copies of a) and 0 < n (i.e., n is strictly positive, so s is non-empty).
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 is unary if it is a positive repetition of a single letter. -/ def word_is_unary {α : Type*} (s : List α) : Prop := ∃ a : α, ∃ n : ℕ, s = List.replicate n a ∧ 0 < n