범주론

Functor

Definition and examples of functors

Posted Updated

This post was machine-translated from the Korean original by Marvin (via Kimi). It may contain errors or awkward phrasing — the Korean original is the source of truth.

Definition and Basic Properties of Functors

If we adopt the philosophy of category theory that every mathematical object we study, together with the morphisms between them, forms a category, then it is natural to consider a category whose objects are themselves categories. To do this, we must first define what a morphism between categories is.

Definition 1 A functor \(F:\mathcal{A}\rightarrow\mathcal{B}\) between two categories \(\mathcal{A},\mathcal{B}\) consists of the following data:

  • For each \(A\in\obj(\mathcal{A})\), an object \(F(A)\in\obj(\mathcal{B})\),
  • For each \(f\in\Hom_\mathcal{A}(A_1,A_2)\), a morphism \(F(f)\in\Hom_\mathcal{B}(F(A_1),F(A_2))\).

These satisfy the following conditions:

  • The image under \(F\) of the composite of two morphisms equals the composite of their images. That is, \(F(g\circ f)=F(g)\circ F(f)\).
  • For any object \(A\in\obj(\mathcal{A})\), we have \(F(\id_A)=\id_{F(A)}\).

For any category \(\mathcal{A}\), the assignment sending each object and each morphism to itself is a functor. We call this the identity functor of \(\mathcal{A}\) and denote it by \(\id_\mathcal{A}\).

It is not difficult to show that the composition of functors is again a functor.

Lemma 2 For any categories \(\mathcal{A},\mathcal{B},\mathcal{C}\) and functors \(F:\mathcal{A}\rightarrow \mathcal{B}\), \(G:\mathcal{B}\rightarrow \mathcal{C}\), define \(G\circ F:\mathcal{A} \rightarrow \mathcal{C}\) by

  • \((G\circ F)(A)=G(F(A))\) for any \(A\in \mathcal{A}\),
  • \((G\circ F)(f)=G(F(f))\) for any \(f\in\Hom_\mathcal{A}(A_1,A_2)\).

Then \(G\circ F\) is a functor.

Proof

It suffices to verify the two conditions required of a functor, and these follow immediately from

\[(G\circ F)(g\circ f)=G(F(g\circ f))=G(F(g)\circ F(f))=G(F(g))\circ G(F(f))=(G\circ F)(g)\circ(G\circ F)(f)\]

and

\[(G\circ F)(\id_A)=G(F(\id_A))=G(\id_{F(A)})=\id_{G(F(A))}=\id_{(G\circ F)(A)}.\]

Examples of Functors

We have seen that any preordered set can be viewed as a category. (§Category, ⁋Example 3) The following example offers a new perspective on this. For a fixed category \(\mathcal{I}\) and any category \(\mathcal{A}\), we call a functor \(F:\mathcal{I}\rightarrow \mathcal{A}\) an \(\mathcal{I}\)-shaped diagram in \(\mathcal{A}\).

Example 3 Consider the set \(I_1=\{a,b,c\}\) with the preorder relation given by \(a\leq b\leq c\). Then the category \(\mathcal{I}_1\) constructed from \((I_1,\leq)\) can be represented by the following diagram:

A functor \(F:\mathcal{I}_1 \rightarrow \mathcal{A}\) now satisfies

\[F(\beta)\circ F(\alpha)=F(\beta\circ\alpha)=F(\gamma).\]

That is, for objects \(F(a),F(b),F(c)\) in \(\mathcal{A}\) and morphisms \(F(\alpha):F(a) \rightarrow F(b)\), \(F(\beta):F(b) \rightarrow F(c)\), \(F(\gamma): F(a) \rightarrow F(c)\) between them, the following diagram

is a commutative triangle (in the sense we have used before). Conversely, any data satisfying this condition arises from a functor \(\mathcal{I}_1 \rightarrow \mathcal{A}\) in this manner.

Similarly, if we impose a preorder relation on the set \(I_2=\{a,b,c,d\}\) by \(a\leq b,c\) and \(b,c\leq d\), then a functor \(\mathcal{I}_2 \rightarrow \mathcal{A}\) becomes a commutative square.

