Composition of Relations is Associative

Theorem
The composition of relations is an associative binary operation:


 * $\paren {\RR_3 \circ \RR_2} \circ \RR_1 = \RR_3 \circ \paren {\RR_2 \circ \RR_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 {\RR_2} = \Cdm {\RR_1}$
 * $\Dom {\RR_3} = \Cdm {\RR_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: