Append congruence for List.destutter #
Mathlib's Mathlib/Data/List/Destutter.lean has no destutter-vs-append lemma. These
fill that gap for the (· ≠ ·) relation: collapsing either operand before appending is
absorbed by an outer destutter, so destutter (· ≠ ·) is a congruence for ++. The
proofs go through destutter' boundary scaffolding. Candidates for
Mathlib/Data/List/Destutter.lean.
Main results #
List.destutter_append_left/List.destutter_append_right— collapsing one operand before appending does not change the destuttered result.List.destutter_append_destutter— the congruence:destutter (· ≠ ·)of an append equalsdestutter (· ≠ ·)of the destuttered operands.List.destutter_head?—destutterpreserves the head.List.destutter_append_length_clean— the clean-clean boundary length: two(· ≠ ·)chains concatenated and destuttered merge exactly one element iff the seam matches.List.destutterConcat— append then destutter; the multiplication of the destutter quotient monoid, with its associativity and unit laws (pureListfacts).
Collapsing the left operand before appending does not change the destuttered result.
Collapsing the right operand before appending does not change the destuttered result.
The append congruence: destutter (· ≠ ·) of an append equals destutter (· ≠ ·) of
the destuttered operands.
Head and the clean-clean boundary #
destutter fuses a constant run whenever the relation is irreflexive at its
element.
destutter preserves the head: the running element is the input's head.
The clean-clean boundary length. Two chains concatenated and destuttered merge only
at the seam: the length is the sum of lengths minus one exactly when the last element of l
equals the first of m. The numerical core of the autosegmental OCP quotient
(Phonology/Autosegmental/Collapse.lean).
Append-then-destutter #
destutterConcat — append, then collapse the single run that may form at the seam — is the
multiplication of the destutter quotient monoid (built on the free monoid in
Mathlib.Algebra.FreeMonoid.Destutter). Associativity and the unit laws reduce to the
++-congruences above, so they are pure List facts and live here.
Append then destutter: concatenate, then collapse the single run that may form at the seam. The multiplication of the destutter quotient monoid.
Equations
- x.destutterConcat y = List.destutter (fun (x1 x2 : α) => x1 ≠ x2) (x ++ y)
Instances For
destutterConcat outputs are stutter-free.
destutterConcat is associative — inherited from ++ through destutter.
destutter (· ≠ ·) carries (List α, ++) onto (·, destutterConcat).