To maintain this intuition, when we regard \(\mathcal{I}\rightarrow \mathcal{A}\) as a diagram, we denote the objects of \(\mathcal{I}\) by \(i,j,k,\dots\).

Example 4 Fix a locally small category \(\mathcal{A}\) and an object \(A\in\obj(\mathcal{A})\). Then assigning to each \(B\in\obj(\mathcal{A})\) the set \(\Hom_\mathcal{A}(A,B)\) defines a functor from \(\mathcal{A}\) to \(\Set\). To verify this, we must assign to each \(f:B \rightarrow B'\) a morphism \(\Hom_\mathcal{A}(A,B)\rightarrow\Hom_\mathcal{A}(A,B')\), which we define by

\[\Hom_\mathcal{A}(A, f):\Hom_\mathcal{A}(A,B)\rightarrow\Hom_\mathcal{A}(A,B');\qquad \phi\mapsto f\circ\phi.\]

Then one can verify that the assignment \(\Hom_\mathcal{A}(A,-)\) given by this data is indeed a functor.

Contravariant Functors

In the same manner as Example 4, we might try to define a functor \(\Hom_\mathcal{A}(-,A)\). However, as can be seen from the following diagram,

\(\Hom_\mathcal{A}(f,A)\) becomes a morphism from \(\Hom_\mathcal{A}(B',A)\) to \(\Hom_\mathcal{A}(B,A)\).

Definition 5 A contravariant functor \(F:\mathcal{A}\rightarrow\mathcal{B}\) between two categories \(\mathcal{A},\mathcal{B}\) consists of the following data:

  • For each \(A\in\obj(\mathcal{A})\), an object \(F(A)\in\obj(\mathcal{B})\),
  • For each \(f\in\Hom_\mathcal{A}(A_1,A_2)\), a morphism \(F(f)\in\Hom_\mathcal{B}(F(A_2),F(A_1))\).

These satisfy the following conditions:

  • The image under \(F\) of the composite of two morphisms in \(\mathcal{A}\) equals the composite of their images in reversed order. That is, \(F(g\circ f)=F(f)\circ F(g)\).
  • For any object \(A\in\obj(\mathcal{A})\), we have \(F(\id_A)=\id_{F(A)}\).

Because of this definition, the functor in Definition 1 is sometimes more precisely called a covariant functor. However, when we say “functor” we usually mean a covariant functor, because by the following definition every contravariant functor can be viewed as a covariant functor of a special kind.

Definition 6 Let a category \(\mathcal{A}\) be given. The opposite category \(\mathcal{A}^\op\) of \(\mathcal{A}\) is defined by the following data:

  • \(\obj(\mathcal{A}^\op)=\obj(\mathcal{A})\).
  • For any \(A,B\in \obj(\mathcal{A}^\op)=\obj(\mathcal{A})\), we have \(\Hom_{\mathcal{A}^\op}(A,B)=\Hom_{\mathcal{A}}(B,A)\).
  • For any \(A\in\obj(\mathcal{A})\), the identity \(\id_A\) in \(\mathcal{A}^\op\) is the same as the identity in \(\mathcal{A}\).
  • For any \(f\in\Hom_{\mathcal{A}^\op}(A,B)\) and \(g\in\Hom_{\mathcal{A}^\op}(B,C)\), their composite \(g\circ^\op f\) is defined by viewing \(f,g\) as morphisms in \(\mathcal{A}\) and composing them there.
    That is, for \(f\in \Hom_\mathcal{A}(B,A)\) and \(g\in\Hom_\mathcal{A}(C,B)\), the composite \(g\circ^\op f\) of \(f\) and \(g\) in \(\mathcal{A}^\op\) is defined as

    \[g\circ^\op f= f\circ g\in\Hom_{\mathcal{A}}(C,A)=\Hom_{\mathcal{A}^\op}(A,C).\]

Under this definition, Definition 5 can be restated as follows: a contravariant functor from \(\mathcal{A}\) to \(\mathcal{B}\) is simply a (covariant) functor \(\mathcal{A}^\op \rightarrow \mathcal{B}\).

Bifunctor

The following definition consists only of notions we already know, but giving it a name is occasionally useful.

Definition 7 For categories \(\mathcal{A}, \mathcal{B}, \mathcal{C}\), we call a functor \(\mathcal{A}\times \mathcal{B}\rightarrow \mathcal{C}\) a bifunctor.

Example 8 For any (locally small) category \(\mathcal{A}\), the map \(\Hom_\mathcal{A}(-,-): \mathcal{A}^\op\times \mathcal{A}\rightarrow \Set\) is a bifunctor.

To verify this, it suffices to check functoriality. By definition, a morphism in \(\mathcal{A}^\op\times \mathcal{A}\) is of the form

\[(g,h):(A_1,A_2) \rightarrow (A_1',A_2');\qquad g\in \Hom_{\mathcal{A}^\op}(A_1,A_1'),\quad h\in \Hom_\mathcal{A}(A_2,A_2')\]

and through the bifunctor \(\Hom_\mathcal{A}(-,-)\) this morphism is sent to the morphism

\[\Hom_\mathcal{A}(g,h):\Hom_\mathcal{A}(A_1,A_2) \rightarrow \Hom_\mathcal{A}(A_1',A_2');\qquad f\mapsto h\circ f\circ g.\]

Here we have viewed the morphism \(g\) in \(\mathcal{A}^\op\) as a morphism \(A_1'\rightarrow A_1\) in \(\mathcal{A}\).

The Category \(\Cat\)

Through this we can define the category of categories. However, to avoid the problem related to Russell’s paradox mentioned earlier, we generally consider the category of all small categories or the category of all locally small categories, rather than the category of all categories.

Definition 9 The category \(\Cat\) is defined by the following data:

  • The objects of \(\Cat\) are small categories.
  • For any \(\mathcal{A},\mathcal{B}\in\obj(\Cat)\), \(\Hom_\Cat(\mathcal{A},\mathcal{B})\) is the collection of functors from \(\mathcal{A}\) to \(\mathcal{B}\).
  • Composition of morphisms in \(\Cat\) is given by functor composition as in Lemma 2.
  • For any \(\mathcal{A}\in\obj(\Cat)\), the identity at \(\mathcal{A}\) is the identity functor \(\id_\mathcal{A}\).

Similarly, the category \(\CAT\) is defined by the following data:

  • The objects of \(\CAT\) are locally small categories.
  • For any \(\mathcal{A},\mathcal{B}\in\obj(\CAT)\), \(\Hom_\CAT(\mathcal{A},\mathcal{B})\) is the collection of functors from \(\mathcal{A}\) to \(\mathcal{B}\).
  • Composition of morphisms in \(\CAT\) is given by functor composition as in Lemma 2.
  • For any \(\mathcal{A}\in\obj(\CAT)\), the identity at \(\mathcal{A}\) is the identity functor \(\id_\mathcal{A}\).

We can verify that these data indeed form categories. On the other hand, since the collection of functors between two small categories is a set, \(\Cat\) is locally small, but \(\CAT\) is not. Indeed, let \(\mathcal{A}\) be a category whose collection of objects is not a set but which has no morphisms other than identities, and let \(\mathcal{B}\) be a category with two objects and no morphisms other than identities; both are locally small, but functors from \(\mathcal{A}\) to \(\mathcal{B}\) correspond to assigning one of the two objects of \(\mathcal{B}\) to each object of \(\mathcal{A}\), so their collection is not a set. Thus the locally small assumption placed after §Category, ⁋Definition 4 does not apply to \(\CAT\) itself.

Definition 10 For locally small categories \(\mathcal{A}, \mathcal{B}\), a functor \(F:\mathcal{A}\rightarrow \mathcal{B}\) is called faithful if for any \(A_1,A_2\in\obj(\mathcal{A})\), the map

\[\Hom_\mathcal{A}(A_1,A_2)\rightarrow\Hom_{\mathcal{B}}(F(A_1),F(A_2));\qquad f\mapsto F(f)\]

is injective. If this map is surjective, we say \(F\) is full.


References

[Rie] Emily Riehl. Category Theory in Context. Dover Publications, 2016.


댓글남기기