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}: h \paren n = \circ^{n m} a$

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


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

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

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

But $h \paren 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}$