Search topics and sections

Category theory is a branch of mathematics that studies structures through the maps between them, not through what they are made of. A category is a system of related objects, such as sets or spaces, together with maps between those objects that can be chained together.[1]

Samuel Eilenberg and Saunders Mac Lane introduced categories in a paper published in 1945.[2]

The same few ideas appear across mathematics, so category theory serves as a shared language for much of it.[3][2] They describe constructions such as products (objects that combine other objects) and free constructions. These patterns show up in several fields:

  • algebra
  • topology
  • geometry
  • logic
  • computer science

The basic idea

Many parts of mathematics study objects of one kind together with the maps that respect their structure.[3]

Category theory keeps only the objects, the maps, and the rule for chaining maps.

Many properties can be stated using maps alone. For example, a function into the Cartesian product X×YX \times Y of two sets is fixed by its two components, one into XX and one into YY. The same description works for topological spaces and for groups.[3]

Mac Lane described the subject as "learning how to live without elements, using arrows instead."[3]

A category with three objectsABCfgg ∘ f1A1B1C
A category: objects AA, BB, CC, morphisms ff and gg, their composite g∘fg \circ f, and an identity morphism 1A1_A, 1B1_B, 1C1_C on each object.

Definition of a category

Objects, morphisms, and composition

A category C\mathcal{C} has four parts.[1]

  • A collection of objects.
  • For each pair of objects AA and BB, a collection C(A,B)\mathcal{C}(A,B) of morphisms from AA to BB, written f:A→Bf : A \to B. Morphisms are also called maps or arrows.
  • A composition rule. Given f:A→Bf : A \to B and g:B→Cg : B \to C, it gives a morphism g∘f:A→Cg \circ f : A \to C (first ff, then gg).
  • For each object AA, an identity morphism 1A:A→A1_A : A \to A.

These parts must satisfy two laws. For all f:A→Bf : A \to B, g:B→Cg : B \to C and h:C→Dh : C \to D:[1]

(h∘g)∘f=h∘(g∘f)(h \circ g) \circ f = h \circ (g \circ f)
f∘1A=f=1B∘ff \circ 1_A = f = 1_B \circ f

The first law (associativity) says that a chain of morphisms has one composite, however it is grouped. The second (the identity laws) says that composing with an identity changes nothing.

Isomorphisms and commutative diagrams

An isomorphism is a morphism that can be undone. A morphism f:A→Bf : A \to B is an isomorphism if there is a g:B→Ag : B \to A with g∘f=1Ag \circ f = 1_A and f∘g=1Bf \circ g = 1_B. Objects joined by an isomorphism are called isomorphic.[1]

This one definition covers many familiar cases:[4]

  • bijections of sets
  • isomorphisms of groups
  • homeomorphisms of spaces (continuous maps with a continuous inverse)

Category theorists draw morphisms as arrows in diagrams. A diagram commutes when any two paths of arrows with the same start and end have the same composite.[4]

Proving facts by following arrows around such diagrams is called diagram chasing. It is a proof method that category theory introduced.[4]

Examples

The most familiar categories have sets with extra structure as objects and structure-preserving functions as morphisms.[1]

Category Objects Morphisms
Set sets functions
Grp groups group homomorphisms
Ring rings ring homomorphisms
Vectk_k vector spaces over a field kk linear maps
Top topological spaces continuous maps

A category does not have to be made of sets with structure. There is a category with one object and only its identity morphism.[1] Some familiar structures are themselves small categories, meaning categories whose objects and morphisms form sets:[5][6][4]

  • A monoid is a category with one object. Its elements are the morphisms, and composition is the monoid operation.
  • A group is a category with one object in which every morphism is an isomorphism.
  • A preorder, such as a partially ordered set, is a category with at most one morphism between any two objects. There is a morphism x→yx \to y exactly when x≤yx \le y.
  • A groupoid is a category in which every morphism is an isomorphism.
A preorder and a group drawn as categories Preorder as a category Group as a category a b c one arrow x → y exactly when x ≤ y; at most one arrow between any two objects one object; composing arrows = adding mod 3; every arrow has an inverse 0 1 2 ★
On the left, a preorder on a≤b≤ca \le b \le c drawn as a category: one arrow x→yx \to y for each pair with x≤yx \le y, including an identity loop on each object. On the right, the group Z/3\mathbb{Z}/3 drawn as a category with one object ⋆\star and arrows 00, 11, 22, where composition is addition mod 3.

Functors

