If <code>φ</code> is a natural transformation from `F` to `M(1C)` and <code>γ</code> is <code>(φ G')</code>, that is, a natural transformation from `FG` to `MG`, then we can extend (iii.1) as follows:
+<pre>
γ = (φ G')
= ((unit <=< φ) G')
= ((join -v- (M unit) -v- φ) G')
= (join G') -v- (M (unit G')) -v- γ
??
= (unit G') <=< γ
+</pre>
where as we said <code>γ</code> is a natural transformation from some `FG'` to `MG'`.
Similarly, if <code>φ</code> is a natural transformation from `1C` to `MF'`, and <code>γ</code> is <code>(φ G)</code>, that is, a natural transformation from `G` to `MF'G`, then we can extend (iii.2) as follows:
+<pre>
γ = (φ G)
= ((φ <=< unit) G)
= (((join F') -v- (M φ) -v- unit) G)
= ((join F'G) -v- (M (φ G)) -v- (unit G))
??
= γ <=< (unit G)
+</pre>
where as we said <code>γ</code> is a natural transformation from `G` to some `MF'G`.
-----------------------------------------------------------
In category theory, the monad laws are usually stated in terms of `unit` and `join` instead of `unit` and `<=<`.
-(*
+<!--
P2. every element C1 of a category <b>C</b> has an identity morphism 1<sub>C1</sub> such that for every morphism f:C1→C2 in <b>C</b>: 1<sub>C2</sub> ∘ f = f = f ∘ 1<sub>C1</sub>.
P3. functors "preserve identity", that is for every element C1 in F's source category: F(1<sub>C1</sub>) = 1<sub>F(C1)</sub>.
-*)
+-->
Let's remind ourselves of some principles:
- * composition of morphisms, functors, and natural compositions is associative
- * functors "distribute over composition", that is for any morphisms f and g in F's source category: F(g ∘ f) = F(g) ∘ F(f)
- * if η is a natural transformation from F to G, then for every f:C1→C2 in F and G's source category <b>C</b>: η[C2] ∘ F(f) = G(f) ∘ η[C1].
+* composition of morphisms, functors, and natural compositions is associative
+
+* functors "distribute over composition", that is for any morphisms `f` and `g` in `F`'s source category: <code>F(g ∘ f) = F(g) ∘ F(f)</code>
+
+* if <code>η</code> is a natural transformation from `F` to `G`, then for every <code>f:C1→C2</code> in `F` and `G`'s source category <b>C</b>: <code>η[C2] ∘ F(f) = G(f) ∘ η[C1]</code>.
Let's use the definitions of naturalness, and of composition of natural transformations, to establish two lemmas.
-Recall that join is a natural transformation from the (composite) functor MM to M. So for elements C1 in <b>C</b>, join[C1] will be a morphism from MM(C1) to M(C1). And for any morphism f:a→b in <b>C</b>:
+Recall that join is a natural transformation from the (composite) functor `MM` to `M`. So for elements `C1` in <b>C</b>, `join[C1]` will be a morphism from `MM(C1)` to `M(C1)`. And for any morphism <code>f:C1→C2</code> in <b>C</b>:
+
+<pre>
+ (1) join[C2] ∘ MM(f) = M(f) ∘ join[C1]
+</pre>
+
+Next, consider the composite transformation <code>((join MG') -v- (MM γ))</code>.
+
+* <code>γ</code> is a transformation from `G` to `MG'`, and assigns elements `C1` in <b>C</b> a morphism <code>γ\*: G(C1) → MG'(C1)</code>. <code>(MM γ)</code> is a transformation that instead assigns `C1` the morphism <code>MM(γ\*)</code>.
- (1) join[b] ∘ MM(f) = M(f) ∘ join[a]
+* `(join MG')` is a transformation from `MMMG'` to `MMG'` that assigns `C1` the morphism `join[MG'(C1)]`.
-Next, consider the composite transformation ((join MG') -v- (MM γ)).
- γ is a transformation from G to MG', and assigns elements C1 in <b>C</b> a morphism γ*: G(C1) → MG'(C1). (MM γ) is a transformation that instead assigns C1 the morphism MM(γ*).
- (join MG') is a transformation from MMMG' to MMG' that assigns C1 the morphism join[MG'(C1)].
- Composing them:
- (2) ((join MG') -v- (MM γ)) assigns to C1 the morphism join[MG'(C1)] ∘ MM(γ*).
+Composing them:
-Next, consider the composite transformation ((M γ) -v- (join G)).
+<pre>
+ (2) <code>((join MG') -v- (MM γ))</code> assigns to `C1` the morphism <code>join[MG'(C1)] ∘ MM(γ*)</code>.
+</pre>
+
+Next, consider the composite transformation <code>((M γ) -v- (join G))</code>.
+
+<pre>
(3) This assigns to C1 the morphism M(γ*) ∘ join[G(C1)].
+</pre>
-So for every element C1 of <b>C</b>:
+So for every element `C1` of <b>C</b>:
+
+<pre>
((join MG') -v- (MM γ))[C1], by (2) is:
join[MG'(C1)] ∘ MM(γ*), which by (1), with f=γ*: G(C1)→MG'(C1) is:
M(γ*) ∘ join[G(C1)], which by 3 is:
((M γ) -v- (join G))[C1]
+</pre>
-So our (lemma 1) is: ((join MG') -v- (MM γ)) = ((M γ) -v- (join G)), where γ is a transformation from G to MG'.
+So our **(lemma 1)** is:
+<pre>
+ ((join MG') -v- (MM γ)) = ((M γ) -v- (join G)), where γ is a transformation from G to MG'.
+</pre>
+
+
+Next recall that unit is a natural transformation from `1C` to `M`. So for elements `C1` in <b>C</b>, `unit[C1]` will be a morphism from `C1` to `M(C1)`. And for any morphism <code>f:a→b</code> in <b>C</b>:
-Next recall that unit is a natural transformation from 1C to M. So for elements C1 in <b>C</b>, unit[C1] will be a morphism from C1 to M(C1). And for any morphism f:a→b in <b>C</b>:
+<pre>
(4) unit[b] ∘ f = M(f) ∘ unit[a]
+</pre>
-Next consider the composite transformation ((M γ) -v- (unit G)). (5) This assigns to C1 the morphism M(γ*) ∘ unit[G(C1)].
+Next consider the composite transformation <code>((M γ) -v- (unit G))</code>:
-Next consider the composite transformation ((unit MG') -v- γ). (6) This assigns to C1 the morphism unit[MG'(C1)] ∘ γ*.
+<pre>
+ (5) This assigns to C1 the morphism M(γ*) ∘ unit[G(C1)].
+</pre>
+
+Next consider the composite transformation <code>((unit MG') -v- γ)</code>.
+
+<pre>
+ (6) This assigns to C1 the morphism unit[MG'(C1)] ∘ γ*.
+</pre>
So for every element C1 of <b>C</b>:
+
+<pre>
((M γ) -v- (unit G))[C1], by (5) =
M(γ*) ∘ unit[G(C1)], which by (4), with f=γ*: G(C1)→MG'(C1) is:
unit[MG'(C1)] ∘ γ*, which by (6) =
((unit MG') -v- γ)[C1]
+</pre>
-So our lemma (2) is: (((M γ) -v- (unit G)) = ((unit MG') -v- γ)), where γ is a transformation from G to MG'.
+So our **(lemma 2)** is:
+
+<pre>
+ (((M γ) -v- (unit G)) = ((unit MG') -v- γ)), where γ is a transformation from G to MG'.
+</pre>
-Finally, we substitute ((join G') -v- (M γ) -v- φ) for γ <=< φ in the monad laws. For simplicity, I'll omit the "-v-".
+Finally, we substitute <code>((join G') -v- (M γ) -v- φ)</code> for <code>γ <=< φ</code> in the monad laws. For simplicity, I'll omit the "-v-".
+<pre>
for all φ,γ,ρ in T, where φ is a transformation from F to MF', γ is a transformation from G to MG', R is a transformation from R to MR', and F'=G and G'=R:
(i) γ <=< φ etc are also in T
which will in turn be true just in case:
(iii.2') (join (unit M)) = the identity transformation
+</pre>
Collecting the results, our monad laws turn out in this format to be:
+</pre>
when φ a transformation from F to MF', γ a transformation from F' to MG', ρ a transformation from G' to MR' all in T:
(i') ((join G') (M γ) φ) etc also in T
(iii.1') (join (M unit)) = the identity transformation
(iii.2')(join (unit M)) = the identity transformation
+</pre>