# The trace of a category

## Idea

The trace of a category (or more generally of an endobimodule or endoprofunctor) is a categorification of the trace of a linear endomorphism on a finite dimensional vector space (that is a matrix).

A notion of trace is generally definable for maps in a compact closed category (even more generally in a traced monoidal category?), and here the idea is to categorify this to the context of compact closed bicategories, in particular the bicategory of bimodules between small categories.

## Definition

Let $C$ be a compact closed symmetric monoidal category, with monoidal product $\otimes$ and monoidal unit $1$. The trace of an endomorphism $f:c\to c$ is the composite

$1\stackrel{\eta }{\to }{c}^{*}\otimes c\stackrel{{1}_{{c}^{*}}\otimes f}{\to }{c}^{*}\otimes c\stackrel{\epsilon }{\to }1$1 \overset{\eta}{\to} c^* \otimes c \overset{1_{c^*} \otimes f}{\to} c^* \otimes c \overset{\varepsilon}{\to} 1

where $\eta$ is a unit and $\epsilon$ is a counit of appropriate adjunctions (note that the symmetry makes the dual ${c}^{*}$ both a right and left adjoint of $c$: the adjunctions are ambidextrous). In the classical case where $C$ is the category of finite-dimensional vector spaces with its usual monoidal structure, this gives the usual trace of an endomorphism; in particular, for $f={1}_{c}$, this defines $\mathrm{dim}\left(c\right)\in \mathrm{hom}\left(1,1\right)$.

The same idea applies to compact closed symmetric monoidal bicategories. In particular, it applies to the bicategory Prof whose objects are small categories, whose 1-morphisms are profunctors $C\to D$, i.e., functors

$R:{D}^{\mathrm{op}}×C\to \mathrm{Set}$R: D^{op} \times C \to Set

and whose 2-morphisms are natural transformations between profunctors. The bicategory $\mathrm{Prof}$ is a cartesian bicategory and hence symmetric monoidal under $×$, and is also compact closed: the dual of a category $C$ in this case is just the opposite category ${C}^{\mathrm{op}}$, and the unit and counit profunctors

$\eta :1\to {C}^{\mathrm{op}}×C,\phantom{\rule{thinmathspace}{0ex}}\epsilon :{C}^{\mathrm{op}}×C\to 1$\eta: 1 \to C^{op} \times C, \, \varepsilon: C^{op} \times C \to 1

are given by ${\mathrm{hom}}_{{C}^{\mathrm{op}}}$ and ${\mathrm{hom}}_{C}$. Composing these (according to the coend formula for profunctor composition) yields

${\int }^{c,c\prime \in \mathrm{Ob}\left(C\right)}\mathrm{hom}\left(c,c\prime \right)×\mathrm{hom}\left(c\prime ,c\right)\cong {\int }^{c}\mathrm{hom}\left(c,c\right)$\int^{c, c' \in Ob(C)} hom(c, c') \times hom(c', c) \cong \int^c hom(c, c)

and this is the trace of the identity ${1}_{C}$ in $\mathrm{Prof}$ (which as a functor is also given by ${\mathrm{hom}}_{C}$); this coend is called the trace of the category $C$. It could also reasonably be called, by analogy with the vector space case, the dimension of the category $C$. The trace of a general endoprofunctor $F$ on $C$ is the coend

${\int }^{c\in \mathrm{Ob}\left(C\right)}F\left(c,c\right)$\int^{c \in Ob(C)} F(c, c)

which generalizes the trace of linear functions:

$\mathrm{Tr}\left(f\right)=\sum _{i}{f}_{ii}$Tr(f) = \sum_i f_{i i}

(where the matrix entries ${f}_{ij}$ are computed with respect to any basis).

The foregoing discussion can be generalized to the case of bimodules between small categories enriched in a cocomplete symmetric monoidal closed category $V$, where the dimension of a small $V$-category $C$ is the object of $V$ given by the enriched coend

${\int }^{c}\mathrm{hom}\left(c,c\right)$\int^c hom(c, c)

## Example

We sketch the calculation of the trace or dimension of FinSet, the category of finite sets. The calculation is quite down-to-earth: the relevant coend is just the quotient of the set of all endofunctions $h:c\to c$ between finite sets, modulo the equivalence relation $\sim$ generated by the stipulation $f\circ g\sim g\circ f$ whenever $f:c\to d$ and $g:d\to c$ are functions between finite sets.

Let $h:c\to c$ be a finite endofunction, and let

$c\stackrel{p}{\to }d\stackrel{i}{\to }c$c \overset{p}{\to} d \overset{i}{\to} c

be its epi-mono factorization. Then $h=\left(i\circ p\right)\sim \left(p\circ i\right)$; if we think of $d$ as the image $h\left(c\right)$, then $p\circ i$ can be viewed as the restriction

$h\mid :h\left(c\right)\to h\left(c\right)${h|}\colon h(c) \to h(c)

and this process iterates. The sequence of epis

$h\left(c\right)\stackrel{h\mid }{\to }{h}^{\left(2\right)}\left(c\right)\stackrel{h\mid }{\to }\dots$h(c) \overset{h|}{\to} h^{(2)}(c) \overset{h|}{\to} \ldots

eventually stabilizes (after finitely many steps) to a finite set ${h}^{\left(\infty \right)}\left(c\right)$ on which $h$ restricts to a surjective endofunction, which is a bijection since we are dealing with finite sets.

This argument shows that the trace of the category of finite sets is isomorphic to the trace of the underlying groupoid of finite sets and bijections. Here the equivalence classes with respect to $\sim$ are the conjugacy classes of permutations; in this way, the trace can be identified with the class of finite Young diagrams.

Revised on September 5, 2010 17:33:08 by Toby Bartels (75.117.105.28)