mask_u_runs_nil
An empty binary mask has zero U-runs: mask_u_runs [] = 0.
Statement
theorem mask_u_runs_nil : mask_u_runs [] = 0- Source
- folklore
- Verified
- 31 Oct 2026
- Axioms
- none — Lean reports it depends on no axioms
- Built on 1
- mask_u_runsThe number of maximal nonempty U-runs in a binary mask M is defined by mask_u_runs M = mask_u_runs_aux false M, counting contiguous blocks…
Read back from the Lean
The value of mask_u_runs on the empty list is 0.
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
The theorem holds by definitional equality. Expanding mask_u_runs on the empty list immediately yields mask_u_runs_aux false [], which evaluates to 0 by the base case of its definition.
The number of U-runs in the empty mask is 0 (that is, mask_u_runs [] = 0).
By definition, mask_u_runs [] evaluates to mask_u_runs_aux false [], which evaluates directly to 0 on an empty list. Since both sides reduce to 0, the equality holds by definition.
theorem mask_u_runs_nil : mask_u_runs [] = 0 := by rfl
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.
/-- An empty binary mask has zero U-runs. -/theorem mask_u_runs_nil : mask_u_runs [] = 0 := by rfl