The composition of $R$ and $S$ is the relation $S\mathbin {\diamond }R$ defined as follows:
-
•
Viewing relations from $A$ to $C$ as subsets of $A\times C$, we define
\[ S\mathbin {\diamond }R \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\left\{ \webleft (a,c\webright )\in A\times C\ \middle |\ \begin{aligned} & \text{there exists some $b\in B$ such}\\ & \text{that $a\sim _{R}b$ and $b\sim _{S}c$}\end{aligned} \right\} . \] -
•
Viewing relations as functions $A\times B\to \{ \mathsf{true},\mathsf{false}\} $, we define
\begin{align*} \webleft (S\mathbin {\diamond }R\webright )^{-_{1}}_{-_{2}} & \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\int ^{b\in B}S^{-_{1}}_{b}\times R^{b}_{-_{2}}\\ & = \bigvee _{b\in B}S^{-_{1}}_{b}\times R^{b}_{-_{2}},\end{align*}where the join $\bigvee $ is taken in the poset $\webleft (\{ \mathsf{true},\mathsf{false}\} ,\preceq \webright )$ of Chapter 3: Sets, Definition 3.2.2.1.3.
-
•
Viewing relations as functions $A\to \mathcal{P}\webleft (B\webright )$, we define
where $\operatorname {\mathrm{Lan}}_{\chi _{B}}\webleft (S\webright )$ is computed by the formula\begin{align*} \webleft [\operatorname {\mathrm{Lan}}_{\chi _{B}}\webleft (S\webright )\webright ]\webleft (V\webright ) & \cong \int ^{b\in B}\chi _{\mathcal{P}\webleft (B\webright )}\webleft (\chi _{b},V\webright )\odot S_{b}\\ & \cong \int ^{b\in B}\chi _{V}\webleft (b\webright )\odot S_{b}\\ & \cong \bigcup _{b\in B}\chi _{V}\webleft (b\webright )\odot S_{b}\\ & \cong \bigcup _{b\in V}S_{b} \end{align*}for each $V\in \mathcal{P}\webleft (B\webright )$, so we have1
\begin{align*} \webleft [S\mathbin {\diamond }R\webright ]\webleft (a\webright ) & \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}S\webleft (R\webleft (a\webright )\webright )\\ & \mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\bigcup _{b\in R\webleft (a\webright )}S\webleft (b\webright ). \end{align*}for each $a\in A$.
- 1That is: the relation $R$ may send $a\in A$ to a number of elements $\left\{ b_{i}\right\} _{i\in I}$ in $B$, and then the relation $S$ may send the image of each of the $b_{i}$’s to a number of elements $\left\{ S\webleft (b_{i}\webright )\right\} _{i\in I}=\left\{ \left\{ c_{j_{i}}\right\} _{j_{i}\in J_{i}}\right\} _{i\in I}$ in $C$.