### Graphical Category Theory Demonstrations

#### Posted by Urs Schreiber

*guest post by*

**Jocelyn Paine**If you could commission a computer demonstration of any categorical idea, what would you ask for? Could such demonstrations have helped you, or your students, learn tricky ideas? And, would you be willing to share the visualisations and metaphors that you have devised to explain these ideas to yourself or others?

Ways of explaining categorical ideas have been discussed here and there in the Café — for example, in Gerbes in the Guardian. But it would be good to devote a single thread to “how to explain” and how we can use the computer to help us do so.

Last
year in fact, I
implemented some
Web-based
category theory
demonstrations of products,
coproducts, and other constructions;
and Urs suggested
that it would be really nice to combine my work with
*n*Lab by making
applet
demonstrations for the
*n*Lab:product
and
*n*Lab:coproduct
pages. So I’ve asked
Urs to guest-post this and start the thread.

I’ll just mention that one hope I have is that one could eventually build up a “metaphor repository”: a computerised stock of mappings from categorical ideas to their depictions on screen, including how these relate to animation space and time. From this, one would, with help from the computer, select ideas to be demonstrated and ways to demonstrate them, then piece these together into a complete demonstration. It would be a huge project — perhaps only an order of magnitude smaller than Douglas Lenat’s logic-based encyclopaedia of common-sense knowledge Cyc — but I’m convinced it’s doable, and that someone ought to be doing it. Perhaps it could be a first step to Greg Egan’s Truth Mines! This is his virtual landscape for learning maths, that John Baez mentions near the top of This Week’s Finds in Mathematical Physics (Week 115).

When I have time,
I’ll post some ideas on how I think one might implement a
“metaphor repository”.
But anyway, do please post
suggestions for applets that you’d like to
see in *n*Lab.

And here are some
questions to start off with. At the moment,
my Web-page demonstrations use
finite sets. The limits demo,
for example, randomly chooses sets and arrows
between them, generates a limit, then
depicts the limit cone using a graph-drawing
program called GraphViz.
It lists the sets and arrows, so the reader can
check that things commute as they should.
Sets and set functions are easy to
calculate with. But what other categories could
I use, whose objects and arrows would also be easy to
depict, and easy for a reader to calculate with?
Is this anyway too “low-level” a way to show what
limits do, paying too much attention to calculation
and not enough to the essence of the idea? Probably. And,
how much could one really convey in an *n*Lab limit
applet, given the size and resolution of current laptop
screens and the need to reserve some space for
controls and the *n*Lab page text around the applet?

## Re: Graphical Category Theory Demonstrations

I applaud your Java applets, Jocelyn! This is the sort of thing where it’s very easy for mathematicians to dream big — but only a few brave people dare to actually

dosomething.A possibility that leaps to mind is finite-dimensional vector spaces, perhaps over the rational numbers. By picking bases for all these vector spaces, morphisms between them can be described as matrices of rational numbers.

An amusing about this example is that the coproduct is the same as the product, unlike in the category of finite sets. They’re both the ‘direct sum’ of vector spaces.

Taking an equalizer of two linear maps

$V \stackrel{\to}{\to} W$

amounts to solving a system of linear equations. If there are $n$ linearly independent solutions, you can say the equalizer is $\mathbb{Q}^n$, and specify the actual solutions by giving a matrix to describe the inclusion

$\mathbb{Q}^n \to V$

There could be software packages for solving systems of linear equations that would reduce the amount of programming you need to do.

If you want a more ‘finitistic’ example along the same lines, you could use finite-dimensional vector spaces over a finite field — for example the integers mod 2, which should please your programmer’s heart!

Maybe they’re “low-level” — but maybe that’s great! A lot of people think category theory is “too abstract”. Seeing limits worked out in a very low-level concrete way should correct any misimpression that they’re some sort of airy nonsense.