Category

A category $$\mathsf{C}$$ consists of:


 * A set of objects $$\operatorname {Ob}(\mathsf{C})$$, and
 * For each pair of objects $$X, Y \in \operatorname {Ob}(\mathsf{C})$$ a set of morphisms (or maps) $$\operatorname{Hom}_{\mathsf{C}}(X, Y)$$, and
 * For each triple of objects $$X, Y, Z \in \operatorname {Ob}(\mathsf{C})$$ an composition operator $$\circ : \operatorname{Hom}_{\mathsf{C}}(Y, Z) \times \operatorname{Hom}_{\mathsf{C}}(X, Y) \to \operatorname{Hom}_{\mathsf{C}}(X, Z)$$

such that the composition is an associative operator with identities.

Before stating these conditions formally, let's first define the notations $$f : X \to Y$$ and $$X \xrightarrow{f} Y$$ for the condition $$f \in \operatorname{Hom}_{\mathsf{C}}(X, Y)$$.

Now we can write the conditions like so:

For any objects $$X, Y, Z, W \in \operatorname{Ob}(\mathsf{C})$$ and morphisms $$W \xrightarrow{h} X \xrightarrow{g} Y \xrightarrow{f} Z$$ we have


 * (Identity) There exists $$1_X : X \to X$$ such that $$g \circ 1_X = g$$ and $$1_X \circ h = h$$.
 * (Associativity) We have $$(f \circ g) \circ h = f \circ (g \circ h)$$.

Examples

 * The category $$\mathsf{Set}$$ whose objects are sets, whose morphisms are continuous functions, and whose composition operator is composition of functions.
 * A concrete category
 * The category $$\mathsf{Top}$$ of topological spaces and continuous maps.
 * The category $$\mathsf{CRing}$$ of commutative rings with identity and ring homomorphisms.
 * A poset category
 * The category of open sets of a topological space