Composition of Mappings is Associative

Theorem
The composition of mappings is an associative binary operation:


 * $\left({f_3 \circ f_2}\right) \circ f_1 = f_3 \circ \left({f_2 \circ f_1}\right)$

Proof
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:


 * $\operatorname{Dom} \left({f_2}\right) = \operatorname{Cdm} \left({f_1}\right)$
 * $\operatorname{Dom} \left({f_3}\right) = \operatorname{Cdm} \left({f_2}\right)$

where $\operatorname{Cdm} \left({f}\right)$ denotes the codomain of the mapping $f$.

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

... and also the same codomain, thus:

Then we note that a mapping is a relation.

Then we note the fact that composition of relations is associative:


 * $\forall x \in \operatorname{Dom} \left({f_1}\right): \left({f_3 \circ f_2}\right) \circ f_1 \left({x}\right) = f_3 \circ \left({f_2 \circ f_1}\right) \left({x}\right)$

Hence the result.