Associativity on Four Elements

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

Let $a, b, c, d \in S$.

Then:
 * $a \circ b \circ c \circ d$

gives a unique answer no matter how the elements are associated.

Proof
As $\left({S, \circ}\right)$ is a semigroup:
 * it is closed
 * $\circ$ is associative

From Count of Associations, there are exactly $5$ different ways of inserting brackets in the expression $a \circ b \circ c \circ d$.

As $\circ$ is associative, we have that:
 * $\forall s_1, s_2, s_3 \in S: \left({s_1 \circ s_2}\right) \circ s_3 = s_1 \circ \left({s_2 \circ s_3}\right)$

As $\left({S, \circ}\right)$ is closed, we know that all products of elements from $\left\{{a, b, c, d}\right\}$ are in $S$, and are likewise bound by the associativity of $S$.

So:

Also see

 * General Associativity Theorem, which demonstrates this rule for any number of elements.