Composition of Relations is Associative

Theorem
The composition of relations is an associative binary operation:


 * $\paren {\mathcal R_3 \circ \mathcal R_2} \circ \mathcal R_1 = \mathcal R_3 \circ \paren {\mathcal R_2 \circ \mathcal R_1}$

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:


 * $\Dom {\mathcal R_2} = \Cdm {\mathcal R_1}$
 * $\Dom {\mathcal R_3} = \Cdm {\mathcal R_2}$

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

... and also the same codomain, thus:

So they are equal they have the same value at each point in their common domain, which this shows: