Observation. Monoid structure of strings [016L]

By Lemma [016K], strings under concatenation form a monoid, but not a commutative monoid (indeed, we don’t have uv=vu unless either u or v is empty or u=v). Viewing \Sigma ^\star as a monoid, we see that the length function {\mathopen {}\left \lvert -\right \rvert \mathclose {}}\colon \Sigma ^\star \to \mathbb {N} is a homomorphism of monoids from strings to the additive monoid of the natural numbers:

\begin {aligned} {\mathopen {}\left \lvert \epsilon \right \rvert \mathclose {}} &= 0\\ {\mathopen {}\left \lvert uv\right \rvert \mathclose {}} &= {\mathopen {}\left \lvert u\right \rvert \mathclose {}}+{\mathopen {}\left \lvert v\right \rvert \mathclose {}} \end {aligned}