qary_all_zero_word_is_constant
For 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.
Statement
theorem qary_all_zero_word_is_constant (q n : ℕ) (hq : 1 ≤ q) :
is_constant_word (qary_all_zero_word q n hq)- Source
- folklore
- Verified
- 12 Nov 2026
- Axioms
Quot.soundpropext- Built on 3
- is_constant_wordA 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.
- qary_all_zero_wordFor an alphabet size q with 1 ≤ q and length n, the all-zero word is the word in Fin n → Fin q taking constant value 0 (represented by ⟨0,…
- power_divergence_quarter_root_boundsFor x ≥ 0 and b ≥ 0, if a^4 ≤ x ≤ b^4 then a ≤ x^(1/4) ≤ b.
Read back from the Lean
For all natural numbers $q$ and $n$, and any hypothesis $hq : 1 \le q$, the $q$-ary all-zero word of length $n$ (qary_all_zero_word q n hq) is a constant word (is_constant_word).
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
By definition, a word is constant if all its coordinates are equal. Unfolding the definitions of `is_constant_word` and the all-zero word `qary_all_zero_word`, each coordinate is identically 0. The required equality between any two positions simplifies to 0 = 0, which holds trivially.
The all-zero word is a constant word. automation
Unfolding the definitions of a constant word (`is_constant_word`) and the all-zero word (`qary_all_zero_word`), the goal is to show that for any indices i and j, the i-th coordinate ⟨0, hq⟩ equals the j-th coordinate ⟨0, hq⟩. This reflexivity equality simplifies to True, leaving the trivial goal ∀ i j : Fin n, True, which the simplifier closes immediately.
uses
is_constant_word,qary_all_zero_word,power_divergence_quarter_root_boundsis_constant_word (qary_all_zero_word q n hq) := by first | exact power_divergence_quarter_root_bounds | (apply power_divergence_quarter_root_bounds <;> assumption) | (apply power_divergence_quarter_root_bounds <;> simp_all) | simpa using power_divergence_quarter_root_bounds | (simp only [is_constant_word, qary_all_zero_word] at *; first | exact power_divergence_quarter_root_bounds | (apply power_divergence_quarter_root_bounds <;> assumption) | (apply power_divergence_quarter_root_bounds <;> simp_all) | simpa using power_divergence_quarter_root_bounds)
is_constant_word- A word y of length n is constant if y(i) = y(j) for all coordinate indices i and j.
qary_all_zero_word- The word of length n over an alphabet of size q (with 1 ≤ q) where every coordinate is 0.
power_divergence_quarter_root_bounds- For real numbers with 0 ≤ x, 0 ≤ b, a⁴ ≤ x, and x ≤ b⁴, the fourth root x^(1/4) lies between a and b (spurious library lemma not mathematically needed here).
- The proof script is the output of an automated tactic search (such as a hammer or try-at-each-step script). It attempts several fallback branches referencing the real-analysis lemma `power_divergence_quarter_root_bounds`, which is entirely irrelevant to words and alphabets. Once the definitions are expanded, the statement reduces to showing that 0 = 0, which is closed by the simplifier without using the real-analysis lemma at all.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- The all-zero word is constant. -/theorem qary_all_zero_word_is_constant (q n : ℕ) (hq : 1 ≤ q) : is_constant_word (qary_all_zero_word q n hq) := by first | exact power_divergence_quarter_root_bounds | (apply power_divergence_quarter_root_bounds <;> assumption) | (apply power_divergence_quarter_root_bounds <;> simp_all) | simpa using power_divergence_quarter_root_bounds | (simp only [is_constant_word, qary_all_zero_word] at *; first | exact power_divergence_quarter_root_bounds | (apply power_divergence_quarter_root_bounds <;> assumption) | (apply power_divergence_quarter_root_bounds <;> simp_all) | simpa using power_divergence_quarter_root_bounds)