# Examples of "inner products" of parallel morphisms in a dagger category

There is a very interesting abstract notion of the trace of an endomorphism $f : c \to c$ of an object $c$ in a braided monoidal category (although the symmetric case is easier): see, for example, Ponto and Shulman's Traces in symmetric monoidal categories and Willerton's slides Two 2-traces for interesting examples.

Recently I learned from Vicary's Completeness of dagger-categories and the complex numbers that another basic construction from linear algebra has a similar abstractification: there is an abstract notion of inner product of two $b$-points $f, g : b \to c$ of an object $c$ in a dagger category $C$ defined as the composition $f^{\dagger} g : b \to b$. When $C = \text{Hilb}$ and $b = 1$ this reduces to the ordinary inner product of vectors in a Hilbert space.

Does anyone know of a good list in the literature of more examples of this construction?

Here are some that occur to me: when $C$ is the dagger category whose objects are (say, small) categories and whose morphisms are functors with right adjoints, where $\dagger$ is the right adjoint, the inner product $f^{\dagger} f$ of $f : b \to c$ with itself is precisely the monad determined by $f$.

When $C$ is a dagger category of cobordisms, a morphism from the empty manifold is just a manifold $M$ with boundary $\partial M$, and its inner product with itself consists of two copies of $M$ (one of which, I guess, ought to have reversed orientation if $C$ keeps track of such things) glued together at the boundary. I expect that this construction has a name somewhere in the topology literature.

• "when C is the dagger category whose objects are (say, small) categories and whose morphisms are functors with right adjoints, where † is the right adjoint"... For this to be a dagger category, mustn't you restrict even further, to functors with both left and right adjoints which coincide (so the dagger is involutive)? Aug 11, 2011 at 0:10
• @Sridhar: hmm. I guess you're right. That's a pretty restrictive condition... Aug 11, 2011 at 0:31
• @Sridhar,Qiaochu: a natural dagger category of (small) categories is to take as morphisms contravariant functors with an adjoint. Note that it doesn't matter matter whether the adjoint is left or right now. This category in fact has a lot of properties in common with that of sets and relations and that of Hilbert spaces. Aug 11, 2011 at 10:15
• @Chris: can you explain why it doesn't matter whether the adjoint is left or right? Aug 11, 2011 at 14:00

A good list in the literature? Not precisely. But this kind of thing crops up all the time in the calculus of relations and generalizations thereof. Let me give some examples; I'm going to ignore the restriction to parallel morphisms, because the construction is just as interesting without that restriction.

(Sorry for such a lengthy answer, but the examples will require some preface, to make manifest just how generally these constructions come up in mathematics.)

If you have a regular category $C$, then you can construct a category of relations in $C$, where objects are objects of $C$ and morphisms are jointly monic pairs of morphisms in $C$ (a jointly monic span):

$$X \stackrel{f}{\leftarrow} R \stackrel{g}{\to} Y$$

The axioms for a regular category ensure that one can define a relational composition that is associative (up to isomorphism: the category $Rel_C$ is actually a bicategory). If this is not already familiar, in particular if the composition of such relations is not already clear, one takes a pullback of the middle two arrows in

$$X \stackrel{f}{\leftarrow} R \stackrel{g}{\to} Y \stackrel{h}{\leftarrow} S \stackrel{k}{\to} Z$$

and then the image factorization of the evident map $R \times_Y S \to A \times C$, to get a monomorphism $S \circ R \to A \times C$, i.e., a jointly monic span from $A$ to $C$. The axioms of a regular category ensure that all this works out smoothly.

There is also such a thing as taking the opposite or transpose of a relation, just by swapping $f$ and $g$ above. The sorts of equations satisfied by such composition and transpose can be extrapolated to give the notion of allegory, as discussed at length in Categories, Allegories by Freyd and Scedrov. We get a dagger category from an allegory by considering this transpose operation as dagger.

Now, morphisms $f: A \to B$ in $C$ can be treated as special relations

$$A \stackrel{i_A}{\leftarrow} A \stackrel{f}{\to} B$$

