Index Laws/Product of Indices/Semigroup

Theorem
Let $\struct {S, \circ}$ be a semigroup.

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

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

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

Proof
Let $b = \circ^m a$.

Let $h: \N_{>0} \to S$ be the mapping defined as:


 * $\forall n \in \N_{>0}: \map h n = \circ^{n m} a$

Let the mapping $f_b: \N_{>0} \to S$ be recursively defined as:


 * $\forall n \in \N_{>0}: \map {f_b} n = \circ^n b$

From the Principle of Recursive Definition:
 * $f_b$ is the unique mapping which satisfies:
 * $\forall n \in \N_{>0}: \map {f_b} n = \begin{cases}

b & : n = 1 \\ \map {f_b} r \circ b & : n = r \circ 1 \end{cases}$

But $\map h 1 = \circ^{1 \times m} a = \circ^m a = b$.

So:

Thus $h = f_b$, and so:


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

From Natural Number Multiplication is Commutative:


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