Inverse of Composite Relation

Theorem
Let $\RR_2 \circ \RR_1 \subseteq S_1 \times S_3$ be the composite of the two relations $\RR_1 \subseteq S_1 \times S_2$ and $\RR_2 \subseteq S_2 \times S_3$.

Then:
 * $\paren {\RR_2 \circ \RR_1}^{-1} = \RR_1^{-1} \circ \RR_2^{-1}$

Proof
Let $\RR_1 \subseteq S_1 \times S_2$ and $\RR_2 \subseteq S_2 \times S_3$ be relations.

We assume that:
 * $\Dom {\RR_2} = \Cdm {\RR_1}$

where $\Dom \RR$ denotes domain and $\Cdm \RR$ denotes codomain of a relation $\RR$.

This is necessary for $\RR_2 \circ \RR_1$ to exist.

From the definition of an inverse relation, we have:


 * $\Dom {\RR_2} = \Cdm {\RR_2^{-1} }$
 * $\Cdm {\RR_1} = \Dom {\RR_1^{-1} }$

So we confirm that $\RR_1^{-1} \circ \RR_2^{-1}$ is defined.