Hacker News new | past | comments | ask | show | jobs | submit login
Infinity Category Theory Offers a Bird’s-Eye View of Mathematics (scientificamerican.com)
130 points by louthy on Sept 16, 2021 | hide | past | favorite | 52 comments



I've recently been studying category theory, mostly from Riehl's book, a few years after finishing my undergraduate math degree at a well-regarded school. I can't help but feel a little cheated that not one of my professors thought it was important to show us a little category theory.

Learning category theory has brought clarity that I never felt as a student. I always had this strange feeling that many of my courses wasted time proving "the same" facts over and over again. From group theory, to linear algebra, to topology, to measure theory. We'd spend most of the semester proving some trivial facts about morphisms and functors, just specialized to an unfamiliar category, and by the time we were done, we only had time to prove one or two interesting theorems before the semester ended.

Back then, I had stumbled upon some Wikipedia pages about category theory, but all the jargon seemed impenetrable at the time. Now, I really wish it had part of the curriculum from the very beginning. Simply giving students in an abstract algebra class the simple definitions for category, functor, and natural transformation would go a long way. Math programs should probably also start teaching Haskell or Coq in the first or second year.


I kind of disagree. I think you found category theory rewarding precisely because you already had a math background and could benefit from seeing the linkages. Without having already done the classes you did, it would be very difficult to motivate category theory and it's liable to just make students' eyes glaze over. For example, most of Riehl's examples wouldn't make sense.

I also think that abstract algebra, linear algebra, analysis, geometry etc. even at the undergraduate level have the majority of their theorems unprovable from category theory alone.

Category theory is good for proving that the trivial is truly trivial, but the nontrivial still remains.

> Math programs should probably also start teaching Haskell or Coq in the first or second year.

I also disagree. For all the distrust many programmers have of Haskell and its "mathiness" it actually has rather little to do with mathematics and the parts that it does have to do with mathematics are generally in ways mostly irrelevant for the classical undergraduate math curriculum.

As for formal theorem provers such as Coq, though one day they may become standard mathematical rigor, that day is not now. They remain very unergonomic compared to the usual informal, but rigorous proofs in pure mathematics and often have several orders of magnitude more time to arrive at the same proof with no real increase in mathematical insight. I am personally very excited by them, but view their current status as far too premature to include in the average undergraduate mathematical curriculum.


I don't mean to say that category should be the primary focus of the undergraduate curriculum, just that professors shouldn't shy away from using a bit of category theory to elucidate the connections between different subfields of mathematics. Nothing wrong with spending fifteen minutes here and there explaining how something fits into the categorical framework. It's also very useful for identifying what the "meat" of a topic is--which theorems depend only on the categorical structure, and which theorems require deeper insight? This is a useful skill to have.

My main complaint about the math program I attended is that all of my courses felt disjoint -- they could be taken in any order, so we basically had to start over from scratch every semester, rather than allowing the material to compound over four years. I wish course selection had been more rigid.

As for teaching functional programming -- I agree with you learning category theory is not necessary for learning Haskell. But, learning Haskell is an incredibly useful and tangible way of exploring the basic ideas of category theory / type theory. I think it would be a natural addition to any math program, and the earlier students learn it the more mileage they'll get out of it. Most math programs are sorely missing a bit of computer science, anyway.


> I think it would be a natural addition to any math program, and the earlier students learn it the more mileage they'll get out of it. Most math programs are sorely missing a bit of computer science, anyway.

Honestly I don't find arguments that CS should be included in math programs all that convincing. What about any of the other sister fields to mathematics such as statistics or physics? I find parts of them equally compelling if not more so than CS to round out a mathematical education, but of course you quickly run out of space and time to actually include them. The crucial differentiator is that they "feel different" than normal mathematics work. I have a different set of intuitions when I'm programming in Haskell vs doing a stats problem vs doing physics. They are all deeply informed by mathematics and ultimately based on mathematics, but in each case when push comes to shove it's mathematical rigor that first goes out the window and then is hopefully later recovered rather than the other way around.

I've also never found type theory to be something useful to include at the undergraduate math level. In general, foundations of mathematics stuff is something that I think is very useful for a specific subset of undergrads who are very interested in seeing how the rigor "goes through all the way" so to speak, but for most undergrads is probably neither interesting nor useful for their future mathematical endeavors. Mathematics at large is not all that sensitive to your choice of foundations.

