Igor wrote:

> How do \\(k\\)-valued matrices act on finite sets?

They don't, nor need they. In general, morphisms don't act on objects. You just need to know what a morphism from one object to another is, and how to compose them.

To a modern mathematician, a matrix \\(T\\) is a "rectangle of numbers" where the numbers are chosen from some field \\(k\\). The rows of this matrix can be indexed by any finite set \\(X\\), and the columns can be indexed by any finite set \\(Y\\). (That's the modern part.) So, for any \\(x \in X\\) and any \\(y \in Y\\) we get an element of \\(k\\). In short, a matrix is a function

$$ T \colon X \times Y \to k $$

You can write the matrix entries as \\(T(x,y)\\) if you like, but let's write them as \\(T_{xy}\\), since people love to use subscripts when talking about matrices.

In the category I mentioned, we think of \\(T\\) as a morphism from \\(X\\) to \\(Y\\). If we have another morphism \\(S\\) from \\(Y\\) to \\(Z\\), that is a function

$$ S \colon Y \times Z \to k $$

we compose them as follows:

$$ (ST)\_{xz} = \sum\_{y \in Y} S\_{xy} T\_{yz} $$

Note that this is exactly like the formula for composing profunctors in my lecture!

There are lots of arbitrary conventions running around here, like which index labels the rows and which labels the columns, and whether we think of \\(T \colon X \times Y \to k\\) as a morphism from \\(X\\) to \\(Y\\) or a morphism from \\(Y\\) to \\(X\\). I think the conventions I've been using for profunctors don't match the most common conventions for thinking of matrices as linear maps. But don't worry! It doesn't really matter which conventions you use.