## November 11, 2015

### Burritos for Category Theorists

#### Posted by John Baez

You’ve probably heard of Lawvere’s Hegelian taco. Now here is a paper that introduces the burrito to category theorists:

The source of its versatility and popularity is revealed:

To wit, a burrito is just a strong monad in the symmetric monoidal category of food.

Frankly, having seen plenty of attempts to explain monads to computer scientists, I thought this should have been marketed as ‘monads for chefs’. But Mike Stay, who pointed me to this article, explained its subtext:

Haskell uses monads all over the place, and programmers who are not used to functional programming often find them confusing. This is a quote from a widely-shared article on the proliferation of “monad tutorials”:

After struggling to understand them for a week, looking at examples, writing code, reading things other people have written, he finally has an “aha!” moment: everything is suddenly clear, and Joe Understands Monads! What has really happened, of course, is that Joe’s brain has fit all the details together into a higher-level abstraction, a metaphor which Joe can use to get an intuitive grasp of monads; let us suppose that Joe’s metaphor is that Monads are Like Burritos. Here is where Joe badly misinterprets his own thought process: “Of course!” Joe thinks. “It’s all so simple now. The key to understanding monads is that they are Like Burritos. If only I had thought of this before!” The problem, of course, is that if Joe HAD thought of this before, it wouldn’t have helped: the week of struggling through details was a necessary and integral part of forming Joe’s Burrito intuition, not a sad consequence of his failure to hit upon the idea sooner.

The article is this:

Posted at November 11, 2015 5:24 PM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/2853

### Re: Burritos for Category Theorists

Have you seen this elaboration of the ‘monads are like burritos’ idea?

Posted by: lk on November 11, 2015 9:49 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

No, I hadn’t. The paper by Ed Morehouse seems to be a more extended exploration of the same ideas.

Posted by: John Baez on November 11, 2015 10:13 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I should say that I have some problems if I see jokes around food. That is in general I do find it important to be able to say what you want in a playful manner (“to joke around”) and actually in case of hunger that may eventually even help, but wether joking helps or not depends in this case heavily on who is saying what. But my grandmother nearly starved in Kohlrübenwinter, her recollections may have eventually made me over?-susceptible to this question.

I am not happy with either explanation, with a tendency to find Mark Dominus explanation a bit closer to how I understood Monads. In particular Ed Morehouse didn’t even define “unwrapping” before explaining the left unit law so I don’t understand his left unit law (I didn’t read further).

If the endofunctor of the monad is “a process that wraps food with a Tortilla”,i.e. “Tortilla wrapping” then isn’t the unit more something like “a process which leaves food as it is”, like watching it? And the unit functor would then be something that turns “watching food” into “Tortilla wrapping”?

In the left unit law then a process in which I first “tortilla wrap” and then “watch food” is turned into a process which “tortilla wraps twice” and then into a process that just “tortilla wraps” (like by joining the Tortillas), which is the “same” as “tortilla wrap and watch it.” And in the right unit law I apply the natural transformations to a “process that first watches and then wraps”.

But maybe I am wrong that is I watched Eugenia Cheng’s videos where she explained monads, even if I found it not so pleasant to be yelled at, but I didn’t really understood what she was talking about and I then looked into McLanes’s book. After that I think I understood a little better, but I am not sure about that. That is maybe I still don’t understand monads.

Moreover even if the monad construction is an important concept in category theory, I am not sure that everybody needs to know the term “monad”, especially as it had apparently already been used by the old greeks in a slightly different context.

In particular if it comes to finding words -I think there are rather not enough words for example for differentiating human relationships and I wonder wether this is desired or just an omittance and why there is such an emphasis on finding terms for abstract entities. Maybe because it is easier to define?

Like for americans I got the impression that the term “friend” is quite something different than for Europeans. And like what words are there to express the scale(s) between friend, aquaintance, enemy.

### Re: Burritos for Category Theorists

I’m pretty sure that ‘monad’ was coined not just for the “pleasure of purloining words from the philosophers” [Mac Lane], but because of the resemblance to “monoid”, which is a pretty familiar concept for mathematics students.

A monoid is a set $M$ that is equipped with a binary multiplicative operation that is associative and with an identity element. The multiplication is a function $m: M \times M \to M$, and the identity for that multiplication is an element $e \in M$ which we could identify with a function $e: 1 \to M$ from a one-element set.

Analogously, a monad is a functor $M$ (on some category $C$, so a functor $M: C \to C$) that is equipped with a “multiplication” $m$ which is a natural transformation $m: M M \to M$, and a “unit” $e$, which is a natural transformation $e: 1_C \to M$. Here $1_C$ denotes the identity functor on $C$. The data consisting of the natural transformations $m, e$ are required to satisfy associativity and unit/identity laws that are exactly analogous to the corresponding laws for monoids.

(Exercise: show how to each monoid $M$ we may associate a corresponding monad.)

The analogy is actually pretty fruitful. Algebras of a monad are analogous to actions of a monoid. On a much fancier level, there is a bar construction for monads that is analogous to the bar construction for monoids, but that is getting somewhat far afield.