E.g. model theory is great! Set theory is fantastic! I have a hard time justifying their inclusion alongside the traditional three pillars of algebra, analysis, and geometry, however.


For one, I think it is irresponsible to leave math graduates so woefully unprepared to enter the workforce. There are not enough PhD slots for everyone to attend graduate school, nor should they. Math students can be very effective in the workforce with some practical programming experience under their belt.

There are pedagogical reasons too. Programming has been an endless soure of applications and motivation to learn and explore math, especially computer graphics and FP. Many math students are naturally curious and explore on their own anyway, but of course a good instructor can accelerate the learning process.


I agree, as a computer science and maths undergrad, the first rewarding part of category theory was in algebraic topology where we first saw examples of very nontrivial functors (fundamental group, and homology). Up until that point, category theory seemed like a pointlessly abstract way of stating obvious facts.

Even now as a research mathematician, category theory is a good tool for guiding to the “correct” definitions of things, but virtually all the work after that is “category-less” in that it is completely and utterly specialised into the problem domain.

Category theory is still a fantastic way of organising information, stating things like universal properties, and also sometimes making “abstract nonsense” arguments (which often guide you towards some nontrivial observation in a particular category). But it is certainly not the panacea that some make it out to be.


> Without having already done the classes you did, it would be very difficult to motivate category theory

The usual approach of teaching category theory is motivated where examples motivate the categorical gadgets, I think the unmotivated alternative (to create intuition for category theory as a formalist game) has not been explored


Don't hold me to it since my math education is basically me fumbling through the internet for the past several years trying to piece things together, but I think this is the unmotivated approach you're talking about.

https://www.youtube.com/watch?v=US4Zr1WKD-8&list=PLCTMeyjMKR...

As others have stated trying to learn this abstractly first, before developing a concrete mathematical foundation, simply didn't work. I understood what the subject purported to do. I understood why I wanted to have a birds-eye view of subjects to come. The trouble is that the concepts didn't have enough to latch onto in my brain. I found myself frantically looking for examples in various subjects. In the end I realized my time was better spent in the weeds.


> Without having already done the classes you did, it would be very difficult to motivate category theory and it's liable to just make students' eyes glaze over.

There's enough motivation for category theory even in basic foundations. You could start by teaching a structural set theory like ETCS as the formal counterpart of naïve set theory. Then yes, teach abstract algebra as usual but introduce category-theoretical generalizations early instead of duplicating content.


Concretely, what exactly are you claiming is duplicated?


I think category theory can help to give a "roadmap" for what the basic theorems of each course will be. Personally, as a student, I always felt like my courses jumped around too much without explanation, and like I could never see what was coming next. Knowing category theory has helped me see the bigger picture. When we encounter a new category, it helps to understand what products, limits, colimits, functors, natural transformations, Yoneda Lemma, adjunctions, etc. look like for this category. Indeed, most of the theorems in a topology or algebra or measure theory course fit into this mold -- we define what a morphism is and then prove a bunch of facts about products, functors, etc..


We should teach the bulk of Lawvere theories only once. Students should get to know groups and rings as two flavors of a similar construction, and also be introduced to the mysterious fact that some objects, like fields, don't fit into the Lawvere-theory paradigm.


I vouched for this comment not because I fully agree, but because I like how provocative it is.


I fully disagree, learning category theory (& friends) in undergrad does more harm than good.

An undergrad curriculum is expository in nature, the main goals being diversity of topics and developing a maturity.

Maturity is the biggest prerequisite to approaching cat theory imo. Similarly, without examples and non-examples from various fields, cat theory will feel like esperanto for its own sake. Given this, cat theory should not fall into undergrad territory, but will be present in any grad program.

Categories should show up naturally in Algebra/Algebraic topology, and not much elsewhere (in undergrad). Saying 'category of vector spaces over k' in a (linear) algebra course is effectively a waste of breath due to how little additional insight it provides.


They don't show up much elsewhere even in research-level mathematics. Unless you're doing something related to algebraic geometry or algebraic topology, there's a 95% chance they're a waste of time. The stuff in the linked article is relevant mainly to homotopy theorists.

