Altanis

1.5Categories

Updated 11 May 2026Chapter (PDF)

[1.5.1]Definition(Category)#

A category C\sf{C} consists of:

  1. A class Obj(C)\Obj(\sf{C}) of objects of the category.

  2. For every A,BObj(C)A, B \in \Obj(\sf{C}), a set HomC(A,B)\Hom_{\sf{C}}(A, B) of morphisms between objects, with the following properties:

    1. Identity. For every AObj(C)A \in \Obj(\sf{C}), there exists a morphism 1AHomC(A,A)1_A \in \Hom_{\sf{C}}(A, A), called the identity on AA.

    2. Composition. For any A,B,CObj(C)A, B, C \in \Obj(\sf{C}), there is a composition operation: morphisms fHomC(A,B)f \in \Hom_{\sf{C}}(A, B) and gHomC(B,C)g \in \Hom_{\sf{C}}(B, C) determine a morphism gfHomC(A,C)gf \in \Hom_{\sf{C}}(A, C).

    3. Associativity. For any A,B,C,DObj(C)A, B, C, D \in \Obj(\sf{C}), morphisms fHomC(A,B)f \in \Hom_{\sf{C}}(A, B), gHomC(B,C)g \in \Hom_{\sf{C}}(B, C), hHomC(C,D)h \in \Hom_{\sf{C}}(C, D) compose associatively. That is, (hg)f=h(gf)(hg)f = h(gf).

    4. Unitality. For any A,BObj(C)A, B \in \Obj(\sf{C}) and any morphism fHomC(A,B)f \in \Hom_{\sf{C}}(A, B), we have that f1A=ff1_A = f and 1Bf=f1_Bf = f.

[1.5.2]Example(Category Set\Set)#

We can define a category Set\Set, whose objects are all possible sets and whose morphisms are functions mapping one set to another.

From here, we provide examples of common categories.

[1.5.3]Example(Category Induced by an Relation on a Set)#

Suppose SS is a set with an relation \sim that is reflexive and transitive. This determines a category whose objects are the elements of SS and whose morphisms are such that whenever a,bSa, b \in S, (a,b)Hom(a,b)(a, b) \in \Hom(a, b) if aba \sim b and Hom(a,b)=\Hom(a, b) = \emptyset otherwise. We verify the axioms as follows:

  1. Identity. Note, for any aAa \in A, aaa \sim a and so 1a=(a,a)Hom(a,a)1_a = (a, a) \in \Hom(a, a).

  2. Composition. Suppose fHom(a,b)f \in \Hom(a, b) and gHom(b,c)g \in \Hom(b, c) for some a,b,cSa, b, c \in S. Then note aba \sim b and bcb \sim c, so by transitivity, aca \sim c, meaning the morphisms f,gf, g determine the morphism gfHom(a,c)gf \in \Hom(a, c).

  3. Associativity. This follows from the transitivity of \sim.

  4. Unitality. This follows trivially from how composition is defined.

Many important categories fall out of this exam. For a trivial one, consider any set SS and == as its relation (which is actually an equivalence relation!). As such, all the morphisms are identity morphisms—such a category is called discrete.

[1.5.4]Example(Category Induced by a Partially-Ordered Set)#

Branching off from previous discussion, we can endow Z\bZ with the \le relation (aba \sim b iff. aba \le b). This induces a category whose objects are integers and whose morphisms are connections nmn \to m for every nmn \le m.

[1.5.5]Example(Slice Category)#

We can create more abstract—and consequently more powerful—categories: one such example is the slice category. Let C\sf{C} be any category with AObj(C)A \in \Obj(\sf{C}). We can define a category C/A\sf{C}/A as follows:

  1. Objects. An object fObj(C/A)f \in \Obj(\sf{C}/A) is a morphism fHomC(B,A)f \in \Hom_{\sf{C}}(B, A) for any BObj(C)B \in \Obj(\sf{C}). That is, the slice category C/A\sf{C}/A comprises all the morphisms going to AA for its objects.

  2. Morphisms. Suppose f1,f2Obj(C/A)f_1, f_2 \in \Obj(\sf{C}/A) such that f1HomC(C1,A)f_1 \in \Hom_{\sf{C}}(C_1, A) and f2HomC(C2,A)f_2 \in \Hom_{\sf{C}}(C_2, A) for C1,C2Obj(C)C_1, C_2 \in \Obj(\sf{C}). Then a morphism σHomC/A(f1,f2)\sigma \in \Hom_{\sf{C}/A}(f_1, f_2) is defined such that f1=f2σf_1 = f_2 \sigma. Graphically, σ\sigma is a morphism in C\sf{C} making the following triangle commute.

Verification of the category axioms is trivially shown by pulling back to C\sf{C}, so they are omitted.

[1.5.6]Example(Coslice Category)#

In a similar, yet opposite, sentiment, we define the coslice category. Let C\sf{C} be any category with AObj(C)A \in \Obj(\sf{C}). We can define a category A/CA/\sf{C} as follows:

  1. Objects. An object fObj(A/C)f \in \Obj(A/\sf{C}) is a morphism fHomC(A,B)f \in \Hom_{\sf{C}}(A, B) for any BObj(C)B \in \Obj(\sf{C}). That is, the coslice category A/CA/\sf{C} comprises all the morphisms that map AA to some other object in the category.

  2. Morphisms. Suppose f1,f2Obj(A/C)f_1, f_2 \in \Obj(A/\sf{C}) such that f1HomC(A,C1)f_1 \in \Hom_{\sf{C}}(A, C_1) and f2HomC(A,C2)f_2 \in \Hom_{\sf{C}}(A, C_2) for C1,C2Obj(C)C_1, C_2 \in \Obj(\sf{C}). Then a morphism σHomA/C(f1,f2)\sigma \in \Hom_{A/\sf{C}}(f_1, f_2) is defined such that σf1=f2\sigma f_1 = f_2. Graphically, σ\sigma is a morphism in C\sf{C} making the following triangle commute.

Note the similarities between the coslice category and the slice category.

[1.5.7]Example(Slice Category of (Z,)(\bZ, \le))#

Consider the set Z\bZ endowed with the relation \le, and let C\sf{C} be the category induced by this relation. Fix 3Z3 \in \bZ, and consider the slice category C/3\sf{C}/3. Then the objects fObj(C/3)f \in \Obj(\sf{C}/3) are morphisms fHomC(n,3)f \in \Hom_{\sf{C}}(n, 3) for any n3n \le 3. The morphisms are maps between two objects, so they take the form σHomC(n,m)\sigma \in \Hom_{\sf{C}}(n, m) for mn3m \le n \le 3.

[1.5.8]Example(Coslice Category Set\Set^*)#

Let C=Set\sf{C} = \Set and let AA be a fixed singleton {}\{*\}. Then the objects of A/CA/\sf{C} are precisely set-functions of form f:{}Sf: \{*\} \to S. Suppose f1:{}Sf_1: \{*\} \to S and f2:{}Tf_2: \{*\} \to T. Then a morphism σ:ST\sigma: S \to T is determined in the sense that σ(f1())=f2()\sigma(f_1(*)) = f_2(*).