But the best way (in my opinion) of beginning to grasp the meaning of monads is through a whole bunch of examples coming from algebra. I am less fond of the explanations that come out of the Haskell programming language community which seem to emphasize Kleisli multiplication. Maybe that is attributable to difference in background, but somehow that treatment seems more abstract and less grounded than how I would go about explaining it.

I haven’t watched the Catster videos in a while, but I think maybe the loudness of Eugenia in some of them is a combination of her exuberance and the recording equipment, and maybe her proximity to the camera. (You think she’s loud? Try watching Doron Zeilberger on YouTube some time. And he’s not even that close to the camera.)

Posted by: Todd Trimble on November 13, 2015 1:24 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I haven’t watched the Catster videos in a while, but I think maybe the loudness of Eugenia in some of them is a combination of her exuberance and the recording equipment

It’s also been a while ago that I watched it, actually before I met her in person. I just remember that when I watched I found the audio strenuous. So yes it seems there may be a not too fortunate combination of her what you call “exuberance” and the recording equipment in the videos.

What you called the identity functor is what I called the unit functor and I identified this with “food watching” in this food description. So with this identification the monad unit takes “food watching” into “Tortilla wrapping”.

But Ed Morehouse wrote:

“The burrito monad unit takes something you can eat and wraps it in a tortilla,”

So for him the “identity functor” is “something that you can eat”.

And Mark Dominus writes: “A monad must also possess a unit function that takes a regular value, such as a particular batch of meat, and turns it into a burrito.”

Where with unit function he means the monad unit.

So these two identifications of Ed Morehouse and Mark Dominus are rather different from mine. I don’t know the “official” definition of a monad in Haskell but Mark Dominus definition is so different, in particular he uses the word “regular value” that I got the impression that the definition of a monad in Haskell may be different from the one category theory.

Analogously, a monad is a functor M

By the way for MacLane a monad consists of a triple of a functor and two natural transfomations satisfying the monad laws. So for him a monad is not a functor. This sounds like nitpicking but if there may be different meanings of the word monad depending on the person than such difference in definitions may already lead to confusion if you try to understand the concepts.

Anyways thanks for your comments Todd. I actually don’t have the time to discuss category theory, in fact I gave up trying to understand it. I just wanted to give a brief feedback on these particular postings.

### Re: Burritos for Category Theorists

You truncated what I said. I said a monad is a functor equipped with … [the data of two natural transformations such that…].

That doesn’t mean a functor that satisfies some property, it means a functor together with some extra structure. The distinction is crucial. There is no disagreement between what Mac Lane said and what I am saying.

Posted by: Todd Trimble on November 13, 2015 5:44 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

You truncated what I said. I said a monad is a functor equipped with

Sorry. I am not a native speaker of english, so I might have misunderstood the concept of the english word “is”. That is I thought that usually in english one would mean that if I AM a mountaineer equipped with a pickaxe then I am a mountaineer, which HAS a pickaxe as an equipment. But yes of course in principle that could also mean I AM the same as the entity “mountaineer with a pickaxe.” I just -obviously thought wrongly- that this isn’t the usual meaning in the english language.

### Re: Burritos for Category Theorists

What’s relevant here isn’t the usual meaning of “is” in the English language. What is relevant is the meaning of “is”, in this context, in the dialect mathematical English — of which nobody is a native speaker!

Posted by: Mark Meckes on November 13, 2015 6:34 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I didn’t want to discuss the meaning of “is” per se. I just wanted to point out that some people, especially newcomers might interpret that “something is a functor equipped with …”

as “something that is a functor” and regard the “equipped with” as unimportant.

### Re: Burritos for Category Theorists

Would “together with” instead of “equipped with” be a more helpful or more understandable way of speaking?

The idea anyway is to consider all three data $M, m, e$ together, as constituting the whole (is gestalt the right word here?) of what we mean by “monad”.

This is an interesting discussion because it brings out some of the difficulties in becoming a fluent speaker of mathematical English. Although I doubt it’s really the English that’s the issue: the same conceptual distinctions must be present in mathematical German as well (which I understand poorly). What would be the corresponding phrase there? If you were taking a walk in the forest and describing to someone in German what a monad is, how would you say it?

Posted by: Todd Trimble on November 13, 2015 7:28 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

“Eine Monade ist ein Funktor $M : \mathcal{C} \to \mathcal{C}$ zusammen mit natürlichen Transformationen $\eta : \mathbb{1} \Rightarrow M$ und $\mu : M \circ M \Rightarrow M$ sodass …”

Posted by: Ingo Blechschmidt on November 18, 2015 12:59 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

Thanks! If I read that, I would without hesitation mentally translate that zusammen mit as “together with”, just as we say in English.

I’m not sure the expression “equipped with” was really firmly in my mathematical lexicon before the time spent as post-doc in Australia. And I’m not sure I hear it used a lot outside of categorical circles. It’s interesting to hear how it can sound to other people.

Posted by: Todd Trimble on November 18, 2015 4:59 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I’m pretty sure I saw a lot of “muni(e) de” when reading maths in French, although that could be from an unrepresentative sample.

