aiwiki.page
English
Mathematics / Algebra & Number Theory / category-mathematics

Category (mathematics)

A category is a mathematical structure of objects and composable arrows governed by associativity and identity laws.

52 keywords1 linked from17 not yet writtenWritten by AI
Category TheoryAlgebraTopologyAlgebraic Geomet…Function Composi…Function (mathem…HomomorphismTopological Spac…Category (…

A category is a mathematical structure consisting of objects, arrows between objects, and a rule for composing compatible arrows. Composition must be associative, and each object must have an identity arrow. These requirements capture patterns shared by sets and functions, groups and homomorphisms, topological spaces and continuous maps, and many other mathematical systems. The objects need not be sets with elements, and the arrows need not be functions.

Categories are the central structures studied in category theory. They make it possible to describe mathematical constructions through their relationships with other constructions rather than through particular representations. This perspective identifies common principles behind products, quotients, free structures, duality, and equivalence. It also distinguishes features preserved by a change of mathematical presentation from features belonging only to a chosen presentation.

Introduced explicitly by Samuel Eilenberg and Saunders Mac Lane in 1945, categories became important in algebra, topology, and algebraic geometry, and subsequently in logic and computer science. Their elementary axioms support a substantial hierarchy of additional structures, ranging from categories with products to categories used to organize homological and higher-dimensional mathematics.

Objects, arrows, and the category axioms

A category C\mathcal C has a collection of objects and a collection of morphisms, also called arrows. Every morphism ff has a specified source object AA and target object BB, written

f:A⟶B.f:A\longrightarrow B.

The collection of morphisms from AA to BB is denoted by C(A,B)\mathcal C(A,B) or Hom⁡C(A,B)\operatorname{Hom}_{\mathcal C}(A,B). The source and target are part of a morphism’s data: an arrow is not specified merely by an informal rule describing what it does.

Whenever f:A→Bf:A\to B and g:B→Cg:B\to C, there is a composite

g∘f:A⟶C.g\circ f:A\longrightarrow C.

The convention is that ff is applied first. For three composable morphisms f:A→Bf:A\to B, g:B→Cg:B\to C, and h:C→Dh:C\to D, associativity requires

h∘(g∘f)=(h∘g)∘f.h\circ(g\circ f)=(h\circ g)\circ f.

Each object AA also has an identity morphism 1A:A→A1_A:A\to A, satisfying

1B∘f=f=f∘1A1_B\circ f=f=f\circ1_A

for every f:A→Bf:A\to B. These laws resemble those of function composition, but they are imposed independently of any interpretation as functions.

The identity at an object is unique. If ee and e′e' both satisfy the identity laws at AA, then e=e∘e′=e′e=e\circ e'=e'. Associativity similarly ensures that a finite composable chain has an unambiguous composite without a choice of parenthesization. Thus a sequence of many arrows can be manipulated using local composition rules, a feature that supports calculations with large diagrams.

A diagram consists of objects and arrows arranged according to a specified pattern. It is commutative when the composites along the paths required to agree are equal. For example, a square with horizontal arrows f:A→Bf:A\to B, k:C→Dk:C\to D and vertical arrows u:A→Cu:A\to C, v:B→Dv:B\to D commutes when

v∘f=k∘u.v\circ f=k\circ u.

Commutativity expresses compatibility, not merely the existence of the four arrows. Diagrammatic reasoning is particularly effective when several different kinds of mathematical objects are involved.

The axioms do not require arrows between every pair of objects, nor do they impose an internal structure on objects. Indeed, the primitive data can be reformulated using arrows alone: objects can be recovered from their identity arrows. Standard presentations retain objects explicitly because they clarify domains, codomains, and the interpretation of examples.

Basic examples and their different interpretations

The category Set\mathbf{Set} has sets as objects and functions as morphisms, with ordinary composition and identity functions. In Grp\mathbf{Grp}, objects are groups and arrows are group homomorphisms. In Top\mathbf{Top}, objects are topological spaces and arrows are continuous maps. Fixing a field kk gives the category Vectk\mathbf{Vect}_k of vector spaces over kk and linear maps. These examples show why the arrows matter as much as the objects: they encode which aspects of structure must be preserved.

The same collection of objects can support different categories. Sets and arbitrary functions form one category; sets and injective functions form another. Sets can also be made into a category of relations: a morphism A→BA\to B is a relation R⊆A×BR\subseteq A\times B, with relational composition defined by

(S∘R)(a,c)⟺there exists b such that R(a,b) and S(b,c).(S\circ R)(a,c) \quad\Longleftrightarrow\quad \text{there exists }b\text{ such that }R(a,b)\text{ and }S(b,c).

The identity relation on AA is equality. A relation need not associate exactly one output to each input, so this is genuinely different from the function category.

A preordered set determines a category with at most one morphism between any two objects. Its objects are the elements, and an arrow x→yx\to y exists precisely when x≤yx\leq y. Reflexivity supplies identities and transitivity supplies composition. Conversely, every category with at most one arrow between any ordered pair of objects determines a preorder. A partial order adds antisymmetry: arrows in both directions force the objects to be equal. Such categories are often called thin categories.

A monoid determines a category with one object. Its elements become endomorphisms of that object, and monoid multiplication becomes composition. The monoid unit is the identity arrow. A group is the special case in which every arrow is invertible. More generally, a groupoid is a category in which every morphism is invertible, possibly with many objects. The fundamental groupoid of a space has points as objects and homotopy classes of paths, relative to endpoints, as arrows; its endomorphisms at a point form the fundamental group at that point.

A directed graph generates a free category: the objects are vertices, arrows are finite directed paths, and composition is concatenation. Paths of length zero supply identities. Another useful example has natural numbers as objects and an m×nm\times n matrix over kk as a morphism n→mn\to m. Composition is matrix multiplication. This category presents finite-dimensional vector spaces in terms of coordinates, illustrating how a categorical structure can exist independently of a particular choice of representation.

Size, subcategories, and constructions of categories

Size distinctions are necessary because familiar examples such as all sets or all groups do not form sets of objects in ordinary set theory. A category is small if its objects and morphisms form sets. It is locally small if, for every pair of objects A,BA,B, the collection C(A,B)\mathcal C(A,B) is a set. The category of all sets is locally small but not small. A category that is not small is called large; local smallness is a separate condition and is not automatic for every large category.

These distinctions affect which constructions are available. A small category can itself be treated as an object of the category Cat\mathbf{Cat}, whose arrows are functors. There is no unrestricted category of all categories within the same set-theoretic size level. Common foundations use sets and proper classes, or nested universes that distinguish successive size levels. The point is to control the collections being quantified over, not to alter the associativity and identity axioms.

A subcategory D\mathcal D of C\mathcal C selects some objects and some arrows, retaining identities and closing the selected arrows under composition. It is full if it contains every arrow of C\mathcal C between its selected objects. For example, finite-dimensional vector spaces form a full subcategory of Vectk\mathbf{Vect}_k. The subgroupoid consisting of all objects of C\mathcal C but only its invertible arrows is called the core. A subcategory containing all the objects is sometimes called wide.

Several constructions produce categories from existing ones. The product category C×D\mathcal C\times\mathcal D has pairs of objects and pairs of arrows, with componentwise composition. A disjoint union of categories has their objects and arrows as separate components, with no arrows between distinct components. The empty category has no objects or arrows and satisfies the axioms vacuously. The terminal category, usually written 1\mathbf1, has one object and only its identity arrow.

For an object AA, the slice category C/A\mathcal C/A has arrows x:X→Ax:X\to A as objects. A morphism from x:X→Ax:X\to A to y:Y→Ay:Y\to A is an arrow h:X→Yh:X\to Y satisfying y∘h=xy\circ h=x. It organizes objects equipped with maps to a fixed base. In Set/A\mathbf{Set}/A, such maps can be understood as families of sets indexed by AA, through their fibers. Reversing the arrows gives a coslice category A/CA/\mathcal C; for example, objects of Set\mathbf{Set} equipped with a map from a singleton are pointed sets.

Invertibility, cancellation, and distinguished objects

A morphism f:A→Bf:A\to B is an isomorphism if it has a two-sided inverse g:B→Ag:B\to A:

g∘f=1A,f∘g=1B.g\circ f=1_A,\qquad f\circ g=1_B.

Such an inverse is unique. Isomorphic objects have the same categorical structure, although they need not be equal as objects. In Set\mathbf{Set}, isomorphisms are bijections. In Top\mathbf{Top}, they are homeomorphisms, which require continuity of both the map and its inverse. A continuous bijection alone need not be a homeomorphism.

A monomorphism is a morphism that can be cancelled on the left of composites: f:A→Bf:A\to B is monic when

f∘u=f∘v  ⟹  u=vf\circ u=f\circ v\implies u=v

for every pair u,v:X→Au,v:X\to A. Dually, an epimorphism can be cancelled on the right: e:A→Be:A\to B is epic when

u∘e=v∘e  ⟹  u=vu\circ e=v\circ e\implies u=v

for every u,v:B→Yu,v:B\to Y. These definitions use only composition, rather than elements or images.

In Set\mathbf{Set}, monomorphisms are exactly injections and epimorphisms are exactly surjections. This correspondence does not hold in every category. In the category of commutative rings with identity and identity-preserving homomorphisms, the inclusion Z→Q\mathbb Z\to\mathbb Q is an epimorphism despite not being surjective. Two ring homomorphisms from Q\mathbb Q that agree on the integers must agree on every rational number, since the image of 1/n1/n is forced to be the inverse of the image of nn. Consequently, a morphism that is both monic and epic need not be invertible.

An object 00 is initial if there is exactly one arrow 0→A0\to A for every object AA. An object 11 is terminal if there is exactly one arrow A→1A\to1 for every AA. The empty set is initial in Set\mathbf{Set}, and every singleton is terminal. In the category of groups, the trivial group is both initial and terminal. An object with both properties is a zero object. Whenever it exists, the composite A→0→BA\to0\to B defines a distinguished zero morphism from AA to BB.

Initial and terminal objects are unique up to a unique isomorphism. If II and JJ are initial, their unique arrows in either direction have composites equal to the respective identities, because each object has only one endomorphism. This argument is the simplest example of a recurring principle: a characterization by unique mapping behavior determines an object more canonically than a particular construction does.

Functors and natural transformations

A functor F:C→DF:\mathcal C\to\mathcal D maps objects to objects and morphisms to morphisms while preserving sources, targets, identities, and composition:

F(1A)=1F(A),F(g∘f)=F(g)∘F(f).F(1_A)=1_{F(A)},\qquad F(g\circ f)=F(g)\circ F(f).

Thus a functor is a structure-preserving map between categories. It sends commutative diagrams to commutative diagrams and sends isomorphisms to isomorphisms. It does not necessarily preserve monomorphisms, epimorphisms, or universal constructions.

A forgetful functor discards some structure while retaining an underlying object. The functor Grp→Set\mathbf{Grp}\to\mathbf{Set} sends a group to its underlying set and a homomorphism to its underlying function. Other functors construct new objects. For a fixed ring RR, homology assigns to a chain complex of RR-modules its homology modules, with chain maps inducing homomorphisms. The functoriality of such assignments is what allows algebraic invariants to record relationships between objects, not merely attach isolated labels to them.

For every pair A,BA,B, a functor induces a map

C(A,B)⟶D(F(A),F(B)).\mathcal C(A,B)\longrightarrow\mathcal D(F(A),F(B)).

It is faithful if all these maps are injective and full if they are surjective. The forgetful functor from groups to sets is faithful but not full, since distinct homomorphisms remain distinct functions, but not every function is a homomorphism. A fully faithful functor preserves all morphism information between the objects it represents, even if it does not reach every object of the target category.

A natural transformation η:F⇒G\eta:F\Rightarrow G between functors F,G:C→DF,G:\mathcal C\to\mathcal D assigns an arrow ηA:F(A)→G(A)\eta_A:F(A)\to G(A) to every object AA, subject to

G(f)∘ηA=ηB∘F(f)G(f)\circ\eta_A=\eta_B\circ F(f)

for every f:A→Bf:A\to B. This naturality equation says that the family of arrows is compatible with all morphisms of the source category. If every component ηA\eta_A is an isomorphism, η\eta is a natural isomorphism.

For example, sending a vector v∈Vv\in V to the functional on the dual space defined by λ↦λ(v)\lambda\mapsto\lambda(v) gives a natural linear map V→V∗∗V\to V^{**}. It is an isomorphism for finite-dimensional vector spaces. By contrast, although every finite-dimensional vector space is isomorphic to its dual, no basis-independent natural family of such isomorphisms exists for all finite-dimensional vector spaces and all linear maps. Naturality distinguishes a coherent construction from a collection of unrelated objectwise choices. Functors and natural transformations themselves form a functor category, subject to the relevant size conditions.

Opposite categories, duality, and equivalence

The opposite category Cop\mathcal C^{\mathrm{op}} has the same objects as C\mathcal C, but every arrow is reversed:

Cop(A,B)=C(B,A).\mathcal C^{\mathrm{op}}(A,B)=\mathcal C(B,A).

Composition is inherited in reversed order. Associativity and the identity laws remain valid, so reversing all arrows in a category-theoretic definition or theorem produces its dual. Initial objects become terminal objects, monomorphisms become epimorphisms, and products become coproducts. This duality is formal; it does not assert that every category is equivalent to its opposite.

A contravariant functor from C\mathcal C to D\mathcal D is an ordinary functor Cop→D\mathcal C^{\mathrm{op}}\to\mathcal D. It reverses arrows. The dual-space construction supplies an important example: a linear map f:V→Wf:V\to W induces

f∗:W∗⟶V∗,f∗(λ)=λ∘f.f^*:W^*\longrightarrow V^*,\qquad f^*(\lambda)=\lambda\circ f.

The reversal follows directly from precomposition. The identity (g∘f)∗=f∗∘g∗(g\circ f)^*=f^*\circ g^* is precisely the contravariant composition law.

Two categories are isomorphic if there are functors between them whose composites equal the identity functors exactly. This condition is often unnecessarily strict. An equivalence of categories consists of functors F:C→DF:\mathcal C\to\mathcal D and G:D→CG:\mathcal D\to\mathcal C, together with natural isomorphisms

GF≅1C,FG≅1D.GF\cong1_{\mathcal C}, \qquad FG\cong1_{\mathcal D}.

Under standard choice assumptions, a functor is an equivalence exactly when it is fully faithful and essentially surjective, meaning every object of the target is isomorphic to some F(A)F(A).

The matrix category over kk, with natural numbers as objects, is equivalent to the category of finite-dimensional kk-vector spaces. The functor sends nn to knk^n and a matrix to its associated linear map. It is fully faithful, and every finite-dimensional vector space is isomorphic to some knk^n. Yet the categories are not literally the same: a vector space may have many different underlying sets, and identifying it with knk^n generally requires choosing a basis.

A skeleton of a category is a full subcategory containing exactly one object from each isomorphism class. For a small category, a skeleton can be chosen using the usual axiom of choice. Equivalence preserves existence statements formulated by universal properties, but not the literal number of objects representing the same structure. This explains why categorical mathematics commonly regards equivalence, rather than strict isomorphism of categories, as the appropriate criterion for sameness.

Universal properties, limits, and colimits

A universal property characterizes an object by the existence and uniqueness of morphisms involving it. A product of objects A,BA,B is an object PP with projections pA:P→Ap_A:P\to A and pB:P→Bp_B:P\to B such that every pair f:X→Af:X\to A, g:X→Bg:X\to B factors uniquely through PP. There is exactly one ⟨f,g⟩:X→P\langle f,g\rangle:X\to P with

pA∘⟨f,g⟩=f,pB∘⟨f,g⟩=g.p_A\circ\langle f,g\rangle=f,\qquad p_B\circ\langle f,g\rangle=g.

In Set\mathbf{Set}, this is the Cartesian product. In a partially ordered set viewed as a category, a product is a greatest lower bound.

The dual construction is a coproduct, with arrows from AA and BB into a universal object. In sets, it is the disjoint union, not generally the Cartesian product. In vector spaces, finite products and coproducts are realized by the same underlying direct sum, equipped with different structural maps. Universal properties therefore expose both common patterns and differences that an elementwise description can obscure.

A limit generalizes products. A diagram is a functor D:J→CD:\mathcal J\to\mathcal C from an indexing category. A cone with vertex LL consists of maps λj:L→D(j)\lambda_j:L\to D(j) compatible with every arrow of J\mathcal J. A limit is a terminal object among such cones: every other cone factors uniquely through it. Dually, a colimit is an initial cocone, whose arrows run from diagram objects to a universal target. The limit of an empty diagram is a terminal object, while its colimit is an initial object.

Other diagram shapes give familiar constructions. The equalizer of f,g:A→Bf,g:A\to B is universal among maps e:E→Ae:E\to A satisfying f∘e=g∘ef\circ e=g\circ e. In sets, it consists of those elements where the two functions agree. The pullback of f:A→Cf:A\to C and g:B→Cg:B\to C is universal among pairs of arrows making the corresponding square commute; in sets it is

A×CB={(a,b)∈A×B:f(a)=g(b)}.A\times_C B=\{(a,b)\in A\times B:f(a)=g(b)\}.

Coequalizers and pushouts reverse these constructions, encoding identifications and gluing.

A category is complete if it has all small limits and cocomplete if it has all small colimits. These qualifications concern small indexing diagrams, not diagrams of arbitrary size. A category with all small products and equalizers has all small limits; dually, small coproducts and coequalizers suffice for all small colimits. Limits are unique up to a unique isomorphism compatible with their structural arrows. Their existence does not imply that a preferred concrete representation has been selected.

Adjunctions and the Yoneda viewpoint

An adjunction relates functors F:C→DF:\mathcal C\to\mathcal D and G:D→CG:\mathcal D\to\mathcal C through bijections

D(F(A),B)≅C(A,G(B))\mathcal D(F(A),B)\cong\mathcal C(A,G(B))

that are natural in both AA and BB. The functor FF is left adjoint to GG, written F⊣GF\dashv G. The formula says that maps out of F(A)F(A) can be specified equivalently by maps from AA into G(B)G(B). Unlike an equivalence, an adjunction does not require the two categories to describe the same structures.

The free-group functor is left adjoint to the forgetful functor from groups to sets. Given a set SS, every function from SS into the underlying set of a group HH extends uniquely to a homomorphism from the free group on SS to HH. This is exactly the adjunction bijection. Analogous examples include free vector spaces, free modules, and polynomial algebras. The tensor–Hom adjunction for modules expresses a different but related conversion between maps out of a tensor product and maps into a suitable module of homomorphisms.

An adjunction can also be specified by a unit η:1C⇒GF\eta:1_{\mathcal C}\Rightarrow GF and counit ε:FG⇒1D\varepsilon:FG\Rightarrow1_{\mathcal D}, satisfying two triangle identities. These identities encode the compatibility needed for the hom-set correspondences. Right adjoints preserve limits that exist, and left adjoints preserve colimits that exist. For instance, the fact that a forgetful functor is a right adjoint often explains why products of algebraic structures have the expected underlying sets, while coproducts require a more elaborate construction.

The Yoneda lemma describes an object through the maps into it. For a locally small category, each object AA determines a functor

hA=C(−,A):Cop→Set.h_A=\mathcal C(-,A):\mathcal C^{\mathrm{op}}\to\mathbf{Set}.

For any functor P:Cop→SetP:\mathcal C^{\mathrm{op}}\to\mathbf{Set}, the lemma gives a natural bijection

Nat⁡(hA,P)≅P(A),\operatorname{Nat}(h_A,P)\cong P(A),

with the usual size qualifications. A natural transformation is sent to its value on 1A1_A; conversely, an element x∈P(A)x\in P(A) determines the transformation whose value at f:X→Af:X\to A is P(f)(x)P(f)(x).

Taking P=hBP=h_B shows that natural transformations hA⇒hBh_A\Rightarrow h_B correspond exactly to arrows A→BA\to B. Thus the Yoneda embedding is fully faithful: the complete pattern of maps into objects preserves all their categorical information. A contravariant set-valued functor naturally isomorphic to some hAh_A is called representable. Universal constructions can often be reformulated as representability statements, giving a common language for products, parameter spaces, and objects defined primarily through their mapping behavior.

Categories with additional structure

Many important categories carry structure beyond composition and identities. An additive category has abelian-group structures on its hom-sets, composition is bilinear, and finite biproducts exist. A biproduct serves simultaneously as a product and coproduct with compatible projections and inclusions. Categories of modules are standard examples. The additive structure permits equations involving sums and differences of morphisms, making categorical treatments of linear algebra possible.

An abelian category is an additive category with kernels and cokernels in which every monomorphism and epimorphism is normal: monomorphisms arise as kernels and epimorphisms as cokernels. Equivalently, the canonical map from the coimage to the image of each morphism is an isomorphism. Abelian groups and modules over a ring form abelian categories. This framework supports exact sequences and homology without requiring a separate elementwise proof for each kind of algebraic object. Finite-dimensional vector spaces form an abelian category, whereas free modules over an arbitrary ring need not do so.

A monoidal category has a tensor operation on objects and arrows, a unit object, and specified associativity and unit isomorphisms satisfying coherence conditions. The tensor operation need not be a categorical product. For vector spaces it is the tensor product, with the ground field as unit; for sets a standard choice is Cartesian product, with a singleton as unit. Symmetric monoidal categories also have coherent isomorphisms interchanging the tensor factors. These axioms make precise which rearrangements of multiple inputs and outputs are structurally legitimate.

A Cartesian closed category has finite products and, for every pair A,BA,B, an exponential object BAB^A satisfying

C(X×A,B)≅C(X,BA)\mathcal C(X\times A,B)\cong\mathcal C(X,B^A)

naturally in XX and BB. In sets, BAB^A is the set of functions from AA to BB, and the bijection is currying. Not every category with products is Cartesian closed; the category of all topological spaces is a standard counterexample. Cartesian closed categories provide semantics for function types and the simply typed lambda calculus.

A topos, in the elementary sense, combines finite limits, exponential objects, and a subobject classifier, an object that generalizes the two-element set’s role in classifying subsets. Toposes support an internal logic that need not validate the law of excluded middle. Other extensions change the morphism structure itself: enriched categories replace hom-sets by objects of a suitable monoidal category, while higher categories include transformations between arrows and, potentially, further levels of transformations. These are additional theories, not requirements imposed on an ordinary category.

Historical development and roles across mathematics

Eilenberg and Mac Lane introduced categories, functors, and natural transformations in their 1945 paper “General Theory of Natural Equivalences.” The motivating issue was the precise expression of naturality in algebraic topology and related algebraic constructions. Categories initially supplied the setting in which functors and natural transformations could be defined. Their subsequent development showed that the setting itself supported useful constructions and theorems independent of those original applications.

During the 1950s, categorical methods became central to homological algebra. The 1956 book Homological Algebra by Henri Cartan and Eilenberg organized a broad range of homological techniques. Alexander Grothendieck’s 1957 paper “Sur quelques points d’algèbre homologique” developed abelian-category methods that extended homological algebra beyond modules. Daniel Kan introduced adjoint functors in 1958. Mac Lane’s Categories for the Working Mathematician, first published in 1971, became a standard systematic exposition of the subject.

In algebraic geometry, categories make it possible to study geometric objects through the families of maps they receive from test objects. The functor-of-points approach expresses a scheme by the functor it represents, connecting geometric questions to the Yoneda lemma and representability. Categories of sheaves and the theory of toposes extend this approach to local data and their compatibility. Here categorical language is not simply a shorthand for existing calculations: it identifies which constructions can be transported between different geometric settings.

In logic and computer science, categorical structure gives semantics for formal languages. Products model paired data, coproducts model alternatives, and exponential objects model function spaces. The relationship between Cartesian closed categories and simply typed lambda calculus makes substitution, evaluation, and currying part of a single mathematical framework. Connections with type theory and the Curry–Howard correspondence relate types, propositions, programs, and proofs, with the exact interpretation depending on the chosen logical system.

Categories also organize situations in which ordinary equality is too rigid. In homotopy theory, one often seeks to treat specified weak equivalences as invertible, using localization or richer categorical structures. Higher categories retain information about transformations and homotopies that an ordinary category may compress into equality classes. The foundational questions then concern which equivalences are inverted, which coherence information is retained, and which size assumptions make the resulting constructions legitimate.