• No results found

In this section we study the relation between two seemingly distant concepts as adjunction and monad. As a matter of fact, every adjunction immediately defines a monad, and conversely every monad can be thought of as generated by an adjunction, called a resolution for the monad (see 5.4.2 below). Resolutions for a given monad can be build up in a category by introducing a natural notion of morphism between them; it then happens that the Eilenberg-Moore and the Kleisli Categories associated with the monad (see definitions 4.2.3 and 4.2.4) are respectively the terminal and initial object of the category.

The presentation is rather technical; at first reading, the reader may just look at the first theorem, which will be applied in the next section.

5.4.1 Proposition Let (F, G, η , ε) be an adjunction from Cto D; then (T = GF, η , µ = GεF)

Proof Note first that GF, η, and GεF have the correct types, i.e., T = GF: C→C, η: IdC→GF, and µ = GεF: GFGF→GF. We must prove the unity and associative laws for the monad.

As for the unity laws we have

µ° Tη = GεF ° GFη = G(εF ° Fη) = G(idF) = idGF µ°ηT = GεF °ηGF = (Gε°ηG)F = idG(F) = idGF For the associative law, note first that

ε°εFG = ε° FGε .

Indeed, for any d∈ObD , and letting f = εd: FG(d)→d, εd °εFG(d) = f °εFG(d)

= εd ° FG(f) by naturality of ε

= εd ° FG(εd)

Then one has the following:

µ°µT = GεF ° GεFGF = G(ε°εFG)(F) = G(ε° FGε)(F) = GεF ° GFGεF = µ° Tµ . The rest is an exercise in duality. ♦

5.4.2 Definition Let (T, η , µ) be a monad over a category C. A resolution for (T, η , µ) is a

category D and an adjunction (F, G, η , ε) from C to D such that T = GF and µ = GεF. A

