2
$\begingroup$

A part of Monad definition is an endofunctor $T$, and a natural transformation $\mu : T²→T$, such that the $\mu ∘T\mu = \mu ∘\mu T$ holds.

I struggled hard with both sides of the equation, so here're points with my misunderstandings:

  1. What $\mu ∘T\mu$ does? As far as I could break it down, by virtue of having the same category as both domain and codomain, $T$ can lift its natural transformations. So $T\mu$ simplifies to $T(T²→T)$.

    Intuitively I'd think, $\mu ∘T\mu$ would "unwrap" $T\mu$ from the functor, so whole thing simplifies to $T²→T$. But the problem: $\mu$ is defined on $T²$ — not on $T$, or $T³$, or something. So actually the application $\mu(T(T²→T))$ gives a non-sensical result, like "a functor it would be if it was $T²(T²→T)$, but which it isn't".

  2. What $\mu ∘\mu T$ does? $\mu$ is defined as a family of morphisms of the underlying category, whilst $T$ is not its part, so formally the application $\mu T$ doesn't make a sense. Perhaps the author meant rather $\mu ∘\mu ∘ T$, I don't know. Whatever it means, I see again the application of $\mu$ to a non-$T²$ argument — is it even defined?
  3. Oh, wait, there's a small print about the equation, it says "(as natural transformations $T³→T$)". What?? How could they get to $T³$, there's a single $T$ in the formula!
  • 2
    Do you know any examples of monads? Try finding some, then working through what the definition means for your examples.2017-01-18
  • 0
    @QiaochuYuan yes, and it's the reason that led to the question. Because I thought that I perfectly know what's Monad, and then I've read the formal definition, and revealed that I don't know it at all. That single question shows only ⅓ of efforts btw — just trying to understand the equation led to re-reading and rethinking definitions of natural transformations and functors, which I also was sure that I perfectly know.2017-01-18

3 Answers 3

1

