01.02.09 · foundations / groups

Category, functor, natural transformation, the Yoneda lemma, and adjunction

shipped3 tiersLean: none

Anchor (Master): Mac Lane 1971 Categories for the Working Mathematician Ch. III-IV; Yoneda 1954; Kan 1958 Adjoint functors; Eilenberg-Mac Lane 1945 General theory of natural equivalences

Intuition Beginner

Mathematics is full of collections that come with maps between them. Sets come with functions. Groups come with group homomorphisms. Vector spaces come with linear maps. Each time, you have a kind of object and a kind of arrow that carries one object to another. A category is the bookkeeping that records both at once: a world of objects together with the arrows allowed between them.

Two rules make the bookkeeping work. First, arrows compose: if an arrow goes from to and another goes from to , then following one after the other gives an arrow from to . Second, every object has an identity arrow that does nothing, the way the function leaving each element fixed does nothing to a set.

The surprise is how much you can say while looking only at the arrows, never opening up the objects. Whether two objects are "the same" can be decided by the arrows between them and everything else. This arrows-first viewpoint turns vague analogies between different parts of mathematics into precise statements you can prove once and reuse everywhere.

A functor is the next idea: a rule that turns one whole world of objects-and-arrows into another, sending objects to objects and arrows to arrows while respecting composition. Functors let you compare different categories, and they are how a fact proved in one area gets transported to another.

Visual Beginner

Picture two columns of dots. The left column is one category, the right column another. Inside each column, curved arrows connect the dots: these are the arrows of that category. Now draw a faithful copy: a functor takes every dot on the left to a chosen dot on the right, and every left arrow to a right arrow, so that the picture of "arrow then arrow" on the left lands on "arrow then arrow" on the right.

The point of the picture is that a functor preserves the shape of the diagram, not just the individual dots. A triangle of composable arrows on the left becomes a triangle on the right. This shape-preservation is the entire content of the word "functor," and it is why functors carry structure faithfully from one category to another.

Worked example Beginner

Take the category of sets. The objects are sets and the arrows are ordinary functions. Pick a fixed set with two elements, say .

Step 1. Build a rule that sends each set to the set of all functions from to . Call this collection . A function from a two-element set to is just a choice of two elements of in order, so behaves like the set of ordered pairs from .

Step 2. Check that this rule also acts on arrows. Given a function from to , turn any function from to into the function following , which goes from to . So the rule sends an arrow to an arrow .

Step 3. Confirm the identity is respected. If is the do-nothing function on , then following by returns unchanged.

What this shows: the construction "functions out of " is itself a functor on the category of sets. This single example is the seed of the whole unit, because reading a fixed object through all the arrows pointed at it is exactly the move that the Yoneda lemma later turns into a theorem.

Check your understanding Beginner

Formal definition Intermediate+

A category consists of a class of objects ; for each ordered pair of objects a set of morphisms (also written ); a composition law ; and for each object an identity [Mac Lane 1971]. These obey two axioms: associativity whenever the composites are defined, and identity for .

Standard examples: (sets and functions), (groups and homomorphisms, building on 01.02.01), (topological spaces and continuous maps), and (-modules and -linear maps for a ring , building on 01.02.06 and 01.02.10). A morphism is an isomorphism if there is with and .

Definition (Functor). A covariant functor assigns to each object an object and to each morphism a morphism , such that and . A contravariant functor reverses arrows: and , equivalently a covariant functor on the opposite category .

Definition (Hom-functors). For a fixed object , the covariant Hom-functor sends and to . The contravariant Hom-functor sends and to .

Definition (Natural transformation). Given functors , a natural transformation is a family of morphisms , one per object, such that for every the naturality square commutes: . If every is an isomorphism, is a natural isomorphism and are naturally isomorphic.

Definition (Universal property). An object is initial if for every object there is exactly one morphism ; it is terminal if there is exactly one morphism for every . A product of is an object with projections such that every pair of morphisms , factors uniquely through ; the coproduct is the dual notion in . A representation of a functor is an object together with a natural isomorphism .

Counterexamples to common slips Intermediate+

  • A functor is not a function on Hom-sets in isolation. The assignment must be coherent across composition: sending each to a same-shaped arrow but failing gives only a graph map, not a functor. The power-set assignment is a functor only once you fix the direction (image gives a covariant functor, preimage a contravariant one).

  • Natural is not the same as "exists for each object." Two functors can have isomorphic values at every object while having no natural isomorphism between them, because the chosen isomorphisms need not make the naturality squares commute. A finite-dimensional vector space is isomorphic to its dual, but not naturally; it is naturally isomorphic to its double dual.

  • Initial and terminal can coincide or differ. In the empty set is initial and any singleton is terminal, and these differ. In the zero module is both initial and terminal, a zero object. Conflating "an object with a unique map in" with "a unique map out" loses the direction that the universal property fixes.

