Yoneda Lemma

download Yoneda Lemma

of 9

Transcript of Yoneda Lemma

  • 8/3/2019 Yoneda Lemma

    1/9

    The Yoneda Lemma: What's It All About?Tom Leinster

    Department of Pure Mathematics, University of CambridgeEmail: [email protected]

    Web: http://www.dpmms.cam.ac.uk/ ...leinsterOctober 2000

    1 The Yoneda Lemma 12 Corollaries2.1 A representation is a universal element2.2 The Yoneda embedding2.3 Isomorphic representables

    6689

    The level of generality and abstraction in the Yoneda Lemma means thatmany people find it quite bewildering. This document is meant to guide youslowly through what the Yoneda Lemma and its corollaries say, and give yousome wider conceptual perspective. It contains no results other than those inthe lectures, and as such is not 'required reading' for the course, but it mightmake your life easier.

    Breathe deeply, take it slowly, and remain calm.

    1 The Yoneda LemmaHere's the statement of the Lemma. The proof was in lectures so I won't repro-duce it here; in any case, once you have thoroughly understood the statement,you should find the proof straightforward.

    The Yoneda Lemma Let C be a locally small category. Then[ C O P , Set](HA' X) ~ X(A)

    naturally in A E C and X E [C O P , Set].First I will go through what this says at the formal level. Then I will try to

    explain what it means in a more intuitive sense.

    1

    mailto:[email protected]://www.dpmms.cam.ac.uk/http://www.dpmms.cam.ac.uk/mailto:[email protected]
  • 8/3/2019 Yoneda Lemma

    2/9

    Reminder: (*) says[ C O P , Set] (HA' X)~X(A)

    What it says Experience shows that many students are confused by the left-hand side of equation (*). Let's dissect it.

    C is a category. cop is also a category, the opposite or dual of C, obtained by keeping thesame objects and reversing all the arrows.

    Set is a category too, whose objects are sets and whose morphisms arefunctions.

    For any two categories A and B there is a category [A, BJ,whose objects arefunctors from A to B and whose morphisms are natural transformations.

    In particular we have the category [ C O P , Set J, whose objects are functorscop _ Set and whose morphisms are natural transformations.

    For any object A of C, there is a functor HA : cop - Set (also writtenC(-,A)). This functor is defined on objects by HA(B) = C(B,A), andon morphisms by HA(f) = r (compose with I). (Think of dual vectorspaces if it helps.)

    X is a functor cop - Set. For any category V and objects D, D' of V, the set of morphisms from Dto D' is written V(D, D').

    In particular, the left-hand side of (* ) is the set of morphisms in [ C O P , Set]from HA to X. That is, it is the set of natural transformations of the form

    So the left-hand side of (* ) is a set. The right-hand side is also a set. Hencethe isomorphism (* ) is a bijection between sets.

    In summary, Yoneda says that a transformation from HA to X is the samething as an element of X (A).Digression: size worries If you are happy with this explanation then somuch the better. But it does contain a slight economy with the truth: namely,that for a locally small category C , the functor category [ C O P , Set] is not ingeneral locally small, and so the left-hand side of (* ) is a priori a class andnot necessarily a set. However, when we prove the Yoneda Lemma we set up abijection between this class and the right-hand side of (*), which certainly is aset: hence the left-hand side is a set too.

    It's really best not to worry about this kind of point if you can help it. Forthose who remain concerned, take C to be small rather than just locally small:this guarantees that [ C O P , Set] is locally small, and your worries are over.

    2

  • 8/3/2019 Yoneda Lemma

    3/9

    What it says, continued Putting these worries aside, we have seen that forfixed A and X, the Yoneda Lemma claims there is a bijection between a certainpair of sets. What about 'naturally in A and X'? Recall that if F, G : V -- Eare a pair of functors, we use the phrase 'F(D) ~ G(D) naturally in D E V' tomean that there is a natural isomorphism F ~ G. The use of this phrase in theYoneda Lemma carries the implication that each side of (* ) is functorial in bothA and X; this means, for instance, that a map X -- XI induces a map

    (as can be seen), and that there's a way of choosing the isomorphisms (* ) for allA and X which is compatible with such induced maps. So more exactly, whatthe Yoneda Lemma says is that the 'evaluation' functor

    cop x [COP,Set](A,X)

    ev SetX(A)-is naturally isomorphic to the composite functor

    cop x [COP,Set] ~ [COP,SettP x [COP,Set] ~ Set.Here

    H. :C -- [COP,Set]is the 'Yoneda embedding', as detailed in lectures, which sends an object A E Cto the functor HA and a morphism f :A -- AI to the natural transformationHf :HA -- HA'.

    Iwill now suggest some ways of understanding the Yoneda Lemma.Smaller formulae At a very practical level, you can think of the YonedaLemma as a useful tool: later in the course we'll come across various large andperhaps mystifying expressions, and by applying the isomorphism (* ) from leftto right we will be able to reduce them to something more friendly.

    Topological presheaves You can try to get a handle on the Yoneda Lemmaby considering the following special case.

    Fix a topological space S, and denote by O(S) the poset of open subsets ofS, ordered by inclusion. Posets can be regarded as categories; thus an object ofthe corresponding category (also denoted O(S)) is an open subset of S, and

    Hom(V U) = { I if V ~ U, 0 otherwise.The functor category [O(S)OP, Set] is called the category of presheaves on

    S. (This year's algebraic geometry course uses a different way of defining(pre)sheaves; the two approaches are equivalent, but don't worry about thishere.) Explicitly, a presheaf X on S consists of

    3

  • 8/3/2019 Yoneda Lemma

    4/9

    for each open U ~ S, a set X(U) for each open V and U with V ~ U, a function X(U) - X (V), usuallywritten p f-----t p i v and called 'restriction'.

    Restriction is required to satisfy functoriality axioms: (p I v ) Iw = p i wand pi u =p, for p E X(U) and W ~ V ~ U . The classic example of a presheaf on a spaceis where X (U) is the set of continuous functions from U to the real numbers,and restriction is restriction in the usual sense. A morphism a : X - Yof presheaves is a natural transformation, and explicitly consists of a family(au: X(U ) - Y(U))U EO (S) offunctions satisfying (au(p))lv = av(plv) foreach p E X(U) and open V ~ U .

    The representable presheaves are those of the form H u : O (S)O P - Set,where U ~ S is open. Then Hu(V) is given by the formula (j), and the restric-tion maps for Hu are uniquely determined.

    Now ask yourself: given an open U ~ S and a presheaf X on S, what's amorphism H u - X? Well, it's a family av : Hu(V) - X (V) offunctions,one for each open V, which is compatible with the restriction maps. After somecontemplation you should see that such an a is entirely determined by the valueof au at the single element of Hu(U). So a map H u - X is just the samething as an element of X(U): that is, there is a bijection

    [O (S)O P, Set](H u,X) ~X(U).And of course, this is the Yoneda Lemma (minus naturality) in the case C =O(S) .

    Monoid actions Here is another potentially enlightening special case.Fix a monoid M. As we have seen, monoids are the same thing as one-objectsmall categories, and viewing M in this way, [ M O P ,Set] is the category of rightM -sets (= sets equipped with a right action by M). Ifwe write A for the singleobject of the category M , then the representable functor HA : M O P - Setcorresponds to what is sometimes called the 'right regular representation of M':that is, the set M acting on itself by composition. I will (perhaps confusingly)write M for this particular right M-set. Then, for an arbitrary right M -set X ,a morphism a :M - X of M-sets is entirely determined by a(l). Hence

    [ M O P ,Set](M, X) ~ X,in accordance with Yoneda again.

    Coherence General category theory springs no nasty surprises: any sensibleequation you can write down is true. People sometimes say 'all diagrams com-mute'. Of course, you need to take this with a pinch of salt (and it's no excusefor omitting the proper checks in an exam ... ). But contrast, for instance, grouptheory, where there are plenty of equations, such as a . b = b . a, which are per-fectly sensible but in general false. In category theory this equation wouldn't

    4

  • 8/3/2019 Yoneda Lemma

    5/9

    in general make sense: if a composite a-b exists then the composite bo a usuallydoesn't.To put it another way, in general category theory, there's at most one wayof taking inputs of given types and obtaining an output of a given type. Moresnappily, there's only one way of getting from A to B. For example:

    Given a natural transformationF~C .lJ.0: V

  • 8/3/2019 Yoneda Lemma

    6/9

    2 CorollariesThe Yoneda Lemma has (at least) three corollaries. Each can be proved directlyas well, and in fact that's not a bad exercise.

    2.1 A representation is a universal elementCorollary Let C be a locally small category and X : cop -- Set. Thena representation of X consists of an object A of C together with an elementu E X(A) such that

    for any B E C and x E X(B), there is a unique mapf: B -- A satisfying (Xf)(u) = x.

    To clarify the statement, first recall that a representation of X is, by definition,an object A of C together with a natural isomorphism 0: : HA - X. TheCorollary says that such pairs (A,o:) are in one-to-one correspondence withpairs (A, u) satisfying ( : j:) . This follows easily from the Yoneda Lemma.

    We can think of u as a 'universal' or 'generic' element. I will try to explainwhat's going on by two examples.

    Example 1 Fix vector spaces U and V, and consider the functorBilin(U, V; -): Vect

    W - Set,f---t Bilin(U, V; W)= {bilinear maps U x V - W}.Then a representation of Bilin(U, V; -) can be described in either of two equiv-alent ways:

    a. as a vector space T together with an isomorphismVect(T, W) ~Bilin(U, V; W)

    natural in W E Vectb. as a vector space T together with a bilinear map h: U x V - T, such

    thatfor any vector space Wand bilinear 9 : U X V - W, there isa unique linear f :T - W making

    hUxV-T~ l fW

    commute.

    6

  • 8/3/2019 Yoneda Lemma

    7/9

    Part (a) is just the definition of representation. Part (b) is the descriptiongiven in the Corollary, or rather the dual of the Corollary (concerning covariantfunctors X : C - Set: try writing out this statement). The map called hshould for consistency be called u (but would then look like an element of U).Those who know about such things will recognise T as the tensor product UV,and h as the map (u, v) f---t u v.

    You will observe that the first description is substantially shorter than thesecond. Indeed, it's clear enough that if the situation of (b) holds then there iscertainly an isomorphism

    Vect(T, W) - Bilin(U, V; W)natural in W, got by composition with h. But it looks at first as if (b) saysrather more than (a): that not only are the two things naturally isomorphic,they are naturally isomorphic in a rather specific manner. The Corollary tellsus that this is an illusion: all such natural isomorphisms arise in this manner.It's the word 'natural' in (a) that hides all the explicit detail.

    FExample 2 Let C ------:;:--- be an adjunction, and fix an object A of C. Then+--=--Gthe functor

    C(A,G-): V - Setis representable, as can be expressed in either of the following two ways:

    a. C(A, GB) ~ V(FA, B) naturally in B E Vb. the unit map r J A : A - G(F A) is an initial object of the comma cate-gory (A=>G).

    Again, the first description comes from the definition of representability, and thesecond from (the dual of) the Corollary. (It takes a moment to see this; I leavethat to you.) We looked at the second description from another perspective insection B of lectures.

    7

  • 8/3/2019 Yoneda Lemma

    8/9

  • 8/3/2019 Yoneda Lemma

    9/9

    2.3 Isomorphic representablesThe previous corollary has in turn the following corollary:Corollary For objects A and B of a locally small category C ,

    H A~H B ~ A~B ~ HA ~HB .

    The force ofthis is that H A ~ HB = > A ~ B; the other direction of implicationfollows immediately from functoriality of H . The second ~ is just the dualresult, and therefore also follows immediately.

    The Corollary can be explained as follows. Regard HA(U) = C(U,A) as 'Aviewed from U ': then our result says that two objects are the same if and onlyif they look the same from all viewpoints.The category of sets is very unusual in this context: for sets A and B,

    and so the Corollary has a trivial proof for C = Set. In other words, in Set it'senough to look at everything from the one-element set I-the only thing thatmatters about a set is its elements!

    In contrast, take C = Gp. Imagine that we have two groups A and B, andsomeone is telling us that A and B 'look the same from U' for various groupsU. Then, for instance,

    H A(I) ~H B(I) would tell us nothing at all H A(Z) ~H B(Z) would tell us that A and B have isomorphic underly-ing sets-that is, the same cardinality, but perhaps quite different groupstructures

    H A(Z jpZ) ~H B(Z jpZ) would tell us that A and B have the same numberof elements of order p, for a prime p,

    and so on. Each of these only gives partial information about the similarity ofA and B, but the whole natural isomorphism HA ~ HB tells us that A ~ B.

    9