Composition of Mappings is Associative

Theorem
The composition of mappings is an associative binary operation:


 * $\paren {f_3 \circ f_2} \circ f_1 = f_3 \circ \paren {f_2 \circ f_1}$

where $f_1, f_2, f_3$ are arbitrary mappings which fulfil the conditions for the relevant compositions to be defined.

Proof
From the definition, we know that a mapping is a relation.

First, note that from the definition of composition of relations, the following must be the case before the above expression is even to be defined:


 * $(1): \quad \Dom {f_2} = \Cdm {f_1}$
 * $(2): \quad \Dom {f_3} = \Cdm {f_2}$

where $\Cdm f$ denotes the codomain of the mapping $f$.

The two composite relations can be seen to have the same domain, as follows:

Also they have the same codomain, as is seen by:

As a mapping is a relation, we can use that the Composition of Relations is Associative‎:


 * $\forall x \in \Dom {f_1}: \paren {f_3 \circ f_2} \circ f_1 \paren x = f_3 \circ \paren {f_2 \circ f_1} \paren x$

Hence the result.