Key theorem with proof Intermediate+

Theorem (Yoneda lemma). Let be a category, , and a functor. There is a bijection $$ \mathrm{Nat}\bigl(\mathrm{Hom}(A,-),,F\bigr);\cong;F(A), $$ natural in both and , sending a natural transformation to the element .

Proof. Define by . We build an inverse . Given , define a transformation with components by for .

First, is natural. For and , the covariant Hom-functor sends to , so the two routes around the naturality square give , using functoriality . The square commutes.

Next, . We compute , using .

Finally, . Let be a natural transformation and set . For any , naturality of applied to the morphism gives , that is . So . The two maps are mutually inverse, and naturality in and follows by tracing the same identities.

Bridge. The Yoneda lemma builds toward the entire representable-functor viewpoint and appears again in 04.02.01 (the functor of points of a scheme), where a space is recovered from the maps into it. The foundational reason it matters is that taking yields the Yoneda embedding : morphisms between objects are exactly natural transformations between their Hom-functors, so this is exactly the precise sense in which an object is determined by the arrows around it. The argument generalises the elementary fact that an element of a set is a function from a one-point set, and the central insight is that the identity morphism is the universal probe. Putting these together, the bridge is from "objects and their maps" to "functors and their natural transformations," a shift that recurs whenever a universal property defines an object up to unique isomorphism.

Exercises Intermediate+

Advanced results Master

Definition (Adjunction). Functors and form an adjunction ( left adjoint, right adjoint) if there is a bijection $$ \mathrm{Hom}{\mathcal{D}}(F C,,D);\cong;\mathrm{Hom}{\mathcal{C}}(C,,G D) $$ natural in and [Kan 1958]. Equivalently, an adjunction is given by a unit and a counit satisfying the triangle identities and .

The model example (free–forgetful). Let be the forgetful functor and the free-group functor (building on 01.02.01). Then : a homomorphism from the free group to a group is the same as a function , because a homomorphism out of a free group is determined freely by the images of the generators. The unit is the inclusion of generators; the counit multiplies a formal word back out in . The tensor–hom adjunction in 01.02.10, , is another instance, with left adjoint to .

Theorem (Uniqueness of adjoints). If has right adjoints and , then naturally. The defining natural bijection determines as the object representing at each , and a representing object is unique up to unique isomorphism by Yoneda.

Theorem ((Co)limits as universal cones). Let be a small index category and a diagram. A cone over with apex is a natural transformation from the constant functor to ; the limit is a terminal cone, equivalently an object representing the functor . Dually the colimit is an initial cocone. Products, equalisers, pullbacks, terminal objects (and their duals) are the special cases discrete, parallel-pair, cospan, empty. Right adjoints preserve all limits; left adjoints preserve all colimits.

Theorem (Adjoint functor theorem, statement). Let be a functor where is locally small and complete. Then has a left adjoint if and only if preserves all small limits and satisfies the solution-set condition [Mac Lane 1971]. This converts the search for a free construction into checking limit-preservation plus a smallness bound.

Synthesis. The Yoneda lemma is the foundational reason that universal properties pin objects down: representability says an object is exactly what a functor wants it to be, and uniqueness of representing objects is exactly the uniqueness of the universal cone. Putting these together, adjunctions, limits, and colimits all become the single phenomenon of representing a Set-valued functor, and the bridge is the natural bijection that turns a mapping problem into an object. This is exactly the pattern that generalises from the free-forgetful pair to every "best approximation" construction in algebra, and the central insight is that left adjoints build (free objects, tensor products, colimits) while right adjoints probe (forgetful functors, Hom, limits). The duality between the two sides is dual to the op-construction on categories itself, so each theorem about limits yields a theorem about colimits for free, and the whole apparatus appears again in homological algebra where derived functors measure the failure of an adjoint to be exact.

Full proof set Master

Proposition 1 (Hom-functor is a functor). For a fixed object in a category , the assignment is a covariant functor.

Proof. On objects , a set. On a morphism define for ; since , this is a function . Identities: , so . Composition: for and , by associativity, so . Both functor axioms hold.

Proposition 2 (Triangle identity from the adjunction bijection). Given a natural bijection , the unit and counit satisfy .

Proof. Naturality of in the second variable applied to relates to composition. By definition , and naturality of in the first variable along gives . Tracking through both naturality squares: the morphism has adjunct , which by naturality of and the definition reduces to . Since is a bijection and both and have the same adjunct , they are equal.