The importance of category theory in mathematics seems wildly overestimated by HN, judging by the number of stories about it.


> The stuff in the linked article is relevant mainly to homotopy theorists.

HoTT makes homotopy theory relevant to the foundations of mathematics. So every mathematician encounters this stuff in some way. It clarifies what it means for mathematical structures to be isomorphic, and what exactly one is doing when treating isomorphisms by analogy with equality, which is often dismissed as an "abuse of notation" but is something that practically everyone does in math.


> HoTT makes homotopy theory relevant to the foundations of mathematics.

OK.

> So every mathematician encounters this stuff in some way.

I doubt that. First, not every mathematician cares all that much about foundations. If you're using differential equations in mathematical biology, how much do you actually care about foundations? And second, even if you do care about foundations, HoTT isn't the only possible foundation, nor is it the most common one. You could care about foundations and base those foundations on ZFC without giving a rip about HoTT.

So... I don't buy it. (Unless by "encounters in some way" you mean "hears it in hallway conversations" or "skims journal articles about it now and then".)


HoTT is not really relevant to the study of the foundations of mathematics, in the sense that it does not help solve the questions considered important or interesting by the foundations/metamathematics community. The best they can say is basically that they came up with a theory that is mutually interpretable with ZFC, and in their opinion more aesthetically pleasing, which sort of misses the point. The purpose of ZFC isn't to be aesthetically pleasing or "capture how mathematicians actually think" or anything like that, it's to facilitate proving metamathematical theorems.

Also, people understood isomorphisms quite well decades before HoTT was invented.

I hear these talking points repeated often enough on HN that it makes me think I should write a centralized debunking of them and just link it every time a HoTT story hits the front page.


As I mentioned elsewhere, my biggest complaint about my undergrad math education is that the topics felt entirely disjoint. We could take courses in any order, and it effectively felt like we started over from scratch each semester, rather than allowing the material to compound over four years. If courses are offered in a more rigid order, I think that the gradual introduction of categorical language could go a long way. It does not need to be emphasized, but it should not be neglected.

Textbook authors let some categorical language slip through so the time, and I think eductors are doing students a disservice my neglecting it. For instance, I was utterly confused about the "natural" isomorphism between a vector space and its double dual, as well as the "universal property" of tensor products, free modules, etc.. I also saw commutative diagrams in my complex analysis and topology books, but no one bothered to explain where they come from or what the rules are. Much later I finally took the time to study category theory on my own, and I can't help but think the whole experience would have been much more efficient had my professors exposed us to the idea of working with abstract morphisms much earlier.


>Textbook authors let some categorical language slip through so the time, and I think eductors are doing students a disservice my neglecting it.

I agree. When teaching, I try to choose my terms carefully so someone would not go astray from the subject matter. It is remarkable how easy it is to get stuck on a side-quest with looking up abstract terms, while-so missing the main topic. imo the graceful way to handle it is to drop references (and disclaimers in case they are time-consuming) when introducing new things.

Somehow math learning has the property that 'struggle with x, finish x. learn y. if I knew y before x it would've been so much smoother!' sounds correct, but in practice it often does not go so well.


> We'd spend most of the semester proving some trivial facts about morphisms and functors, just specialized to an unfamiliar category

Even if you know category theory, you still need to prove facts about the different categories you are dealing with. Just phrasing it in the language of category theory seldom suffices to prove something.


'The category of algebras of a monad on Set is complete and cocomplete, and the forgetful functor preserves limits.' gets you pretty far in a lot of subjects.


Doesn't the preservation of limits follow from the fact that the forgetful functor is right adjoint to the free functor? A left adjoint functor is always cocontinuous and a right adjoint functor is always continuous.

Looking at examples of "algebras of a monad on set", I see groups and monoids. Does this explain why:

- The trivial group corresponds to a singleton set?

- The direct product of two groups G and H corresponds to their Cartesian products as sets? And so on to direct products of infinitely many groups?

- An equaliser of G under homs f and g has as its underlying set {x \in G : f(x) = g(x)}?

And so on, I see that the same must be true for any other algebraic structure which is a "category of algebras of a monad on Set". Or have I misunderstood?

[edit]

