41.01.01 · category-theory / categories-functors-natural-transformations

Categories, Functors, and the Duality Principle

shipped3 tiersLean: none

Anchor (Master): Mac Lane 1998 *Categories for the Working Mathematician* 2e (Springer GTM 5) Ch. I-II in full; Eilenberg-Mac Lane 1945 *General theory of natural equivalences*; Freyd 1964 *Abelian Categories*; Borceux 1994 *Handbook of Categorical Algebra 1* (Cambridge) Ch. 1-2

Intuition Beginner

Across mathematics the same shape of idea keeps reappearing. Sets come with functions between them. Groups come with homomorphisms. Shapes in geometry come with continuous deformations. Each time there is a kind of object and a kind of arrow that carries one object to another. A category is the simple device that records both at once: a collection of objects together with the arrows allowed between them, and a rule for following one arrow after another.

Only two things are required for the bookkeeping to work. First, arrows compose: an arrow from to followed by an arrow from to yields an arrow from to . Second, every object carries an identity arrow, a do-nothing arrow that leaves any arrow it meets unchanged, the way the function fixing every point leaves a set alone.

The striking part is how much you can say while looking only at the arrows and never opening up the objects. Whether two objects deserve to be called "the same" can be settled by the arrows around them. This arrows-first habit turns loose analogies between different fields into exact statements you can prove once and reuse everywhere.

A functor is the next idea. It is a translation between two whole categories: a rule that sends objects to objects and arrows to arrows while respecting both composition and identities. Functors are how a fact established in one area gets carried faithfully into another.

Visual Beginner

Picture two boards of pins. The left board is one category, the right board another. On each board, curved strings connect the pins; these strings are the arrows of that category. A functor is a careful tracing: it pins every left dot to a chosen right dot and every left string to a right string, so that "string then string" on the left always lands on "string then string" on the right.

feature a category a functor between two
has objects (pins) and arrows (strings) a target pin for each source pin
respects composition and identities composition and identities
typical example sets with functions sending a set to its number of elements
reversing arrows gives the opposite category the same functor, arrows flipped

The point of the picture is that a functor preserves the shape of the diagram, not merely the separate pins. A triangle of composable strings on the left becomes a triangle on the right. That shape-keeping is the whole meaning of the word functor, and it is why a functor carries structure honestly from one category to another.

Worked example Beginner

Work inside the category of sets: the objects are sets, the arrows are ordinary functions. Take a fixed set with two elements, .

Step 1. Build a rule that sends each set to the set of all functions from to . Name 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 drawn from .

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

Step 3. Confirm identities are respected. If is the do-nothing function on , then " following " returns unchanged, so the do-nothing arrow maps to the do-nothing arrow.

What this tells us: the construction "functions out of " is itself a functor on the category of sets. Now run the same recipe with the arrows flipped, sending to "functions into ": following an arrow now goes backward, . The two recipes are mirror images. That mirror is the duality this unit is built around.

Check your understanding Beginner

Formal definition Intermediate+

A category consists of a class of objects ; for each ordered pair of objects a collection of morphisms (also written ); a composition operation ; and for each object an identity [Mac Lane 1998]. These satisfy associativity, whenever the composites are defined, and the identity law, for every .

The size hierarchy matters once Hom-collections are themselves objects of study. A category is small if and the totality of morphisms are sets; locally small if each is a set (the standard ambient assumption); and large otherwise. The standard examples (sets and functions), (groups and homomorphisms), (topological spaces and continuous maps), and (-vector spaces and linear maps) are locally small but not small; collecting all their objects into a single set is barred by the set-theoretic paradoxes, so one fixes a Grothendieck universe or works with classes.

Two examples encode familiar structures as one-object or arrows-only categories. A monoid is a category with a single object whose morphisms are the elements of , composition the monoid product, identity the unit. A preordered set is a category whose objects are the elements of , with exactly one morphism when and none otherwise; associativity and identities encode transitivity and reflexivity. Such thin categories — at most one morphism between any two objects — are exactly the preorders.

Definition (iso, mono, epi). A morphism is an isomorphism if there is with and . It is a monomorphism (left-cancellable) if forces , and an epimorphism (right-cancellable) if forces . In these recover injective and surjective functions, but the match is not universal: the inclusion of rings is both monic and epic yet not an isomorphism, and in a continuous bijection that is monic and epic need not be a homeomorphism.

Definition (opposite category). The opposite has the same objects, with and composition . Identities are unchanged, and on the nose. Under this reversal a monomorphism in is exactly an epimorphism in , and an initial object becomes a terminal one.

Definition (product and slice categories). The product category has objects the pairs and morphisms the pairs , composed coordinatewise. For a fixed object of , the slice (or over) category has as objects the morphisms into , and as morphisms the morphisms with . The dual coslice is , with objects the morphisms out of .

Definition (functor). A covariant functor assigns to each object an object and to each morphism a morphism , with and . A contravariant functor reverses arrows, with ; equivalently it is a covariant functor on . The covariant Hom-functor sends to postcomposition ; the contravariant sends to precomposition . Notation introduced here (, , , ) is recorded in _meta/NOTATION.md.

Definition (kinds of functor; subcategories). is faithful if each map is injective, full if each is surjective, and essentially surjective if every object of is isomorphic to some . A subcategory is a category whose objects and morphisms lie in with the inherited composition; it is full when the inclusion is a full functor. Small categories and functors between them form a category .

Counterexamples to common slips Intermediate+

  • Mono and epi are not injective and surjective. The cancellation properties are defined purely by arrows; in concrete categories they often but not always coincide with injectivity and surjectivity. The dense inclusion in the category of Hausdorff spaces, or in commutative rings, is epic without being surjective: an arrow agreeing on a dense or generating part already agrees everywhere.

  • A bijective morphism need not be an isomorphism. In the identity from a set with the discrete topology to the same set with a coarser topology is a continuous bijection — monic and epic — but its inverse is not continuous. Being iso requires a two-sided inverse inside the category, not merely a bijection of underlying sets.

  • A functor is not a function on Hom-sets in isolation. The assignment must respect composition: sending each to a same-shaped arrow while failing gives only a graph map. The power-set assignment becomes a functor only after fixing a direction — direct image makes it covariant, preimage makes it contravariant.

Key theorem with proof Intermediate+

The signature result of the unit is the duality principle: every theorem about categories has a dual, obtained by reversing arrows, and a single proof establishes both.

Theorem (duality principle). Let be a statement in the first-order language of categories — built from objects, morphisms, the relations "is the source of", "is the target of", "is the composite of", and "is an identity". Let be the statement obtained by reversing every morphism (swapping source and target, and reversing every composite ). Then holds in a category if and only if holds in . Consequently, if is a theorem (true in every category), then is a theorem as well [Mac Lane 1998].

Proof. The opposite construction is an exact, structure-reversing relabelling. By definition and , with composition and the same identities. So a morphism has source and target in if and only if it has source and target in , and holds in if and only if holds in ; the identity predicate is preserved verbatim.

Interpret the language of categories in . Reading any basic relation of back through these identifications produces precisely the arrow-reversed relation of . By induction on the construction of from atomic relations using the logical connectives and quantifiers (which range over the same objects and morphisms in both readings, since the underlying data are equal), the truth value of evaluated in equals the truth value of evaluated in . This is the first claim.

For the second, suppose holds in every category. Given any category , apply the hypothesis to : then holds in , so by the first claim holds in . Since was arbitrary, is a theorem. The involution on statements satisfies , so the correspondence between theorems and their duals is a bijection.

