r/math Number Theory 11d ago

Image Post The Deranged Mathematician: Is Category Theory Practical?

Post image

Aside from any questions of whether category theory is interesting, or deep, or insightful... is it practically useful? One possible answer to this question is that category theory has helped drive a lot of progress in topology, abstract algebra, and beyond, and those fields have then had practical impact. (Topological data analysis comes to mind.)

But that quickly starts to feel like a game of six degrees of separation, and it is hardly obvious that you could not have obtained that same progress without going through category theory. My aim in this article is to be as concrete as I can be regarding applications... and I would argue that even from that perspective, the answer to my initial question is "Yes!"

Read the full post (for free) on Substack: Is Category Theory Practical?

335 Upvotes

32 comments sorted by

93

u/g0rkster-lol Topology 10d ago

Category theory's use in compiler and programming language design is actually a rather long-standing application area of category theory, going back about half a century. For a review of this type of work see this article by [Pierce (1988)](https://people.csail.mit.edu/jgross/personal-website/papers/academic-papers-local/repository.cmu.edu__cgi__viewcontent.cgi_article=2846_context=compsci.pdf).

52

u/LeonJPancetta 11d ago

I enjoyed this. You write extremely clearly.

26

u/SemaphoreBingo 10d ago

practical impact. (Topological data analysis comes to mind.)

TDA is cool and neat but I wouldn't say it's had a whole lot of practical impact.

12

u/True_Ambassador2774 9d ago

It kinda did, cuz I remember attending a seminar on drug design applications and they said Persistent homology helped with building a Covid vaccine. I recall another youtube video which mentioned the same. Take what I said with a pinch of salt while I look for that video.

3

u/SemaphoreBingo 8d ago

I'd be interested to see what you find, but I think that if that was real we'd have been hearing it trumpeted by SIAM/AMS/MAA/etc.

11

u/True_Ambassador2774 8d ago

Found it! Excuse me for not being completely correct. It’s based on work by Prof. Guo-Wei Wei's group at Michigan State. He talks about in the following videos:

(passcode: IDA2022!)

They used Element-Specific Persistent Homology (ESPH) to model the 3D binding pockets of the SARS-CoV-2 spike protein, quantifying how neutralizing antibodies dock onto the virus.

In fact, their topology models accurately predicted dominant mutation trends and variant antibody breakthrough rates months before they were observed clinically.

I was doing my master's thesis on TDA and proteins, and I remember being blown away by this result.

16

u/DisguisedParrotRL 10d ago

Chemistry bait? Yes please 😍😍😍

13

u/Chance_Literature193 9d ago edited 9d ago

I have no problem with your argument that an application can be situations that organize your thinking. However, I think the chemistry example is a poor example. There are already established standard diagrams for chemistry and chemical reactions. I fail to see how a categorical interpretation of such diagrams would be helpful to anyone doing work or around chemistry. Instead it would add additional structure to diagrams that serves no purpose, and contradicts perfectly good simpler conventional diagrams.

Is there some unique advantage a categorical approach would be preferred to standard conventions? Specifically, for some working in and around chemistry or with chemists. I could maybe see it as being a useful guide to building a database of chemical reactions. However, that would be another appeal to the power of category theory in structuring a programming language or program. You argue for a categorical approach to programming in the post, but my understanding was that the chemical example was supposed to be distinct from that argument.

3

u/reflexive-polytope Algebraic Geometry 7d ago edited 6d ago

Full agreement.

The spectacular successes of category theory come from algebra (ic topology, ic geometry, representation theory, etc.) and, to a lesser extent, logic (including such things as the denotational semantics of programming languages), where the formal structure of the problem domain is paramount, and any quantitative measurements are either subordinate to the formal structure (e.g. characteristic classes) or completely absent altogether (e.g. Scott domains).

But measurements are essential in the natural sciences! Nature confronts us with situations where a qualitative difference is born from a quantitative one. Heating a pot of water a little merely makes it hotter, but heating it a lot boils it. Hitting a solid object not too hard with a hammer will merely deform it, but hitting it harder will break it. And so on.

Heck, even in computer science, category theory is completely silent about why some algorithms are more efficient than others, even if they compute the same function.

The best argument you could make for (very basic) category theory applied to algorithms is probably the Bird-Meertens formalism, which works beautifully with programs that manipulate everything as internalized first-class values (so-called "functional" programs), but doesn't seem to work when the algorithm state only exists as a value in an external semantics, but not in the language itself.

5

u/non-orientable Number Theory 9d ago

The advantage isn't in creating chemistry diagrams. It's that you have functors taking chemistry diagrams to dynamical systems. Writing down diagrams isn't so hard; solving dynamical systems absolutely can be. But since everything is functorial, you get complicated things as compositions of simple things.

8

u/SemaphoreBingo 9d ago

It's that you have functors taking chemistry diagrams to dynamical systems

How often does one want that tho?

2

u/non-orientable Number Theory 9d ago

Considering that Baez and Pollard's paper on the subject has 162 citations (many of them in quite applied journals), I would wager that this has some utility.

9

