Words as blank-padded indexed families #
List.config reads a word as a two-sided indexed family ℤ → Option α: letters on
[0, w.length), blank (none) elsewhere; List.window k w i is its width-k slice
at i. Position-indexed statements about words replace factor-of-augmented-word
bookkeeping: a window entry is a letter or a blank according to a single interval
test, so occurrence pinning is interval arithmetic.
[UPSTREAM] candidate: Mathlib.Data.List, on the List.toFinsupp precedent — a list
as an indexed family with a default.
The two-sided configuration of a word: letters on [0, w.length), blank
elsewhere.
Instances For
theorem
List.getElem?_of_config_eq_some
{α : Type u_1}
{w : List α}
{i : ℤ}
{a : α}
(h : w.config i = some a)
:
w[i.toNat]? = some a
Windows #
The width-k window of w at i: the configuration restricted to [i, i + k).
Equations
- List.window k w i = List.ofFn fun (j : Fin k) => w.config (i + ↑↑j)
Instances For
@[simp]