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,B∈Obj(C)A, B \in \Obj(\sf{C}), a set Hom⁡C(A,B)\Hom_{\sf{C}}(A, B) of morphisms between objects, with the following properties:

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

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

    3. Associativity. For any A,B,C,D∈Obj(C)A, B, C, D \in \Obj(\sf{C}), morphisms f∈Hom⁡C(A,B)f \in \Hom_{\sf{C}}(A, B), g∈Hom⁡C(B,C)g \in \Hom_{\sf{C}}(B, C), h∈Hom⁡C(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,B∈Obj(C)A, B \in \Obj(\sf{C}) and any morphism f∈Hom⁡C(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,b∈Sa, b \in S, (a,b)∈Hom⁡(a,b)(a, b) \in \Hom(a, b) if a∼ba \sim b and Hom⁡(a,b)=∅\Hom(a, b) = \emptyset otherwise. We verify the axioms as follows:

  1. Identity. Note, for any a∈Aa \in A, a∼aa \sim a and so 1a=(a,a)∈Hom⁡(a,a)1_a = (a, a) \in \Hom(a, a).

  2. Composition. Suppose f∈Hom⁡(a,b)f \in \Hom(a, b) and g∈Hom⁡(b,c)g \in \Hom(b, c) for some a,b,c∈Sa, b, c \in S. Then note a∼ba \sim b and b∼cb \sim c, so by transitivity, a∼ca \sim c, meaning the morphisms f,gf, g determine the morphism gf∈Hom⁡(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 (a∼ba \sim b iff. a≤ba \le b). This induces a category whose objects are integers and whose morphisms are connections n→mn \to m for every n≤mn \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 A∈Obj(C)A \in \Obj(\sf{C}). We can define a category C/A\sf{C}/A as follows:

  1. Objects. An object f∈Obj(C/A)f \in \Obj(\sf{C}/A) is a morphism f∈Hom⁡C(B,A)f \in \Hom_{\sf{C}}(B, A) for any B∈Obj(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,f2∈Obj(C/A)f_1, f_2 \in \Obj(\sf{C}/A) such that f1∈Hom⁡C(C1,A)f_1 \in \Hom_{\sf{C}}(C_1, A) and f2∈Hom⁡C(C2,A)f_2 \in \Hom_{\sf{C}}(C_2, A) for C1,C2∈Obj(C)C_1, C_2 \in \Obj(\sf{C}). Then a morphism σ∈Hom⁡C/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 A∈Obj(C)A \in \Obj(\sf{C}). We can define a category A/CA/\sf{C} as follows:

  1. Objects. An object f∈Obj(A/C)f \in \Obj(A/\sf{C}) is a morphism f∈Hom⁡C(A,B)f \in \Hom_{\sf{C}}(A, B) for any B∈Obj(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,f2∈Obj(A/C)f_1, f_2 \in \Obj(A/\sf{C}) such that f1∈Hom⁡C(A,C1)f_1 \in \Hom_{\sf{C}}(A, C_1) and f2∈Hom⁡C(A,C2)f_2 \in \Hom_{\sf{C}}(A, C_2) for C1,C2∈Obj(C)C_1, C_2 \in \Obj(\sf{C}). Then a morphism σ∈Hom⁡A/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 3∈Z3 \in \bZ, and consider the slice category C/3\sf{C}/3. Then the objects f∈Obj(C/3)f \in \Obj(\sf{C}/3) are morphisms f∈Hom⁡C(n,3)f \in \Hom_{\sf{C}}(n, 3) for any n≤3n \le 3. The morphisms are maps between two objects, so they take the form σ∈Hom⁡C(n,m)\sigma \in \Hom_{\sf{C}}(n, m) for m≤n≤3m \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 σ:S→T\sigma: S \to T is determined in the sense that σ(f1(∗))=f2(∗)\sigma(f_1(*)) = f_2(*).