# What is category theory?

Cat­e­gory the­ory is the math­e­mat­ics of math—speci­fi­cally, it’s a math­e­mat­i­cal the­ory of math­e­mat­i­cal struc­ture. It turns out that ev­ery kind of math­e­mat­ics you’re likely to en­counter in a nor­mal uni­ver­sity ed­u­ca­tion is just an­other kind of cat­e­gory—group the­ory falls un­der the cat­e­gory of groups, topol­ogy falls un­der the cat­e­gory of topolog­i­cal spaces, etc.

Speci­fi­cally, cat­e­gory the­ory shows that all of the highly di­verse math­e­mat­i­cal struc­tures that we know of can be bro­ken down into nodes and ar­rows be­tween nodes. Nodes and ar­rows define a cat­e­gory in a nut­shell—plus some­thing called com­po­si­tion, which ba­si­cally says that if a bird can fly from Mex­ico to the USA to Canada, then the bird can also travel “di­rectly” from Mex­ico to Canada in a way that is equal to the Mex­ico —> USA —> Canada path. (See “the right to use a name” sec­tion.)

Break­ing any and ev­ery math­e­mat­i­cal struc­ture down to nodes and ar­rows be­tween nodes is a su­per-gen­eral, su­per-ab­stract way of study­ing math­e­mat­ics. It’s like try­ing to study Shake­speare by break­ing down all of his sen­tences into nouns and verbs. Cat­e­gory the­ory has a rep­u­ta­tion for be­ing painfully ab­stract—in fact, it’s been called “ab­stract non­sense” by one of its founders. Be­cause of this, it’s typ­i­cally recom­mended that you have a few math­e­mat­i­cal struc­tures un­der your belt—alge­bra, groups, topol­ogy, etc.—be­fore study­ing cat­e­gory the­ory so that you have spe­cific ex­am­ples to re­late the ab­strac­tions to. (It would be tough to study verbs if you didn’t know about things like run­ning and jump­ing!)

But while there’s only so much to learn about Shake­speare by break­ing “to be or not to be” into in­fini­tives, con­junc­tions, and ad­verbs, it turns out that the su­per-gen­eral per­spec­tive of cat­e­gory the­ory is in­cred­ibly use­ful in con­crete ways. In par­tic­u­lar, it turns out that pretty much ev­ery cool idea in math is some­thing called an ad­joint func­tor—a spe­cial con­struc­tion that can only be ac­cessed through cat­e­gory the­ory. A lot of cat­e­gory the­o­rists will tell you that ad­joint func­tors are kind of the point of cat­e­gory the­ory. Ad­joints, or ad­junc­tion, gen­er­al­izes op­ti­miza­tion it­self.

Then there is the Yoneda lemma, which is as deep as it is el­e­gant and pow­er­ful. We will ex­plore it in depth. (If this se­ries works out.)

You might be won­der­ing what suc­cess cat­e­gory the­ory has found in ap­pli­ca­tions to the sci­ences. How can you even ap­ply some­thing so gen­eral and ab­stract to our highly spe­cific and con­crete re­al­ity?

Well, cat­e­gory the­ory is su­per gen­eral, so when­ever you are study­ing su­per-gen­eral phe­nom­ena, it makes sense to think of cat­e­gory the­ory. What’s a su­per-gen­eral phe­nomenon? For ex­am­ple, the laws of physics! They gov­ern ev­ery­thing, pre­sum­ably. If you’re look­ing for fun­da­men­tal rules that ap­ply to ev­ery­thing from tiny par­ti­cles to enor­mous planets and the com­plex liv­ing crea­tures in be­tween, cat­e­gory the­ory im­me­di­ately comes to mind.

Then there is biol­ogy, which less su­per-gen­eral, un­less there re­ally are Mar­ti­ans hid­ing from our rovers, but or­ganisms have to sur­vive and re­pro­duce un­der wildly di­verse con­di­tions—the planet Earth can throw a lot of stuff at you, from vol­ca­noes to Ice Ages. On some level, or­ganic life clearly has the abil­ity to adapt to all of these con­di­tions—and adapt­ing the same ba­sic thing to lots of differ­ent con­texts with pow­er­ful re­sults is ba­si­cally what cat­e­gory the­ory is.

Definitely the biggest ap­plied suc­cess for cat­e­gory the­ory has been in pro­gram­ming. I’d en­courage you to look up func­tional pro­gram­ming, lambda calcu­lus, or just Google some­thing like “pro­gram­ming cat­e­gory the­ory.” It’s fas­ci­nat­ing, though I’m ac­tu­ally go­ing to deem­pha­size the pro­gram­ming side of things if any­thing, as I don’t want to dis­tract from the fun­da­men­tals.

So what is cat­e­gory the­ory? Noth­ing other than the for­mal gen­er­al­iza­tion of ev­ery­thing. Why should you be in­ter­ested in it? Be­cause it gives you an in­cred­ible bird’s-eye view of all of math­e­mat­ics, and a par­tic­u­lar perch, ad­junc­tion, that can’t be found any­where else.

This se­ries will be very slow paced rel­a­tive to other in­tro­duc­tions—I will not as­sume you know what sets and func­tions are, to give just one ex­am­ple. If you’re com­fortable with math or just want to plunge into things a lit­tle more, I strongly en­courage you to look up the many fan­tas­tic in­tro­duc­tions to cat­e­gory the­ory that already ex­ist on the In­ter­net for free as videos, text­books, blog posts, and pa­pers. This is a se­ries meant for peo­ple who ei­ther have no ex­po­sure to math­e­mat­ics be­yond the high school level or ac­tively want to avoid it! (I’ll put it this way: if there was a “Baby Rudin” for cat­e­gory the­ory, this se­ries would be aiming to be a “Fe­tal Rudin.”)

There’s no sched­ule for these posts, which isn’t ideal for learn­ing, but that’s just the re­al­ity of how this se­ries is go­ing to be made. Com­ing up is a se­quence of posts on the most ba­sic de­tails of defin­ing a cat­e­gory, with an em­pha­sis on de­vel­op­ing in­tu­ition at each step.

• It seems a bit odd to offer lambda calcu­lus as an ex­am­ple of how cat­e­gory the­ory is use­ful in com­put­ing, when lambda calcu­lus pre­dates cat­e­gory the­ory by about a decade (1932 to 1942).

• Lambda calcu­lus is though the in­ter­nal lan­guage of a very com­mon kind of cat­e­gory, so, in a sense, cat­e­gory the­ory al­lows lambda calcu­lus to do com­pu­ta­tions not only with func­tions, but also sets, topolog­i­cal spaces, man­i­folds, etc.

• Cat­e­gory the­ory is use­ful for un­der­stand­ing lambda calcu­lus—I feel like any­one who stud­ies the lat­ter will cer­tainly en­counter the former soon enough.

• Really look­ing for­ward to this se­quence!

• I’m cu­ri­ous if be­ing a pro­gram­mer is helpful to un­der­stand­ing cat­e­gory the­ory in the same way as hav­ing “a few math­e­mat­i­cal struc­tures un­der your belt” is.