In this section, we will explore further concepts in category theory. First, we shall talk about “maps” between categories.
Let C, D be categories. A (covariant) functor (written as F : C → D) is a map F : Ob(C) → Ob(D), and for any objects X, Y in C, a map F : Mor(X,Y) → Mor(F(X), F(Y)), which respects the identity morphism and composition of morphisms, i.e. if X, Y, Z are objects in C, then:
- F(1X) = 1F(X);
- F(gf) = F(g)F(f) for any f:X→Y and g:Y→Z.
Clearly, functors bring isomorphisms and inverses to isomorphisms and inverses respectively. Also, if F : C → D and G : D → E are both functors of categories, then so is GF : C → E. The functor is an isomorphism if F is bijective on Ob(C) → Ob(D) and Mor(X, Y) → Mor(F(X), F(Y)) for any objects X, Y in C.
One common-occurring functor is that of inclusion:
Let C be a category. A subcategory D is given by subset Ob(D) of Ob(C), and for any objects X, Y in D, a subset MorD(X, Y) of MorC(X, Y), such that
- for any object X in D, 1X lies in MorD(X, X);
- for any f:X→Y and g:Y→Z in D, the composition gf:X→Z is also in D.
D is a full subcategory if MorD(X, Y) = MorC(X, Y) for any objects X, Y of D (i.e. D inherits the full morphism set from C).
- In Set, we have the full subcategory FinSet, whose objects are finite sets and morphisms are functions f : X → Y.
- In FinSet, we have the (non-full) subcategory FinSet0 whose objects are finite sets and morphisms are bijections f : X → Y. Thus, Mor(X, Y) = Ø unless |X|=|Y|.
- Ab is a full subcategory of Grp.
- We have the forgetful functor Grp → Set which takes a group to its underlying set and a group homomorphism to the underlying set function: thus, the functor forgets the group structure.
- We have a functor Grp → Grp which takes G to G × G since any homomorphism G → H induces G × G → H × H.
- We have a functor Set → Ab which takes a set X to (|X| copies of Z), since a function X → Y gives a group homomorphism PX→PY.
- The free-group functor F : Set→ Grp takes X to F(X).
- Abelianisation also gives a functor F : Grp→ Ab since any homomorphism of groups G→ H induces a homomorphism Gab→Hab.
- We do not have a functor Grp → Grp which takes G to its automorphism group Aut(G). The reason is that a group homomorphism G → H does not induce a homomorphism Aut(G) → Aut(H).
- If G and H are abelian (denoted additively), then the set of group homomorphisms G → H, denoted by Hom(G, H), is an abelian group under pointwise addition: (f + f’)(g) := f(g) + f’(g). Upon fixing G, Hom(G, -) is the functor Ab → Ab which takes H to Hom(G, H). Any group homomorphism φ : H → H’ will induce a map Hom(G, H) → Hom(G, H’) by composing with φ (i.e. f:G→H maps to φf:G→H’). You can check that this is a group homomorphism also. We call this the Hom-functor.
Note that if we fix H, then the group homomorphism ψ : G → G’ gives us a group homomorphism in the reverse direction:
Hom(G’, H) → Hom(G, H), f maps to fψ.
This inspires us to consider another class of functors.
Let C, D be categories. A contravariant functor F is a map F : Ob(C) → Ob(D), and for any objects X, Y in C, a map F : Mor(X,Y) → Mor(F(Y), F(X)), which respects the identity morphism and composition of morphisms, i.e. if X, Y, Z are objects in C, then:
- F(1X) = 1F(X);
- F(gf) = F(f)F(g) for any f:X→Y and g:Y→Z.
Thus we see that the functor Hom(-, H) is a contravariant functor.
Conclusion: Hom(-, -) is contravariant in the first component and covariant in the second component!
The Hom-functor is extremely useful in higher algebra, in particular, cohomology theory – but we’re not going into that right now.
Exercise: prove that if X, Y are objects in a category C, we get contravariant functor Mor(X, -) and covariant functor Mor(-, Y), where:
- Mor(X, -) : C → Set, takes Y to the set Mor(X, Y);
- Mor(-, Y) : C → Set (contravariant), takes X to the set Mor(X, Y).