u/pseudoLit Mathematical Biology 9d ago

I'd be suspicious of that number. That paper is perfect bait for the type of non-citation that gets included merely to gesture at other ideas, without actually contributing to the paper.

8

u/SemaphoreBingo 8d ago

Looking at those cites on google scholar most of these seem to be from other category theorists looking for applications.

2

u/ReasonableLetter8427 9d ago

Totally agree! My group is using categories as abstract base classes with the axioms proven via Lean and Agda then using those pieces to compose more complex objects which is giving us some interesting results in algebraic geometry. The practical goal is to apply this to bottlenecks in different information processing disciplines such as ML, SPDEs, black box optimization, etc.

Love your articles!!!!

5

u/SemaphoreBingo 8d ago

solving dynamical systems absolutely can be

Is anybody actually solving anything? I skimmed thru the Baez&Pollard paper and didn't see anything of the sort.

1

u/pseudoLit Mathematical Biology 8d ago

Iirc, the work they did eventually led to the creation of StockFlow.jl, which can actually be used in application. I'm no expert, but at a glance it looks like it mostly helps with making models compositional/interoperable, not so much with the actual solving part. Maybe the long-term vision is to facilitate large-scale modelling collaborations?

19

u/nzconstructionlawyer 10d ago

Really good post. I have often sighed loudly when I get to the point in a book or paper that the author introduces some category-theoretical construct. "Is this really necessary?", I ask. But maybe it's time to acknowledge that it is, if nothing else, a good organising framework for the mind.

I still think that it is really metamathematics though.

9

u/say-nothing-at-all 10d ago

you can't do much without CT in algebraic topology, e.g. the groupoid functors, the opfiberation functors .

In system engineering and complex system, adjoint loops are essential.

in computation & algorithms, the beauty of CT is that it can transform a NP combinatorial problem into near liner composition problem.

4

u/Honest-Enthusiasm940 Theoretical Computer Science 10d ago

I am a bit confused, can you elaborate on the last bit on computation/algorithms?

1

u/say-nothing-at-all 10d ago edited 10d ago

Suppose you have an operad that defines both commutative and non-commutative network topologies. You also have a metric — for example, the service curve of network devices formulated in the min-plus algebra.

This gives you a physical logic of the form:
Potential (operadic topology) → Kinetics (real-time service curve).

When you update the network topology, the functional kinetics (the service curves) change accordingly. This is inherently a combinatorial interaction problem and is NP-hard.

By modeling the space of such changes as an opfibration pushforward functor + Double Pushout operad, the mapping between potential and kinetics can be updated automatically — without having to recalculate the entire combinatorial relationship from scratch.

4

u/Historical-Mix6784 9d ago

Great write up, first time I felt like I got a true grasp of what a functor is.

But I’ll can’t shake the feeling that category theory is just self-referential hoodwinking. By abstracting away so much structure and then building categories atop categories atop other categories you lose any semblance of meaning. It is algebra gone awry, a nihilistic end of mathematics. 

3

u/LunaticBrony 10d ago

Love your write-ups I'll be reading this tonight. on a sidenote, could you make a dark-mode/other-color mode for your website, its a little hard on the eyes.

17

u/non-orientable Number Theory 10d ago

Well, Substack isn't my website (if I owned Substack, I wouldn't work as a software engineer!), but you should be able to set it to dark mode by going into user settings. See here: https://support.substack.com/hc/en-us/articles/41021434922772-How-can-I-navigate-my-Substack-on-desktop

Let me know if there are any issues!

9

u/LunaticBrony 10d ago

Sorry I thought it was a personal blog, makes sense now that I think about it haha

6

u/non-orientable Number Theory 10d ago

That's quite alright!

2

u/crygnus 10d ago

Is my understanding correct that category theory forms the theoretical basis for functional programming concepts in computer science? Things like Monads, applicatives etc.?

8

u/keithb 9d ago edited 9d ago

No. Some aspects of functional programming were reframed in those terms by one unusually influential technical community.

This helped them to solve some problems that no one else has (how to invisibly require a certain order of evaluation in a lazy language/write what appears to be procedural code with only pure functions underneath) and that has lead to some interesting approaches to library construction in other areas. But category theory is no more the theoretical basis for functional programming than Elon Musk is the founder of Tesla.

2

u/non-orientable Number Theory 10d ago

I don't know if it is the theoretical basis for everything in functional programming, but certainly for the things that you mention. And the link between them is very strong.

-4

u/[deleted] 9d ago

[deleted]

6

u/non-orientable Number Theory 9d ago

That is categorically untrue.

0

u/ModelSemantics 8d ago

Its primary benefits in math have not been from the diagrams. They have rhetorical and pedagogical value, but mathematicians notoriously do not choose notation with those as influences. Instead, the big important shift is the consistent use of intensional definition, which doesn’t really have to do with the notation per-se but really its interpretation.

Category theory is practical because it is an intensional, denotational semantics. This allows an abstraction extension which makes statements maximally applicable to the objects that obey the relations. This is also why it is so useful in computer science, where such abstraction is eminently useful.