I also see that because the free functor is cocontinuous (because it's left adjoint to the forgetful functor), the free group generated by the union of some sets is the same as the free product (not direct sum) of their individual free groups (because the free product is a coproduct but the direct sum is not). If we want a correspondence with direct sum instead, we need to generate free abelian groups instead of free groups.


Yes, all of this is true. Other examples of 'categories of algebras of a monad on Set' include vector spaces, rings, modules over a given ring, representations of a given group, and Lie algebras.

So if we could somehow teach category theory first (which would be hard because students would have no examples) we could shave a few lectures off each of those courses.


That's pretty useful. Thanks. There's a lot contained in that statement.


Can someone explain that in simple(r) terms?


The trouble is that, from a certain perspective, all of those terms are indeed very simple. What they are not, however, is familiar.

Everything I say below will be completely useless to you, because it starts abstract and gets worse from there. You won't be able to apply this to anything immediately. But perhaps it will help you see why these concepts apply to so many things.

A category is a world of two-sided widgets that can be fit together, with a rule that two things can be fit together only if the shapes at matching ends line up. We call the widgets "morphisms" and the shapes of their ends "objects".

A functor is a way of seeing a piece of a category in terms of another category. If we're relating a category to itself, it's an endofunctor. Endofunctors are funny in that, if you're looking at a piece of a category in terms of the whole category, you can find something that looks like that piece itself inside the piece -- it's kind of fractal.

Monads are endofunctors where the infinite regress doesn't really get you anywhere -- if you zoom in by two levels, you see basically the same picture as if you only zoomed in once.

An algebra on a monad is a particular object, and a way to go from the zoomed-in version under the monad back to the unzoomed object at the top. It doesn't work for just any object; only the particular one.

My favorite example of a monad is the Tree monad in the category of data structures. (If you're familiar with programming, imagine the universe of all primitive types and all structs or enums you could possibly define.) The Tree monad zooms in on just the data structures that are trees whose leaves are a particular other data structure, like a tree of ints or a tree of customer records.

Among these tree types is the type of trees of trees of ints; that is, trees whose leaves are themselves trees of ints. It's valid, but a bit silly; we can always just graft each subtree onto the main tree to obtain a tree of ints. The extra level of tree doesn't add anything to the data structure.

A tree algebra picks out a particular leaf type and tells us how to turn a tree over this type into a single value. I can, for instance, explain how to sum all of the integers in a tree of ints to get a single integer. If we have a tree of trees of ints, I need to make sure that summing the subtrees and then summing the main tree is the same as just splicing the subtrees in and evaluating the whole thing. (It is.)

Deep breath.

There are lots of algebras that could exist for any given monad; I just illustrated one for the Tree monad. It turns out that if you take all of the algebras for a monad together, they form a category of their own. Morphisms between algebras in this category are a pair of morphisms in the original category, one going between the types the algebras work over, and one doing the same but within the focus of the monad. They have to cohere in a specific sense.

If this category is complete, then certain general kinds of optimization problems can be solved in that category -- for instance, the kind where you have some algebras and you want to find an algebra compatible with all of them. If it's cocomplete, you can solve another class of problems. (Loosely speaking, one is a minimization problem and the other is a maximization problem.)


Sure. A monad is just a monoid in the category of endofunctors.


Yeah no. There are whole fields completely untouched by such reasoning, like analysis.


He said "lot of" not "all".


It's not a "lot of". Only small portions of mathematics benefit from category theory. Analysis is all about getting down-and-dirty with your mathematical objects. It's pretty tiring how much category theory evangelism there is online despite being very different than actual mathematical academia.


Well most don’t, it’s an absurd statement. I can think of a few constructions that boil down to this, but most don’t.


Thousands of eyeballs glazing over, snark semi intended.


Ok, but does that help me find out the speed of an object if I know its acceleration? Does it help me compute the length of the hypothenuse if I know the lengths of the other sides of a triangle?


Of course not. Moreover, if you learn category theory first, you will never be able to do any of those things (nor will you want to).


My point is not that learning category theory would prevent you from understanding other math, but simply that category theory doesn't get you far at all in practical math.

And for understanding a normal school curriculum, it's much more important to understand derivatives than it is to understand the deep connections between constructive geometry and algebra, which is the kind of thing where category theory shines.

Basically, category theory in education proponents seem to forget that math is not just learned for its own self, but that it is also an important basis for understanding physics and perhaps other subjects.

Students also tend to do horribly with abstraction, it's one of the hardest things for some to understand. I've literally seen (very young) students who can tell you how many apples they have if the multiply 5 apples by 3 apples, but can't tell you how much is 5 * 3. Or who can tell you what's the missing number in 5 + _ = 9, but can't tell you what is x in 5 + x = 9. This may or may not apply at other levels of abstraction for older students as well.


Are there any introductions to category theory you would recommend in particular?

A cursory glance gives me this: http://www.cs.nott.ac.uk/~pszgmh/cat.html

Which seems to avoid being very "mathy" right out of the gate, though I can't tell its quality.


MIT's 18.S097: Programming with Categories with Brendan Fong, Bartosz Milewski and David Spivak is great: http://brendanfong.com/programmingcats.html

All lectures from the course are in this playlist: https://www.youtube.com/playlist?list=PLhgq-BqyZ7i7MTGhUROZy...

Milewski's free book Category Theory for Programmers is a "classic" as well https://github.com/hmemcpy/milewski-ctfp-pdf

In general you can find videos on youtube of talks given at various industry functional programming conferences that often help since they start from the industry programmer point of view rather than the pure maths one.

E.g. A practical introduction to Category Theory (for Scala devs) https://www.youtube.com/watch?v=GNG3Gk9KsoI


I would recommend "Seven Sketches in Compositionality", as it does not progressively get harder, but each chapter starts off very easily. So you can catch up, if you got lost.

It is available here: https://arxiv.org/abs/1803.05316


Definitely recommend CTFP: (Category Theory For Programmers)

https://bartoszmilewski.com/2014/10/28/category-theory-for-p...


Seconding the suggestions in my sibling comments. I think I managed to learn some category theory by haphazard clambering and osmosis of the material.

I’d like to add a recommendation for the book Category Theory for the Sciences: https://mitpress.mit.edu/books/category-theory-sciences

Archive.org seems to have it for download: https://archive.org/details/cattheory

(I prefer the printed copy myself, i.e. it has been worth having.)


> Back then, I had stumbled upon some Wikipedia pages about category theory, but all the jargon seemed impenetrable at the time. Now, I really wish it had part of the curriculum from the very beginning.

It’s possible that the jargon would have seemed impenetrable to most students, and ,any students would have dropped out if they had done that.

I think you have to learn first that abstraction can be useful in math by learning that similarities exist between seemingly distinct structures.

It also just takes time for things to sink in. As one of my teachers said about analysis: “don’t worry if you can’t do the exercises. In six weeks time, look back at today’s exercises, and you’ll wonder how you ever found them difficult”


Category theory seems very natural from the the programming point of view, there are things which are connected to other things by 'arrows', much like data-structures, or function call-graphs.


I have no math background but find category theory very interesting for thinking about math foundations, it really makes more sense than set theory for that ....


Why and how? I've been through ZFC course and I found it quite natural. Okay maybe not natural, but it quickly clicked.


sorry I meant for thinking about math foundations as in the philosophical questions about math (is it constructed, discovered, a priori etc.) not mathematical foundations as in concrete theorems.


From the article:

"Through category theory, we teach young mathematicians the latest ideas by using general rules that apply broadly to categories across mathematics rather than drilling down to individual laws that apply only in a single area."


CT is almost designed to just wrap up "ugly" details in cute proofs after the fact. I think theres a real danger of students getting a false sense of understanding if they dont know how to contextualize this kind of stuff.


All of math education is bad like this. We're taught the "ladder myth" that math is a linear subject leading to like multivariable calculus, not even real analysis.

It's a terrible waste of people's time, interests, and talents.


The left picture called "compositions are associative and unital" makes more sense when you reverse the bottom two arrows so that g.f : A -> C and h : C -> D


Well, of course if you start with a problem in Galois Theory (as the author of the OP does), it is very likely that Category Theory might enlighten you. In the end, it was built for those problems.

However, go and try to explain Bolzano's Theorem or the midpoint rule using that framework.


> for instance, there is a continuous deformation that would allow you to convert an unbaked doughnut

Donuts are not baked, they're fried.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: