Probably Random

A blog by Paul Siegel

Adjunctions

September 02, 2017

The promise of category theory is that the right abstractions will help us extend our intuition for simple objects to nontrivial theorems about more complex objects. The concept of an adjunction - along with a few other fundamental tools such as limits/colimits or the Yoneda lemma - are critical to actually fulfilling that promise.

Adjunctions are an abstraction of the concept of duality, wherein one translates a problem into a new context where it becomes simpler, solves it, and then translates the solution back. This strategy is ubiquitous in algebra and geometry - in number theory, for instance it is standard practice to solve problems about integers by extending them to complex numbers. And in computer science there are a variety of dualities embedded in the tools that one uses to construct complex transformations between data sets, and certain kinds of adjunctions emerge explicitly to organize these dualities (more on this in a future post).

That said, working with adjunctions requires great care and patience - there are a variety of different but equivalent definitions in common use, and all of them take some effort to parse.

Review of Natural Transformations

Before diving into the definition of an adjunction, let us revisit the concept of a natural transformation, defined as follows:

Let F and G be functors from a category C to a category D. A natural transformation η from F to G is a family of morphisms ηC:F(C)G(C) in D parametrized by the objects C of C which is compatible with the morphisms of C in the sense that:

ηC2F(f)=G(f)ηC1

for every morphism f:C1C2 in C. The morphism ηC is called the component of η at C.

There are a variety of different ways to manufacture new natural transformations from old; we will need two specific examples of this.

Let F, G, and H be functors from C to D and let η:FG and θ:GH be natural transformations. Then there is a new natural transformation

θη:FH

called the composition of θ and η whose component at an object C of C is given by composition of components:

(θη)C=θCηC

Let η:FG be a natural transformation between functors F,G:CD and let H:DE be a functor. Then there is a new natural transformation

Hη:HFHG

whose component at an object C of C is the morphism H(ηC).

Similarly, if E:BC is a functor then there is a natural transformation

ηE:FEGE

whose component at an object B of B is the morphism ηE(B).

Show that the natural transformations in the previous two examples - θη, Hη, and ηE - really are natural transformations. (In other words, check the compatibility condition in the definition of natural transformation.)

Definition of Adjunction

We are now ready to define the notion of an adjunction. Informally, an adjunction between two categories is a pair of functors between them which are “almost inverses” in a certain precise sense. Often adjunctions arise because one seeks a proxy for the inverse of a non-invertible functor, and the adjoint construction is “as close as possible”. For instance, the inclusion I:ZQ of the integers in to the rational numbers is not invertible, but the pair I,R where R:QZ is the “rounding down” function determines an adjunction between Z and Q (viewed as poset categories - see my post on Galois connections for more detail on this example).

Let C and D be categories. An adjunction between C and D consists of a pair of functors F:DC and G:CD together with natural transformations

u:1DGFandv:FG1C

which satisfy the following identities:

vFFu=1FandGvuG=1G

F is said to be the left adjoint of G and G is said to be the right adjoint of F. The natural transformations u and v are called the unit and counit of the adjunction, respectively.

Note that the symbol 1 is used in two different ways: 1C and 1D are the identity functors for the categories C and D, respectively, whereas 1F and 1G are the identity natural transformations for F and G, respectively.

Let us take a moment to unravel the adjunction identities a little bit before moving on to an example. The component of the natural transformation vFFu at an object D in D is by definition:

(vFFu)D=(vF)D(Fu)D=vF(D)F(uD)

Similarly, for any object C in C we have:

(GvvG)C=(Gv)C(uG)C=G(vC)uG(C)

Example: Products and Diagonals

In order to make things a little more concrete we shall construct a left adjoint for the familiar cartesian product functor and work through the definitions in some detail. (This example has the added advantage of being quite fundamental - many more sophisticated constructions can be viewed as generalizations of this one.)

In this example we will work extensively with the category Set2 of pairs of sets (i.e. the product of the category Set with itself). The objects of this category are pairs (X,Y) of sets and the morphisms from (X1,Y1) to (X2,Y2) are pairs (f,g) where f:X1X2 and g:Y1Y2 are functions. The reader is warned to keep in mind the distinction between the pair of sets (X,Y) and the product of sets X×Y - the former is an object in Set2 while the latter is an object in Set. In particular, (X,Y) doesn’t have “elements” - sets have elements, not pairs of sets!

Consider the product functor P:Set2Set defined by P(X,Y)=X×Y on objects and P(f,g)=f×g on morphisms. We will show that the “diagonal” functor Δ:SetSet2 defined by Δ(X)=(X,X) on objects and Δ(f)=(f,f) on morphisms is a left adjoint for P. In order to do this we must construct a unit and a counit, i.e. natural transformations

u:1SetPΔandv:ΔP1Set2

which satisfy the appropriate axioms.

We begin with the counit. ΔP is the functor Set2Set2 which sends a pair of sets (X,Y) to the pair (X×Y,X×Y). On the other hand 1Set2(X,Y) is just (X,Y). So the component of the counit at (X,Y) must be a morphism

v(X,Y):(X×Y,X×Y)(X,Y)

Define v(X,Y) to be the pair (π1,π2) where π1:X×YX and π2:X×YY are the projection maps on to the first and second factor, respectively.

Verify that v as defined above is a natural transformation.

Now for the unit. 1Set of course sends a set X to itself, while PΔ sends X to X×X. So the component of the unit at X must be a mapping

uX:XX×X

Simply define uX(x)=(x,x), the “diagonal function”.

Verify that u as defined above is a natural transformation.

We conclude by showing that u and v give P and Δ the structure of an adjoint pair.

The diagonal functor Δ:SetSet2 is left adjoint to the product functor P:Set2Set together with the natural transformations u and v defined above form an adjunction between Set and Set2.

It remains only to verify the adjunction identities:

vΔΔu=1ΔandPvuP=1P

Let us begin with the identity for Δ. The left- and right-hand sides are both natural transformations from Δ to itself, so the component of each side at a set X is a morphism from Δ(X)=(X,X) to itself. We have:

(vΔΔu)X=vΔ(X)Δ(uX)=v(X,X)(uX,uX)=(π1,π2)(uX,uX)=(π1uX,π2uX)

For any point xX we have:

(π1uX)(x)=π1(x,x)=x

and similarly for π2uX, so we conclude:

(vΔΔu)X=(1X,1X)=1(X,X)=1Δ(X)

as desired.

The adjunction identity for P proceeds similarly; the left- and right-hand sides are both natural transformatios from P to itself, so the component of each at a pair (X,Y) is a morphism from P(X,Y)=X×Y to itself. We calculate:

(PvuP)(X,Y)=P(v(X,Y))uP(X,Y)=P(π1,π2)uX×Y=π1×π2uX×Y

For any point (x,y)X×Y we have:

(π1×π2uX×Y)(x,y)=π1×π2(uX×Y(x,y))=π1×π2((x,y),(x,y))=(π1(x,y),π2(x,y))=(x,y)

Thus:

(PvuP)(X,Y)=1X×Y=1P(X,Y)

This completes the proof.

Adjunctions and Graph Theory

Adjunctions can be used to prove nontrivial results about graph colorings - this post probably contains sufficient background for reading a paper due to Foniok and Tardif on the subject, for example. I may make a pass at explaining some of these results in the future, but for now I will conclude with some simple exercises.

Let Gph denote the category whose objects are graphs and whose morphisms are graph homomorphisms. Consider the functor F:GphSet which sends a graph to its vertex set and a graph homomorphism to its restriction to vertex sets. Construct a left adjoint for F.