The destutter quotient monoid of a free monoid #
For [DecidableEq α], List.destutter (· ≠ ·) collapses each maximal run of equal adjacent
elements to one; the lists it fixes are exactly the List.IsChain (· ≠ ·) lists (no two
adjacent elements equal). Under append-then-destutter these form a monoid, and
List.destutter (· ≠ ·) is the quotient homomorphism out of the free monoid:
{l // l.IsChain (· ≠ ·)} ≃* FreeMonoid α ⧸ ker.
Abstractly this is the monoid presented by idempotent generators ⟨α | a · a = a⟩: the
defining relations destutterRel make each generator absorb its own repeat, the rewriting
system a · a → a is confluent and terminating, and destutter (· ≠ ·) computes its normal
forms — the stutter-free words. presentedMonoidEquiv packages this as a MulEquiv
PresentedMonoid (destutterRel α) ≃* {l // l.IsChain (· ≠ ·)}, identifying the abstract
presentation with the concrete normal-form model.
Main definitions #
Monoid {l : List α // l.IsChain (· ≠ ·)}— the destutter quotient monoid, with multiplicationList.destutterConcat(fromCore.Data.List.Destutter).FreeMonoid.destutterHom— the quotient mapFreeMonoid α →* {l // l.IsChain (· ≠ ·)}.FreeMonoid.destutterRel— the presentation⟨α | a · a = a⟩: each generator is idempotent.FreeMonoid.destutterQuotientEquiv— first isomorphismFreeMonoid α ⧸ ker ≃* {l // …}.FreeMonoid.presentedMonoidEquiv— the concrete model is the presented monoidPresentedMonoid (destutterRel α) ≃* {l // l.IsChain (· ≠ ·)}.FreeMonoid.destutterLift— the universal property: the destutter monoid is the free monoid on idempotent generators; anyf : α → Mwithf a * f a = f aextends uniquely (destutterLift_unique) to a monoid homl ↦ (l.map f).prod.
Implementation notes #
The destutter-vs-++ congruence lemmas live in Core.Data.List.Destutter (candidates
for Mathlib.Data.List.Destutter); this file adds the monoid/presentation layer (candidate
for Mathlib.Algebra.FreeMonoid). The monoid multiplication is associative because
destutter (· ≠ ·) is a ++-congruence (destutter_append_left/_right from that file);
the presentation is identified with the concrete model by the normalization lemma
conGen_destutterRel_destutter. Nothing here is specific to any application; the phonological
Obligatory Contour Principle (Phonology.OCP) is one consumer, reading the presentation as
autosegmental tier fusion.
The bundled quotient monoid #
The multiplication List.destutterConcat (append then destutter) and its List-level laws
live in Core.Data.List.Destutter; here they are bundled into the monoid structure.
Equations
- List.instMulSubtypeIsChainNe_linglib = { mul := fun (a b : { l : List α // List.IsChain (fun (x1 x2 : α) => x1 ≠ x2) l }) => ⟨(↑a).destutterConcat ↑b, ⋯⟩ }
Equations
- List.instOneSubtypeIsChainNe_linglib = { one := ⟨[], ⋯⟩ }
The destutter quotient monoid: destutterConcat multiplication, [] unit.
Equations
- One or more equations did not get rendered due to their size.
The destutter quotient map: send a free-monoid word to its destutter (· ≠ ·)
normal form. List.destutter_append_destutter is its map_mul.
Equations
- FreeMonoid.destutterHom = { toFun := fun (l : FreeMonoid α) => ⟨List.destutter (fun (x1 x2 : α) => x1 ≠ x2) (FreeMonoid.toList l), ⋯⟩, map_one' := ⋯, map_mul' := ⋯ }
Instances For
ofList of a stutter-free list is a right inverse of destutterHom: a chain is its own
destutter normal form.
First isomorphism theorem for the destutter quotient: the abstract quotient
FreeMonoid α ⧸ ker is the concrete stutter-free model {l // l.IsChain (· ≠ ·)}.
Computable: ofList on chains is the right inverse.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The monoid presentation ⟨α | a · a = a⟩ #
The defining relations of the destutter monoid: every generator is idempotent
(a · a = a). The presented monoid PresentedMonoid (destutterRel α) is ⟨α | a · a = a⟩.
Equations
- FreeMonoid.destutterRel α x y = ∃ (a : α), x = FreeMonoid.of a * FreeMonoid.of a ∧ y = FreeMonoid.of a
Instances For
destutterHom collapses each defining relation: destutter [a, a] = [a].
Normalization: every free-monoid word is congruent, modulo the idempotent-generator
relations, to its destutter (· ≠ ·) normal form. The rewriting system a · a → a reduces
each word to a stutter-free one.
The destutter congruence is the presentation ⟨α | a · a = a⟩: two words have the
same destutter exactly when the idempotent-generator relations identify them.
The concrete stutter-free model is the monoid presented by idempotent generators
⟨α | a · a = a⟩, with destutter (· ≠ ·) computing normal forms.
Equations
- FreeMonoid.presentedMonoidEquiv = (Con.congr ⋯).trans FreeMonoid.destutterQuotientEquiv
Instances For
Universal property: the free monoid on idempotent generators #
(· .map f).prod is invariant under destutter (· ≠ ·) when each f a is idempotent:
collapsing an adjacent run replaces f a * f a by f a. The engine of destutterLift,
read off the normalization lemma conGen_destutterRel_destutter.
Universal property — the destutter monoid is the free monoid on idempotent
generators: any f : α → M sending each generator to an idempotent element of M extends
to the monoid hom l ↦ (l.map f).prod out of the stutter-free model. This realizes
PresentedMonoid.lift's universal property for the presentation ⟨α | a · a = a⟩ (via
presentedMonoidEquiv) in concrete computable form — the destutter-monoid analogue of
FreeMonoid.lift.
Equations
- FreeMonoid.destutterLift f hf = { toFun := fun (l : { l : List α // List.IsChain (fun (x1 x2 : α) => x1 ≠ x2) l }) => (List.map f ↑l).prod, map_one' := ⋯, map_mul' := ⋯ }
Instances For
A stutter-free list is the product of its single-element generators (no fusion occurs, since it is already a chain): the generators generate.
Uniqueness for the universal property: any monoid hom agreeing with f on the
single-autosegment generators is destutterLift f hf.