List.destutter and ++ #
Mathlib/Data/List/Destutter.lean has no lemma relating destutter to ++. The primitive is
the append decomposition List.destutter'_append: destuttering l ++ m from a destutters l
from a and then m from the last element kept. Destuttering the left operand first changes
nothing for any relation. When the negation of the relation is an equivalence, as for (· ≠ ·),
the same holds on the right, so destutter is a congruence for ++. [UPSTREAM] candidates for
that file.
Main statements #
List.head?_destutter:destutterpreserves the head.List.destutter'_append: the append decomposition.List.destutter_append_left,List.destutter_append_right: absorbing adestutterof either operand, soList.destutter_append_destuttermakesdestuttera congruence for++.List.destutter_replicate: a constant run fuses to one element.List.IsChain.destutter_ne_append: two(· ≠ ·)-chains concatenated and destuttered merge only at the seam.
Destuttering l ++ m from a destutters l from a, then m from the last element
kept.
List.destutter' on a relation like ≠, whose negation is an equivalence, keeps the same
elements after the first if the first elements are not related.
Destuttering two concatenated chains merges at most the seam, dropping the head of m
exactly when it repeats the last element of l.