A functor is a map between categories. A functor F:C→DF : \mathcal{C} \to \mathcal{D} sends each object AA of C\mathcal{C} to an object F(A)F(A) of D\mathcal{D}, and each morphism f:A→Bf : A \to B to a morphism F(f):F(A)→F(B)F(f) : F(A) \to F(B). It must preserve composition and identities:[6]

F(g∘f)=F(g)∘F(f),F(1A)=1F(A)F(g \circ f) = F(g) \circ F(f), \qquad F(1_A) = 1_{F(A)}
A functor between two categories Source category Target category A B C F(A) F(B) F(C) F g ∘ f F(g ∘ f) = F(g) ∘ F(f) f g F(f) F(g)
A functor FF from a category C\mathcal{C} to a category D\mathcal{D} sends each object XX to F(X)F(X) and each arrow to an arrow between the images. It preserves composition, so F(g∘f)=F(g)∘F(f)F(g \circ f) = F(g) \circ F(f).

Functors appear throughout mathematics:

  • A forgetful functor drops structure. For example, it sends each monoid to its underlying set and each monoid homomorphism to its underlying function.[6]
  • The fundamental group is a functor from spaces to groups. Using it, the Brouwer fixed-point theorem (every continuous map from a closed disk to itself has a fixed point) reduces to a simple fact in algebra.[4]
  • Taking derivatives is a functor: the chain rule of multivariable calculus says that the derivative of a composite is the composite of the derivatives.[4]
  • If groups are viewed as one-object categories, a group homomorphism is exactly a functor between them.[6]

Functors compose, so small categories and the functors between them form a category of their own, called Cat.[6]

A functor can also show that two categories are essentially the same. Such an equivalence of categories links finite-dimensional vector spaces with a category whose objects are natural numbers and whose morphisms are matrices.[4]

Natural transformations

A natural transformation is a map between two functors. Leinster calls natural transformations "maps between maps between categories."[1] Given functors F,G:C→DF, G : \mathcal{C} \to \mathcal{D}, a natural transformation α:F⇒G\alpha : F \Rightarrow G picks a morphism αX:F(X)→G(X)\alpha_X : F(X) \to G(X) for each object XX, called its component at XX.[7]

The components must fit together. For every morphism f:X→Yf : X \to Y in C\mathcal{C}:[7]

G(f)∘αX=αY∘F(f)G(f) \circ \alpha_X = \alpha_Y \circ F(f)

This condition is called naturality. It says that the square of arrows below commutes.

Naturality square F(X) F(Y) G(X) G(Y) F(f) G(f) αX αY
The naturality square for a natural transformation α:F⇒G\alpha: F \Rightarrow G. For every morphism f:X→Yf: X \to Y, both paths from F(X)F(X) to G(Y)G(Y) agree: αY∘F(f)=G(f)∘αX\alpha_Y \circ F(f) = G(f) \circ \alpha_X.

Eilenberg and Mac Lane created these ideas to make the word "natural" precise. Mathematicians used it to mean "defined without arbitrary choices."[4]

Vector spaces give an example. The dual space of a vector space VV over a field kk is the space of linear maps V→kV \to k, and the double dual is the dual of that space. For a finite-dimensional VV, matching VV with its dual space needs a choice of basis, but matching VV with its double dual needs no choice, so only the second is natural.[4]

Natural transformations compose component by component. The functors from C\mathcal{C} to D\mathcal{D} and the natural transformations between them form a functor category.[7]

A natural transformation whose components are all isomorphisms is a natural isomorphism.[5]

Universal properties

A universal property describes an object by how morphisms go into it or out of it. By the Yoneda lemma (see below), an object is fully described by such a property.[4] This lets mathematicians define and prove things without picking a particular construction.

The tensor product V⊗WV \otimes W of vector spaces is an example. It is defined by declaring that linear maps out of V⊗WV \otimes W match bilinear maps out of V×WV \times W (maps that are linear in each input when the other is held fixed). Its symmetry and associativity can then be proved without reference to any particular construction.[4]

Products

The Cartesian product of sets shows the pattern. The set X×YX \times Y comes with projections p:X×Y→Xp : X \times Y \to X and q:X×Y→Yq : X \times Y \to Y. For any set WW and functions f:W→Xf : W \to X and g:W→Yg : W \to Y, there is exactly one function h:W→X×Yh : W \to X \times Y with[3]

p∘h=f,q∘h=gp \circ h = f, \qquad q \circ h = g

