# The category with binary relations as objects

I have reconsidered my ideas and remember how I thought ones upon a time. I will make a last try and delete if it doesn't work:

Set is the category where sets are objects and functions are morphisms and Rel is the category where sets are objects and binary relations are morphisms.

I can think about two categories where functions are the objects, with pair of functions $(\alpha,\beta)$ $\require{AMScd}$ \begin{CD} X @>\alpha>> X'\\ @VfV V @VVf'V\\ Y @>>\beta> Y' \end{CD} as morphism, with or without a condition of commutative diagrams ($f'\alpha=\beta f$). For relations these alternative do not preserve even the structure of relations as graphs in a natural way.
$$\begin{CD} X @>\alpha>> X'\\ @VR V\qquad \displaystyle ? V @VVR'V\\ Y @>>\beta> Y' \end{CD}$$ Is there a suitable condition on the diagram that preserves the graph-structure and make the pairs of relations $(\alpha,\beta)$ to morphisms?

The composition of relations $\alpha\subset X\times X'$ and $\alpha'\subset X'\times X''$ is defined

$(x,x'')\in\alpha'\alpha \Leftrightarrow \exists x'\in X':(x,x')\in\alpha \wedge (x',x'')\in \alpha'$.

You where right about my first attempt, but I hope that this is interesting enought, since many structures in mathematics in fact is just relations, and preserving those relation should be interesting.

• I don't understand your question. e.g. I don't see why you think there is a problem defining the category of binary relations and commutative squares of relations. Your construction would appear to work on any category at all, and has nothing to do with whether the morphisms from the original category are functions or relations or even a completely abstract thing. – Hurkyl Aug 28 '14 at 9:57
• to second @Hurkyl 's comment: For any category you can construct the category of arrows of it. The objects are the morphisms and the morphisms are pairs of morphisms as making a commutative square as you describe. This works for Rel as well. – Ittay Weiss Aug 28 '14 at 9:59
• I don't think that you can prove that. Of course it holds for all categories, but with relations as objects and commuting pairs as candidates to morphisms, the composition don't have to be of the right sort. – Lehs Aug 28 '14 at 10:00
• if it works for any category, why should it not work for Rel??? – Ittay Weiss Aug 28 '14 at 10:04
• If the ordinary composition of relation turns Rel into a category (which it does), then the construction works ... Even if you want functions for horizontal and relations for vertical arrows, this doesn't really matter as the composition for functions is the composition for relations – Hagen von Eitzen Aug 28 '14 at 10:15

(Hurkyl + Ittay Weiss are right)

If u define Rel to have sets as objects and binary relations as arrows and you show this makes it a category, then u have (as for any category):

Say $\mathcal{C}$ is an arbitrary category (not necessarily small)

Define $\mathcal{\hat C}$ to be the category having as objects all $\mathcal{C}$-arrows and as arrows between two $\mathcal{\hat C}$-objects $f:A\longrightarrow A'$, $g:B\longrightarrow B'$ the pairs of $\mathcal C$-arrows $\phi_{AB}:A\longrightarrow B$, $\phi_{A'B'}:A'\longrightarrow B'$ such that the following diagram commutes

\begin{align} A & \space\space\space\space\space\space\space\longrightarrow & B\\ \downarrow & & \downarrow \\ A' & \space\space\space\space\space\space\space\longrightarrow &B' \end{align}

The composition of arrows is well defined since for $\mathcal{\hat C}$-objects $f:A\longrightarrow A'$, $g:B\longrightarrow B'$ and $h:C\longrightarrow C'$ and $\mathcal{\hat C}$-arrows (i.e. commuting $\mathcal{C}$-diagrams)

\begin{align} A & \space\space\space\space\space\space\space\longrightarrow & B\\ \downarrow & & \downarrow \\ A' & \space\space\space\space\space\space\space\longrightarrow &B' \end{align} and \begin{align} B & \space\space\space\space\space\space\space\longrightarrow & C \\ \downarrow & & \downarrow \\ B' & \space\space\space\space\space\space\space\longrightarrow &C' \end{align}

the combined $\mathcal{C}$-diagram commutes

\begin{align} A & \space\space\space\space\space\space\space\longrightarrow & B & \space\space\space\space\space\space\space\longrightarrow & C \\ \downarrow & & \downarrow & & \downarrow \\ A' & \space\space\space\space\space\space\space\longrightarrow &B' & \space\space\space\space\space\space\space\longrightarrow &C' \end{align}

thus buidling a composed $\mathcal{\hat C}$-arrow $\phi_{AC}:A\longrightarrow C$, $\phi_{A'C'}:A'\longrightarrow C'$