This page is about the concept in mathematics. For the concept of the same name in philosophy see at category (philosophy).
A category consists of a collection of things and binary relationships (or transitions) between them, such that these relationships can be combined and include the “identity” relationship “is the same as.”
A category is a quiver (a directed graph with multiple edges) with a rule saying how to compose two edges that fit together to get a new edge. Furthermore, each vertex has an edge starting and ending at that vertex, which acts as an identity for this composition.
A category is a combinatorial model for a directed space – a “directed homotopy 1-type” in some sense. It has “points”, called objects, and also directed “paths”, or “processes” connecting these points, called morphisms. There is a rule for how to compose paths; and for each object there is an identity path that starts and ends there.
More precisely, a category consists of a collection of objects and a collection of morphisms. Every morphism has a source object and a target object. If is a morphism with as its source and as its target, we write
and we say that is a morphism from to . In a category, we can compose a morphism and a morphism to get a morphism . Composition is associative and satisfies the left and right unit laws.
A good example to keep in mind is the category Set, in which the objects are sets and a morphism is a function from the set to the set . Here composition is the usual composition of functions.
For more background on and context for categories see
There are two broad ways to write down the definition of category; in the usual foundations of mathematics, these two definitions are equivalent. It is good to know both, for several reasons:
Each introduces its own system of notation, both of which are useful in other parts of category theory, so one should know them.
One definition generalises quite nicely to the notion of an internal category, while the other generalises quite nicely to the notion of an enriched category; these are both important concepts.
When examining alternative foundations, sometimes one definition or the other may be more appropriate; in any case, one will want to examine the question of their equivalence.
The two definitions may be distinguished by whether they use a single collection of all morphisms or several collections of morphisms, a family of collections indexed by pairs of objects.
[Grothendieck 61, Section 4]
A category consists of
a collection (see Foundational issues and Size issues) of objects;
a collection of morphisms (or arrows);
for every morphism , an object (called its source or domain), and an object (called its target or codomain);
for every pair of morphisms and , where , a morphism , called their composite (also written or sometimes — see diagrammatic order);
for every object , a morphism (or ), called the identity morphism on ;
such that the following properties are satisfied:
source and target are respected by composition: and ;
source and target are respected by identities: and ;
composition is associative: whenever and ;
composition satisfies the left and right unit laws: if and , then .
People also often write instead of as a short way to indicate that is an object of . Also, some people write and instead of and . One usually writes if to state that and . Finally, people often write , , or for the collection of morphisms .
If the identity-assigning map and its axiom is omitted, then one speaks of a semicategory.
A category consists of
a collection (see Foundational issues and Size issues) of objects;
for each pair of objects, a collection of morphisms from to ;
for each pair of morphisms in and in , a morphism in , called their composite (also written or sometimes — see diagrammatic order);
for each object , a morphism (or ) in , called the identity morphism on ;
such that the following properties are satisfied:
composition is associative: for each quadruple of objects, if , , and , then ;
composition satisfies the left and right unit laws: for each pair of objects, if , then .
People also often write instead of as a short way to indicate that is an object of . Also, some people write instead of and , , or instead of . One usually writes to state that . Finally, people often write or for the disjoint union .
Given a one-collection-of-morphisms category , we define a family-of-collections-of-morphisms category by taking to be the preimage of under the function . Conversely, given a family-of-collections-of-morphisms category we define a one-collection-of-morphisms category by taking to be the disjoint union of the families of morphisms . With the straightforward definitions of functor and natural transformation in both cases, this sets up a strict 2-equivalence? of 2-categories.
Note, though, that this 2-equivalence is not an isomorphism of 2-categories, because the disjoint union operation has to “tag” each morphism with its domain and codomain. It seems that the strongest thing that can be said is that, in a material set theory, if a family-of-collections-of-morphisms category has the property that sets are all disjoint, then there is a one-collection-of-morphisms category with (the non-disjoint union) that gives rise to on the nose. The notion of a protocategory is a way to formalize a family-of-collections-of-morphisms category together with the information about how its hom-sets “overlap”.
In ordinary category theory one rarely specifies which of the two definitions is being used, although often language implicitly suggests that it is the latter, e.g. when defining a category one first specifies the objects and then specifies what “the morphisms from to are” rather than specifying what “a morphism” is and then what the domain and codomain of each morphism are. Indeed, when defining a category in this way, one rarely worries about whether the hom-sets are disjoint, meaning that it must be the second definition in use. Even for the prototypical category Set, if constructed in a material-set-theoretic foundation like ZFC, the natural definition “a morphism from to is a function, i.e. a subset of that is total and functional”, produces hom-sets that are not disjoint, since a total and functional set of ordered pairs can have any codomain that is a superset of its range. Moreover, categorical constructions do not “naturally” preserve disjointness of homsets, e.g. in the category of elements of a functor a given morphism in can “be” a morphism between many different elements of , and similarly for a slice category and so on.
We said a category has a ‘collection’ of objects and ‘collection’(s) of morphisms. However, different mathematical foundations have different notions of equality. For foundations whose notion of a ‘collection’ has proposition-valued equality, such as in set theory, class-set theory, or extensional type theory, the two definitions above suffice for defining a category. However, in for other foundations, with a weaker notion of equality, such as internally in a (2,1)-topos like Grpd, in Thomas Streicher‘s groupoid model of types, or in homotopy type theory, there are multiple definitions of a category. The naive definition of the category above with a collection of objects and a collection of morphisms results in a wild category. If the morphism collections are sets, then the resulting structure is a precategory, and if the collection of objects is a set as well, then the resulting structure is a strict category. The above definitions in set theory foundations are the same as strict categories in the alternative foundations, but in the alternative foundations categories like Set are not strict categories. Instead, they happen to be a special kind of precategory called univalent categories, where equality of objects is isomorphism of objects.
We said a category has a ‘collection’ of objects and ‘collection’(s) of morphisms. A category is said to be small if these collections are all sets — as opposed to proper classes, for example. (The alternatives depend on ones foundations for mathematics.)
Similarly, a category is locally small if is a set for every pair of objects in that category. The most common motivating examples of categories (such as Set) are all locally small but not small (unless one restricts their objects in some way).
For some purposes it is useful or necessary to vary the way the ordinary definition of category is expressed. See
single-sorted definition of a category– a variant of the first definition, with only one collection at all (, no ). This is sometimes convenient for technical reasons.
type-theoretic definition of category– a variant of the second definition, interpreted explicitly in dependent type theory.
protocategory– a sort of mixture of the two definitions, in which all the hom-sets are subsets of a single set , but not necessarily disjoint.
A category is equivalently
a monad in the 2-category of spans of sets;
a monoid in the monoidal category of endospans on the set of objects;
a simplicial set which satisfies the Segal conditions;
a simplicial set which satisfies the weak Kan complex conditions strictly:
hence a directed homotopy type which is “1-truncated”
The first definition, with a single collection of morphisms, generalises to the notion of an internal category. Essentially, we define a category internal to (some other category) as above, with ‘collection’ interpreted as an object of and ‘function’ interpreted as a morphism of . In particular, a category internal to Set is the same thing as a small category.
The second definition of a category, as a family of collections of morphisms, generalises to the notion of an enriched category: we define a category enriched over (some other category) as above, with the collection of objects still a ‘collection’ as before, but with objects of in place of the collections of morphisms and morphisms of in place of the various functions. In particular, a category enriched over Set is the same thing as a locally small category.
The notion of an indexed category captures the idea of woking “over a base” other than Set.
There is a generalization of the notion of a category where one allows a morphism to go from several objects to a single object. This is called a multicategory or operad. If we additionally allow a morphism to go to several objects, we obtain a polycategory or PROP.
This section lists a few well-known categories and some of their properties.
The archetypal example of a category is:
Direct generalization of this case are the concrete categories of sets equipped with extract structure and with homomorphic functions between them as morphisms:
Vect– vector spaces as objects, linear maps as morphisms.
Grp– groups as objects, group homomorphisms as morphisms.
Top– topological spaces as objects, continuous functions as morphisms.
Diff– smooth manifold as objects, smooth maps as morphisms.
Ring– rings as objects, ring homomorphisms as morphisms.
These all are large categories.
Yet more generally there are non-concrete categories, often small ones:
For instance for a group, its delooping groupoid:
Or for a topological space its fundamental groupoid:
These two are examples of categories which are (small) groupoids: namely (small) categories in which all morphisms are invertible.
More generally, for a monoid there is its delooping category:
and in this vein one may generally regard small categories as being the “monoids with many objects”: the “horizontal categorification” of monoids (which in the terminology of “oidification” would be called the “monoid-oids” – but are not).
In a similar spirit, given a partially ordered set it may be regarded as a category:
Related to this, while directed graphs are not themselves categories (lacking a specified composition operation and specified identity morphisms and in general not even admitting this structure) they induce free categories:
There is no hope (or point) in making a comprehensive list of categories, but here are a few further examples, with comments on their properties:
Ab: abelian groups as objects, homomorphisms as morphisms. Since this category consists of models of a Lawvere theory it has all small limits and colimits. It is the prototypical abelian category and also a closed symmetric monoidal category under the tensor product of abelian groups.
Alg: algebras as objects, homomorphisms as morphisms. This is actually many different categories, depending on a choice of ground field or more generally commutative ring. Since any one of these categories consists of models of a Lawvere theory, it has all small limits and colimits.
Bicat: bicategories(weak 2-categories) as objects, 2-functors as its 1-cells, pseudonatural transformations between its 1-cells as its 2-cells, and modifications between its 2-cells as its 3-cells. BiCat is a tricategory. BiCat is sometimes denoted .
CartSp: spaces as objects, smooth maps as morphisms.
Cat: small categories as objects, functors as morphisms. Since this category consists of models of a finite limits theory, it has all small limits and colimits. It is cartesian closed, and its internal homs make it into a 2-category.
Diff: smooth manifolds as objects, smooth maps as morphisms. This category has finite but not infinite products, and all small coproducts. It does not have equalizers or coequalizers, and is not cartesian closed.
Diffeological spaces as objects, smooth maps as morphisms. This category has all small limits and colimits, it is cartesian closed, and it has a weak subobject classifier. So, it is a quasitopos.
Grp: groups as objects, homomorphisms as morphisms. Since this category consists of models of a Lawvere theory it has all small limits and colimits.
: (right) -modules as objects, -module homomorphisms as morphisms. There is one such category for any ring (or more generally, any small Ab-enriched category. This is also the category of models of a Lawvere theory and is thus complete and cocomplete. It is an abelian category and even Grothendieck category. If is commutative, then is a closed symmetric monoidal category under the tensor product of -modules.
Rel: sets as objects, relations as morphisms. This is an allegory and therefore a dagger category. The empty set is an zero object, and disjoint union plays the role of biproduct. This category does not have equalizers or coequalizers.
Ring: rings as objects, ring homomorphisms as morphisms. Since this category consists of models of a Lawvere theory it has all small limits and colimits. (maybe we should have unital rings separately; the difference is important sometimes).
SimpSet: simplicial sets as objects, simplicial maps as morphisms. This is a presheaf topos.
Set: sets as objects, functions as morphisms.
This has the following properties:
At least assuming classical logic, these properties suffice to characterize uniquely up to equivalence among all categories. Note, however, that the definitions of “locally small” and “(co)complete” presuppose a notion of small and therefore a knowledge of what a set is.
See also Understanding Set?.
Top: topological spaces as objects, continuous functions as morphisms. This has all small limits and colimits, but is not cartesian closed — a problem that may be addressed by introducing a convenient category of topological spaces.
-Vect: vector spaces as objects, linear maps as morphisms. This is actually many different categories, depending on a choice of field ; in fact, it is a special case of when is a field. Since any one of these categories consists of models of a Lawvere theory, it has all small limits and colimits.
A homomorphism between categories is a functor.
This way small categories themselves form a category, the category Cat whose objects are small categories and whose morphisms are functors. This naturally enhances to a 2-category whose 2-morphisms are natural transformations between functors.
An equivalence of categories is an equivalence in Cat, hence a pair of functors going back and forth, that are each others inverse up to natural isomorphism.
Weaker than the notion of a pair of functors exhibiting an equivalence is the notion of a pair of adjoint functors.
Other standard operations on categories include
category
References on category theory:
The concepts of category, functor and natural transformation were introduced in
apparently (see there) taking inspiration from:
The rational for introducing the concept of categories was to introduce the concept of functors, and the reason for introducing functors was to introduce the concept of natural transformations (more specifically natural equivalences) in order to make precise the meaning of “natural” in mathematics and specifically in algebraic topology, concretely for the example case of dual objects:
Freyd 64, page 1:] If topology were publicly defined as the study of families of sets closed under finite intersection and infinite unions a serious disservice would be perpetrated on embryonic students of topology. The mathematical correctness of such a definition reveals nothing about topology except that its basic axioms can be made quite simple. And with category theory we are confronted with the same pedagogical problem. The basic axioms, which we will shortly be forced to give, are much too simple.
A better (albeit not perfect) description of topology is that it is the study of continuous maps; and category theory is likewise better described as the theory of functors. Both descriptions are logically inadmissible as initial definitions, but they more accurately reflect both the present and the historical motivations of the subjects.
It is not too misleading, at least historically, to say that categories are what one must define in order to define natural transformations.
and
Freyd 65, beginning of Part Two]: Category theory is an embodiment of Klein’s dictum that it is the maps that count in mathematics. If the dictum is true, then it is the functors between categories that are important, not the categories. And such is the case. Indeed, the notion of category is best excused as that which is necessary in order to have the notion of functor. But the progression does not stop here. There are maps between functors, and they are called natural transformations. And it was in order to define these that Eilenberg and MacLane first defined functors.
The article by Eilenberg & Maclane 1945 was a clash of ideas from abstract algebra (Mac Lane) and topology/homotopy theory (Eilenberg). It was first rejected on the ground that it had no content. Since then category theory has flourished into almost all areas of mathematics, has found many applications outside mathematics and even attempts to build a foundations of mathematics.
This and much more history is recalled in:
Saunders MacLane: Concepts and Categories in Perspective, in: A Century of Mathematics in America, Part I, Am. Math. Soc. (1988) 323–366. [ISBN 0-8218-0124-4, pdf]
Ralf Krömer: Tool and object: A history and philosophy of category theory, Science Networks. Historical Studies 32 (2007) [doi:10.1007/978-3-7643-7524-9]
see specifically
See also:
Jean-Pierre Marquis: What is Category Theory?, in G. Sica (ed.) What is Category Theory?, Polimetrica (2006) 221-256 pdf, SemanticScholar]
Jean-Pierre Marquis: From a Geometrical Point of View: A Study of the History and Philosophy of Category Theory, Springer (2009) [doi:10.1007/978-1-4020-9384-5]
The definition of categories as internal categories in Set is due to:
For the definition of categories in the foundations of homotopy type theory see at internal category in homotopy type theory.
Monographs on category theory:
Peter Freyd: Abelian Categories – An Introduction to the theory of functors, Harper and Row (1964), Reprints in Theory and Applications of Categories, 3 (2003) [tac:tr2, pdf]
Peter Freyd: The theories of functors and models, in: Proceedings of Symposium on the Theory of Models, North Holland (1965) [doi:10.1016/C2013-0-11897-1]
Barry Mitchell: Theory of categories, Pure and Applied Mathematics 17, Academic Press (1965) [ISBN:978-0-12-499250-4]
Saunders MacLane (notes by Ellis Cooper): Lectures on category theory, Bowdoin Summer School (1969) pdf]
Peter Hilton (ed.): Category Theory, Homology Theory and Their Applications,
vol 1: Lecture Notes in Mathematics 86, Springer (1969) [doi:10.1007/BFb0079380]
vol 2: Lecture Notes in Mathematics 92, Springer (1969) [doi:10.1007/BFb0080761]
vol 3: Lecture Notes in Mathematics 99, Springer (1969) [doi:10.1007/BFb0081959]
Bodo Pareigis: Categories and Functors, Pure and Applied Mathematics 39, Academic Press (1970) [doi:10.5282/ubm/epub.7244, pdf]
Saunders MacLane: Categories for the Working Mathematician, Graduate Texts in Mathematics 5, Springer (1971, second ed. 1998) [doi:10.1007/978-1-4757-4721-8]
John Gray: Formal category theory: adjointness for -categories, Lecture Notes in Mathematics, 391, Springer (1974) [doi:10.1007/BFb0061280]
(formal category theory in the 2-category Cat)
Horst Schubert: Categories, Springer (1972) [doi:10.1007/978-3-642-65364-3]
Nicolae Popescu, Liliana Popescu: Theory of categories, Sijthoff & Noordhoff International Publishers (1979) [doi:10.1007/978-94-009-9550-5]
Ioan Mackenzie James; §1 in: General Topology and Homotopy Theory, Springer (1984) [doi:10.1007/978-1-4613-8283-6]
Robert Geroch: Mathematical Physics, University of Chicago Press (1985) [ISBN:9780226223063, ark:/13960/t10p8v264]
(introduces categories by examples arising in mathematical physics)
Jiří Adámek, Horst Herrlich, George Strecker: Abstract and Concrete Categories – The Joy of Cats, Wiley (1990), reprinted as: Reprints in Theory and Applications of Categories 17 (2006) 1-507 [tac:tr17, book webpage, pdf]
Peter Freyd, Andre Scedrov: Categories, Allegories, Mathematical Library 39, North-Holland (1990) [ISBN 978-0-444-70368-2]
Benjamin Pierce: Basic category theory for computer scientists (1991) [ISBN: 9780262660716]
Francis Borceux: Handbook of Categorical Algebra, Encyclopedia of Mathematics and its Applications 50, Cambridge University Press (1994)
Vol. 1: Basic Category Theory [doi:10.1017/CBO9780511525858]
Vol. 2: Categories and Structures [doi:10.1017/CBO9780511525865]
Vol. 3: Categories of Sheaves [doi:10.1017/CBO9780511525872]
Roy L. Crole: Categories for types, Cambridge University Press (1994) [doi:10.1017/CBO9781139172707]
Michael Barr, Charles Wells: Category theory for computing science, Prentice-Hall International Series in Computer Science (1995); reprinted in: Reprints in Theory and Applications of Categories 22 (2012) 1-538 [tac:tr22, pdf]
(aimed at computer science, see computational trilogy)
Steve Awodey: Category theory, Oxford University Press (2006, 2010) [doi:10.1093/acprof:oso/9780198568612.001.0001, ISBN:9780199237180, pdf]
Masaki Kashiwara, Pierre Schapira, Categories and Sheaves, Grundlehren der Mathematischen Wissenschaften 332, Springer (2006) [doi:10.1007/3-540-27950-4, pdf]
F. William Lawvere, Stephen Schanuel: Conceptual Mathematics: A first introduction to categories, Cambridge University Press (2009P) [pdf, pdf]
Harold Simmons: An Introduction to Category Theory, Cambridge (2011) [ISBN:9781107010871]
David Spivak: Category theory for scientists, MIT Press (2014) [ISBN:9780262028134, arXiv:1302.6946]
Tom Leinster: Basic Category Theory, Cambridge University Press (2014) [doi:10.1017/CBO9781107360068, ]
Emily RiehlL Category Theory in Context, Dover Publications (2017) [ISBN:https://store.doverpublications.com/products/9780486809038, pdf, webpage]
Martin Brandenburg, Einführung in die Kategorientheorie, Springer (2017) [doi:10.1007/978-3-662-53521-9]
Brendan Fong, David Spivak: An invitation to applied category theory (2018) [doi:10.1017/9781108668804, arXiv:1803.05316, web, pdf]
Chris Heunen, Jamie Vicary: Categories for Quantum Theory, Oxford University Press (2019) [ISBN:9780198739616]
(emphasis on monoidal category-theory with an eye towards quantum information via dagger-compact categories)
Marco Grandis: Category Theory and Applications: A Textbook for Beginners, World Scientific (2021) [doi:10.1142/12253]
Paolo Perrone: Starting Category Theory, World Scientific (2024) [doi:10.1142/13670, arXiv:1912.10642]
On category theory in computer science/programming languages (such as for monads in computer science):
Monographs with focus on topos theory:
Peter Johnstone, Topos theory (1977)
Michael Barr, Charles Wells: Toposes, Triples, and Theories, Grundlehren der math. Wissenschaften 278, Springer (1983) [tac:tr12]
(Here “triple” means“ monad”).
Robert Goldblatt: Topoi, the categorial analysis of logic (1984) [GBooks]
Colin McLarty: Elementary Categories, Elementary Toposes, Oxford University Press (1992) [ISBN:9780198514732]
Ieke Moerdijk, Saunders Mac Lane, Sheaves in Geometry and Logic Springer (1992) [doi:10.1007/978-1-4612-0927-0]
Peter Johnstone, Sketches of an Elephant, vol 1-2, Oxford University Press (2002)
Vol 1: [ISBN:9780198534259]
Vol 2: [ISBN:9780198515982]
Tom Leinster, Higher Operads, Higher Categories, London Mathematical Society Lecture Note Series 298, Cambridge University Press (2004) [ISBN:0 521 53215 9, doi:10.1017/cbo9780511525896, arXiv:math/0305049]
Eugenia Cheng, Aaron Lauda: Higher-dimensional categories: an illustrated guide book (2004) [pdf]
Jacob Lurie, Higher Topos Theory, Princeton University Press (2009) [pup:8957, pdf]
Carlos Simpson, Homotopy Theory of Higher Categories, Cambridge University Press (2011) [ISBN:9780521516952, hal:00449826, arXiv:1001.4071]
Towards homotopy theory:
Daniele Turi: Category Theory Lecture Notes (2001) [pdf]
Jaap van Oosten: Basic category theory (2002) [pdf]
Thomas Streicher: Introduction to Category Theory and Categorical Logic (2003) [pdf, pdf]
Bodo Pareigis: Category theory (2004) [dvi, ps, pdf]
Tom Leinster: Notes on basic category theory (2007) [web]
Peter Johnstone: Category Theory , Lecture notes taken by David Mehrle, University of Cambridge (2015) [pdf]
Benedikt Ahrens, Kobe Wullaert: Category Theory for Programming (2022) [arXiv:2209.01259]
The Catsters: Videos on various topics in category theory [YouTube]
Tom LaGatta: Category theory [YouTube]
Discussion of the relation to and motivation from the philosophy of mathematics:
Joachim Lambek: The Influence of Heraclitus on Modern Mathematics, in: Joseph Agassi, Robert S. Cohen (eds.) Scientific Philosophy Today: Essays in Honor of Mario Bunge, , 111-21. Boston: D. Reidel Publishing Co. (1981) 111-121 [doi:10.1007/978-94-009-8462-2_6, pdf]
Colin McLarty: The Last Mathematician from Hilbert’s Göttingen: Saunders Mac Lane as Philosopher of Mathematics,Brit. J. Phil. Sci. (2007) [pdf]
Last revised on April 11, 2026 at 21:28:13. See the history of this page for a list of all contributions to it.