Namely, hh sends ww to the pair (f(w),g(w))(f(w), g(w)).[3] A product in any category is an object with two morphisms that has this same property.

Universal property of the productWX × YXYfgh (unique)pq
The product X×YX \times Y has projections pp and qq. For any object WW with morphisms f:W→Xf: W \to X and g:W→Yg: W \to Y, there is exactly one h:W→X×Yh: W \to X \times Y with p∘h=fp \circ h = f and q∘h=gq \circ h = g.

Limits and colimits

Limits and colimits are universal constructions built from a whole diagram of objects. Limits build new objects by imposing equations on existing ones.[4]

Ordered sets give a simple case. In a partially ordered set viewed as a category, the supremum (least upper bound) of a set of elements is a colimit, and the infimum (greatest lower bound) is a limit.[4]

Duality

Reversing every arrow in a category gives another category, its opposite category. The axioms for a category stay true when arrows are reversed.[4] So any theorem proved for all categories also holds in their opposites, which yields a dual theorem with no extra work.[4]

The coproduct is the dual of the product. It has the product's universal property with every arrow reversed. In Set the coproduct is the disjoint union, and in Grp it is the free product of groups.[8]

Universal property of the coproductWX ⊔ YXYijfgh (unique)In Set, X ⊔ Y isthe disjoint union
The universal property of the coproduct: for any object WW with maps f:X→Wf: X \to W and g:Y→Wg: Y \to W, there is exactly one map h:X⊔Y→Wh: X \sqcup Y \to W with h∘i=fh \circ i = f and h∘j=gh \circ j = g. Every arrow points the opposite way from the product diagram.

Adjoint functors

Adjoint functors are pairs of functors that point in opposite directions and match morphisms in a precise way. Functors F:C→DF : \mathcal{C} \to \mathcal{D} and G:D→CG : \mathcal{D} \to \mathcal{C} are adjoint when there is a one-to-one correspondence[3][5]

D(FA,B)≅C(A,GB)\mathcal{D}(F A, B) \cong \mathcal{C}(A, G B)

that is natural in the objects AA of C\mathcal{C} and BB of D\mathcal{D}. Then FF is the left adjoint and GG the right adjoint, written F⊣GF \dashv G.[5]

Free and forgetful adjunction between Set and GrpSetGrpF = free groupG = underlying set (forgetful)F ⊣ Ghomomorphisms F(A) → B ↔ functions A → G(B)D(F A, B) ≅ C(A, G B)
The free group functor FF from Set to Grp is left adjoint to the forgetful functor GG from Grp to Set, written F⊣GF \dashv G. Group homomorphisms F(A)→BF(A) \to B correspond one to one with functions A→G(B)A \to G(B), which is the case D(FA,B)≅C(A,GB)D(FA, B) \cong C(A, GB) of the general form.

Free constructions are standard examples. The functor FF that sends a set AA to the free group on AA is left adjoint to the forgetful functor GG from groups to sets.[5] A homomorphism from the free group F(A)F(A) to a group BB is the same as a function from AA to the underlying set G(B)G(B). Groups, rings, modules and many other algebraic structures have such free and forgetful pairs.[4]

The Cartesian product is also a right adjoint. It is right adjoint to the diagonal functor that sends a set WW to the pair (W,W)(W, W).[3]

Daniel Kan introduced adjoint functors in a paper published in 1958.[2]

Kan showed that adjoint functors include limits and colimits as special cases.[2]

Mac Lane summed up their reach with the slogan "Adjoint functors arise everywhere."[3]

The Yoneda lemma

The Yoneda lemma says that an object is determined by the morphisms into it. Riehl calls it "arguably the most important result in category theory."[4]

Fix a category C\mathcal{C} whose morphisms between any two objects form a set (a locally small category). Each object AA gives a representable functor C(−,A)\mathcal{C}(-, A), which sends an object BB to the set C(B,A)\mathcal{C}(B, A). For every functor F:Cop→SetF : \mathcal{C}^{\mathrm{op}} \to \mathbf{Set}, the lemma states[9]

Nat(C(−,A),F)≅F(A)\mathrm{Nat}(\mathcal{C}(-, A), F) \cong F(A)

Here Nat\mathrm{Nat} is the set of natural transformations, and the one-to-one correspondence is natural in AA. It sends a natural transformation α\alpha to the element αA(1A)\alpha_A(1_A) of F(A)F(A).[9]