$\mu\circ T\mu$ is the natural transformation whose component at $X$ is $T^3X\stackrel{T(\mu_X)}{\to} T^2X\stackrel{\mu_X}{\to} TX$. On the other hand, $\mu\circ \mu T$ is the composition $T^3X\stackrel{\mu_{TX}}{\to} T^2X\stackrel{\mu_X}{\to} TX$.

  • 0
    Wouldn't it serve any purpose mention associativity? Probably the OP has seen examples of associativity before!2017-01-18
  • 1
    Probably, but the post was asking for descriptions of what exactly these natural transformations are, and I thought I'd keep it at that. I think the fact that a monad is a monoid can be pretty confusing at first.2017-01-18
  • 0
    Well, I'd ask the same question as to Hurkyl: how did you get from $T³X$ to $T²X$? I do understand *(due to thinking on Harkyl's answer)* that $T(\mu_X) = T²X$, but I doesn't see how $T(\mu_X)$ is relevant to $T³X$.2017-01-18
  • 0
    No, $T(\mu_X)$ is not $T^2X$. It's a map from $T^3X \to T^2 X$ gotten by applying $T$ to the map $\mu_X: T^2 X\to TX$.2017-01-18
  • 0
    Ah, so $T(\mu_X)$ *(and probably $T\mu_X$ too)* is an application of $T$ to the morphism $\mu_X$, but not a composition with that. Oh dear, it's so confusing, you're actually the first from all three answer who gave definite answer for that part — I was already sure it's rather a composition. Thank you. But either way, how came that $T(T²X→TX)$ get distributed into $T³X→T²X$? Is it some rule that I can read somewhere?2017-01-18
  • 1
    Glad we're getting somewhere! These things are very confusing at first, but in my experience you'll have them straight soon. Yes, you should interpret $T\mu_X$ as $T(\mu_X)$. We had our map $\mu_X: T^2 X\to TX$. When you apply a functor $F$ to a morphism $f:x\to y$, the result is a morphism $F(f): F(x)\to F(y)$. In our case, we must have $T(\mu_X):T(T^2X)\to T(TX)$. And $T^3X$ is just notation for $T(T^2X)$.2017-01-18
  • 0
    Okay, so the $T\mu_X$ part gave us a functor $T³X→T²X$. Now we're composing it with $\mu$ on the left, right? So, it means that to advance any further, we apply the functor to a $X$. And it is such $X$, that for some object $y$, $T³(y) = X$. Then $T\mu(X) = T²(y)$, and $\mu(T²) = T$, which is what they say on Wikipedia, i.e. that $\mu∘T\mu : T³→T$!! Oh, I can't believe, I understood, thank you very much!!! I've actually rewritten, like, 4 times this comment for this slow process 2017-01-18
  • 0
    Last thing, I believe: if $T\mu$ is an application of $T$ to $\mu$, then $\mu T$ is an application of $\mu$ to $T$. But how is this possible, a functor is not even a part of the category! A natural transformation is defined on functor's domain and codomain, but neither this makes sense in the particular case — $\mu$ works with $T²$, not just $T$.2017-01-18
  • 0
    Well, your first inference is, surprisingly, wrong. $\mu T$ is better written as $\mu_T$. It's the transformation whose components at $X$ is $\mu_{TX}$. It's not most naturally viewed as a composition at all.2017-01-19
  • 0
    Sorry, you've got an error in the formatting, I didn't get… "Whose components at $X$ is $\mu\{TX\}$"…? Or $\mu(TX)$…? If it's the last one, I don't see how application of $\mu$ to $TX$ makes sense. And neither I got the last sentence — I didn't say it's a composition, quite the reverse, I said it's an application. But if I guessed your formula, $\mu(TX) = \mu∘TX$ is a composition.2017-01-19
  • 0
    Sorry, that should say $\mu_{TX}$.2017-01-19
  • 0
    Okay, so… how is $\mu_{TX}$ different from $\mu_X$? I see, it's different, but what does it even do?2017-01-19
  • 0
    $\mu$ is a natural transformation. $\mu_{TX}$ is a morphism, namely, the component of that natural transformation at $TX$.2017-01-19
  • 0
    Okay, then, why it's not $\mu_{T²X}$ instead? Because we know the component of $\mu$ at $X$ when it is $\mu(T²X)$. But we never defined it for the case $\mu(TX)$!2017-01-19
  • 1
    $\mu_X$ maps $T^2X$ to $TX$. $\mu_{TX}$ thus maps $T^3X$ to $T^2X$.2017-01-19
  • 0
    Ah, now I've got the notation. Just FTR, can I say "*$\mu_{TX}$ is the component at $X$ of natural transformation $\mu_T$*" ? And anyway, how $\mu_{TX}$ is defined? I'd suppose it's $T∘\mu$ — but no, we know that we have to apply it to $T³X$, not to $T²X$.2017-01-19
  • 0
    Yes, you can say that. It's defined as the component of $\mu$ at $T(X)$.2017-01-19
  • 0
    Probably, you want to say it's defined as $\mu_{TX}:T³X→T²X$. But that makes me suspicious: we've only had $\mu_X:T²X→TX$, and now it's a level higher. Is there rules, or something, about how $\mu_{T}$ is constructed from $\mu$?2017-01-20
  • 0
    ...You might want to take a while to think further about this on your own. $\mu$ comes with a component at every object of the base category. $TX$, in particular, is an object of the base category. Therefore $\mu$ has a component, $\mu_{TX},$ at $TX$. It maps from $T^2(TX)=T^3X$ to $T(TX)=T^2 X$.2017-01-20
  • 0
    I was thinking about for a long time already, it's like a red line going through my comments and question. I know that we *can* apply $\mu$ to $T³$, because it's in the same category as $T²$. I even saw how it works in an example of lists in **Hask** category, e.g. that I can do `[[[x]]] → [[x]]`. But then I ask myself "Can I do e.g. $TX→X$ with natural transformation? E.g. in **Hask** I can't unwrap an object from `IO` monad.". And to answer that question I need a formal definition of getting from $\mu$ to $\mu_T$, and that's what I'm asking.2017-01-20
  • 0
    I really don't understand the complaint. I don't know Haskell, in particular. To give a natural transformation is to give a function $X\mapsto \mu_X$ from objects of a category to morphisms in that category (satisfying certain conditions.) We define the natural transformation $\mu_T$ via the function $X\mapsto \mu_{T(X)}$. It's the composition of the functions $X\mapsto $\mu_X$ and $X\mapsto TX$.2017-01-20
  • 0
    That is, so, $\mu_{TX}$ is defined as $T∘\mu_X$! Okay. Then, [as I mentioned](https://math.stackexchange.com/questions/2101774/elaboration-for-%CE%BC-%E2%88%98t%CE%BC-%CE%BC-%E2%88%98-%CE%BCt-from-a-monad-definiton/#comment4328063_2102596), the equation in question doesn't hold. We've previously established that $\mu∘T\mu$ formula takes as an argument a $T³X$. To simplify, remove a composition, it's an argument of $T\mu$. And it should be the argument for $T∘\mu_X$. But the $\mu(T³X)$ could take it to $TX$ or to $T²X$, or wherever — we don't know, we've never defined it for $T³X$ argument!2017-01-20
  • 0
    No, it's not! That notation doesn't make any sense, and I have absolutely no idea what you're talking about in the rest of the comment! The equation does hold. I promise you. Think about this from the perspective of being *absolutely certain* that you have to figure out how to understand the notation from the standpoint that the equation is *definitely* going to hold. I don't think I can be of any further help here. Best of luck.2017-01-20
  • 0
    Man, but it is your own words! You said, quoting "*It's [i.e. $\mu_T$] the composition of the functions $X↦\mu_X$ and $ X ↦TX$*". I just shaped your words into the exact formula $T∘\mu_X$.2017-01-20
  • 0
    Oh, OK. But that's in the wrong order-I should have been clearer. You map to $\mu$ *after* you map to $TX$: $X\mapsto TX\mapsto \mu_{TX}$.2017-01-20
  • 0
    In this case the problem from the end of my comment still holds, that is, see. We have $\mu_T = \mu∘T$. As we've established, the argument is T³X, so we have $\mu(T(T³X)) = \mu(T⁴X)$. And we don't know what $\mu(T⁴X)$ equals to — $TX$, or $T³X$, or whatever — we've never defined the result of $\mu$ for $T⁴$ argument.2017-01-20
  • 0
    I don't know what you mean by this claim that the argument is $T^3X$. $\mu_{TX}$ is a morphism with domain $T^3X$, but the *argument* to $\mu_T$ is just $X$. In any case, we've defined the result of $\mu$ for any argument from the base category, including $T^nX$ for every $X$ and $n$.2017-01-20
  • 0
    Okay, then it's probably the last missing link — you said "*we've defined the result of $\mu$ for any argument from the base category, including $T^nX$ for every $X$ and $n$*". Where or how? It's definitely neither in comments, nor on Wikipedia, because I've suspected that from the beginning, and I'd remember if I see.2017-01-20
  • 1
    That's just the definition of $\mu$. It gives a morphism $\mu_X:T^2X\to TX$ for every object $X$ of the base category. $TX$ is itself an object of the base category. Thus $\mu$ gives a morphism at $TX$, which is $\mu_{TX}:T^3X\to T^2X$.2017-01-20
3

Here is a graphical depiction of the operation $\mu \circ (T\mu)$.

Diagram of the composite

Here, $T$ is depicted as the identity natural transformation $1_T$, and appears as the parallelogram in the top-left. The top-right trapezoid is $\mu$, and they are composed horizontally, forming a larger trapezoid $T^3 \to T^2$. $\mu$ again appears as the bottom trapezoid, and the two trapezoids are composed vertically.

If we horizontally compose on the right with a functor from the one-point category that picks out an object $X$, we can resolve the diagram down to an arrow:

$$ T^3 X \xrightarrow{T \mu_X} T^2 X \xrightarrow{\mu_X} TX $$

This is simply computed by working right to left in the diagram. Here's a picture with all of the intermediate results filled in:

enter image description here

Note the dotted lines are not arrows of the category; I only left them in to help compare with the previous diagram.

Similarly, if we did this with $\mu \circ (\mu T)$, we get the arrow

$$ T^3 X \xrightarrow{\mu_{TX}} T^2 X \xrightarrow{\mu_X} TX $$


Alternatively, we can work this out algebraically, by inserting identities as needed and applying the interchange law $(ab)\circ(cd) = (a\circ c)(b \circ d)$ when both make sense:

(note that I identify $T$ and $X$ with their corresponding identity natural transformations, so that $X = X \circ X$)

$$ (\mu \circ (T\mu)) X = (\mu \circ (T\mu)) (X \circ X) = (\mu X) \circ (T\mu X) = \mu_X \circ T(\mu_X)$$ $$ (\mu \circ (\mu T)) X =(\mu \circ (\mu T)) (X \circ X) = (\mu X) \circ (\mu TX) = \mu_X \circ \mu_{T(X)}$$

  • 0
    Thank you for this big answer, I still don't understand something though. 1) Are you using $T\mu_X$ notation to mean $T∘\mu_X$? 2) The $T\mu_X$ is equal to $T²X$, and means that $X$ chooses some object $x$ which is $X²(y)$ for some $y$. I get it. But how did you move from $T³X$ to $T²X$? You can't just do $\mu(T³(X())) = T²(X())$, because $\mu$ is defined for $T²$! 3) I didn't find a rule for query "square rule function composition". If I imagine $X = T²(y)$ for some $y$, I can make sense of the right algebraic equation part, but thinking of it as indentity functor, I didn't make sense of it.2017-01-18
  • 0
    @Hi-Angel: No; I am following the notation used in your post: juxtaposition is horizontal composition and $\circ$ is vertical composition. (Also, evaluation of a functor is a special case of horizontal composition, as is getting the arrow $\mu_X$ from a natural transformation $\mu$) The square rule is the "interchange law" which is what I had meant to write. Also, note that composing functors is a case of horizontal composition, and composing arrows in a category is a special case of vertical composition.2017-01-18