morphism between two resolutions (F, G, η , ε): C→D and (F', G', η , ε'): C→D' (for the

same monad) is a functor H: D→D' such that F' = H ° F, G = G' ° H , and Hε = ε'H.

It is easily proved that resolutions with the associated morphisms form a category. Now we are going to prove that the Eilenberg-Moore and Kleisli categories associated with a monad (T, η , µ) both give rise to resolutions. In particular, they are respectively the terminal and initial objects in the category of all resolutions for that monad.

5.4.3 Proposition Let (T, η , µ) be a monad over a category C , and let CT be the Eilenberg-

Moore category associated with the monad. Then there exists a resolution for (T, η , µ) which is an

adjunction from CT to C.

Proof Let UT: CT→C be the forgetful functor that takes every algebra (c,α) to c, and every morphism of algebras h to the same h regarded as a morphism in C. Let FT: C→CT be the

functor which takes every object c to its free algebra (T(c),µc), and every morhism f: c→c' to FT(f) = T(f). Let εΤ: FTUT→idCT be the natural transformation defined by εΤ(c,α) = α (note that α: T(c)=FTUT(c,α)→c). We want to prove that (FT, UT, η , εT) is a resolution for (T, η , µ).

Obviously UT ° FT = T . UT εT FT = µ, since for any object c one has (UT εT FT)(c) = UT(εT FT(c))

= UT(εT(T(c), µc)) by def. of FT

= UT(µc) by def. of εT

= µc by def. of UT

We still haveto prove that (FT, UT, η , εT) is an adjunction from CT to C, that is,

(UTεT) ° (ηUT) = idUT

(εTFT) ° (F) = idFT

One has, for every T-algebra (c,α),

(UTεT °ηUT) (c,α) = UT(εT(c,α) ) °ηUT(c,α)

= α°ηc by def. of εT and UT

= idc by def. of T-algebra

And for every c∈ObC :

(εTFT ° FTη) (c) = εTFT(c) ° FT(ηc)

= µc ° T(ηc) by def. of εT and FT

= idT(c) by the unity law of the monad.♦

We say that the resolution (FT, UT, η , εT) from C to the Eilenberg-Moore category CT, and given

by proposition 5.4.3, is associated with CT.

5.4.4 Proposition Let (T, η , µ) be a monad over a category C .Then the resolution (FT, UT,

η, εT): C→CT, associated with the Eilenberg-Moore Category CT, is a terminal object in the

category of all the resolution for the monad (T, η , µ).

Proof Let (F, G, η , ε): C→D be another resolution for (T, η , µ). We must prove that there exists a unique arrow from (F, G, η , ε) to (FT, UT, η , εT). Remember (cf. definition 5.4.2) that

such an arrow is a functor H: D→CT , such that FT = H ° F, G = UT ° H , and Hε = εTH.

Define, for any object d, and any morphism f of D, H(d) = (G(d), G(ε(d)) )

H(f) = G(f).

Then one has, for any c∈ObC, any h∈MorC,

H(F(c)) = (G(F(c)), G(ε(F(c))) ) = (T(c), µc) = FT(c) H(F(h)) = G(F(h)) = T(h) = FT(h)

that proves the equality H ° F = FT.

Moreover, for any d∈ObD, and any f∈MorD, UT(H(d)) = UT(G(d), G(ε(d)) ) = G(d)

UT(H(f)) = UT(G(f)) = G(f), as UT is the identity on morphisms. That proves the equality G = UT ° H .

Finally, for any d∈ObD,

εTH(d) = εT(G(d), G(ε(d)) ) = G(ε(d)) = H(ε(d)) that proves the equality Hε = εTH.

We have still to prove that H is the unique morphism from (F, G, η , ε) to (FT, UT, η , εT).

Let H' be another morphism; then, for any f∈MorD, H'(f) = UT(H'(f) = G(f) = UT(H(f) = H(f) and, for any d∈MorD,

H'(d) = ( UT(H'(d), εTH'(d)) by def. of UT and εT

= ( G(d), H'(εT(d)) ) as G = UT ° H' = ( UT(H(d), H(εT(d)) ) as H'(f) = H(f) = ( UT(H'(d), εTH(d))

= H(d). This completes the proof. ♦

The unique functor to (FT, UT, η , εT) in the category of all resolutions for a given monad (T, η , µ) is called comparison functor and it is usually denoted by KT.

The category of resolutions of a monad has also an initial object, which is based on the Kleisli category associated with the monad.

5.4.5 Proposition Let (T, η , µ) be a monad over a category C, and let CT be the Kleisli

category associated with the monad. Then there exists a resolution for (T, η, µ) that is an adjunction

from CT to C.

Proof: Let UT: CTC be the functor defined by the following:

for any object c of CT (i.e., of C ), and any morphism hCT[c,c'] (and thus h∈C[c,Τ(c')]) UT(c) = T(c);

UT(h) = µc' ° T(h).

Let FT: CCT be functor defined by the following: for any object c of C, and any morphism f∈C[c,c']

FT(c) = c;

FT(f) = ηc' ° f ( = T(f) °ηc ).

Let εΤ: FTUT→id be the natural transformation defined by the following: for any object c of CT

εΤ(c) = idT(c) (in C).

We want to prove that (FT, UT, η , εT): CCT is a resolution for (T, η , µ). Obviously, UT ° FT = T .

Moreover, UT εT FT = µ, since for any object c one has

= UT(idT(c)) by def. of εT

= µc. by def. of UT

We have still to prove that (FT, UT, η , εT) is an adjunction from C to CT, that is, (UTεT) ° (ηUT) = id: UTUT

TFT) ° (FTη) = id: FTFT

One has, for every object c of CT:

(UTεT °ηUT) (c) = UT(idT(c)) °ηT(c) by def. of εT and UT

= µc ° T(idT(c)) °ηT(c) by def. UT on morphisms

= µc °ηT(c) as T is a functor

= idc. by the unity law of the monad

And, for every c∈ObC,

TFT ° FTη) (c) = εT(c) °(ηΤ(c) °ηc) by def. of FT

= idT(c) °(ηΤ(c) °ηc) by def. of εT

