Example

Suppose all elements of the monoid M can be expressed as products of a single element, say c. So M = {e = c0, c, c2, ...}. (The monoid is said to be generated by c.) Define a map f : N -> M by

f(n) = cn.

Then we have

f(n + m) = cn + m = cn * cm = f(n) * f(m).

Also, f(0) = e. Hence f is a morphism of monoids. Clearly, f is surjective. But it need not be injective. If M is a free monoid, then the map f is also injective.

Another example of a morphism of monoids is the length function for a free monoid. Indeed, if M is a free momoid over an alphabet A, then the length function L from M to N satisfies L(Ø) = 0 and L(x . y) = L(x) + L(y).

If A has size 1, this length function is the inverse of the morphism mentioned above.