Definition:Composition of Relations

Definition
Let $$\mathcal R_1 \subseteq S_1 \times T_1$$ and $$\mathcal R_2 \subseteq S_2 \times T_2$$ be relations.

Then the composite of $$\mathcal R_1$$ and $$\mathcal R_2$$ is defined and denoted as:


 * $$\mathcal R_2 \circ \mathcal R_1 \ \stackrel {\mathbf {def}} {=\!=} \ \left\{{\left({x, z}\right) \in S_1 \times T_2: \exists y \in S_2 \cap T_1: \left({x, y}\right) \in \mathcal R_1 \and \left({y, z}\right) \in \mathcal R_2}\right\}$$

Some authors write $$\mathcal R_2 \circ \mathcal R_1$$ as $$\mathcal R_2 \mathcal R_1$$.

It is clear that the composite relation $$\mathcal R_2 \circ \mathcal R_1$$ can also be defined as:


 * $$\mathcal R_2 \circ \mathcal R_1 \left( {S_1}\right) = \mathcal R_2 \left( {\mathcal R_1 \left({S_1}\right)}\right)$$

Illustration
The following is a Venn diagram illustrating the relations between the various entities.


 * CompositionOfRelations.png

In the above:
 * $$\operatorname{Im} \left({\mathcal R}\right)$$ denotes the image of a relation $$\mathcal R$$;
 * $$\operatorname{Im}^{-1} \left({\mathcal R}\right)$$ denotes the preimage of a relation $$\mathcal R$$.