Categories of relations over a fixed category $\mathcal{C}$

168 Views Asked by At

Let $\bf{Set}$ be the category of sets and functions. We have an associated category $\bf{Set}_\bf{Rel}$, whose objects are also sets but whose morphisms are relations, i.e. a morphism $X\xrightarrow{\ \ R\ \ }Y$ is a subset $R\subseteq X\times Y$. Composition of relations $X\xrightarrow{\ \ R\ \ }Y\xrightarrow{\ \ S\ \ }Z$ is given by$$S\circ R=\left\{(x,z)\in X\times Z\;\middle|\;(x,y)\in R,(y,z)\in S\text{ for some }y\in Y\right\}\,.$$It is a standard exercise to check that this is associative. Identities are given by the diagonal $1_X=\Delta_X=\left\{(x,x)\middle|x\in X\right\}$. We write $xRy$ if $(x,y)\in R$.

$\bf{Set}_\bf{Rel}$ even has a 2-categorical structure: On each $\operatorname{Hom}(X,Y)=\mathfrak{P}(X\times Y)$ just choose the preorder given by inclusion as the data for a category.

Abstracting a little, we can replace $R\subseteq X\times Y$ by a monomorphism $R\xrightarrow{\ \ m\ \ }X\times Y$. Then given generalized elements $x\in_AX$ and $y\in_ AY$ (i.e. maps to X resp. Y with domain $A$), we write $xRy$ if $x$ and $y$ factor through the same morphism $A\longrightarrow M$ via $p_1m$ and $p_2m$ (which is then uniquely determined because of the properties of the product and since $m$ is monic).

We can call two relations equivalent, if they are equivalent as subobjects of $X\times Y$, or equivalentely if they induce the same relation on the class of generalized elements of $X$ and $Y$. Modding out this equivalence, we obtain the same notion as in the first paragraph.

Much of the theory of relations of sets can be generalized to arbitrary categories, for example we might call $R\longrightarrow X\times X$ an equivalence relation if $\;xRx,\quad$ $xRy\implies yRx,\quad$ $xRy\land yRz\implies xRz$ holds whenever it makes sense. In $\bf{Set}$, this agrees with the usual notion. In Categories of algebraic structures like $\bf{Grp}$ or $\bf{Ring}$, we find the usual notion of a congruence. For example, one can show that in complete categories, arbitrary intersections of equivalence relations are again equivalence relations.

I wondered, if it is also possible to generalize the notion of composition of relations, as to obtain the structure of a (weak) 2-category $\mathcal{C}_\bf{Rel}$, whenever $\mathcal{C}$ is a category with finite products. If it is, has this category been studied? Where can I find more?

2

There are 2 best solutions below

2
On BEST ANSWER

The problem with relations is that they only tell you that two things are related, but they don't tell you how two things are related. A much more flexible generalization is to replace monomorphisms $R \to X \times Y$ with arbitrary maps $R \to X \times Y$, which are variously called either spans or correspondences depending on whether you're a category theorist or an algebraic geometer. Instead of only returning a bit ("$x$ and $y$ are related" or "$x$ and $y$ are not related") when fed an element of $X$ and an element of $Y$, a span returns an object, namely the fiber over $(x, y)$ of the map $R \to X \times Y$. Composition of spans is also given by taking pullbacks, so this construction makes sense in any category with finite pullbacks.

Even spans of sets are more useful than relations: they keep track of a set of ways two things are related, and there is a natural linearization functor taking spans of finite sets to matrices which does not exist for relations.

This construction is important in the theory of motives, Fourier-Mukai transforms, and topological field theories, among other places. It is implicit, but rarely made explicit, in the theory of Hecke algebras, which roughly speaking is about ways to linearize the category of spans of $G$-sets for $G$ a group.

2
On

An answer has already been accepted suggesting a change of perspective, but I'd like to point out that the original question has been much studied by category theorists.

The issue is that composition of relations is a bit more complicated than composition of spans. In order to compose them, first you take a pullback (just like with spans), but the result is generally a span which is not a relation: you have to take an epi-mono factorization of the result in order to get a relation. And the messiness of this process turns out to mean that composition of relations is not necessarily associative, even when epi-mono factorizations exist. In fact, composition of relations is associative if and only if the category is regular (see Freyd & Scedrov's Categories, Allegories, 1.569).

I believe this is the only obstacle to obtaining a 2-category: the original category must be regular.