Proposition 3 (Right adjoints preserve limits). If and has a limit, then .

Proof. For any object of , the adjunction and the limit-defining bijection give natural isomorphisms $$ \mathrm{Hom}{\mathcal{C}}\bigl(C,G(\textstyle\lim D)\bigr)\cong\mathrm{Hom}{\mathcal{D}}(FC,\lim D)\cong\lim_{j}\mathrm{Hom}{\mathcal{D}}(FC,Dj)\cong\lim{j}\mathrm{Hom}{\mathcal{C}}(C,GDj), $$ the middle isomorphism because $\mathrm{Hom}{\mathcal{D}}(FC,-)\mathbf{Set}CG(\lim D)C\mapsto\lim_j\mathrm{Hom}(C,GDj)G\circ DG(\lim D)\cong\lim(G\circ D)\square$

Connections Master

  • Tensor product of modules 01.02.10. The tensor product is defined by the universal property of bilinear maps, and the tensor–hom adjunction exhibits as a left adjoint. The construction in 01.02.10 is the prototype the present unit abstracts: a universal arrow representing a Set-valued functor of bilinear maps, with uniqueness furnished by the Yoneda argument given here.

  • Ring, ring homomorphism, ideal 01.02.06. The category supplies the running examples of (co)products, kernels as equalisers, and the zero object, and the forgetful functor has a left adjoint sending a set to the free module on it. The quotient by an ideal is a colimit (coequaliser), so the isomorphism theorems of 01.02.06 are instances of the universal properties developed here.

  • Abelian category and Grothendieck axioms 01.02.33. Abelian categories are the setting where kernels, cokernels, and exactness make sense functorially; they are built on the limit/colimit language of this unit, and the AB5 axiom is a statement about commuting a particular colimit with finite limits. The representability and adjoint-functor machinery here is what later lets derived functors be defined as adjoints' failures of exactness.

  • The functor of points of a scheme 04.02.01. A scheme is recovered from its functor of points on commutative rings, a direct application of the Yoneda embedding proved here: morphisms of schemes are exactly natural transformations of their functors of points, so geometry is encoded in a representable presheaf.

Historical & philosophical context Master

Category theory was created by Samuel Eilenberg and Saunders Mac Lane in their 1945 paper General theory of natural equivalences [Eilenberg-Mac Lane 1945], whose stated motivation was to make precise the word "natural" in statements such as the natural isomorphism between a finite-dimensional vector space and its double dual. To define natural transformation they first had to define functor, and to define functor they first had to define category, so the foundational hierarchy was built top-down from the phenomenon it was meant to explain. The naturality square is the technical residue of that original concern.

The representability circle of ideas crystallised in the early 1950s. Nobuo Yoneda's contribution emerged from work on homological algebra and a 1954 conversation with Mac Lane in a Paris train station, recorded in print only later; the lemma now bearing his name expresses the slogan that an object is determined by its relationships [Yoneda 1954]. Daniel Kan's 1958 paper Adjoint functors [Kan 1958] isolated adjunction as the organising concept, showing that free constructions, limits, and tensor products are instances of a single pattern. The philosophical upshot, much discussed since, is structuralist: mathematical objects have no internal essence beyond their position in a web of morphisms, and the universal property is the modern replacement for an explicit construction.

Bibliography Master

@article{EilenbergMacLane1945,
  author = {Eilenberg, Samuel and Mac Lane, Saunders},
  title = {General theory of natural equivalences},
  journal = {Transactions of the American Mathematical Society},
  volume = {58},
  year = {1945},
  pages = {231--294},
}

@article{Yoneda1954,
  author = {Yoneda, Nobuo},
  title = {On the homology theory of modules},
  journal = {Journal of the Faculty of Science, University of Tokyo, Section I},
  volume = {7},
  year = {1954},
  pages = {193--227},
}

@article{Kan1958,
  author = {Kan, Daniel M.},
  title = {Adjoint functors},
  journal = {Transactions of the American Mathematical Society},
  volume = {87},
  year = {1958},
  pages = {294--329},
}

@book{MacLane1971,
  author = {Mac Lane, Saunders},
  title = {Categories for the Working Mathematician},
  publisher = {Springer},
  year = {1971},
  series = {Graduate Texts in Mathematics 5},
}

@book{Riehl2016,
  author = {Riehl, Emily},
  title = {Category Theory in Context},
  publisher = {Dover},
  year = {2016},
}

@book{Lang2002,
  author = {Lang, Serge},
  title = {Algebra},
  edition = {3rd revised},
  publisher = {Springer},
  year = {2002},
  series = {Graduate Texts in Mathematics 211},
}