Mathematics for the interested outsider

The Unit and Counit of an Adjunction

Let’s say we have an adjunction. That is, functors and and a natural isomorphism .

Last time I drew an analogy between equivalences and adjunctions. In the case of an equivalence, we have natural isomorphisms and . This presentation seems oddly asymmetric, and now we’ll see why by moving these structures to the case of an adjunction.

So let’s set like we did to show that an equivalence is an adjunction. The natural isomorphism is now . Now usually this doesn’t give us much, but there’s one of these hom-sets that we know has a morphism in it: if then . Then is an arrow in from to .

We’ll call this arrow . Doing this for every object gives us all the components of a natural transformation . For this, we need to show the naturality condition for each arrow . This is a straightforward calculation:
using the definition of and the naturality of .

This natural isomorphism is called the “unit” of the adjunction . Dually we can set and extract an arrow for each object and assemble them into a natural transformation called the “counit”. If both of these natural transformations are natural isomorphisms, then we have an equivalence.

For a particular example, let’s look at this in the case of the free-monoid functor as the left adjoint to the underlying-set monoid . The unit will give an arrow , which here is just the inclusion of the generators (elements of ) as elements of the underlying set of the free monoid. The counit, on the other hand, will give an arrow . That is, we take all elements of the monoid and use them as generators of a new free monoid — write out “words” where each “letter” is a whole element of . Then to take such a word and send it to an element of , we just take all the letters and multiply them together as elements of . Since we gave a description of last time for this case, it’s instructive to sit down and work through the definitions of and to show that they do indeed give these arrows.

Advertisements

Share this:

Like this:

Related

And this unit, together with the functor GF and the map GFGF -> GF are precisely the data that the Haskell crowd (including me and sigfpe) are so excited about, calling it “monad” and viewing as the best thing since sliced bread for programming.

This is, IIRC, the historically first neat place that the things were found in. Their use for programming is MUCH later at any rate.

Well, after polishing off universals it’s time to show what neat things you can do with monoidal categories. In particular, I’ll deal with internalization, which gives the idea of a “monoid object” in a category. Then a monad on a category is a monoid object in the category of endofunctors on the category.

Incidentally, I’m a little surprised you’re interested in monads for the programming applications rather than for those to homology theory.

I was just thinking this was looking as if it was heading towards triples (or ‘standard constructions’ or ‘monads’ depending on whom you talk to). As you say, the main place I’ve come across these is in terms of homology theories (especially the work of Barr and Beck), but it doesn’t entirely surprise me to hear that they’re relevant to functional programming in some way – I understand quite a bit of category theory is.

It’s odd, really. I dropped the computer science half of my major as an undergraduate after I was the one person in a 100+ student class who really loved programming in ML. It made me realize that I was too much a mathematician to really finish off that other program as well.

And then it was years later that I realized that functional programming semantics are all category theory. Even before I knew from categories, I evidently picked up on their elegance.

[…] connected to properties of adjoints. First off, we know that and . This essentially expresses the unit and counit of the adjunction. For the antitone version, let’s show the analogous statement more […]

About this weblog

This is mainly an expository blath, with occasional high-level excursions, humorous observations, rants, and musings. The main-line exposition should be accessible to the “Generally Interested Lay Audience”, as long as you trace the links back towards the basics. Check the sidebar for specific topics (under “Categories”).

I’m in the process of tweaking some aspects of the site to make it easier to refer back to older topics, so try to make the best of it for now.