Inverse of Composite Relation

Theorem
Let $$\mathcal{R}_2 \circ \mathcal{R}_1 \subseteq S_1 \times S_3$$ be the composite of the two relations $$\mathcal{R}_1 \subseteq S_1 \times S_2$$ and $$\mathcal{R}_2 \subseteq S_2 \times S_3$$. Then:

$$\left({\mathcal{R}_2 \circ \mathcal{R}_1}\right)^{-1} = \mathcal{R}_1^{-1} \circ \mathcal{R}_2^{-1}$$

Proof
Let $$\mathcal{R}_1 \subseteq S_1 \times S_2$$ and $$\mathcal{R}_2 \subseteq S_2 \times S_3$$ be relations.

We assume that $$\mathrm {Dom} \left({\mathcal{R}_2}\right) = \mathrm {Rng} \left({\mathcal{R}_1}\right)$$ as is necessary for $$\mathcal{R}_2 \circ \mathcal{R}_1$$ to exist.

From the definition of an inverse relation, we have:


 * $$\mathrm {Dom} \left({\mathcal{R}_2}\right) = \mathrm {Rng} \left({\mathcal{R}_2^{-1}}\right)$$
 * $$\mathrm {Rng} \left({\mathcal{R}_1}\right) = \mathrm {Dom} \left({\mathcal{R}_1^{-1}}\right)$$

So we confirm that $$\mathcal{R}_1^{-1} \circ \mathcal{R}_2^{-1}$$ is defined.