Index Laws/Product of Indices/Monoid

Theorem
Let $\struct {S, \circ}$ be a monoid whose identity element is $e$.

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

Then:
 * $\forall m, n \in \N: a^{n m} = \paren {a^n}^m = \paren {a^m}^n$

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

Proof
Because $\struct {S, \circ}$ is a monoid, it is a fortiori a semigroup.

Hence, from Index Laws for Semigroup: Product of Indices:
 * $\forall m, n \in \N_{>0}: \circ^{n m} a = \circ^m \paren {\circ^n a} = \circ^n \paren {\circ^m a}$

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

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

so the condition holds for either $n = 0$ or $m = 0$.

Finally, we also have:


 * $\circ^n \paren {\circ^0 a} = e = \circ^0 \paren {\circ^m a}$
 * $\circ^0 \paren {\circ^n a} = e = \circ^m \paren {\circ^0 a}$