Several consequences follow:

  • The Yoneda embedding A↦C(−,A)A \mapsto \mathcal{C}(-, A) is full and faithful (it matches morphisms A→BA \to B one to one with natural transformations between the representable functors). So C\mathcal{C} sits inside a category of set-valued functors (presheaves).[9]
  • Objects AA and BB are isomorphic if and only if their representable functors are naturally isomorphic.[9]
  • Riehl points to a related classical antecedent: every group is isomorphic to a subgroup of a permutation group (Cayley's theorem).[4]
  • Modern algebraic geometry starts from the observation that a commutative ring can be identified with the functor it represents.[4]

Further structures

The basic notions combine into richer structures, each with its own theory.

  • A monad is a functor from a category to itself that encodes an algebraic structure. Beck's theorem uses monads to tell which categories are categories of algebras.[4][3]
  • An abelian category has enough structure to prove the standard lemmas about diagrams of maps used in homological algebra, without chasing elements.[3]
  • A monoidal category has a tensor product of objects.[3]
  • A Kan extension extends a functor F:C→EF : \mathcal{C} \to \mathcal{E} along another functor K:C→DK : \mathcal{C} \to \mathcal{D} to a functor from D\mathcal{D} to E\mathcal{E}, in a universal way, when such an extension exists.[10] Representable functors, limits, colimits, adjoint functors and monads are special cases of it.[4]
  • Higher category theory adds morphisms between morphisms, and so on upward. It is to category theory what higher-dimensional geometry is to plane geometry.[2]

Toposes

A topos can be viewed both as a generalized space and as a generalized universe of sets. The two views arose independently around 1963.[11]

View Origin Motivating idea
Generalized space Alexander Grothendieck toposes as categories of sheaves, from reworking sheaf theory for algebraic geometry
Generalized universe of sets William Lawvere a search for axioms for the category of sets

Lawvere and Myles Tierney, working together at Dalhousie University, then gave axioms for an elementary topos.[11]

In its final form, an elementary topos is a category with three features, subject to a few simple axioms:[11]

  • finite limits (limits of finite diagrams)
  • a function object YXY^X for any two objects, playing the role of the set of all functions from XX to YY
  • a power object P(X)P(X) for each object, playing the role of the set of all subsets of XX

Every Grothendieck topos is an elementary topos, but not every elementary topos is a Grothendieck topos.[11]

History

Timeline of category theory, 1940 to 2020 1940 1950 1960 1970 1980 1990 2000 2010 2020 1945 Eilenberg and Mac Lane categories, functors, natural transformations 1958 Kan adjoint functors 1971 Mac Lane Categories for the Working Mathematician 1964 Lawvere Elementary Theory of the Category of Sets 1963 Lawvere begins categorical foundations 1957 Grothendieck Tohoku paper 2013 Homotopy Type Theory book
Timeline of category theory from 1940 to 2020. It marks the founding paper of Eilenberg and Mac Lane (1945), Grothendieck's Tohoku paper (1957), Kan's adjoint functors (1958), Lawvere's work on foundations (1963 and 1964), Mac Lane's textbook (1971), and the Homotopy Type Theory book (2013).

Origins

Eilenberg and Mac Lane defined categories, functors and natural transformations in "General Theory of Natural Equivalences," published in 1945 in the Transactions of the American Mathematical Society.[2] They saw categories as less central. Their basic concepts were functors and natural transformations, and categories served only as the domains and ranges of functors.[2]

Mac Lane later recalled that categories were accepted slowly, or dismissed as "general abstract nonsense" (see abstract nonsense).[12]

Growth into a field

In the decade after 1945, categories came into use in algebraic topology and homological algebra.[2] Key steps followed:

With these developments, category theory became a field of research in its own right.[2]

Recent developments

From the 1980s on, category theory took root in theoretical computer science. There it helps develop new logical systems and the semantics of programming (the study of what programs mean).[2]

Higher categories have reached physics.[2] In 2013 the Univalent Foundations Program, building on ideas of Voevodsky and others, published the book Homotopy Type Theory.[2]

Applications

Category theory is used both inside mathematics and in other fields.

Foundations and open questions

Size

Categories such as Set are too large to be sets themselves. Questions of size, especially the line between sets and proper classes (collections too large to be sets), play a key role in category theory.[16]

A category whose objects and morphisms form sets is called small.[5] There are several ways to make size formal, and the choice affects which constructions are allowed.[16]

Categorical foundations

Some category theorists propose categories as a foundation for mathematics in place of set theory. Proposals include:[2]

  • Lawvere's category of categories
  • Mac Lane's suggestion of certain toposes
  • Lambek's free topos

One objection is that categories are usually defined as sets, so they cannot give a deeper foundation. The debate remains open.[2]

Higher categories

The foundations of higher category theory are still being worked out. Mathematicians now understand $(\infty, 1)$-categories, one kind of higher category, well, and important results have been proved with them.[2]

A suitable language and definite axioms for arbitrary higher-dimensional categories have not yet been given. Homotopy type theory is a related approach based on homotopy theory.[2]

References

  1. Basic Category Theory, Tom Leinster, Cambridge University Press, 2014.
  2. Category Theory, Jean-Pierre Marquis, Stanford Encyclopedia of Philosophy, 2019.
  3. Categories for the Working Mathematician, 2nd edition, Saunders Mac Lane, Springer, 1998.
  4. Category Theory in Context, Emily Riehl, Dover, 2016.
  5. Category Theory, Part III lecture notes, University of Cambridge, 2016.
  6. Basic Category Theory (Chapter 4 of Category Theory for Scientists), David I. Spivak, MIT OpenCourseWare, 2013.
  7. Lecture 9: Natural Transformations and Universal Properties, Max S. New, University of Michigan, 2023.
  8. Coproduct, Wolfram MathWorld, 2024.
  9. Lecture Notes: Introduction to Categorical Logic, Steven Awodey and Andrej Bauer, Carnegie Mellon University, 2009.
  10. Kan Extensions (seminar notes), Gideon Chiusole, 2019.
  11. Sheaves in Geometry and Logic: A First Introduction to Topos Theory, Saunders Mac Lane and Ieke Moerdijk, Springer, 1992.
  12. Concepts and Categories in Perspective, Saunders Mac Lane, American Mathematical Society, 1988.
  13. Categories for the Working Mathematician, 1st edition, Saunders Mac Lane, Springer, 1971.
  14. A Generalization of the Curry-Howard Correspondence, arXiv, 2016.
  15. Seven Sketches in Compositionality: An Invitation to Applied Category Theory, Brendan Fong and David I. Spivak, arXiv, 2018.
  16. Set Theory for Category Theory, Michael A. Shulman, arXiv, 2008.

Figure

Subtopics

(∞,1)-categoryAbelian categoryAbstract nonsenseAdjoint functorsAlexander GrothendieckAntiisomorphismApplied category theoryBeck's monadicity theoremCahiers de Topologie et Géométrie Différentielle CatégoriquesCategorical logicCategorical set theoryCategories for the Working MathematicianCategory (mathematics)Category algebraChu spaceCocycle categoryCoequalizerCommutative diagramCompletions in category theoryCone (category theory)CoproductCryptomorphismDaniel KanDerived equivalenceDirect limitDold-Kan correspondenceDorette PronkDual (category theory)Eckmann–Hilton argumentElement (category theory)End (category theory)Envelope (category theory)Equivalence of categoriesEssentially uniqueExact sequenceF-algebraF-coalgebraFinitely generated objectFree objectFreyd coverFunctorFurio HonsellGenerator (category theory)Global elementGrothendieck topologyGrothendieck's Galois theoryGrothendieck's relative point of viewGrothendieck's Tohoku paperGroup objectGroupoidGroupoid objectHigher category theoryHomotopical algebraHow to Bake PiIndexed categoryInverse limitIsbell dualityJean BénabouJean-Louis VerdierJohn R. IsbellJournal of Pure and Applied AlgebraKan extensionKaroubi envelopeKenneth Brown (mathematician)Lambek's lemmaLawvere's fixed-point theoremList objectMax KellyMichael Barr (mathematician)Mitchell's embedding theoremModel categoryMonad (category theory)Monoidal categoryMyles TierneyNatural transformationnLabOperadPaul DedeckerPeter Johnstone (mathematician)Pierre Cartier (mathematician)Pointed setProduct (category theory)PullbackPushout (category theory)Raphaël RouquierRefinement (category theory)Robin CockettSamuel EilenbergSaunders Mac LaneSemigroupoidSieve (category theory)Simplicial localizationSimplicial setSix operationsSmall object argumentSmall set (category theory)Span (category theory)Stable model categoryStack (mathematics)Stephen SchanuelStone dualitySubobjectSubquotientSynthetic differential geometryTensor-hom adjunctionTom LeinsterToposWilliam LawvereYoneda lemma