Profunctors as matrices

118 Views Asked by At

Let $\cal C,\cal D$ be small categories. A profunctor $\phi:\cal C\nrightarrow D$ is a functor $\phi:{\cal C}^{\operatorname{op}}\times{\cal D}\to\mathbf{Set}$. If we have another small category $\cal E$ and another profunctor $\psi:\cal D\nrightarrow E$ we can define the composition $\psi\phi:\cal C\nrightarrow E$ as the functor \begin{align*} {\cal C}^{\operatorname{op}}\times{\cal E}&\to\mathbf{Set}\\ (i,k)&\mapsto\int^{j\in \cal D} \phi(i,j)\times\psi(j,k) \end{align*} Now, notationally this looks very similar to matrices: A matrix over a ring $R$ is a map (of sets) $A:\{1,\dots,n\}^{\operatorname{op}}\times\{1,\dots,m\}\to R$ (the '$\operatorname{op}$' doesn't really have any meaning here, but it fits because the first component is vertical while the second is horizontal when 'visualizing' a matrix). Given another matrix $B:\{1,\dots m\}^{\operatorname{op}}\times\{1,\dots,l\}\to R$ their product $AB$ is defined by \begin{align*} \{1,\dots n\}^{\operatorname{op}}\times\{1,\dots,l\}&\to R\\ (i,k)&\mapsto\sum_{j\in \{1,\dots, m\}} A(i,j)\cdot B(j,k) \end{align*}

Question: Is this just a notational coincidence or is there actually a way to see matrices as special profunctors?

I already found a partial answer to this (see below) in the case $R=\Bbb N_0$ (ok, this isn't a ring but still works), but I am still interested to see examples of actual rings $R$, perhaps by replacing $\mathbf{Set}$ with a suitable other category so that we can identify certain objects with ring elements such that the categorical product is the ring product and the coend for special $\cal C,D$ is the ring addition.

1

There are 1 best solutions below

0
On

We can identify the isomorphism classes of finite sets with the set of natural numbers including $0$ ($R=\Bbb N_0$). Now a $n\times m$ matrix $A$ over $R$ is a profunctor $\cal C\nrightarrow D$ where $\cal C,D$ are discrete categories with $n,m$ elements and such that its image only contains finite sets. Given another $m\times l$ matrix $B$ in this sense the profunctor-composition coincides with the usual matrix multiplication (but in reverse order, i.e $AB$ as matrices $=$ $BA$ as profunctors because composition is read from right to left). Indeed, under the identification of $R$ with the finite sets the product in $\mathbf{Set}$ is just the product of natural numbers and the coend over a discrete category is just the coproduct, hence usual addition of numbers.