After another long break from writing about math in order to write about other math, I am back to write about math. Eventually I should talk about my own research so in order to get to that point I am going to attempt to explain category theory to non-mathies.
This should be easier than explaining it to math people because math people already have a stereotype about the subject. It’s way too hard! That’s what I used to think too, but like anything else all it takes is an amazing speaker to spark interest and keep attention. Unfortunately for you the reader, I am not that person, so you’ll have to deal with my mediocrity.
Math people are good at studying dots or points, but suddenly you throw in a bunch of arrows and it is too much to handle. Dots, and arrows between dots are the easiest way to start talking about category theory. Category theory is the study of categories and a category is nothing more than a bunch of dots and arrows between them that satisfy certain rules. Math needs rules, just like people. Otherwise the civilization of dots and arrows would break down into chaos!
Somehow a category is also an abstraction of all other types of math. Everything is just a bunch of dots and arrows! So lets stop procrastinating and define a category. A category consists of a bunch of dots, which we call objects and a bunch of arrows that go from an object to another object, which we fancily call morphisms . In order to actually be a category we need that for any given dot we have an arrow from that dot to itself.
What if I have an arrow going from dot A to dot B and then an arrow from dot B to dot C? Well I have to be able to put them together to have one big arrow from dot A to dot C. This is called composition of arrows. There is one more rule that will be easier to see after we have an example. So here is one in the form of a picture.
The objects consist of A, B and C. The arrows are and , where goes from A to C and goes from C to B. Notice that each object has an arrow from it to itself. This is a necessary for a reason not shown in this example. It boils down to needing an arrow that does nothing. In multiplication we have the number 1, which does nothing. With addition we have 0, which does nothing.
Lastly, I can go from A to B by means of going through and then . Confusingly, mathematicians write the composition of followed by as .
The final rule that I left out comes into play when we have more than two arrows in a row. It’s called associativity and may seem like a really stupid rule because most things obey it so you never actually think about it. For numbers and addition it just means something like this: . The idea is simple, we can add the first two numbers together, then add that result with the third or we can add the second and third together and put that with the first. It also works with multiplication: .
Not everything is associative though! For example if you need to bake a cake. Mixing wet ingredients with dry ingredients followed by baking will give you a much tastier result than baking dry ingredients and then mixing that result with wet ingredients.
For a category we need to do the same idea with our arrows. That is, if we have an arrow from A to B, from B to C, from C to D, it shouldn’t matter how we make up the big arrow from A to D. Putting and together, then taking that to go from A to C followed by going through to get to D is the same as putting and together first and using to get to B then taking that grouping from B to D. Here is a pretty picture to clear that long sentence up.
The dotted lines represent the composition of two arrows. Remember we can turn any two arrows that are next to each other into one long arrow (dotted arrow) by means of composition.
So lets turn the route from A to C into one arrow, the dotted arrow . Again, mathematicians annoyingly write as meaning to first go through the arrow and then the arrow . Then we can use that long arrow (dotted arrow) and the leftover arrow, , to get from A to D.
However we could have went to D from A through a different route. Since the arrows and are next to each other we could have also put them together first. This is the dotted line, . Then we can go from A to D by first going through and then the dotted arrow .
Associativity is simply a complicated way of saying both of these routes are the secretly the same. (Same being a very weird idea which is left for another time.)
To recap, a category needs to have some objects, some arrows between those objects, an arrow from any object to itself, composition of arrows, and associativity of composition. I never mentioned how this abstracts all of math. The way that happens is just by thinking of objects which are more complicated than dots, and arrows with cool properties instead of just a simple arrow.
For example we could talk about sets and functions between sets as the category called Set. There are mathematical objects called groups, so we could think about the dots as groups and the arrows as the special kinds of maps that happen to go from group to group called group homomorphisms.
Some more examples are even cooler. You can think about propositions and proofs which go from proposition to proposition as a category. In computer science you have data types and programs that go from one to another. Theories and experiments can be thought of a category in the same way that propositions and proofs are. Basically anything that involves a state and a way to go from state to state is a category. Then later you see what kinds of properties these categories have.
One can even think of a category as an object and then think about what kind of arrows can go between categories. That’s for a much later time. The point is that all the cool things that math people think of can be made into a category. So instead of studying some property of a specific kind of that object, we can study what all of them have in common.