General Associativity Theorem/Formulation 3

Theorem
Let $\left({S, \circ}\right)$ be a semigroup.

Let $a_i$ denote elements of $S$.

Let $\circ$ be associative.

Let $n$ be any positive integer: $n>3, n\in\N$.

Then every possible parenthesization of the expression:


 * $\displaystyle a_1 \circ a_2 \circ \dots \circ a_n$

is equivalent.

Lemma
Let $\circ$ be associative.

Then any parenthesization of $a_1 \circ a_2 \circ \dots \circ a_n$ is equal to the left-associated expression:
 * $\displaystyle ((\dots ( a_1 \circ a_2) \circ a_3) \circ \dots ) \circ a_n)$

Proof by induction
The base case, $n=3$: the product $a_1 \circ a_2 \circ a_3$ has two parenthesizations: $P_1: a_1 \circ (a_2 \circ a_3)$, $P_2: (a_1 \circ a_2) \circ a_3$.

$P_2$ is the left-associative parenthesization for $n=3$.

From the associativity condition, $P_1$ and $P_2$ are identical, so the base case holds.

The induction hypothesis: if for all $m<n$, all parenthesizations of the $m$-product are identical to its left-associative parenthesization
 * $\displaystyle ((\dots ( a_1 \circ a_2) \circ a_3) \circ \dots ) \circ a_m)$,

then all parenthesizations of the $n$-product are identical to its left-associative parenthesization
 * $\displaystyle ((\dots ( a_1 \circ a_2) \circ a_3) \circ \dots ) \circ a_n)$

Let $P_i$ denote any parenthesization of $a_1 \circ a_2 \circ \dots \circ a_n$.

Then $P_i$ is always the product of two smaller products:

}}

By the Principle of Mathematical Induction, the proof is complete.

It follows that all parenthesizations of $a_1 \circ a_2 \circ \dots \circ a_n$ yield identical results.

So the theorem holds.