Definition:Category

Definition
A category is an interpretation of the metacategory axioms within set theory.

Universal Definition
A major success of category theory is unification of certain theorems for which analogous results are true for many different algebraic structures.

For example the First Isomorphism Theorem has analogues for structures such as groups, rings, modules etc.

So to use categorical (mathematical definition: pertaining to categories) ideas to prove, say, the first isomorphism theorem for all groups one would like to consider the set of all groups.

More generally, for a property $P$ of sets, we come to consider the subset


 * $\displaystyle \left\{ X : P(X) \right\}$

of the set of all sets.

This is a problem of comprehension, and cannot be allowed in such generality without leading to paradoxes (see Russell's Paradox).

The Zermelo-Fraenkel axioms of set theory allow a restricted comprehension principle.

In the universal definition of a category, we escape this problem by asserting the existence of a Universe $\mathbb U$ of sets with the properties:
 * $u \in \mathbb U$ and $x \in u$ implies that $x \in \mathbb U$
 * $u,v \in \mathbb U$ implies that $\{u,v\} \in \mathbb U$ and the ordered pair $\left\langle u, v\right\rangle \in \mathbb U$
 * $u \in \mathbb U$ implies that the power set $\mathcal P \in \mathbb U$
 * The set of finite ordinals $\omega \in \mathbb U$
 * If $u \in \mathbb U$, $v \subseteq \mathbb U$, and $f:u \to v$ is a surjective function, then $v \in \mathbb U$

Grothendieck proposed the further assertion that for every set $x$ there exists a universe containing $x$.

We consider mathematics to be "carried out" in $\mathbb U$, and the above axioms ensure that we remain within $\mathbb U$.

For a universe $\mathbb U$, we say that an algebraic structure $x$ is small if it's underlying set is an element of $\mathbb U$.

In this setting, a category $\mathcal C$ consists of


 * A set of objects denoted $\mathcal C_0$ or $\operatorname{ob}\mathcal C$


 * A set of morphisms or arrows or maps denoted $\mathcal C_1$ or $\operatorname{mor}\mathcal C$ or or $\operatorname{Hom}\mathcal C$

satisfying the following properties:


 * To each arrow $f \in \operatorname{mor}\mathcal C$ is associated a domain $X = \operatorname{dom} (f) \in \operatorname{ob}\mathcal C$ and a codomain $Y = \operatorname{cod}(f) \in \operatorname{ob}\mathcal C$, written $f:X \to Y$ or $X \stackrel{ f }{\longrightarrow} Y$


 * For every two arrows $f$ and $g$ such that $\operatorname{cod}(f)=\operatorname{dom}(g)$, the composition $g \circ f$ or $gf$ is a morphism of $\mathcal C$ with domain $\operatorname{dom}(f)$ and codomain $\operatorname{cod}(g)$


 * Composition is associative, that is, given $f : X \to Y$, $g: Y \to Z$, $h: Z \to W$, $f\circ(g\circ h)=(f\circ g)\circ h$.


 * For each $X \in \operatorname{ob}\mathcal C$ there exists an identity morphism $\operatorname{id}_X$ such that for every $Y \in \operatorname{ob}\mathcal C$ and $f : X\to Y$, $g: Y\to X$ we have $f\circ\operatorname{id}_X = f$, $\operatorname{id}_X \circ g = g$.

The collection of morphisms between two objects $X$ and $Y$ of $\mathcal C$ form a set $\operatorname{Hom}_{\mathcal C}(X, Y)$ or just $\operatorname{Hom}(X, Y)$, called the hom-class or hom-set of morphisms $X \to Y$.

Definition Using Classes
If for every $X,Y \in \operatorname{ob}\mathcal C$, $\operatorname{Hom}(X,Y)$ is a set we say that $\mathcal C$ is locally small.

Note that while a class can be thought of as similar to a set, a major success of category theory is the unification of many properties of algebraic structures.

This means that if one formally the class of objects as a set, one comes to consider the "set of all sets", which is not well defined (is the set of all sets an element of itself? see Russell's Paradox).

One way to rigorously introduce the notion of a class is to use the Godel-Bernays axioms of set theory, which recognise classes at an axiomatic level, and are essentially equivalent to the standard Zermelo-Fraenkel axioms (that is, the same results can be proved from both).

Examples

 * The empty category with no objects and no arrows is trivially a category, often written $\mathbf 0$


 * The category with a single object $X$ with $\operatorname{id}_X$ the only morphism also satisfies the axioms, and is often denoted $\mathbf 1$