# RC 2024 week 2: on... beer and categories?

published:
**27 August 2024**, tagged:
Recurse Center,
category theory

Soooo. I was going to write this post a couple of days ago on Sunday, but some kind soul decided to douse me with beer from the passenger seat of his mate’s car while I was walking back to my flat. Cleaning the errant beverage from my clothes and myself, it turns out, is not an activity particularly conducive to getting in the mood to write. Some rest and a few episodes of Deep Space Nine later, I’m feeling a bit better, so here we are.

It’s been a bit of a low energy week for me in general, so I’ve been more focused on doing some reading and getting some smaller, less challenging work done. For example, I’ve tried to make this site a little more readable and added a form for folks to subscribe by email if they prefer. I haven’t done so much with my chess engine this week, but the FEN parsing and a basic UCI implementation are done so I just need to crack on with the move generation. I think next week I’d like to try and pair on it with some more people, if for no other reason than having some company while I work on the slightly less interesting bits.

*hugs*

Thank you, Lily.

# category theory things

In other news, I’ve had some interesting chats with the category theory group this week, especially about some of the exercises in Milewski’s book. In particular, this one from the first chapter:

When is a directed graph a category?

This question confused a few people in the group, and in my opinion, rightfully so! Saying a directed graph is never a category seems to me a perfectly reasonable answer, in the same way a banana is never a grapefruit. A category simply has more structure than a directed graph – namely categories have composition – and there is no canonical way to add this structure to a digraph. To use a programming analogy, I might ask when a block of memory is a struct.

Right; a block of memory might be an instance of a struct, but you couldn't possibly know unless you knew what the struct was! If someone just handed you some raw bytes, then sure, you could turn it into a struct, but you'd have to choose which structure to impose on it. You can't just say yes or no without making some decisions first.

Exactly! So let’s weaken the question a little bit: can we turn any directed graph into a category?

Sure! Take the graph, throw it in the bin, and replace it with the empty category :D

I– yeah, I guess I can’t argue with that. I’m pretty sure the idea behind that question was to highlight the differences between a category and a directed graph: in a category, if we have any two composable morphisms, their composition must also exist; and every object must have a morphism, from it back to itself, that satisfies the identity laws. But instead, for our group, it ended up serving as a great example of why mathematicians are so insistent on being precise in wording our statements. My thanks to the category theory group for asking me some hard questions and making me think.

# wrapping up

Since I’m writing this post a little late, ‘next week’ is actually this week for me. Still, I have more than half the week left, so it still feels reasonable to talk about my plans. I’m very much enjoying my role in clarifying Milewski’s material for the rest of the reading group, so I’m tempted to put a bit of time into making some materials of my own to present. I’d love to see my chess bot actually playing a game of chess, so I’m going to try and push through writing the move generation code. And finally, Nicholas convinced me to give a talk with him on the basics of solving cryptic crosswords, so I’ll be writing up some notes for that. If it goes well, I might even turn it into a blog post!

That’s all, see you next week! :)