2 The Yoneda Lemma

Definition 2.1 (Locally small). We say a category C is locally small if, for any two objects A and B, the morphisms AB in C are parameterised by a set C(A,B).

If A is an object of a locally small category C, we have a functor C(A,):CSet sending B to C(A,B) and a morphism BgC to the mapping (fgf):C(A,B)C(A,C) (this is functorial since composition in C is associative).

Dually, we have C(,B):CopSet.

Lemma 2.2 (Yoneda). Assuming that:

Then

Proof.

  • (i) Given α:C(A,)F, we define Φ(α)=αA(1A)FA.

    Given xFA, we define Ψ(x):C(A,)F by Ψ(x)B(f:AB)=Ff(x)FB. This is natural in B since F is a functor: given g:BC we have

    (Fg)Ψ(x)B(f)=(Fg)(Ff)(x)=F(gf)(x)=Ψ(x)C(gf).

    For any x, ΦΨ(x)=Ψ(x)A(1A)=F1A(x)=x.

    For any α, ΨΦ(α)B(f)=Ff(αA(1A))=αB(C(A,f)(1A)=αB(f) for all f:AB. So ΨΦ(α)=α.

  • (ii) Later. Seeing examples of usage of (i) is interesting first.

Corollary 2.3. Assuming that:

Then AC(A,) is a full and faithful functor Cop[C,Set].

Proof. Substitute C(B,) for F in Lemma 2.2(i): we have a bijection from C(B,A) to the collection of natural transformations C(A,)C(B,).

For a given f, the natural transformation C(f,) sends g:BC to gf, so this is functorial by associativity of composition C.

Similarly, we have a full and faithful functor C[Cop,Set] sending A to C(,A). We call this the Yoneda embedding: it allows us to regard any locally small category C as a full subcategory of a Set-valued functor category.

Compare with Cayley’s Theorem in group theory (every group is isomorphic to a subgroup of a permutation group) and ‘Dedekind’s Theorem’ (every poset is isomorphic to a sub-poset of a power set).

Definition 2.4 (Representable). We say a functor F:CSet is representable if it’s isomorphic to a C(A,) for some A. By a representation of F, we mean a pair (A,x) where xFA is such that Φ(x) is an isomorphism. We call x a universal element of F.

Corollary 2.5. Suppose (A,x) and (B,y) are both representations of F. Then there is a unique isomorphism AfB such that (Ff)(x)=y.

Proof. (Ff)(x)=g is equivalent to saying that

    𝒞(B,∙)              𝒞(A, ∙)


𝒞ΦΦ(((f,yx∙)))         F
commutes, so f must be the unique isomorphism, whose image under Yoneda is Φ(x)1Φ(y).

Proof of Yoneda(ii).

Suppose for the moment that C is small, so that [C,Set] is locally small. Given two functors C×[C,Set]Set: the first sends an object (A,F) to FA, and a morphism (AfA,FαF) to the diagonal of
  F A       F A′


FααFfAA′fF′ ′A       F ′A ′
The second is the composite

C×[C,Set]Y×1[C,Set]op×[C,Set][C,Set](,)Set

where Y is a Yoneda embedding. Then Φ and Ψ define a natural isomorphism between these two.

In elementary terms, this says that if xFA, and xFA is its image under the diagonal, then Ψ(x) is the composite

C(A,)C(f,)C(A,)Ψ(x)FαF.

This makes sense without the assumption that C is small, and it’s true since the composite maps

1Af(Ff)(x)αA(Ff)(x).

Example 2.6.

  • (a) The forgetful functor GpSet is represented by (,1), RngSet is represented by ([X],X), TopSet is represented by ({},).
  • (b) The functor P:SetopSet is represented by ({0,1},{1}). This is the bijection between subsets of A and functions Af{0,1}, and it’s natural. But P:SetSet is not representable, since P({}) isn’t a singleton.
  • (c) The functor Ω:TopopSet sending X to the set of open subsets of X, and XfY to f1:Ω(Y)Ω(X) is representable by the Sierpinski space Σ={0,1} with {1} open but {0} not open. This works since continuous maps XΩ are the characteristic functions of open subsets of X.
  • (d) The functor ():VectkVectk isn’t representable, but its composite with VectkSet is represented by k.
  • (e) For a group G considered as a 1-object category, the unique representable functor GSet is the Cayley representation: G acting on itself by multiplication.
  • (f) Given two objects A,B in a locally small category C, we have a functor CopSet sending C to C(C,A)×C(C,B). If this functor is representable, we call the representing object a categorical product A×B and write (π1:A×BA,π2:A×BB) for the universal element. Its defining property is that given any pair (f:CA,g:CB), there is a unique isomorphism h:CA×B such that πqh=f and π2h=g.

    Dually, we have the notion of coproduct A+B with coprojections γ1:AA+B, γ2:BA+B.

  • (g) Given a parallel pair AgfB in a locally small category C, we have a functor F:CopSet sending C to {h:CA|fh=gh} and defined on morphisms in the same way as C(,A).

    A representation of this functor is called an equaliser of (f,g): it consists of EeA satisfying fe=ge, and such that any h with fh=gh factors uniquely as ek. Note that e is monic; we call a monomorphism regular if it occurs as an equaliser.

    Dually, we have the notions of coequaliser and regular epi.

In Set, products are just cartesian products (also in Gp, Rng, Top, …). coproducts in Set are disjoint unions AB=(A×{0})(B×{1}). In Gp, coproducts are free products GH.

In Set, the equaliser of AgfB is the inclusion of {aA|f(a)=g(a)} and the coequaliser of (f,g) is the quotient of B by the smallest equivalence relation containing {(f(a),g(a))|a+A}.

Note that in Set, all monomorphisms and all epimorphisms are regular, but in Top, a monomorphism XfY is regular if and only if X is topologised as a subspace of Y. An epimorphism XfY is regular if and only if Y is topologised as a quotient of X.

Note that if f is both regular monic and regular epic, then it’s an isomorphism since the pair (g,h) of which its equaliser must satisfy g=h.

Warning. The following terminology is not standard. These are usually (both!) referred to as “generating”, but to avoid confusion, in this course we will refer to them with separate names.

Definition 2.7 (Separating / generating family). Let G be a family of objects of a locally small category C.

  • (a)
    We say G is a separating family if the functors C(G,), GG are jointly faithful, i.e. given a parallel pair AgfB, the equations fh=gh for all h:GA with GG imply f=g.
  • (b)
    We say G is a detecting family if the G(G,) jointly reflect isomorphisms, i.e. given AfB, if every GgB with GG factors uniquely through f, then f is an isomorphism.

If G={G}, we call G a separator or a detector.

Lemma 2.8.

Proof.

  • (i) Suppose G is a detecting family, and suppose AgfB satisfy the hypothesis of Definition 2.7(a). Let EeA of (f,g): then any GhA with GG factors uniquely through e, so e is an isomorphism, so f=g.
  • (ii) Suppose G is separating, and AfB satisfies the hypothesis of Definition 2.7(b). If ChgA satisfy fg=fh, then any GkC with GG satisfies gk=hk, since both are factorisations of fgk through f. So g=h; hence f is monic.

    Similarly, if BmlD satisfy lf=mf, then any GnB satisfies ln=mn, since it factors through f, so l=m and hence f is epic. Since C is balanced, f is an isomorphism.

Example 2.9.

  • (a) In Set, 1={} is a separator and a detector, since Set(1,) is isomorphic to the identity functor. Also, 2={0,1} is a coseparator and a codetector, since it represents P:SetopSet.
  • (b) In Gp (respectively Rng), (respectively [X]) is a separator and a detector, since it represents the forgetful functor.

    But Gp has no coseparator or codetector set: given any set G of groups, there is a simple group H with cardH>cardG for all GG, so the only homomorphisms HG with GG are trivial.

  • (c) For any small category C, the set {C(A,)|AobC} is separating and detecting in [C,Set]. This uses Yoneda and Lemma 1.8 (for the detecting case).
  • (d) In Top, 1 is a separator since it represents U:TopSet. But Top has no detecting set of objects: given a set G of spaces, choose κ>cardX for all XG, and let Y and Z be a set of cardκ. Give Y the discrete topology and for Z, we set the closed sets be Z plus all the subsets of cardκ. The identity YZ is continuous, but not a homeomorphism, but its restriction to any subset of card<κ is a homeomorphism, so G can’t detect the fact that f isn’t an isomorphism.
  • (e) Let G be the category whose objects are the ordinals, with identities plus two morphisms αgfβ whenever α<β with composition defined by ff=fg=gf=gg=f.

    Then 0 is a detector for C: it can tell that 0gfα aren’t isomorphisms since neither factors through the other, and if 0<α<β it can tell that αgfβ aren’t isomorphisms since 0gβ doesn’t factor through either.

    But C has no separating set: if G is any set of ordinals, choose α>β for all βG and then G can’t separate αgfα+1.

By definition, the functors C(A,):CSet preserve monomorphisms, but they don’t always preserve epimorphisms.

Definition 2.10 (Projective). We say an object P in a locally small category Cis projective if C(P,) preserves epimorphisms, i.e. if given

         P


fg Q      R
there exists h:PQ with gh=f. Dually, P is injective if it’s projective in Cop.

If P satisfies this condition for all g in some class E of epimorphisms, we call it E-projective.

In [C,Set], we consider the class of pointwise epimorphisms, i.e. those α such that αA is surjective for all A.

Corollary 2.11. functors of the form C(A,) are pointwise projective in [C,Set].

Proof. Immediate from Yoneda; given

           𝒞 (A, ∙)


αβ Q        R
with β pointwise epic, Φ(α)RA is βA(y) for some yQA, so βΨ(y)=α.

[C,Set] has enough pointwise projectives”:

Proposition 2.12. Assuming that:

Then there exists a pointwise epimorphism PF where P is pointwise projective.

Proof. Set P=(A,x)C(A,) where the disjoint union is over all pairs (A,x) with AobC and xFA. A morphism PQ is uniquely determined by a family of morphisms C(A,)Q. . Hence P is pointwise projective, since all the C(A,) are. But we have α:PF whose (A,x)-th component is Ψ(x):C(A,)F and this is pointwise epic since any xFA appears as Ψ(x)(1A).