-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfnt.tex
3005 lines (2737 loc) · 86.1 KB
/
cfnt.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Basic Category Theory
% Tom Leinster <[email protected]>
%
% Copyright (c) Tom Leinster 2014-2016
%
% Chapter 1: Categories, functors and natural transformations
%
\chapter{Categories, functors and natural transformations}
\label{ch:cfnt}
A category is a system of related objects. The objects do not live in
isolation: there is some notion of map between objects, binding them
together.
Typical examples of what `object' might mean are `group' and `topological
space', and typical examples of what `map' might mean are `homomorphism'
and `continuous map', respectively. We will see many examples, and we will
also learn that some categories have a very different flavour from the two
just mentioned. In fact, the `maps' of category theory need not be
anything like maps in the sense that you are most likely to be familiar
with.
Categories are \emph{themselves} mathematical objects, and with that in
mind, it is unsurprising that there is a good notion of `map between
categories'. Such maps are called functors. More surprising, perhaps, is
the existence of a third level: we can talk about maps between
\emph{functors}, which are called natural transformations. These, then,
are maps between maps between categories.
In fact, it was the desire to formalize the notion of natural
transformation that led to the birth of category theory. By the early
1940s, researchers in algebraic topology had started to use the phrase
`natural transformation', but only in an informal way. Two mathematicians,
Samuel Eilenberg%
%
\index{Eilenberg, Samuel}
%
and Saunders Mac Lane,%
%
\index{Mac~Lane, Saunders}
%
saw that a precise definition was needed. But before they could define
natural transformation, they had to define functor; and before they could
define functor, they had to define category. And so the subject was born.
Nowadays, the uses of category theory have spread far beyond algebraic
topology. Its tentacles extend into most parts of pure mathematics. They
also reach some parts of applied mathematics; perhaps most notably,
category theory has become a standard tool in certain parts of computer%
%
\index{computer science}
%
science. Applied%
%
\index{applied mathematics}
%
mathematics is more than just applied differential equations!
\section{Categories}
\label{sec:cats}
\begin{defn}
A \demph{category}%
%
\index{category}
%
$\cat{A}$ consists of:
%
\begin{itemize}
\item
a collection $\ob(\cat{A})$%
%
\ntn{ob}
%
of \demph{objects};%
%
\index{object}
%
\item
for each $A, B \in \ob(\cat{A})$, a collection $\cat{A}(A, B)$%
%
\ntn{hom-set-default}
%
of \demph{maps}%
%
\index{map}
%
or \demph{arrows}%
%
\index{arrow}
%
or \demph{morphisms}%
%
\index{morphism}
%
from $A$ to $B$;
\item
for each $A, B, C \in \ob(\cat{A})$, a function
\[
\begin{array}{ccc}
\cat{A}(B, C) \times \cat{A}(A, B) &
\to &
\cat{A}(A, C) \\
(g, f) &
\mapsto &
g \of f,%
%
\ntn{of}
%
\end{array}
\]
called \demph{composition};%
%
\index{composition}
%
\item
for each $A \in \ob(\cat{A})$, an element $1_A$%
%
\ntn{id-map}
%
of $\cat{A}(A, A)$, called the \demph{identity}%
%
\index{identity}
%
on $A$,
\end{itemize}
%
satisfying the following axioms:
%
\begin{itemize}
\item
\demph{associativity}:%
%
\index{associativity}
%
for each $f \in \cat{A}(A, B)$, $g \in \cat{A}(B, C)$ and $h \in \cat{A}(C,
D)$, we have $(h \of g) \of f = h \of (g \of f)$;
\item
\demph{identity%
%
\index{identity}
%
laws}: for each $f \in \cat{A}(A, B)$, we have $f \of 1_A = f = 1_B \of f$.
\end{itemize}
\end{defn}
\begin{remarks}
\label{rmks:defn-cat}
\begin{enumerate}[(b)]
\item
\label{item:defn-cat-notn}
We often write:
%
\begin{displaytext}
\begin{tabular}{rcl}
$A \in \cat{A}$ &to mean &$A \in \ob(\cat{A})$; \\
$f\from A\to B$ or $A \toby{f} B$&to mean &$f \in \cat{A}(A,B)$;%
%
\ntn{arrow}
%
\\
$gf$ &to mean &$g \of f$.%
%
\ntn{juxt}
%
\end{tabular}
\end{displaytext}
%
People also write $\cat{A}(A, B)$ as $\Hom_{\cat{A}}(A, B)$%
%
\ntn{Hom}
%
or $\Hom (A, B)$. The notation `$\Hom$' stands for homomorphism, from one
of the earliest examples of a category.
\item
\label{rmk:defn-cat:loosely}
The definition of category is set up so that in general, from each string
\[
A_0 \toby{f_1}
A_1 \toby{f_2}
\ \cdots \
\toby{f_n} A_n
\]
of maps in $\cat{A}$, it is possible to construct exactly one%
%
\index{uniqueness!constructions@of constructions}
%
map
\[
A_0 \to A_n
\]
(namely, $f_n f_{n - 1} \cdots f_1$). If we are given extra information
then we may be able to construct other maps $A_0 \to A_n$; for instance, if
we happen to know that $A_{n - 1} = A_n$, then $f_{n - 1} f_{n - 2} \cdots
f_1$ is another such map. But we are speaking here of the \emph{general}
situation, in the absence of extra information.
For example, a string like this with $n = 4$ gives rise to maps
\[
\xymatrix@=8em{
A_0
\ar@<1ex>[r]^{((f_4 f_3)f_2)f_1}
\ar@<-1ex>[r]_{(f_4(1_{A_3} f_3))((f_2 f_1)1_{A_0})} &
A_4,
}
\]
but the axioms imply that they are equal. It is safe to omit the brackets
and write both as $f_4 f_3 f_2 f_1$.
Here it is intended that $n \geq 0$. In the case $n = 0$, the statement is
that for each object $A_0$ of a category, it is possible to construct
exactly one map $A_0 \to A_0$ (namely, the identity $1_{A_0}$). An
identity map can be thought of as a zero-fold%
%
\index{identity!zero-fold composite@as zero-fold composite}
%
composite, in much the same way that the number $1$ can be thought of as
the product of zero numbers.
\item
We often speak of \demph{commutative%
%
\index{diagram!commutative}
%
diagrams}. For instance, given objects and maps
\[
\xymatrix{
A \ar[rr]^f \ar[d]_h & &B \ar[d]^g \\
C \ar[r]_i &D \ar[r]_j &E
}
\]
in a category, we say that the diagram \demph{commutes}%
%
\index{commutes}
%
if $gf = jih$. Generally, a diagram is said to commute if whenever there
are two paths from an object $X$ to an object $Y$, the map from $X$ to $Y$
obtained by composing along one path is equal to the map obtained by
composing along the other.
\item
The slightly vague word `collection'%
%
\index{collection}
%
means \emph{roughly} the same as `set', although if you know about such
things, it is better to interpret it as meaning `class'.%
%
\index{class}
%
We come back to this in Chapter~\ref{ch:sets}.
\item
If $f \in \cat{A}(A, B)$, we call $A$ the \demph{domain}%
%
\index{domain}
%
and $B$ the \demph{codomain}%
%
\index{codomain}
%
of $f$. Every map in every category has a definite domain and a definite
codomain. (If you believe it makes sense to form the intersection of an
arbitrary pair of abstract sets, you should add to the definition of
category the condition that $\cat{A}(A, B) \cap \cat{A}(A', B') =
\emptyset$ unless $A = A'$ and $B = B'$.)
\end{enumerate}
\end{remarks}
\begin{examples}[Categories \:of \:mathematical \:structures]
\label{egs:cats-of}
%
\begin{enumerate}[(b)]
\item
There is a category $\Set$%
%
\ntn{Set}
%
described as follows. Its objects are sets.%
%
\index{set!category of sets}
%
Given sets $A$ and $B$, a map from $A$ to $B$ in the category $\Set$ is
exactly what is ordinarily called a map (or mapping, or function) from $A$
to $B$. Composition in the category is ordinary composition of functions,
and the identity maps are again what you would expect.
In situations such as this, we often do not bother to specify the
composition and identities. We write `the category of sets and functions',
leaving the reader to guess the rest. In fact, we usually go further and
call it just `the category of sets'.
\item
There is a category $\Grp$%
%
\ntn{Grp}
%
of groups,%
%
\index{group!category of groups}
%
whose objects are groups and whose maps are group homomorphisms.
\item
Similarly, there is a category $\Ring$%
%
\ntn{Ring}
%
of rings%
%
\index{ring!category of rings}
%
and ring homomorphisms.
\item
For each field $k$, there is a category $\Vect_k$%
%
\ntn{Vect}
%
of vector%
%
\index{vector space!category of vector spaces}
%
spaces over $k$ and linear maps between them.
\item
There is a category $\Tp$%
%
\ntn{Top}
%
of topological%
%
\index{topological space!category of topological spaces}
%
spaces and continuous maps.
\end{enumerate}
\end{examples}
This chapter is mostly about the interaction \emph{between} categories,
rather than what goes on \emph{inside} them. We will, however, need the
following definition.
\begin{defn}
\label{defn:isomorphism}
A map $f\from A \to B$ in a category $\cat{A}$ is an \demph{isomorphism}%
%
\index{isomorphism}
%
if there exists a map $g\from B \to A$ in $\cat{A}$ such that $gf = 1_A$
and $fg = 1_B$.
\end{defn}
In the situation of Definition~\ref{defn:isomorphism}, we call $g$ the
\demph{inverse}%
%
\index{inverse}
%
of $f$ and write $g = f^{-1}$.%
%
\ntn{inverse}
%
(The word `the' is justified by Exercise~\ref{ex:unique-inverse}.) If
there exists an isomorphism from $A$ to $B$, we say that $A$ and $B$ are
\demph{isomorphic} and write $A \iso B$.%
%
\ntn{iso}
%
\begin{example}
\label{eg:iso-Set}
The isomorphisms in $\Set$%
%
\index{set!category of sets!isomorphisms in}
%
are exactly the bijections. This\linebreak statement is not quite a logical
triviality. It amounts to the assertion that a function has a two-sided
inverse if and only if it is injective and surjective.
\end{example}
\begin{example}
The isomorphisms in $\Grp$%
%
\index{group!category of groups!isomorphisms in}
%
are exactly the isomorphisms of groups. Again, this is not quite trivial,
at least if you were taught that the definition of group isomorphism is
`bijective homomorphism'. In order to show that this is equivalent to
being an isomorphism in $\Grp$, you have to prove that the inverse of a
bijective homomorphism is also a homomorphism.
Similarly, the isomorphisms in $\Ring$%
%
\index{ring!category of rings!isomorphisms in}
%
are exactly the isomorphisms of rings.
\end{example}
\begin{example}
The isomorphisms in $\Tp$%
%
\index{topological space!category of topological spaces!isomorphisms in}
%
are exactly the homeomorphisms. Note that, in contrast to the situation in
$\Grp$ and $\Ring$, a bijective map in $\Tp$ is not necessarily an
isomorphism. A classic example is the map
\[
\begin{array}{ccc}
[0, 1) &\to &\{z \in \complexes \such \left|z\right| = 1\} \\
t &\mapsto &e^{2\pi i t},
\end{array}
\]
which is a continuous bijection but not a homeomorphism.
\end{example}
The examples of categories mentioned so far are important, but could give a
false impression. In each of them, the objects of the category are sets
with structure (such as a group structure, a topology, or, in the case
of $\Set$, no structure at all). The maps are the functions preserving the
structure, in the appropriate sense. And in each of them, there is a
clear sense of what the elements of a given object are.
However, not all categories are like this. In general, the objects of a
category are not `sets equipped with extra stuff'. Thus, in a general
category, it does not make sense to talk about the `elements' of an object.
(At least, it does not make sense in an immediately obvious way; we return
to this in Definition~\ref{defn:gen-elt}.) Similarly, in a general
category, the maps need not be mappings or functions in the usual sense.
So:
\begin{slogan}
The objects of a category need not be remotely like sets.%
%
\index{object!need not resemble set}
%
\end{slogan}
%
\begin{slogan}
The maps in a category need not be remotely like functions.
%
\index{map!need not resemble function}
%
\end{slogan}
%
The next few examples illustrate these points. They also show that,
contrary to the impression that might have been given so far, categories
need not be enormous. Some categories are small, manageable structures in
their own right, as we now see.
\begin{examples}[Categories \,as \,mathematical \,structures]
\label{egs:cats-as}
\begin{enumerate}[(b)]
\item
\label{eg:cats-as:graphs}
A category can be specified%
%
\index{category!drawing of}
%
by saying directly what its objects, maps, composition and identities are.
For example, there is a category $\emptyset$%
%
\ntn{empty-cat}
%
with no objects or maps at all. There is a category $\One$%
%
\ntn{terminal-cat}
%
with one object
and only the identity map. It can be drawn like this:
\[
\bullet
\]
(Since every object is required to have an identity map on it, we usually
do not bother to draw the identities.) There is another category that can
be drawn as
\[
\bullet \to \bullet
\qquad
\text{or}
\qquad
A \toby{f} B,
\]
with two objects and one non-identity map, from the first object to the
second. (Composition is defined in the only possible way.) To reiterate
the points made above, it is not obvious what an `element' of $A$ or $B$
would be, or how one could regard $f$ as a `function' of any sort.
It is easy to make up more complicated examples. For instance, here are three
more categories:
\[
\begin{array}{c}
\xymatrix{
\bullet \ar@<.5ex>[r] \ar@<-.5ex>[r] &\bullet
}
\end{array}
\qquad
\begin{array}{c}
\xymatrix{
&B \ar[dr]^g & \\
A \ar[ur]^f \ar[rr]_{gf} & &C
}
\end{array}
\qquad
\begin{array}{c}
\xymatrix{
&\bullet \ar[dl]_{kj} \ar[r]^f \ar[dr]|{hj=gf} \ar[d]_{j} &
\bullet \ar[d]^g \\
\bullet &\bullet \ar[l]^k \ar[r]_{h} &\bullet
}
\end{array}
\]
\item
\label{eg:cats-as:discrete}
Some categories contain no maps at all apart from identities (which, as
categories, they are obliged to have). These are called \demph{discrete}%
%
\index{category!discrete}
%
categories. A discrete category amounts to just a class of objects. More
poetically, a category is a collection of objects related to one another to
a greater or lesser degree; a discrete category is the extreme case in
which each object is totally isolated from its companions.
\item
\label{eg:cats-as:groups}
A group is essentially the same thing as a category that has only one%
%
\index{category!one-object|(}%
\index{group!one-object category@as one-object category}
%
object and in which all the maps are isomorphisms.
To understand this, first consider a category $\cat{A}$ with just one
object. It is not important what letter or symbol we use to denote the
object; let us call it $A$. Then $\cat{A}$ consists of a set (or class)
$\cat{A}(A, A)$, an associative composition function
\[
\of\from \cat{A}(A, A) \times \cat{A}(A, A) \to \cat{A}(A, A),
\]
and a two-sided unit $1_A \in \cat{A}(A, A)$. This would make $\cat{A}(A,
A)$ into a group, except that we have not mentioned inverses. However, to
say that every map in $\cat{A}$ is an isomorphism is exactly to say that
every element of $\cat{A}(A, A)$ has an inverse with respect to $\of$.
If we write $G$ for the group $\cat{A}(A, A)$, then the situation is this:
%
\begin{displaytext}
\begin{tabular}{l@{\hspace{2em}}l}
\emph{category $\cat{A}$ with single object $A$} &
\emph{corresponding group $G$} \\[1ex]
maps in $\cat{A}$ &elements of $G$ \\
$\of$ in $\cat{A}$ &$\cdot$ in $G$ \\
$1_A$ &$1 \in G$ \\
\end{tabular}
\end{displaytext}
%
The category $\cat{A}$ looks something like this:
\[
\SelectTips{cm}{}
\xymatrix{A \ar@(r,u)@<-.5ex>[]_{} \ar@(u,l) \ar@(ld,rd)[]_{}}
\]
The arrows represent different maps $A \to A$, that is, different elements of
the group $G$.
What the object of $\cat{A}$ is called makes no difference. It matters
exactly as much as whether we choose $x$ or $y$ or $t$ to denote some
variable in an algebra problem, which is to say, not at all. Later we will
define `equivalence' of categories, which will enable us to make a precise
statement: the category of groups is equivalent to the category of (small)
one-object categories in which every map is an isomorphism
(Example~\ref{eg:mon-one-obj-eqv}).
The first time one meets the idea that a group is a kind of category, it is
tempting to dismiss it as a coincidence or a trick. But it is not; there
is real content.
To see this, suppose that your education had been shuffled and that you
already knew about categories before being taught about groups. In your
first group theory class, the lecturer declares that a group is supposed to
be the system of all symmetries of an object. A symmetry of an object $X$,
she says, is a way of mapping $X$ to itself in a reversible or invertible
manner. At this point, you realize that she is talking about a very
special type of category. In general, a category is a system consisting of
\emph{all} the mappings (not usually just the invertible ones) between
\emph{many} objects (not usually just one). So a group is just a category
with the special properties that all the maps are invertible and there is
only one object.
\item
\label{eg:cats-as:monoids}
The inverses played no essential part in the previous example, suggesting that
it is worth thinking about `groups without inverses'. These are called
monoids.
Formally, a \demph{monoid}%
%
\index{monoid}
%
is a set equipped with an associative binary operation and a two-sided unit
element. Groups describe the reversible transformations, or symmetries,
that can be applied to an object; monoids describe the
not-necessarily-reversible transformations. For instance, given any set
$X$, there is a group consisting of all bijections $X \to X$, and there is
a monoid consisting of all functions $X \to X$. In both cases, the binary
operation is composition and the unit is the identity function on $X$.
Another example of a monoid is the set $\nat = \{0, 1, 2, \ldots\}$%
%
\ntn{nat}
%
of natural%
%
\index{natural numbers}
%
numbers, with $+$ as the operation and $0$ as the unit. Alternatively, we
could take the set $\nat$ with $\cdot$ as the operation and $1$ as the
unit.
A category with one%
%
\index{monoid!one-object category@as one-object category}
%
object is essentially the same thing as a monoid, by the same argument as
for groups. This is stated formally in Example~\ref{eg:mon-one-obj-eqv}.%
%
\index{category!one-object|)}
%
\item
\label{eg:cats-as:orders}
A \demph{preorder}%
%
\index{preorder}
%
is a reflexive transitive binary relation. A \demph{preordered set} $(S,
\mathord{\leq})$%
%
\ntn{leq}
%
is a set $S$ together with a preorder $\leq$ on it. Examples: $S = \reals$
and $\leq$ has its usual meaning; $S$ is the set of subsets of $\{1,
\ldots, 10\}$ and $\leq$ is $\sub$ (inclusion); $S = \integers$ and $a \leq
b$ means that $a$ divides $b$.
A preordered set can be regarded as a category $\cat{A}$ in which, for each
$A, B \in \cat{A}$, there is at most one map from $A$ to $B$. To see this,
consider a category $\cat{A}$ with this property. It is not important what
letter we use to denote the unique map from an object $A$ to an object $B$;
all we need to record is which pairs $(A, B)$ of objects have the property
that a map $A \to B$ does exist. Let us write $A \leq B$ to mean that
there exists a map $A \to B$.
Since $\cat{A}$ is a category, and categories have composition, if $A \leq
B \leq C$ then $A \leq C$. Since categories also have identities, $A \leq
A$ for all $A$. The associativity and identity axioms are automatic. So,
$\cat{A}$ amounts to a collection of objects equipped with a transitive
reflexive binary relation, that is, a preorder. One can think of the
unique map $A \to B$ as the statement or assertion that $A \leq B$.
An \demph{order}%
%
\index{ordered set}
%
on a set is a preorder $\leq$ with the property that if $A \leq B$ and $B
\leq A$ then $A = B$. (Equivalently, if $A \iso B$ in the corresponding
category then $A = B$.) Ordered sets are also called \demph{partially
ordered sets}%
%
\index{partially ordered set}
%
or \demph{posets}.%
%
\index{poset}
%
An example of a preorder that is not%
%
\index{ordered set!preordered set@vs.\ preordered set}
%
an order is the divisibility relation $\divides$ on $\integers$: for there
we have $2 \divides {-2}$ and $-2 \divides 2$ but $2 \neq -2$.
\end{enumerate}
\end{examples}
Here are two ways of constructing new categories from old.
{\sloppy
\begin{constn}
\label{constn:op-cat}
Every category $\cat{A}$ has an \demph{opposite}%
%
\index{category!opposite}
%
or \demph{dual}%
%
\index{duality}
%
category $\cat{A}^\op$,%
%
\ntn{op}
%
defined by reversing the arrows. Formally, $\ob(\cat{A}^\op) =
\ob(\cat{A})$ and $\cat{A}^\op(B, A) = \cat{A}(A, B)$ for all objects $A$
and $B$. Identities in $\cat{A}^\op$ are the same as in $\cat{A}$.
Composition in $\cat{A}^\op$ is the same as in $\cat{A}$, but with the
arguments reversed. To spell this out: if $A \toby{f} B \toby{g} C$ are
maps in $\cat{A}^\op$ then $A \otby{f} B \otby{g} C$ are maps in $\cat{A}$;
these give rise to a map $A \otby{f \of g} C$ in $\cat{A}$, and the
composite of the original pair of maps is the corresponding map $A \to C$
in $\cat{A}^\op$.
So, arrows $A \to B$ in $\cat{A}$ correspond to arrows $B \to A$ in
$\cat{A}^\op$. According to the definition above, if $f\from A \to B$ is
an arrow in $\cat{A}$ then the corresponding arrow $B \to A$ in
$\cat{A}^\op$ is also called $f$. Some people prefer to give it a
different name, such as $f^\op$.
\end{constn}
}
\begin{remark}
\label{rmk:principle-duality}
The \demph{principle of duality}%
%
\index{duality!principle of}
%
is fundamental to category theory. Informally, it states that every
categorical definition, theorem and proof has a \demph{dual}, obtained by
reversing all the arrows. Invoking the principle of duality can save work:
given any theorem, reversing the arrows throughout its statement and proof
produces a dual theorem. Numerous examples of duality appear throughout
this book.
\end{remark}
\begin{constn}
\label{constn:prod-cat}
Given categories $\cat{A}$ and $\cat{B}$, there is a \demph{product%
%
\index{category!product of categories}
%
category} $\cat{A} \times \cat{B}$,%
%
\ntn{prod-cat}
%
in which
%
\begin{align*}
\ob(\cat{A} \times \cat{B}) &
=
\ob(\cat{A}) \times \ob(\cat{B}),\\
(\cat{A} \times \cat{B})((A, B), (A', B')) &
=
\cat{A}(A, A') \times \cat{B}(B, B').
\end{align*}
%
Put another way, an object of the product category $\cat{A} \times \cat{B}$
is a pair $(A, B)$ where $A \in \cat{A}$ and $B \in \cat{B}$. A map $(A,
B) \to (A', B')$ in $\cat{A} \times \cat{B}$ is a pair $(f, g)$ where
$f\from A \to A'$ in $\cat{A}$ and $g\from B \to B'$ in $\cat{B}$. For the
definitions of composition and identities in $\cat{A} \times \cat{B}$, see
Exercise~\ref{ex:prod-cat}.
\end{constn}
\exs
\begin{question}
Find three examples of categories not mentioned above.
\end{question}
\begin{question}
\label{ex:unique-inverse}
Show that a map in a category can have at most one inverse. That is, given
a map $f\from A \to B$, show that there is at most one map $g\from B \to A$
such that $gf = 1_A$ and $fg = 1_B$.
\end{question}
\begin{question}
\label{ex:prod-cat}
Let $\cat{A}$ and $\cat{B}$ be categories.
Construction~\ref{constn:prod-cat} defined the product category $\cat{A}
\times \cat{B}$, except that the definitions of composition and identities
in $\cat{A} \times \cat{B}$ were not given. There is only one sensible way
to define them; write it down.
\end{question}
\begin{question}
There is a category $\Toph$%
%
\ntn{Toph}
%
whose objects are topological spaces and whose
maps $X \to Y$ are homotopy%
%
\index{homotopy}
%
classes of continuous maps from $X$ to $Y$. What do you need to know about
homotopy in order to prove that $\Toph$ is a category? What does it mean,
in purely topological terms, for two objects of $\Toph$ to be isomorphic?
\end{question}
\section{Functors}
\label{sec:ftrs}
One of the lessons of category theory is that whenever we meet a new type
of mathematical object, we should always ask whether there is a sensible
notion of `map' between such objects. We can ask this about categories
themselves. The answer is yes, and a map between categories is called a
functor.
\begin{defn}
Let $\cat{A}$ and $\cat{B}$ be categories. A \demph{functor}%
%
\index{functor}
%
$F\from \cat{A} \to \cat{B}$ consists of:
%
\begin{itemize}
\item
a function
\[
\ob(\cat{A}) \to \ob(\cat{B}),
\]
written as $A \mapsto F(A)$;
\item
for each $A, A' \in \cat{A}$, a function
\[
\cat{A}(A, A') \to \cat{B}(F(A), F(A')),
\]
written as $f \mapsto F(f)$,
\end{itemize}
%
satisfying the following axioms:
%
\begin{itemize}
\item
$F(f' \of f) = F(f') \of F(f)$ whenever $A \toby{f} A' \toby{f'} A''$ in
$\cat{A}$;
\item
$F(1_A) = 1_{F(A)}$ whenever $A \in \cat{A}$.
\end{itemize}
\end{defn}
\begin{remarks}
\label{rmks:defn-ftr}
\begin{enumerate}[(b)]
\item
\label{rmk:defn-ftr:loosely}
The definition of functor is set up so that from each string
\[
A_0 \toby{f_1} \ \cdots\ \toby{f_n} A_n
\]
of maps in $\cat{A}$ (with $n \geq 0$), it is possible to construct exactly
one%
%
\index{uniqueness!constructions@of constructions}
%
map
\[
F(A_0) \to F(A_n)
\]
in $\cat{B}$. For example, given maps
\[
A_0 \toby{f_1} A_1 \toby{f_2} A_2 \toby{f_3} A_3 \toby{f_4} A_4
\]
in $\cat{A}$, we can construct maps
\[
\xymatrix@=10em{
F(A_0)
\ar@<1ex>[r]^{F(f_4 f_3) F(f_2 f_1)}
\ar@<-1ex>[r]_{F(1_{A_4}) F(f_4) F(f_3 f_2) F(f_1)} &
F(A_4)
}
\]
in $\cat{B}$, but the axioms imply that they are equal.
\item
\label{rmk:defn-ftr:comp}
We are familiar with the idea that structures and the structure-preserving
maps between them form a category (such as $\Grp$, $\Ring$, etc.). In
particular, this applies to categories and functors: there is a category
$\CAT$%
%
\index{category!category of categories}%
\ntn{CAT}
%
whose objects are categories and whose maps are functors.
One part of this statement is that functors can be composed.%
%
\index{functor!composition of functors}
%
That is, given functors $\cat{A} \toby{F} \cat{B} \toby{G} \cat{C}$, there
arises a new functor $\cat{A} \toby{G \of F} \cat{C}$,%
%
\ntn{of-ftr}
%
defined in the obvious way. Another is that for every category $\cat{A}$,
there is an identity%
%
\index{functor!identity}
%
functor $1_\cat{A}\from \cat{A} \to \cat{A}$.%
%
\ntn{id-ftr}
%
\end{enumerate}
\end{remarks}
\begin{examples}
\label{egs:forgetful-functors}
Perhaps the easiest examples of functors are the so-called \demph{forgetful%
%
\index{functor!forgetful}
%
functors}. (This is an informal term, with no precise definition.) For
instance:
%
\begin{enumerate}[(b)]
\item
\label{eg:forgetful-groups}
There is a functor $U\from \Grp \to \Set$ defined as follows: if $G$ is a
group then $U(G)$ is the underlying%
%
\index{underlying}
%
set of $G$ (that is, its set of elements), and if $f\from G \to H$ is a
group homomorphism then $U(f)$ is the function $f$ itself. So $U$ forgets
the group structure of groups and forgets that group homomorphisms are
homomorphisms.
\item
\label{eg:forgetful-ring-vs}
Similarly, there is a functor $\Ring \to \Set$ forgetting the ring
structure on rings, and (for any field $k$) there is a functor $\Vect_k
\to \Set$ forgetting the vector space structure on vector spaces.
\item
\label{eg:forgetful-part}
Forgetful functors do not have to forget \emph{all} the structure. For
example, let $\Ab$%
%
\ntn{Ab}
%
be the category of abelian groups. There is a functor $\Ring \to \Ab$ that
forgets the multiplicative structure, remembering just the underlying
additive group. Or, let $\Mon$%
%
\ntn{Mon}
%
be the category of monoids. There is a functor $U\from \Ring \to \Mon$
that forgets the additive structure, remembering just the underlying%
%
\index{underlying}
%
multiplicative monoid. (That is, if $R$ is a ring then $U(R)$ is the set
$R$ made into a monoid via $\cdot$ and $1$.)
\item
\label{eg:forgetful-ab}
There is an inclusion functor $U\from \Ab \to \Grp$ defined by $U(A) = A$
for any abelian group $A$ and $U(f) = f$ for any homomorphism $f$ of abelian
groups. It forgets that abelian groups are abelian.
\end{enumerate}
The forgetful functors in examples
\bref{eg:forgetful-groups}--\bref{eg:forgetful-part} forget
\emph{structure} on the objects, but that of
example~\bref{eg:forgetful-ab} forgets a \emph{property}. Nevertheless,
it turns out to be convenient to use the same word, `forgetful', in both
situations.
Although forgetting is a trivial operation, there are situations in which
it is powerful. For example, it is a theorem that the order of any finite
field is a prime power. An important step in the proof is to simply forget
that the field is a field, remembering only that it is a vector space over
its subfield $\{0, 1, 1 + 1, 1 + 1 + 1, \ldots\}$.
\end{examples}
\begin{examples}
\label{egs:free-functors}
\demph{Free%
%
\index{functor!free}%
\index{free functor}