Powers of Commuting Elements of Monoid Commute

Theorem
Let $\left({S, \circ}\right)$ be a monoid whose identity element is $e$.

For $a \in S$, let $\circ^n a = a^n$ denote the $n$th power of $a$.

Let $a, b \in S$ such that $a$ commutes with $b$:
 * $a \circ b = b \circ a$

Then:
 * $\forall m, n \in \N: \left({\circ^m a}\right) \circ \left({\circ^n b}\right) = \left({\circ^n b}\right) \circ \left({\circ^m a}\right)$

That is:
 * $\forall m, n \in \N: a^m \circ b^n = b^n \circ a^m$

Proof
Because $\left({S, \circ}\right)$ is a monoid, it is a fortiori also a semigroup.

From Powers of Commuting Elements of Semigroup Commute:
 * $\forall m, n \in \N_{>0}: \left({\circ^m a}\right) \circ \left({\circ^n b}\right) = \left({\circ^n b}\right) \circ \left({\circ^m a}\right)$

That is:
 * $\forall m, n \in \N_{>0}: a^m \circ b^n = b^n \circ a^m$

It remains to be shown that the result holds for the cases where $m = 0$ and $n = 0$.

Let $n \in \N$:

Similarly, let $m \in \N$:

and:

Thus:
 * $a^m \circ b^n = b^n \circ a^m$

holds for $n = 0$ and $m = 0$.

Thus:
 * $\forall m, n \in \N: a^m \circ b^n = b^n \circ a^m$