AFTD Auto-Formalizing Theoretical Domains

word_a_gaps

def

The '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 maximal segments delimited by the letters different from a (so the list has length (number of letters different from a) + 1).

Statement

def word_a_gaps {α : Type*} [DecidableEq α] (a : α) (w : List α) : List ℕ
Source
step towards word_unary_inserted_block_exchange_exact
Verified
07 Nov 2026
Axioms
none listed
Built on 1
  • word_a_gaps_auxAuxiliary accumulator version of the 'a'-gap profile: scanning a word left to right, accumulating the count of copies of a since the last…
Used by 1
  • word_gap_occThe number of gaps in which w has strictly more copies of a than v: the number of indices at which the 'a'-gap profile of w exceeds that…

Lean source view module on GitHub

def word_a_gaps {α : Type*} [DecidableEq α] (a : α) (w : List α) : List ℕ := word_a_gaps_aux a 0 w
See it in the graphDiscuss this resultChallenge it