word_a_gaps_aux
def
Auxiliary accumulator version of the 'a'-gap profile: scanning a word left to right, accumulating the count of copies of a since the last letter different from a, emitting that count when a different letter is met and ending with the trailing count.
Statement
def word_a_gaps_aux {α : Type*} [DecidableEq α] (a : α) : ℕ → List α → List ℕ
- Source
- step towards word_unary_inserted_block_exchange_exact
- Verified
- 07 Nov 2026
- Axioms
- none listed
- Used by 1
- word_a_gapsThe 'a'-gap profile of a word: the list whose j-th entry is the number of copies of a appearing in the j-th gap, the gaps being the…
Lean source view module on GitHub
def word_a_gaps_aux {α : Type*} [DecidableEq α] (a : α) : ℕ → List α → List ℕ | c, [] => [c] | c, x :: xs => if x = a then word_a_gaps_aux a (c + 1) xs else c :: word_a_gaps_aux a 0 xs