Applied Compositional Thinking for Engineers
applied-compositional-thinking.engineeringI always groan when I see posts on HN with grandiose claims about category theory, like this one.
I think it is actively harmful to propagate pseudo-mathematical claims like the those, for example, found in the slides of Guest Lecture 1:
>>> It’s touched or greatly influenced all corners of mathematics.
>>> It’s become a gateway to learning mathematics.
And from the audio of the lecture (paraphrasing):
>>> Category theory is the stem cell that differentiates into and lies at the root of all pure mathematics. ["All forms of pure math" is also written on the slides.]
These statements are simply false. The vast majority of pure mathematics research done today does not involve category theory at all, and does not benefit from it. An even greater majority (like 99%+) of mathematics done in industry and in national labs does not involve category theory. Numerical analysis, probability, statistics, partial differential equations, dynamical systems, harmonic analysis, even lots of modern differential geometry – no category theory to be seen!
Want proof? Pick up any introductory graduate textbook, or any major journal in these fields.
Now, if you want to do research in number theory, or algebraic topology, or algebraic geometry – sure, you likely would benefit from categorical thinking. But those fields hardly have a monopoly on pure mathematics. Even in, for example, Hatcher's introductory graduate text on algebraic topology (perhaps the most widely used), category theory is stuck in a small appendix and you can read the entire thing without it, with no real loss [1].
I don't have the energy right now to explain why I find the lecture series misguided more generally, but I want to at least flag these obviously incorrect statements and urge caution.
[And before anyone grabs a PDE book and tells me the use of cohomology groups in certain places means PDE uses category theory, please note that e.g. homological algebraic and category theory are different things.]
[1] OK, I guess you need to know what e.g. a natural transformation is to read some parts of the last chapter, but no one does that in an introductory course anyway. A motivated teacher could easily present the material in such a way that this didn't matter.
It's a bit of a white lie but I don't see it being harmful to claim that. It is increasingly becoming true.
Lots of fields are adopting CT. And being taught CT earlier on in the process would provide a useful framework for building upon future knowledge.
Mathematics seems to have 10 different names for the same concept depending on which field you are in. CT provides a common vocabulary.
It's a bit of a white lie but I don't see it being harmful to claim that. It is increasingly becoming true.
I do.
Category theory is something that appeals to some mathematicians, and not to others. Those who it doesn't appeal to are likely to wind up in fields like combinatorics, functional analysis, numerical analysis, and so on. If you inflict category theory prematurely on the latter group, people who might have proven quite talented will be driven away from mathematics.
And I feel this quite personally. I left mathematics for other reasons. But still, had I had to deal with category theory first, I'd have never gone into mathematics in the first place.
I consider your example revelatory, as it points to a different source of harm:
Preferences.
"appeals to some, and not others" - this speaks to the need to normalize the abandonment/minimization of preferences. The harm you describe is self-inflicted limitation due to clinging to preferences. I accidentally abandoned my preferences that lie beyond the meeting of my needs, ie. abandoning preferences for how to meet them. This has led me to realize most, if not all preferences, stem from a combination of arbitrary choices made when young and choices born out of trauma. While there exists preferences with biological/physiological origins, such as those that may have developed around allergies, any conditioned reactions to them are still likely unnecessary. I don't need to feel queasy from smelling something rotten to know it's rotten and to avoid it.
Do you want help with disengaging these means of self-limitation?
Not particularly, oh internet stranger. I do not care for your "help" or armchair psychoanalysis.
Your theory is that I have trauma. Here is mine.
Mathematicians are fairly evenly divided between whether they prefer algebra or analysis. Ask any mathematician and they know exactly which side of this divide they stand on. It is a pretty fundamental difference in what interests them, and what they pay attention to.
Enthusiasm for category theory only exists on the algebra side of the divide. I've yet to meet anyone on the analysis side who particularly likes category theory.
My theory is that I just happen to be on the analysis side.
I said trauma or arbitrary choices. I also forgot about cultural transmission of preferences.
But since you got stuck on trauma and then went on with a "I'm just like this" argument, I'm now willing to bet money on it being trauma-related where before I thought it was a silly possibility.
Personally, I wouldn't be that skeptical. By its very nature CT as a foundational theory and is relevant to, and has at least in that sense indeed touched, all corners of mathematics. (Mathematicians had the same skepticism about Set Theory when it first appeared.) Especially the "theoretical" (pure) math. So, sure, "you can read the entire thing without it, with no real loss", but this only says something about the particular textbook and not the subject itself. I assure you, the actual loss, whether you realize it or not, will be very real. Books like Aluffi's Algebra: Chaper 0 have a very good reason behind them. Category Theory is the chapter zero of the modern understanding of mathematics (and not only).
Can you please explain to me how learning category theory is relevant to, or would enhance the work of, a research mathematician who works on, say, harmonic analysis or probability theory?
What is the actual loss to these mathematicians?
Also, your claim that category theory is a foundational theory (in the sense that set theory is) is just mistaken. Homotopy type theory claims to be such a theory, but homotopy type theory should not be identified with category theory more broadly.
I wouldn't try, but Helemskii's Lectures And Exercises on Functional Analysis show all this in exquisite detail.
The Convenient Setting of Global Analysis (freely available as a PDF) makes extensive use of the categorical notions and methods.
This does not answer my question. The material in the first book is all well-known. A standard reference is Reed and Simon's Methods of Modern Mathematical Physics. Categories don't gain you anything there, and in any case it's tangentially relevant to most work in harmonic analysis and probabiility. The second book is not relevant at all.
Just because you can produce books on analysis where someone uses the word "category," does not mean a working mathematician ought to care.
(Funny that you mentioned "a working mathematician.")
Anyway, wouldn't it be nice to really understand, on some (higher, admittedly) level, what it is that you are actually doing? Functors and all...
But this is exactly my objection. Returning to your example, I don't think working through Helemskii's book helps one really understand functional analysis relative to a well-written standard treatment. What interesting problems does this viewpoint permit a probabilist or harmonic analyst to solve that the standard approach does not? What theorems does it enable?
I find it bizarre that you (and others – I don't mean to pick on you) seem to think that a translation to category theoretic language is necessary (and sufficient?) to understand what one is actually doing. Do the many professional mathematicians who prove important theorems in functional analysis today without bothering to learn this language not actually understand what they are doing [0]? But the undergraduate who reads Helemskii does? This seems like an absurd notion of what it means to actually understand a subject.
[0] See, for example, many of the papers noted here: https://en.wikipedia.org/wiki/Invariant_subspace_problem
Well, at the very least Category Theory can help keep things organized. Let me quote Tom Leinster:
K-theory and K-homology have become indispensable tools in operator theory; there is even a bivariant functor 𝐾𝐾(−,−) from the category of C-algebras to the category of abelian groups relating the two constructions, and many deep theorems can be subsumed in the assertion that there is a category whose objects are C-algebras and whose morphism spaces are given by 𝐾𝐾(𝐴,𝐵). Cyclic homology and cohomology has also become extremely relevant to the interface between analysis and topology.
By its very nature CT as a foundational theory and is relevant to, and has at least in that sense indeed touched, all corners of mathematics.
It comes as no surprise that category theorists make this kind of argument for their own importance. However many corners of mathematics are filled with mathematicians who disagree. Take 100 random people who work in some combination of combinatorics, functional analysis and probability theory. I'd bet that most have never used category theory in a publication. And this doesn't just apply to a few luddites. Consider someone like Terry Tao. He knows some category theory, of course. But you'll have to look long and hard for any paper of his that uses it, or any explanation based on it.
And when you step outside of mathematics to fields that use mathematics heavily, you'll find that applications get harder to find. When you listen to category theorists, you get the impression that category theory is central to programming. Haskell and Scala in particular make good use of category theory. But is that how things work in the real world?
Here is an experiment. Take 100 random working programmers. Ask them if they have ever used category theory to write any programs. You might find 1, probably not 2. Go look at https://www.tiobe.com/tiobe-index/. No programming language in the top 20 even has good support for category theoretical ideas. (The top one that does is Julia at #29.)
Go outside of programming to something like engineering and it becomes even harder to find anyone who thinks that category theory is relevant to their lives.
I came close to a PhD in math, and have multiple papers. My experience is that I needed to learn category theory for some required courses, and otherwise it had no relevance to anything of interest to me. And I do not believe that my experience in that is particularly atypical.
If you disagree, go learn about some fields like numerical analysis, combinatorics, cryptography, and number theory. Sure, for every field you can find evangelicalists who try to apply category theory. Ignore them, find out what the mainstream research uses. Guess what? You WON'T find that people use the language of category theory. You also won't find many practitioners who think that recasting what they are doing in terms of category theory is very useful. You may think that category theory is required to understand those topics, but the people who demonstrably do understand those topics well disagree. I'm going to go with the subject matter experts self-assessment over yours here!
In short, category theory's domination of mathematics is far less sweeping than adherents like you would have us believe.
I get it. From where you stand, you only see and are interested in areas where category theory matters. To you it looks dominant. But that is an illusion. In fact it is extremely similar to another illusion that I discussed in http://www.dtc.umn.edu/~odlyzko/doc/metcalfe.pdf:
Metcalfe’s Law is intuitively appealing, since our personal estimate of the size of a network is based on the uptake of that network among friends and family. Our derived value also varies directly with that metric. We therefore see a linear relationship between the perceived size and value of that network.
In both cases you get a biased view that causes things of personal interest to you to look more universal than they truly are.
>>> Category theory is the stem cell that differentiates into and lies at the root of all pure mathematics. ["All forms of pure math" is also written on the slides.]
I would say this statement is not false. It does seem to lie at the root and is an alternative to set theory which means that mathematics can be perceived with category theory as it's foundation. Whether an actual written CT reformalization has been executed within all the pure mathematical sub fields or whether doing an actual formalization from the perspective of CT will be a benefit at all is another topic all together.
I agree that category theory is not popular. However I feel software engineers should have interest in it as Category theory looks to intersect with an area of software engineering that is currently done ad-hoc style with just gut feelings.
If you squint, Category theory looks to be a formalized theory for the design and complexity of modules. Fully understanding Category theory and how it applies to software could lead to a future where design and architecture is "calculated" rather then "designed."
I went into my math undergrad having gotten hyped online about CT and HoTT. ...And basically the only time i've seen CT come up is in algebra (they use aluffi). And the only time Ive heard anything about HoTT was when I tried bringing it up with the logic graduate students and got some light teasing.
>These statements are simply false. The vast majority of pure mathematics research done today does not involve category theory at all, and does not benefit from it. An even greater majority (like 99%+) of mathematics done in industry and in national labs does not involve category theory. Numerical analysis, probability, statistics, partial differential equations, dynamical systems, harmonic analysis, even lots of modern differential geometry – no category theory to be seen!
They might not think of it consciously, but they sure exploit and use properties of sets, rings, groups, and so on all the time in their calculations...
The properties of sets, rings, groups and so on that they most often use were established prior to the invention of category theory in the 1940s. Therefore the fact that they use subjects that category theory tried to find abstractions in no way suggests that they are based on category theory.
I suspect such claims might grow from the idea that you can replace set-theoretic constructs with category-theoretic constructs in certain places, and see what happens. It must be pretty fundamental, in the sense that dependence on a set theory lies in the foundation of many branches of mathematics. I can't say how universally such an approach can be applied; likely not very much.
By chance, I had a sequence of professors that didn't care about category at all. As consequence, I went through the entirety of my Applied Mathematics Msc without ever, not even once using the bits of category theory I learned as undergrad.
And I'm pretty sure that if I cherry-picked my credits right, the same would have happened in the Phd.
I followed the first two thirds of this, and stopped because I felt that I wasn't getting much. A lot of names for things I already knew, but nary a theorem or meaty result that gave me any new insight. I think my greatest benefit was no longer feeling like MacLane's book needs to be on my reading list.
Also, I discovered that there are cranks even in category theory! There was this guy Robert Rosen who tried to apply it to biology, got totally confused, wrote three giant books, and now has a posthumous following. That wasn't something the lecturers were pushing, but it came up among the students.
The way that CT is explained to engineers here is what tech architects do every day, and with the rigour of formalisms that would help clarify a lot of the muddled thinking some architects suffer from. Arguably, an architect is someone who uses categories and relationships between them to solve and optimize for aggregate behaviour and outcomes.
I watched the first guest lecture, which was very good. I'm not a mathematician, engineer, or a category theorist, but I can apply the formalisms to system architecture instantly.
I guess, but I'm reminded of the promises made for UML, where in the end it just introduced some standard conventions for whiteboard diagrams.
Abstract, domain-independent formalisms can make ideas harder to understand than domain-specific, concrete examples. With category theory, I'm not seeing examples of the formalism paying off that would justify the endeavor.
UML did not have a categorical foundation in the way that, e.g. commutative diagrams, tensor networks or proof nets do, though. Categorical foundations help define some implied properties and allowed operations (e.g. "diagram chasing" as a diagrammatic representation of composition) that have no equivalent in ad-hoc modeling notations like UML.
Sure, it's real math, but is that a difference that makes a difference? The real-world applications could still be overly hyped.
Category theory jumps out of its software silo and is applied to ... well, everything else. This looks like a fun course!
Dr. David Spivak, a guest speaker, is one of the well-known researchers and educators in this area.
Is this just the second coming of cellular automata?
Nice to see the ACT field moving forward :-).
I had (maybe unreasonably) hoped that this course would provide a glimpse into how CT can be applied to organizing and processing data in the sense of keywords like "knowledge graphs", "graph databases", "ontologies", "model-based engineering".... And on top of that, representing operations to do meaningful (semantic) version control on these representations (e.g. [1, 2]), and bidirectional transformations [3] between structured representations (e.g. [3, 4] and "Triple Graph Grammars"). I have the sense that there are dozens of disparate concepts and that category theory offers some unifying power.
I hope that there simply hasn't been enough work done to do a category-theoretic treatment of all of these topics, and that perhaps even more category theory itself needs to be developed so that there are good ways to talk about concepts that are almost-but-not-quite-entirely described or subsumed by category theory.
The alternative is that I'm painfully wrong about what applied category theory aims to be, and that I have a ton of application-specific terms to learn about and won't find a formalization of the sense in which all of these concepts relate.
[1] https://en.wikibooks.org/wiki/Understanding_Darcs/Patch_theo...
[2] https://github.com/trailofbits/graphtage
[3] http://bx-community.wikidot.com
[4] https://github.com/grammarware/bx-parsing
[5] https://en.wikipedia.org/wiki/QVT
[6] http://graphdatamodeling.com/Graph%20Data%20Modeling/GraphQL...
[7] https://neo4j.com/developer/guide-data-modeling/
[8] https://web-cats.gitlab.io/#some-of-the-cats-we-come-across
[9] http://pauillac.inria.fr/~pilkiewi/papers/boomerang-tr.pdf
CT is universal in the sense that if you understand how it is applied in one domain you can easily apply it to others.
The problem with CT education IMO is that it cannot be taught at the abstraction level only -- there are too many floating abstractions that people can't anchor to any existing knowledge.
This means CT can only REALLY be understood once you apply it to a domain. The problem is that not many people outside of mathematicians understand the domains that CT is traditionally taught with.
CT for Engineers, CT for Programmers, CT for XYZ, is probably the only viable way CT is going to see wider adoption.
In CT terms, "CT has a universal property..."