just as functions can be treated as special relations. These functional relations can be considered abstractly; they turn out to be be precisely those 1-cells $R$ in $Rel_C$ which are left adjoints (and their right adjoints then turn out to be the daggers $R^\dagger = R^{op}$). One can play the same game in general allegories, defining an arrow to be functional if it has a right adjoint, and much of the interest in allegories comes about through the interplay between relations and functional relations.

For example, in $Rel_C$, for each 1-cell $R$ as displayed above we have

$$R = g \circ f^\dagger.$$

This of course is the type of thing you were asking about (it's $(g^\dagger)^\dagger \circ (f^\dagger)$, if you want to be picky about matching the form to what you have).

If each 1-cell in an allegory can be expressed in this manner for some functional relations $f$, $g$ (and if the pair $(f, g)$ is jointly monic, which can also be expressed allegorically), then Freyd and Scedrov call that allegory tabular. Among other things, they give a precise correspondence between (unitary) tabular allegories and regular categories: given a regular category $C$, one gets a unitary pretabular allegory $Rel_C$ for which $C$ is retrieved as the category of functional relations, and given a unitary pretabular allegory $B$, one gets a regular category $Func_B$ for which $B$ is retrieved as the category of relations.

But this sort of tabulation idea goes beyond bicategories of relations. The same idea applies to bicategories of spans in a finitely complete category $C$, and also to spans of groupoids where one refers to push-pull constructions. These are important in the program of groupoidification.

Here is another example. In logic one very frequently finds what Paul Taylor calls in his book "guarded quantifiers". For example, one encounters all the time formulas like $\forall_{x \in A} P(x)$ where $A$ is a subset of some set $X$, and $P$ is a predicate. One could rewrite this as

$$\forall_{x \in X} x \in A \Rightarrow P(x)$$

and this is a special case of a more general relational construction which looks like this:

$$(S \backslash R)(a, b) = \forall_{c \in C} S(b, c) \Rightarrow R(a, c)$$

where $R$ is a relation from $A$ to $C$ and $B$ is a relation from $B$ to $C$. (You might remember this backslash notation from a recent answer of mine to a question of James Propp.) This $S \backslash R$ is a "right Kan lift" in the bicategory of relations, and is what one needs in the notion of "division allegory" discussed by Freyd-Scedrov.

In situations where one has power objects in allegories (for example, $Rel_C$ where $C$ is a topos), where one has an equivalence between relations $R$ from $A$ to $C$ and functional relations $\chi_R: A \to P(C)$ to a power object, one can construct such divisions as follows:

$$S \backslash R = \chi_{S}^\dagger \chi_R$$

which gives another instance of your construction. Something like this holds as well in the context of bicategories of profunctors, which behave like generalized relations.

In short, this sort of construction comes up, secretly, basically all the time.

Edit: One more example, if I may? This time it's a parallel example. Consider the bicategory of spans (in $Set$). Then a small category $C$ may be considered as an abstract monad $M_C: C_0 \to C_0$ in this bicategory, where $C_0$. In other words, the 0-cell is the set $C_0$ of objects, the 1-cell $M_C$ is the span

$$C_0 \stackrel{dom}{\leftarrow} C_1 \stackrel{cod}{\to} C_0$$

where $C_1$ is the set of morphism, and the multiplication 2-cell $m: M_C M_C \to M_C$ of the monad is given precisely by composition in the category. Then, $M_C$ is given "tabularly" as $cod \circ dom^\dagger$, where $dom$ and $cod$ are "functional spans". The monad $M_C: C_0 \to C_0$ induces a monad

$$Span(1, M_C): Span(1, C_0) \to Span(1, C_0)$$

and the category of algebras for the monad can be identified with $Set^C$. In the topos theory book by Mac Lane and Moerdijk, page 247, you can see this tabulation in action as the composite

$$Span(1, C_0) \stackrel{Span(1, dom^\dagger)}{\to} Span(1, C_1) \stackrel{Span(1, cod)}{\to} Span(1, C_0)$$

$$= Set/C_0 \stackrel{dom^\ast}{\to} Set/C_1 \stackrel{\Sigma_{cod}}{\to} Set/C_0$$

where $dom^\ast$ means "pull back along $dom$" and $\Sigma_{cod}$ means "push forward (compose) along $cod$".

Anyway, I thought it might be worth putting a basic technique in topos theory within the context of the question.