= µC ° T(idT(c)) °ηΤ(c) °ηc by def. of composition ° in CT = µC °ηΤ(c) °ηc

= ηc by the unity law of the monad

= idc by def. of the identity in CT.

5.4.6 Proposition Let (T, η, µ) be a monad over a category C. The resolution (FT, UT, η , εT):

C→CT associated with the Kleisli Category CT is an initial object in the category of resolutions for

the monad (T, η , µ).

Proof Let (F, G, η , ε): C→D be another resolution for (T, η , µ). We must prove that there exists a unique arrow from (FT, UT, η , εΤ) to (F, G, η , ε), that is a unique functor K: CTD, such that F = K ° FT, UT = G ° K , and KεΤ = εK.

Define, for any object cof CT, and any morphism fCT[c,c'], K(c) = F(c);

K(f) = εF(c') ° F(f).

where c and f are regarded as object and morphism of C. Then one has, for any c∈ObC, any h∈C[c,c'],

K(FT(c)) = K(c) = F(c)

K(FT(h)) = K(ηc' ° h) by def. of FT

= εF(c') ° F(ηc' ° h) by def. of K = εF(c') ° F(ηc') ° F(h) as F is a functor

= F(h) as (F, G, η , ε) is an adjunction

This proves the equality K ° FT = F .

Moreover, for any object cof CT, and any morphism fCT[c,c'], G(K(c)) = G(F(c)) = T(c) = UT(c)

G(K(f)) = G(εF(c') ° F(f)) by def. of K = G(εF(c')) ° G(F(f)) as G is a functor

= µc' ° T(f) as (F, G, η , ε) is a resolution

= UT(f) by def. of UT

that proves the equality UT = G ° K . Finally, for any d∈ObD,

K(εΤ(c)) = Κ(idT(c)) by def. of εΤ = εF(c') ° F(idT(c)) by def. of K

= εF(c') as F is a functor

= εK(c') by def. of K

that proves the equality KεΤ = εK.

We have still to prove that K is the unique morphism from (FT, UT, η , εT) to (F, G, η , ε). Let K': CTD be another morphism; then, for every object c of CT,

K'(c) = K'(FT(c)) by def. of FT

= F(c) as K' ° FT = F

= K(FT(c)) as K ° FT = F

= K(c) by def. of FT

and, for any f∈CT[c,c'],

K'(f) = K'(idc' ° f )

= K'(µc' °ηT(c') ° f) by the unitary law of the monad = K'(µc' ° T(idT(c')) °ηT(c') ° f)

= K'(idT(c') ° (ηT(c') ° f) ) by def. of composition ° in CT = K'(idT(c')) ° K'(ηT(c') ° f) ) as K' is a functor

= K'(εΤ(c')) ° K'(FT(f)) ) by def. of εΤ and FT = εK'(c') ° F(f) as K'εΤ=εK' and F=(K'°FT) = εF(c') ° F(f) as K'(c) = K(c) = F(c)

= K(f). by def. of K

This completes the proof. ♦

For consistency with the terminology adopted for the comparison functor, we shall denote by KT the unique arrow from the initial object (FT, UT, η , εT) in the category of all resolutions for a

monad (T, η , µ).

Consider now the comparison functor from the initial to the terminal object. Of course, it must be KT = KT; let us check this explicitly.

For any object c in CT,

KT(c) = (UT(c), UT(εΤ(c)) ) by def. of KT

= (T(c), µc)

= FT(c) by def. of FT

= KT(c). by def. of KT

And for any morphism f∈CT[c,c'],

KT(f) = UT(f) by def. of KT = µc' ° T(f) by def. of UT = εΤ(T(c'), µ(c')) ° T(f) by def. of εΤ = εΤFT(c') ° FT(f) by def. of FT = KT(f) . by def. of KT Exercises

1. Prove that the comparison functor KT = KT : CTCT is full and faithful.

2. Prove that the Kleisli Category is isomorphic to the full subcategory of CT consisting of all free algebras.