1

Take $c\in C,$ Then, since $\mu :T^2\to T$ is a natural transformation, and noting that $\mu_c:T^2c\to Tc$ is a morphism in the category $C, $we see that the following square commutes:

\begin{matrix}T^2(Tc)=T(T^2c) &\stackrel{T\mu_c}{\rightarrow}&T(Tc)=T^2c\\\downarrow{\mu_{Tc} }&&\downarrow{\mu_c}\\ T(Tc)=T^2c& \stackrel{\mu_c}{\rightarrow}&Tc\end{matrix}

That is, we have $\mu_c\circ T\mu_c=\mu_c\circ \mu_{Tc}\Rightarrow (\mu\circ T\mu)_c=(\mu\circ \mu_{T})_c\Rightarrow \mu\circ T\mu=\mu\circ \mu_{T}.$

Remark: We used the fact that $T\mu$ and $\mu_T$ are themselves natural transformations. In fact, they are the horizontal composition of $1_T$ and $\mu$, and $\mu$ and $1_T$, resp.

  • 0
    So, by $T\mu _c$ you actually mean $T ∘ \mu_c$, right? Then I have 2 question: why not just use the composition notation, and how can I know if one didn't mean $T\mu_c = T(\mu(c))$ *(which is valid in the case of endofunctor, though I didn't immediately see a sense in it)*?2017-01-17
  • 0
    Another question… I'm trying to understand the top of your diagram, and I see it as $T(\mu(T²(c))) → T²(c)$. Is it right? Because, just in case you're explaining why does $\mu(T³(c))$ makes sense *(if it does)*, I didn't get it.2017-01-17
  • 0
    Omg, I'm sorry, in the 1-st comment I meant "*how can I know if one didn't mean $Tμ_c=T(μ)$*".2017-01-17
  • 0
    You will find a good explanation of the two possible compositions of natural transformations [here](https://math.vanderbilt.edu/dept/conf/tacl2013/coursematerials/SelingerTACL20132.pdf)2017-01-17
  • 0
    Aha, thank you, so I got it, you and the Wikipedia has to write either $T∘\mu_c$ or $T(\mu(c))$, but not $T\mu_c$. What about my 2-nd comment? Did I get you right?2017-01-17
  • 0
    $T ∘ \mu_c$ does not make sense, since the functor $T$ and the morphism $\mu_c$ are not composable. $T\mu _c$ simply means the application of the functor $T$ to the morphism in $C$ given by $\mu_c:T^2c\to Tc $2017-01-17
  • 0
    Well, see: $T∘\mu_c = T(\mu(c))$ means "one of morphisms of $\mu$ chooses an object, and then functor $T$ takes it somewhere". Then, $T\mu$ could mean "functor takes all morphisms of $\mu$ somewhere". I don't know though, how valid is such notation, so I see a point that if one is abusing notation, they're more free to define the meaning. Btw, you can see an example, like $H∘α$ on 3-rd page of the paper you linked. There's even a diagram like what you wrote, but as far as I can see, the author did not use $T\mu_c$ notation.2017-01-18
  • 0
    $T\circ \mu_c$ does not make sense, but $T\circ \mu$ does. It is shorthand for the horizontal composition of $1_T$ with $\mu$.2017-01-18