The Unapologetic Mathematician

Mathematics for the interested outsider

The Category of Matrices I

What we’ve been building up to is actually the definition of a category. Given a field \mathbb{F} we define the category \mathbf{Mat}(\mathbb{F}) of matrices over \mathbb{F}.

Most of our other categories have been named after their objects — groups are the objects of \mathbf{Grp}, commutative monoids are the objects of \mathbf{CMon}, and so on — but not here. In this case, matrices will be the morphisms, and the category of matrices illustrates in a clearer way than any we’ve seen yet how similar categories are to other algebraic structures that are usually seen as simpler and more concrete.

Down to business: the objects of \mathbf{Mat}(\mathbb{F}) will be the natural numbers \mathbb{N}, and the morphisms in \hom(m,n) are the n\times m matrices. That is, a morphism is a collection of field elements \left(t_i^j\right) where i runs from {1} to m and j runs from {1} to n.

We compose two morphisms by the process of matrix multiplication. If \left(s_i^j\right) is an n\times m matrix in \hom(m,n) and \left(t_j^k\right) is a p\times n matrix in \hom(n,p), then their product \left(s_i^jt_j^k\right) is a p\times m matrix in \hom(m,p) (remember the summation convention).

The category of matrices is actually enriched over the category of vector spaces over \mathbb{F}. This means that each set of morphisms is actually a vector space over \mathbb{F}. Specifically, we add matrices of the same dimensions and multiply matrices by scalars component-by-component.

We have yet to speak very clearly about identities. The axioms of an enriched category state that for each object (natural number) n there must be a linear function I_n:\mathbb{F}\rightarrow\hom(n,n). Because of linearity, this function is completely determined by its value at 1\in\mathbb{F}: I_n(x)=xI_n(1). We must pick this matrix I_n(1) so that it acts as an identity for matrix multiplication, and we choose the Kronecker delta for this purpose: I_n(1)=\left(\delta_i^j\right). That is, we use an n\times n matrix whose entries are {1} if the indices are equal and {0} otherwise. It’s straightforward to check that this is indeed an identity.

Other properties I’ve skipped over, but which aren’t hard to check, are that matrix multiplication is bilinear and associative. Both of these are straightforward once written out in terms of the summation convention; sometimes deceptively so. For example, the associativity condition reads (r_i^js_j^k)t_k^l=r_i^j(s_j^kt_k^l). But remember that there are hidden summation signs in here, so it should really read:


so there’s an implicit change in the order of summation here. Since we’re just doing finite sums, this is no problem, but it’s still worth keeping an eye on.

June 2, 2008 - Posted by | Algebra, Category theory, Linear Algebra


  1. […] Category of Matrices II As we consider the category of matrices over the field , we find a monoidal […]

    Pingback by The Category of Matrices II « The Unapologetic Mathematician | June 3, 2008 | Reply

  2. “Down to business: the objects of \mathbf{Mat}(\mathbb{F}) will be the natural numbers \mathbb{N}…”

    Wait, why? Why wouldn’t it be a vector? I can see how the morphisms are matrices, but don’t the morphisms map one object to another? And wouldn’t matrices – being linear operators – map vector spaces to vector spaces, and vectors to vectors? So…why are natural numbers the objects?

    Comment by Wait one moment... | June 4, 2008 | Reply

  3. (Sorry to keep posting :P)

    But a thought, it’s the natural numbers because the natural number indicates the number of dimensions of the vector space, right? Which is why it’s an n by m matrix that maps the object ‘m’ to the object ‘n’, right?

    Comment by Wait one moment... | June 4, 2008 | Reply

  4. Yes, that’s it. This is not a category of algebraic structures and mappings between them. The morphisms are the most important part of this category, and the objects are largely bookkeeping to tell which morphisms can be composed.

    Comment by John Armstrong | June 4, 2008 | Reply

  5. ‘Wait one moment’ wrote:

    So…why are natural numbers the objects?

    The real reason is that it doesn’t matter what you call the objects – you can call them n or F^n. The latter seems more reasonable when you’re first getting started, but once this realization fully sinks in – it doesn’t matter what you call the objects – people often decide the shorter name n is fine. This is especially true because there’s a large class of important categories where there’s one object per natural number. Some of these categories are called “PROPs” – and there’s a whole big theory of PROPs, which is very interesting.

    Comment by John Baez | June 5, 2008 | Reply

  6. Grr… I typed in the html to get F^n with a superscript for the n, but all I got was Fn.

    Comment by John Baez | June 5, 2008 | Reply

  7. fixed it. And yes, that’s a good point. It’s pretty much what I meant by “the objects are largely bookkeeping”, but your explanation is appreciated.

    Comment by John Armstrong | June 5, 2008 | Reply

  8. Alright, thanks for the clarification Dr Baez and Dr Armstrong; if I may employ a terrible pun, may I give *PROPS* to you both. Ahaha…ahem, what a terrible pun.

    Comment by Wait one moment... | June 7, 2008 | Reply

  9. […] of Matrices III At long last, let’s get back to linear algebra. We’d laid out the category of matrices , and we showed that it’s a monoidal category with […]

    Pingback by The Category of Matrices III « The Unapologetic Mathematician | June 23, 2008 | Reply

  10. If the objects are individual natural numbers and a morphism between two objects m and n is any m by n matrix, then could the identity morphism in turn be any n by n matrix? While it would not necessarily be an identity matrix for the vector space where the matrix is a linear operator, it would be a morphism from n to n,eg from 5 to 5 or 2 to 2 or 1258978 to 1258978.

    (Just starting here, sorry if the question seems naive.)

    Comment by Vincent Poirier | October 1, 2019 | Reply

    • So, an n\times n matrix A would indeed be an morphism from the object n to itself, but it can’t be the identity morphism unless it satisfies the identity properties. That is, given any m\times n matrix B we have BA=B, and given any n\times p matrix C we have AC=C. As it turns out, this uniquely identifies the usual identity matrix, but I’ll leave you to verify that as an exercise!

      Comment by John Armstrong | October 2, 2019 | Reply

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: