First differences of binary words
DefinitionFirst difference of an infinite binary word#✓fully proved
MetaMathlibExt.firstDifference
For an infinite word \(w = w_0 w_1 w_2 \cdots\) over \(\mathbb{Z}/2\mathbb{Z}\), its first difference is the infinite word \(\Delta w\) over \(\mathbb{Z}/2\mathbb{Z}\) with \((\Delta w)_i = w_{i+1} - w_i\) for every natural number \(i\).
DefinitionFirst difference of a finite binary word#✓fully proved
MetaMathlibExt.firstDifferenceList
For a finite word \(w = w_0 w_1 \cdots w_m\) over \(\mathbb{Z}/2\mathbb{Z}\), its first difference is the word \((w_1 - w_0)(w_2 - w_1) \cdots (w_m - w_{m-1})\) of length \(m\), computed in \(\mathbb{Z}/2\mathbb{Z}\). The first difference of the empty word is the empty word.
def firstDifferenceList (w : List (ZMod 2)) : List (ZMod 2) :=
List.zipWith (· - ·) w.tail w
2 fully proved
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.