Index Laws/Product of Indices/Semigroup

Theorem
Let $\left({S, \circ}\right)$ 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} = \left({a^n}\right)^m = \left({a^m}\right)^n$

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

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

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


 * $\forall n \in \N_{>0}: h \left({n}\right) = \circ^{n m} a$

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


 * $\forall n \in \N_{>0}: f_b \left({n}\right) = \circ^n b$

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

b & : n = 1 \\ f_b \left ({r}\right) \circ b & : n = r \circ 1 \end{cases}$

But $h \left({1}\right) = \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 \left({\circ^m a}\right)$

From Natural Number Multiplication is Commutative:


 * $\forall n, m \in \N_{>0}: \circ^m \left({\circ^n a}\right) = \circ^{m n} = \circ^{n m}$