Index Laws/Product of Indices/Monoid

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

For $a \in T$, let $\oplus^n a = a^n$ be defined as the $n$th power of $a$:


 * $a^n = \begin{cases}

e & : n = 0 \\ a^x \oplus a & : n = x + 1 \end{cases}$

That is:
 * $a^n = \underbrace{a \oplus a \oplus \cdots \oplus a}_{n \text{ copies of } a} = \oplus^n \left({a}\right)$

while:
 * $a^0 = e$

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

That is:
 * $\forall m, n \in \N: \oplus^{n m} a = \oplus^m \left({\oplus^n a}\right) = \oplus^n \left({\oplus^m a}\right)$

Proof
Let $a \in T$.

Because $\left({T, \oplus}\right)$ is a monoid, $\oplus$ is associative on $T$.

By the definition of the power of an element, the mapping $\oplus^n: \N \to T$ is defined as:


 * $\forall n \in \N: \oplus^n a = g_a \left({n}\right)$

where $g_a: \N \to T$ is the recursively defined mapping:


 * $\forall n \in \N: g_a \left({n}\right) = \begin{cases}

e & : n = 0 \\ g_a \left({r}\right) \oplus a & : n = r + 1 \end{cases}$

Consider the recursively defined mapping $f_a: \N_{>0} \to T$ defined as:


 * $\forall n \in \N_{>0}: f_a \left({n}\right) = \begin{cases}

a & : n = 1 \\ f_a \left({r}\right) \oplus a & : n = r + 1 \end{cases}$

From Restriction of Recursive Mapping from Naturally Ordered Semigroup to Algebraic Structure:


 * $f_a$ is the restriction of $g_a$ to $\N_{>0}$.

From Index Laws for Semigroup: Product of Indices:
 * $\forall m, n \in \N_{>0}: \oplus^{n m} a = \oplus^m \left({\oplus^n a}\right) = \oplus^n \left({\oplus^m a}\right)$

That is:
 * $\forall m, n \in \N_{>0}: a^{n m} = \left({a^n}\right)^m = \left({a^m}\right)^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:


 * $\oplus^n \left({\oplus^0 a}\right) = e = \oplus^0 \left({\oplus^m a}\right)$
 * $\oplus^0 \left({\oplus^n a}\right) = e = \oplus^m \left({\oplus^0 a}\right)$