News for hackers. Stuff that matters.
Re:A monad is a monoid in the category of endofunctors, what... by nerdponx on Sunday February 10, 2019 @10:11AM (#19128058)
On the flipside, knowing that a ring is "like a group (which we already covered), with another operation that follows these axioms" is useful, and still mostly rigorous.

It's better than "eh just use it a lot and you'll figure it out."

Re:A monad is a monoid in the category of endofunctors, what... by joppy on Sunday February 10, 2019 @04:25PM (#19130137)
Of course I'm not recommending learning ring theory without learning the (usual) definition of a ring. This is absolutely rigorous and useful, and immediately after you learn it you can start playing around with rings, and start proving some interesting theorems.

The analogue of this approach in Haskell is probably something like sections 1 and 2 of "Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell" [1], which is quite an old paper (from around 2000 or something?). It does not even contain the word "monoid", but instead shows what an IO action is, and how functions like >> and >>= can be used to sequence and thread them. It also provides a lot of context as to why monadic IO exists. After reading this, a new programmer could start playing around with making new IO actions using these operators. After reading about monoid objects, a new programmer is no closer to being able to write a Haskell program.

[1]: https://www.microsoft.com/en-us/research/wp-content/uploads/...

Re:A monad is a monoid in the category of endofunctors, what... by throwawaymath on Sunday February 10, 2019 @11:13AM (#19128335)
True, but that likeness is normally taught in abstract algebra without requiring category theory. For example this: https://i.redd.it/yqnbigi032i11.png doesn’t require any category to understand.
Re:A monad is a monoid in the category of endofunctors, what... by nerdponx on Sunday February 10, 2019 @12:39PM (#19128856)
Not my point.

For education, there is a happy medium between providing theoretical context and hand-waving over technicalities and learning by example.

Very nice diagram though.

Re:A monad is a monoid in the category of endofunctors, what... by throwawaymath on Sunday February 10, 2019 @12:54PM (#19128962)
To give credit where it's due, that diagram is from a /r/math thread: https://www.reddit.com/r/math/comments/99y547/my_digram_of_a...
Re:A monad is a monoid in the category of endofunctors, what... by mlevental on Sunday February 10, 2019 @11:20AM (#19128369)
that's definitely a neat diagram but the examples (the blue) almost entail already know the definitively.
Re:A monad is a monoid in the category of endofunctors, what... by zozbot123 on Sunday February 10, 2019 @11:19AM (#19128363)
And "these axioms" are indeed the axioms of a monoid operation (for multiplication), plus some sensible notion of "consistency" with the underlying abelian-group structure. Which is all that the "monoid object" characterization is saying, actually. So, I disagree that the perspective is inherently unintuitive.
Re:A monad is a monoid in the category of endofunctors, what... by throwawaymath on Sunday February 10, 2019 @11:40AM (#19128451)
I think you may have a different definition of intuitive than the top level comment, or else you two are speaking to different things. Category theory is certainly "elegant" and provides a lot of insight in the connection between various algebraic structures. But I think it would be completely asinine to use category theoretic formalisms in a first course covering algebraic structures like groups, rings and fields. That level of abstraction doesn't make the distinctions between each structure more intuitive; if anything it obfuscates them and requires setting up far more machinery to explain what they even are. It would be highly inappropriate for an undergrad's first exposure.

That is my impression of the top level comment's point, and I largely agree with it. If you understand what a group is, I can explain what a ring is to you in a very straightforward way that still shows you the connections between the two things. But setting up category theoretic language would take up a nontrivial portion of the course itself, and at the end you'd have a much less specific understanding of the relevant theorems on rings and groups. You'd be missing all the trees for the forest.

Re:A monad is a monoid in the category of endofunctors, what... by zozbot123 on Sunday February 10, 2019 @11:44AM (#19128479)
Look, it's 2019. "Setting up category-theoretic language" is something that should begin in the first lesson of the first course in formal, non-K12 math, starting with the use of ETCS or a comparable "structural" set theory as the 'naïve' foundation of choice. It provides countless advantages not just in abstract algebra, but in a wide variety of other subfields of math as well.
Re:A monad is a monoid in the category of endofunctors, what... by throwawaymath on Sunday February 10, 2019 @12:52PM (#19128948)
To be clear, how much category theory are you envisioning setting up in a first course on abstract algebra? Are you basically just talking about a modern treatment of morphisms in the abstract sense, or do you also mean discussing things like functors?

My perspective on this is basically informed by the following: I like category theory a lot. I've chatted with Baez about this on a few occasions and insofar as I need to use algebra, I like the category theoretic formalisms that come along with it. I think if you had students with a lot of mathematical maturity but no prior exposure to abstract algebra (except maybe a rigorous treatment of linear algebra), you could accomplish what you're proposing.

To your point, one of my favorite math textbooks is Aluffi's Chapter 0. You're probably familiar with it, but if not: it builds up abstract algebra in a rigorous and modern fashion alongside category theory. However, there are a few caveats here:

1. Aluffi explicitly states it's a textbook for upper level undergrads and preferably graduates. In my experience, when authors say this they actually mean it's appropriate as a year one graduate course. That's not the time to learn abstract algebra for the first time!

2. Aluffi does a great job of covering things like morphisms and categories, but the size of the book is massive. He doesn't have any nontrivial coverage of deeper category theoretic concepts like functors until much later in the book; it's probably far enough in that you couldn't reasonably cover it in a single semester course.

3. I really don't think most math majors would benefit from it. Those who are applied math majors will get questionable benefit from a slower, more comprehensive approach to algebra than a faster approach that lets them get to applications. Moreover, not all pure math majors have the mathematical maturity to approach category theory before grad school. Proofs in traditional abstract algebra are a lot less abstract than category theory, and it's easier to motivate them even if they aren't ultimately as elegant.

Re:A monad is a monoid in the category of endofunctors, what... by zozbot123 on Sunday February 10, 2019 @01:21PM (#19129128)
The problem with "a faster approach that lets [you] get to applications" is that it will depend a lot on what applications you have in mind. And often it's not even faster in any real sense - there's a whole lot of pointless duplication involved in tailoring things to a lower level of abstraction. It may be better to begin with a more effective explanation of what sorts of "mathematical maturity" we're actually seeking here, so that attaining it is easier in the first place for the average student. For all their supposed "unintuitiveness", category-theory-based explanations do this quite well, in a way that I haven't really seen elsewhere - I mean, this very thread is one where we're discussing software developers learning category theory and benefiting from it, so why couldn't this be also a part of mathematical training?
Re:A monad is a monoid in the category of endofunctors, what... by joppy on Sunday February 10, 2019 @04:33PM (#19130185)
I strongly disagree. From experience teaching category theory to undergraduates, it is totally obtuse before that have a large pool of examples on which to draw. In a very first course, students are still struggling to learn concepts from linear algebra, which will be the bread and butter of the rest of their mathematics. In a second course, they are struggling to learn why the definition of "linear map" is different from the definition of "matrix" they learned in their first course. You could say the same thing about metric spaces or topology.

Perhaps the third course is a nice place to start introducing some category theory, since they will now have actual examples on which to draw, and learn about the unifying concepts of "morphism", "categorical product", and so on. They might even be ready for some interesting functors, such as the fundamental group of a topological space.

If you were to teach category theory as a very first course, what would you teach? What examples of categories do you have? What examples of functors?

Re:A monad is a monoid in the category of endofunctors, what... by joppy on Sunday February 10, 2019 @04:46PM (#19130258)
The consistency with the underlying abelian group could be restated as "multiplication is bilinear, and has a unit", which is the correct perspective to take if you want to "upgrade" from the usual definition to the "monoid object in the category of abelian groups" definition.

But understanding bilinearity and its connection to tensor products is the key part of changing between those definitions, and also the most useful step to understand. The final description is pretty uninteresting in contrast with universal mapping properties of a tensor product.

Re:A monad is a monoid in the category of endofunctors, what... by SatvikBeri on Sunday February 10, 2019 @03:53PM (#19129965)
Yup, and I think it's actually a completely rigorous definition – all rings are commutative groups under one operation (often referred to as "addition"), plus another operation ("multiplication"), plus rules for how they interact.
Re:A monad is a monoid in the category of endofunctors, what... by zozbot123 on Sunday February 10, 2019 @04:00PM (#19130000)
The point of the category-theoretical definition is to explain how these "rules for how they interact" might arise, and in what sense these might be understood as 'minimal' rules. These are not "equivalent" definitions in any real sense, and to think of them as such is arguably missing the whole point of how category theory can be useful here.
Re:A monad is a monoid in the category of endofunctors, what... by Koshkin on Sunday February 10, 2019 @12:31PM (#19128787)
> knowing that a ring is “like a group...” is useful

Turns out, not so much, though. The ring theory bears surprisingly little resemblance to the group theory, to the point that these concepts seem to have nothing to do with each other...

Re:A monad is a monoid in the category of endofunctors, what... by nerdponx on Sunday February 10, 2019 @12:37PM (#19128836)
Except that a ring is literally a group under addition?

Do you seriously mean to suggest there's no pedagogical value in using groups to teach rings?

Re:A monad is a monoid in the category of endofunctors, what... by ginnungagap on Sunday February 10, 2019 @03:05PM (#19129673)
There's actually a big debate between math educators on whether abstract algebra courses should follow a groups first or a rings first approach so it is totally possible to teach rings without appealing to groups. (I'd still argue that both approaches have their advantages and disadvantages and that there can be value in using groups to teach rings though, I just wanted to say it's not as obvious as you might think)
Re:A monad is a monoid in the category of endofunctors, what... by throwawaymath on Sunday February 10, 2019 @12:58PM (#19128994)
I could be wrong here, but my read of that comment is that they're talking about the structural differences between rings and groups at the research level. Which I guess makes sense, since you're in very different territories if you're talking about something like representation theory of finite groups...

Otherwise I agree with you, there's a lot of pedagogical value in combining coverage of algebraic structures.

Re:A monad is a monoid in the category of endofunctors, what... by dnautics on Sunday February 10, 2019 @01:24PM (#19129149)
Yes obviously you need to know what a group is to even begin ring theory but ring theory looks and feels nothing like group theory.