Bridge. The duality principle builds toward every later "co-" notion in the corpus — coproduct, colimit, cokernel, comonad — and appears again in 41.02.01, where limits and colimits are shown to be dual under exactly this reversal, so one existence proof discharges both. The foundational reason it works is that makes arrow-reversal an involution; the central insight is that a categorical statement carries no information beyond the pattern of its arrows, so reversing them is a symmetry of the whole language. This is exactly the mechanism by which a monomorphism is dual to an epimorphism and an initial object is dual to a terminal one: each pair is a single statement read in and in . Putting these together, duality halves the labour of the subject — the bridge is that proving a fact about products silently proves the matching fact about coproducts, and this discipline of prove-once recurs whenever a universal property and its dual govern a construction.

Exercises Intermediate+

Advanced results Master

Proposition (size and Hom-functor representability constraints). A locally small category admits, for each object , the Hom-functors and , valued in genuine sets precisely because each Hom-collection is a set. Local smallness is what makes -valued functors the right probes; in a merely large category the Hom-functors land in proper classes and the representable-functor machinery of 41.04.02 does not get off the ground. The product and slice inherit local smallness, and is the coslice — duality acting on the comma constructions.

Theorem (functoriality of geometric and algebraic invariants). The fundamental group is a functor from pointed spaces: a based map induces by , with and . Singular homology is a sequence of functors , and singular cohomology is contravariant. Functoriality is precisely what makes these invariants useful: a property visible in or obstructs the existence of a map upstream in .

Theorem (faithful injective on objects; full + faithful + essentially surjective equivalence). A functor that is full, faithful, and essentially surjective is an equivalence of categories: there is a functor and natural isomorphisms , (the natural-isomorphism language is developed in 41.01.02). Equivalence is the correct notion of sameness for categories — coarser than isomorphism, since it ignores the difference between isomorphic objects, yet preserving every property expressible in the categorical language. The skeleton of , a full subcategory with one object per isomorphism class, is equivalent to .

Theorem ( as a category, and the -dimensional refinement). Small categories and functors form a category , with composition of functors associative and identities the identity functors. But carries more: between two parallel functors live natural transformations, making a -category whose -cells are the subject of 41.01.02. The opposite construction is itself a functor, an involution on objects with , which is the structural home of the duality principle: every theorem about that is stable under comes in dual pairs.

Synthesis. Putting these together, a category is a self-contained universe of arrows, a functor is a translation between such universes, and duality is the symmetry that halves the subject. The foundational reason the whole apparatus coheres is that : arrow-reversal is an involution, so every construction acquires a dual for free and every theorem stable under reversal comes in a matched pair. This is exactly the pattern that generalises from mono/epi and initial/terminal to the limit/colimit duality of 41.02.01 and to the representable/corepresentable split that the Yoneda lemma of 41.04.02 exploits; the central insight is that an object is determined by the arrows around it, so reversing those arrows is a genuine symmetry of meaning rather than a notational trick. The bridge is functoriality itself: , homology, and the Hom-functors all transport categorical structure faithfully, which is exactly why an obstruction proved in one category propagates to another, and the same transport, applied to natural transformations in 41.01.02, upgrades from a category to a -category where equivalence — not isomorphism — is the right notion of sameness.

Full proof set Master

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

Proof. On objects , a set by local smallness. On a morphism define for ; since , this is a function . Identities: , so . Composition: for and , by associativity, so . Both functor axioms hold. The contravariant statement for is its dual, obtained by reading this proof in .

Proposition 2 (composition of functors is a functor; is a category). If and are functors then is a functor, composition is associative, and the identity functors are neutral.

Proof. Define and . Identities: . Composites: , using functoriality of then of . So is a functor. Associativity and the identity laws hold because they hold object- and morphism-wise in the codomains, where composition of the underlying assignments is ordinary function composition. Hence small categories and functors form a category .

Proposition 3 (mono is dual to epi under ). A morphism is a monomorphism in if and only if is an epimorphism in .

Proof. is monic in when for all . Read these data in : the morphism now runs , and run , with the -composite equal to the -composite . The monic condition becomes , which is exactly right-cancellability of in , i.e. is epic there. The converse is the same equivalence read backwards, using .

