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

 * $\begin{xy}\xymatrix@L + 2mu@ + 1em {

E \ar[ddd]^*{f} \ar[rrr]^*{g \circ f} \ar@{..>}[drdrdr]_*{h \circ g \circ f} & & & G \ar[ddd]^*{h} \\ \\ \\ F \ar[rrr]^*{h \circ g} \ar[rururu]_*{g} & & & H }\end{xy}$

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}: \map {\paren {f_3 \circ f_2} \circ f_1} x = \map {f_3 \circ \paren {f_2 \circ f_1} } x$

Hence the result.