Composition of Relations is Associative

Theorem
The composition of relations is an associative binary operation:


 * $$\left({\mathcal R_3 \circ \mathcal R_2}\right) \circ \mathcal R_1 = \mathcal R_3 \circ \left({\mathcal R_2 \circ \mathcal R_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({\mathcal R_2}\right) = \operatorname{Rng} \left({\mathcal R_1}\right)$$
 * $$\operatorname{Dom} \left({\mathcal R_3}\right) = \operatorname{Rng} \left({\mathcal R_2}\right)$$

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

$$ $$

$$ $$

... and also the same codomain, thus:

$$ $$

$$ $$

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

$$ $$ $$ $$