Proposition 4 (equivalences preserve mono, epi, and iso). If is full and faithful, then is monic (resp. epic, resp. iso) in iff is monic (resp. epic, resp. iso) in , restricted to test maps in the image.

Proof. For iso this is Exercise 6 together with its converse: a functor sends isomorphisms to isomorphisms because it preserves the inverse equations, and a fully faithful functor reflects them. For monos: faithfulness gives, for with , that hence , and if is monic then , so is monic against maps from the image; fullness lets every test map into be realised as some , completing the reflection. The epi statement is the dual, obtained by reading the mono argument in the opposite categories via Proposition 3.

Connections Master

  • Natural transformations and the -category 41.01.02. The morphisms between functors are natural transformations; they upgrade from the plain category built here into a -category and supply the natural isomorphisms that define equivalence of categories. The faithful/full/essentially-surjective trichotomy introduced in this unit is exactly the data that, with naturality, characterises an equivalence, so 41.01.02 is the immediate continuation of the functor theory developed here.

  • Limits and colimits 41.02.01. Products and slice categories here are the smallest cases of the general limit/colimit calculus, and the duality principle proved in this unit is what makes colimits the formal mirror of limits: one establishes the limit theory and reads off the colimit theory in the opposite category. Initial and terminal objects, shown dual here, are the empty-diagram limit and colimit.

  • The Yoneda lemma and representability 41.04.02. The covariant and contravariant Hom-functors constructed in this unit are the representable functors whose natural transformations the Yoneda lemma computes; the slogan "an object is determined by the arrows around it", used here to motivate the duality principle, becomes the precise Yoneda embedding in 41.04.02, with the contravariant Hom-functor giving the presheaf incarnation.

  • The categorical survey 01.02.09. This unit deepens the opening pages of the foundations-level survey 01.02.09, which treats categories, functors, natural transformations, Yoneda, and adjunction in a single sweep; the present unit owns the careful theory of categories, the size hierarchy, mono/epi/iso across concrete categories, and the duality principle, which 01.02.09 states more briefly. The groups, rings, modules, and spaces that the rest of the corpus studies are the running examples of the categories named here, so this unit is the language in which their structural theory is phrased.

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 aim was to make precise the word "natural" in statements such as the natural isomorphism between a finite-dimensional vector space and its double dual. Defining "natural transformation" forced the prior definitions of functor and category, so the three notions were introduced in descending order of abstraction from the phenomenon they were meant to explain. The duality principle and the systematic use of the opposite category were already present in that first paper, where reversing arrows was recognised as a symmetry of the new language.

The maturation of the framework belongs to the 1950s and 1960s. Mac Lane's Categories for the Working Mathematician (1971; 2nd ed. 1998) [Mac Lane 1998] codified the size discipline of small, locally small, and large categories, the comma and slice constructions, and the duality principle as a working tool. Peter Freyd's Abelian Categories (1964) pushed duality to the point where each theorem of homological algebra automatically yields its dual, and the contravariant Hom-functors developed here became the foundation of sheaf and presheaf theory in Grothendieck's reworking of algebraic geometry. The structuralist reading — that a mathematical object has no content beyond its position in a web of morphisms, so that arrow-reversal is a genuine symmetry of meaning — descends directly from Eilenberg and Mac Lane's original concern with naturality.

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}
}

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

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

@book{Awodey2010,
  author    = {Awodey, Steve},
  title     = {Category Theory},
  edition   = {2},
  publisher = {Oxford University Press},
  series    = {Oxford Logic Guides 52},
  year      = {2010}
}

@book{Leinster2014,
  author    = {Leinster, Tom},
  title     = {Basic Category Theory},
  publisher = {Cambridge University Press},
  series    = {Cambridge Studies in Advanced Mathematics 143},
  year      = {2014}
}

@book{Freyd1964,
  author    = {Freyd, Peter},
  title     = {Abelian Categories: An Introduction to the Theory of Functors},
  publisher = {Harper and Row},
  year      = {1964}
}