Posted by: Yemon Choi on November 18, 2015 6:34 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

For example: “Un espace de Hilbert est un espace vectoriel muni d’un produit scalaire qui permet de mesurer des longueurs et des angles.”

Posted by: Mark Meckes on November 18, 2015 8:13 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

Interesting. It makes me vaguely wonder whether the people who wield “equipped with” in mathematics are either Francophones or students (or students of students …) of Francophones who picked it up from their masters.

Posted by: Todd Trimble on November 19, 2015 1:41 AM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I may have learned the precise meaning of the phrase ‘equipped with’ or ‘together with’ from James Dolan, who abbreviates it as ‘t.w.’ in his notebooks. The distinction between properties, structure and stuff is hugely important in mathematics, but many mathematicians who don’t know category theory don’t have the apparatus to make it precise. I tried to explain it here, starting on page 15.

Posted by: John Baez on November 18, 2015 6:08 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I wrote:

…especially newcomers might interpret that “something is a functor equipped with..”

as “something that is a functor” and regard the “equipped with ” as unimportant.

I would like to make this a bit more precise.

What I mean is that what comes after the “equipped with” is not regarded as unimportant per se, but with respect to the classification of what a monad is.

Ingo Blechschmidt wrote:

Eine Monade ist ein Funktor M:… zusammen mit natürlichen Transformationen…sodass…

To me this sounds as if the author of that sentence was directly translating the together with that Todd Trimble mentioned rather than that the author wanted to show that he or she masters “a” mathematical dialect. But regardless of what the orginal motivations for this construct were - using zusammen mit in this way is “bad german”. That is it is close to impairing the understanding of a german sentence.

But it seems to me that is is also bad english - that is if you would say a school class is a teacher together with a group of about 30 children then isn’t it that people would look at you as if something is wrong… ?

### Re: Burritos for Category Theorists

But it seems to me that is is also bad english - that is if you would say a school class is a teacher together with a group of about 30 children then isn’t it that people would look at you as if something is wrong… ?

I wouldn’t put too much stock in such analogies. Mathematical English is not even a dialect of English. It’s a jargon.

In the specific case at hand, when we describe a monad, it seems to me that the functor part logically comes first, because the rest of the data, i.e. the multiplication $\mu$ and unit $\eta$, refer back to that functor. The same is not necessarily true of the classroom; we can describe it as Mrs. Smith’s third grade class, or as my son Billy’s class – there is no logical dependency as regards the order in which we say things.

The “equipped with” or “together with” is quite a common expression in this jargon, as John was saying when he mentioned the distinctions between stuff, structures, and properties. There are alternative expressions of course. One is by recourse to a construction like “a monad is a triple $(M: C \to C, \mu: M M \to M, \eta: 1_C \to M)$ such that …” which is okay but sounds a little formal, as if we’re gearing up to writing down an expression in a formal set theory.

Another is: “a monad consists of” followed by an itemized list. For some reason this sounds a little less stuffy to me than the business with the triple. Based on nad’s analogy with classrooms, I’d guess that this would sound less objectionable to her ear than the one with “together with”. It still sounds a little formal to my ear. I’m not sure I could defend exactly why. But when I mentioned taking a walk in the forest a few comments ago, it was with a view to how we say things to each other in less than fully formal language, that we sometimes shoot for even when we’re not in a forest but writing papers or textbooks.

Posted by: Todd Trimble on November 19, 2015 2:15 AM | Permalink | Reply to this

### Re: Burritos for Category Theorists

It’s not great colloquial English, but it’s good mathematical English. Or at least, it’s standard mathematical English. “Equipped with” or “together with” are technical terms indicating importance to definitions. Generally, in a mathematical definition everything after the “is” counts as part of the definition. So we should read the sentence as

A monad is (a functor M equipped with …)

(A monad is a functor M) equipped with …

Posted by: Layra on November 19, 2015 2:29 AM | Permalink | Reply to this

### Re: Burritos for Category Theorists

It’s not great colloquial English…

Layra, are you english?

### Re: Burritos for Category Theorists

Layra are you english?- in the sense of being a native speaker.

### Re: Burritos for Category Theorists

I was born and raised in the USA and speak what people tell me is English, except sometimes my grammar and vocabulary is more mathematical English than the English that people use casually.

Posted by: Layra on November 19, 2015 3:17 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

Maybe my colloquial English has been irretrievably polluted by my mathematical English, but it sounds like perfectly good colloquial English to me.

Posted by: Mike Shulman on November 19, 2015 1:57 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

It sounds rather stilted to me. I think we’d usually say “and” or just “with” if there’s a logical dependence; “together” sounds too formal, “equipped” even more so.

Posted by: Layra on November 19, 2015 3:26 PM | Permalink | Reply to this

### Re: Burritos for Category Theorists

I wrote:

I called the unit functor and I identified this with “food watching” in this food description.

but actually I just saw that I had a mistype in the comment here

that is

“And the unit functor would….”

should be replaced by “And the unit natural transformation would…”

or