forked from stacks/stacks-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.tex
7451 lines (6720 loc) · 253 KB
/
categories.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
\input{preamble}
% OK, start here.
%
\begin{document}
\title{Categories}
\maketitle
\phantomsection
\label{section-phantom}
\tableofcontents
\section{Introduction}
\label{section-introduction}
\noindent
Categories were first introduced in \cite{GenEqui}.
The category of categories (which is a proper class)
is a $2$-category. Similarly, the category of stacks
forms a $2$-category. If you already know
about categories, but not about $2$-categories you
should read
Section \ref{section-formal-cat-cat}
as an introduction to the formal definitions later on.
\section{Definitions}
\label{section-definition-categories}
\noindent
We recall the definitions, partly to fix notation.
\begin{definition}
\label{definition-category}
A {\it category} $\mathcal{C}$ consists of the following data:
\begin{enumerate}
\item A set of objects $\Ob(\mathcal{C})$.
\item For each pair $x, y \in \Ob(\mathcal{C})$ a set of morphisms
$\Mor_\mathcal{C}(x, y)$.
\item For each triple $x, y, z\in \Ob(\mathcal{C})$ a composition
map $ \Mor_\mathcal{C}(y, z) \times \Mor_\mathcal{C}(x, y)
\to \Mor_\mathcal{C}(x, z) $, denoted $(\phi, \psi) \mapsto
\phi \circ \psi$.
\end{enumerate}
These data are to satisfy the following rules:
\begin{enumerate}
\item For every element $x\in \Ob(\mathcal{C})$ there exists a
morphism $\text{id}_x\in \Mor_\mathcal{C}(x, x)$ such that
$\text{id}_x \circ \phi = \phi$ and $\psi \circ \text{id}_x = \psi $ whenever
these compositions make sense.
\item Composition is associative, i.e., $(\phi \circ \psi) \circ \chi =
\phi \circ ( \psi \circ \chi)$ whenever these compositions make sense.
\end{enumerate}
\end{definition}
\noindent
It is customary to require all the morphism sets
$\Mor_\mathcal{C}(x, y)$ to be disjoint.
In this way a morphism $\phi: x \to y$ has a unique {\it source} $x$
and a unique {\it target} $y$. This is not strictly necessary,
although care has to be taken in formulating condition (2) above
if it is not the case. It is convenient and we will often assume
this is the case. In this case we say that $\phi$ and $\psi$ are
{\it composable} if the source of $\phi$ is equal to the
target of $\psi$, in which case $\phi \circ \psi$ is defined.
An equivalent definition would be to define a category
as a quintuple $(\text{Ob}, \text{Arrows}, s, t, \circ)$
consisting of a set of objects, a set of morphisms (arrows),
source, target and composition subject to a long list of axioms.
We will occasionally use this point of view.
\begin{remark}
\label{remark-big-categories}
Big categories. In some texts a category is allowed to have a proper
class of objects. We will allow this as well in these notes but only
in the following list of cases (to be updated as we go along).
In particular, when we say: ``Let $\mathcal{C}$ be a category''
then it is understood that $\Ob(\mathcal{C})$ is a set.
\begin{enumerate}
\item The category $\textit{Sets}$ of sets.
\item The category $\textit{Ab}$ of abelian groups.
\item The category $\textit{Groups}$ of groups.
\item Given a group $G$ the category $G\textit{-Sets}$ of
sets with a left $G$-action.
\item Given a ring $R$ the category $\text{Mod}_R$ of $R$-modules.
\item Given a field $k$ the category of vector spaces over $k$.
\item The category of rings.
\item The category of schemes.
\item The category $\textit{Top}$ of topological spaces.
\item Given a topological space $X$ the category
$\textit{PSh}(X)$ of presheaves of sets over $X$.
\item Given a topological space $X$ the category
$\Sh(X)$ of sheaves of sets over $X$.
\item Given a topological space $X$ the category
$\textit{PAb}(X)$ of presheaves of abelian groups over $X$.
\item Given a topological space $X$ the category
$\textit{Ab}(X)$ of sheaves of abelian groups over $X$.
\item Given a small category $\mathcal{C}$ the category of functors
from $\mathcal{C}$ to $\textit{Sets}$.
\item Given a category $\mathcal{C}$ the category of presheaves of sets
over $\mathcal{C}$.
\item Given a site $\mathcal{C}$ the category of sheaves
of sets over $\mathcal{C}$.
\end{enumerate}
One of the reason to enumerate these here is to try and avoid
working with something like the ``collection'' of ``big'' categories
which would be like working with the collection of all classes
which I think definitively is a meta-mathematical object.
\end{remark}
\begin{remark}
\label{remark-unique-identity}
It follows directly from the definition that any two identity morphisms
of an object $x$ of $\mathcal{A}$ are the same. Thus we may and will
speak of {\it the} identity morphism $\text{id}_x$ of $x$.
\end{remark}
\begin{definition}
\label{definition-isomorphism}
A morphism $\phi : x \to y$ is an {\it isomorphism} of the category
$\mathcal{C}$ if there exists a morphism $\psi : y \to x$
such that $\phi \circ \psi = \text{id}_y$ and
$\psi \circ \phi = \text{id}_x$.
\end{definition}
\noindent
An isomorphism $\phi$ is also sometimes called an {\it invertible}
morphism, and the morphism $\psi$ of the definition is called the
{\it inverse} and denoted $\phi^{-1}$. It is unique if it exists. Note that
given an object $x$ of a category $\mathcal{A}$ the set of invertible
elements $\text{Aut}_\mathcal{A}(x)$
of $\Mor_\mathcal{A}(x, x)$ forms a group under composition.
This group is called the {\it automorphism} group of $x$ in $\mathcal{A}$.
\begin{definition}
\label{definition-groupoid}
A {\it groupoid} is a category where every morphism is an isomorphism.
\end{definition}
\begin{example}
\label{example-group-groupoid}
A group $G$ gives rise to a groupoid with a single object $x$
and morphisms $\Mor(x, x) = G$, with the composition rule
given by the group law in $G$. Every groupoid with a single
object is of this form.
\end{example}
\begin{example}
\label{example-set-groupoid}
A set $C$ gives rise to a groupoid $\mathcal{C}$ defined as follows:
As objects we take $\Ob(\mathcal{C}) := C$ and for morphisms
we take $\Mor(x, y)$ empty if $x\neq y$ and equal to
$\{\text{id}_x\}$ if $x = y$.
\end{example}
\begin{definition}
\label{definition-functor}
A {\it functor} $F : \mathcal{A} \to \mathcal{B}$
between two categories $\mathcal{A}, \mathcal{B}$ is given by the
following data:
\begin{enumerate}
\item A map $F : \Ob(\mathcal{A}) \to \Ob(\mathcal{B})$.
\item For every $x, y \in \Ob(\mathcal{A})$ a map
$F : \Mor_\mathcal{A}(x, y) \to \Mor_\mathcal{B}(F(x), F(y))$,
denoted $\phi \mapsto F(\phi)$.
\end{enumerate}
These data should be compatible with composition and identity morphisms
in the following manner: $F(\phi \circ \psi) =
F(\phi) \circ F(\psi)$ for a composable pair $(\phi, \psi)$ of
morphisms of $\mathcal{A}$ and $F(\text{id}_x) = \text{id}_{F(x)}$.
\end{definition}
\noindent
Note that every category $\mathcal{A}$ has an
{\it identity} functor $\text{id}_\mathcal{A}$.
In addition, given a functor $G : \mathcal{B} \to \mathcal{C}$
and a functor $F : \mathcal{A} \to \mathcal{B}$ there is
a {\it composition} functor $G \circ F : \mathcal{A} \to \mathcal{C}$
defined in an obvious manner.
\begin{definition}
\label{definition-faithful}
Let $F : \mathcal{A} \to \mathcal{B}$ be a functor.
\begin{enumerate}
\item We say $F$ is {\it faithful} if
for any objects $x, y$ of $\Ob(\mathcal{A})$ the map
$$
F : \Mor_\mathcal{A}(x, y) \to \Mor_\mathcal{B}(F(x), F(y))
$$
is injective.
\item If these maps are all bijective then $F$ is called
{\it fully faithful}.
\item
The functor $F$ is called {\it essentially surjective} if for any
object $y \in \Ob(\mathcal{B})$ there exists an object
$x \in \Ob(\mathcal{A})$ such that $F(x)$ is isomorphic to $y$ in
$\mathcal{B}$.
\end{enumerate}
\end{definition}
\begin{definition}
\label{definition-subcategory}
A {\it subcategory} of a category $\mathcal{B}$ is
a category $\mathcal{A}$ whose objects and arrows
form subsets of the objects and arrows
of $\mathcal{A}$ and such that source, target
and composition in $\mathcal{A}$ agree with those
of $\mathcal{B}$. We say $\mathcal{A}$ is a
{\it full subcategory} of $\mathcal{B}$ if $\Mor_\mathcal{A}(x, y)
= \Mor_\mathcal{B}(x, y)$ for all $x, y \in \Ob(\mathcal{A})$.
We say $\mathcal{A}$ is a {\it strictly full} subcategory of $\mathcal{B}$
if it is a full subcategory and given $x \in \Ob(\mathcal{A})$ any
object of $\mathcal{B}$ which is isomorphic to $x$ is also in $\mathcal{A}$.
\end{definition}
\noindent
If $\mathcal{A} \subset \mathcal{B}$ is a subcategory then the
identity map is a functor from $\mathcal{A}$ to $\mathcal{B}$.
Furthermore a subcategory $\mathcal{A} \subset \mathcal{B}$
is full if and only if the inclusion functor is fully faithful.
Note that given a category $\mathcal{B}$ the set of full subcategories
of $\mathcal{B}$ is the same as the set of subsets of
$\Ob(\mathcal{B})$.
\begin{remark}
\label{remark-functor-into-sets}
Suppose that $\mathcal{A}$ is a category.
A functor $F$ from $\mathcal{A}$ to $\textit{Sets}$
is a mathematical object (i.e., it is a set not a class or a formula
of set theory, see
Sets, Section \ref{sets-section-sets-everything})
even though the category of sets is ``big''.
Namely, the range of $F$ on objects will be
a set $F(\Ob(\mathcal{A}))$ and then we
may think of $F$ as a functor between
$\mathcal{A}$ and the full subcategory
of the category of sets whose
objects are elements of $F(\Ob(\mathcal{A}))$.
\end{remark}
\begin{example}
\label{example-group-homomorphism-functor}
A homomorphism $p : G\to H$ of groups gives rise to a functor
between the associated groupoids in Example \ref{example-group-groupoid}. It is
faithful (resp.\ fully faithful) if and only if $p$ is injective (resp.\ an
isomorphism).
\end{example}
\begin{example}
\label{example-category-over-X}
Given a category $\mathcal{C}$ and an object $X\in \Ob(\mathcal{C})$
we define the {\it category of objects over $X$},
denoted $\mathcal{C}/X$ as follows.
The objects of $\mathcal{C}/X$ are morphisms $Y\to X$ for
some $Y\in \Ob(\mathcal{C})$. Morphisms between objects
$Y\to X$ and $Y'\to X$ are morphisms $Y\to Y'$ in $\mathcal{C}$ that
make the obvious diagram commute. Note that there is a functor
$p_X : \mathcal{C}/X\to \mathcal{C}$ which simply forgets the
morphism. Moreover given a morphism $f : X'\to X$ in
$\mathcal{C}$ there is an induced functor
$F : \mathcal{C}/X' \to \mathcal{C}/X$ obtained by composition with $f$,
and $p_X\circ F = p_{X'}$.
\end{example}
\begin{example}
\label{example-category-under-X}
Given a category $\mathcal{C}$ and an object $X\in \Ob(\mathcal{C})$
we define the {\it category of objects under $X$},
denoted $X/\mathcal{C}$ as follows.
The objects of $X/\mathcal{C}$ are morphisms $X\to Y$ for
some $Y\in \Ob(\mathcal{C})$. Morphisms between objects
$X\to Y$ and $X\to Y'$ are morphisms $Y\to Y'$ in $\mathcal{C}$ that
make the obvious diagram commute. Note that there is a functor
$p_X : X/\mathcal{C}\to \mathcal{C}$ which simply forgets the
morphism. Moreover given a morphism $f : X'\to X$ in
$\mathcal{C}$ there is an induced functor
$F : X/\mathcal{C} \to X'/\mathcal{C}$
obtained by composition with $f$,
and $p_{X'}\circ F = p_X$.
\end{example}
\begin{definition}
\label{definition-transformation-functors}
Let $F, G : \mathcal{A} \to \mathcal{B}$ be functors.
A {\it natural transformation}, or a {\it morphism of functors}
$t : F \to G$, is a collection $\{t_x\}_{x\in \Ob(\mathcal{A})}$
such that
\begin{enumerate}
\item $t_x : F(x) \to G(x)$ is a morphism in the category $\mathcal{B}$, and
\item for every morphism $\phi : x \to y$ of $\mathcal{A}$ the following
diagram is commutative
$$
\xymatrix{
F(x) \ar[r]^{t_x} \ar[d]_{F(\phi)} & G(x) \ar[d]^{G(\phi)} \\
F(y) \ar[r]^{t_y} & G(y) }
$$
\end{enumerate}
\end{definition}
\noindent
Sometimes we use the diagram
$$
\xymatrix{
\mathcal{A}
\rtwocell^F_G{t}
&
\mathcal{B}
}
$$
to indicate that $t$ is a morphism from $F$ to $G$.
\medskip\noindent
Note that every functor $F$ comes with the {\it identity} transformation
$\text{id}_F : F \to F$. In addition, given a morphism of
functors $t : F \to G$ and a morphism of functors $s : E \to F$
then the {\it composition} $t \circ s$ is defined by the rule
$$
(t \circ s)_x = t_x \circ s_x : E(x) \to G(x)
$$
for $x \in \Ob(\mathcal{A})$.
It is easy to verify that this is indeed a morphism of functors
from $E$ to $G$.
In this way, given categories
$\mathcal{A}$ and $\mathcal{B}$ we obtain a new category,
namely the category of functors between $\mathcal{A}$ and
$\mathcal{B}$.
\begin{remark}
\label{remark-functors-sets-sets}
This is one instance where the same thing does not hold if
$\mathcal{A}$ is a ``big'' category. For example consider
functors $\textit{Sets} \to \textit{Sets}$. As we have currently
defined it such a functor is a class and not a set. In other
words, it is given by a formula in set theory (with some variables
equal to specified sets)! It is not a good idea to try to consider
all possible formulae of set theory as part of the definition of
a mathematical object. The same problem presents itself when
considering sheaves on the category of schemes for example.
We will come back to this point later.
\end{remark}
\begin{definition}
\label{definition-equivalence-categories}
An {\it equivalence of categories}
$F : \mathcal{A} \to \mathcal{B}$ is a functor such that there
exists a functor $G : \mathcal{B} \to \mathcal{A}$ such that
the compositions $F \circ G$ and $G \circ F$ are isomorphic to the
identity functors $\text{id}_\mathcal{B}$,
respectively $\text{id}_\mathcal{A}$.
In this case we say that $G$ is a {\it quasi-inverse} to $F$.
\end{definition}
\begin{lemma}
\label{lemma-construct-quasi-inverse}
Let $F : \mathcal{A} \to \mathcal{B}$ be a fully faithful functor.
Suppose for every $X \in \Ob(\mathcal{B})$ given an
object $j(X)$ of $\mathcal{A}$ and an isomorphism $i_X : X \to F(j(X))$.
Then there is a unique functor $j : \mathcal{B} \to \mathcal{A}$
such that $j$ extends the rule on objects, and the isomorphisms
$i_X$ define an isomorphism of functors
$\text{id}_\mathcal{B} \to F \circ j$. Moreover, $j$ and $F$
are quasi-inverse equivalences of categories.
\end{lemma}
\begin{proof}
This lemma proves itself.
\end{proof}
\begin{lemma}
\label{lemma-equivalence-categories}
A functor is an equivalence of categories if and only if it is both fully
faithful and essentially surjective.
\end{lemma}
\begin{proof}
Let $F : \mathcal{A} \to \mathcal{B}$ be essentially surjective and fully
faithful. As by convention all categories are small and as $F$ is essentially
surjective we can, using the axiom of choice, choose for every
$X \in \Ob(\mathcal{B})$ an object $j(X)$ of $\mathcal{A}$ and an
isomorphism $i_X : X \to F(j(X))$. Then we apply
Lemma \ref{lemma-construct-quasi-inverse}
using that $F$ is fully faithful.
\end{proof}
\begin{definition}
\label{definition-product-category}
Let $\mathcal{A}$, $\mathcal{B}$ be categories.
We define the {\it product category}
$\mathcal{A} \times \mathcal{B}$ to be the category with
objects
$\Ob(\mathcal{A} \times \mathcal{B}) =
\Ob(\mathcal{A}) \times \Ob(\mathcal{B})$
and
$$
\Mor_{\mathcal{A} \times \mathcal{B}}((x, y), (x', y'))
:=
\Mor_\mathcal{A}(x, x')\times
\Mor_\mathcal{B}(y, y').
$$
Composition is defined componentwise.
\end{definition}
\section{Opposite Categories and the Yoneda Lemma}
\label{section-opposite}
\begin{definition}
\label{definition-opposite}
Given a category $\mathcal{C}$ the {\it opposite category}
$\mathcal{C}^{opp}$ is the category with the same objects
as $\mathcal{C}$ but all morphisms reversed.
\end{definition}
\noindent
In other
words $\Mor_{\mathcal{C}^{opp}}(x, y) =
\Mor_\mathcal{C}(y, x)$. Composition in $\mathcal{C}^{opp}$
is the same as in $\mathcal{C}$ except backwards: if $\phi : y \to z$ and
$\psi : x \to y$ in $\mathcal{C}^{opp}$ then
$\phi \circ^{opp} \psi := \psi \circ \phi$.
\begin{definition}
\label{definition-contravariant}
Let $\mathcal{C}$, $\mathcal{S}$ be categories.
A {\it contravariant} functor $F$
from $\mathcal{C}$ to $\mathcal{S}$
is a functor $\mathcal{C}^{opp}\to \mathcal{S}$.
\end{definition}
\noindent
Concretely, a contravariant functor $F$ is given
by a map $F : \Ob(\mathcal{C}) \to
\Ob(\mathcal{S})$ and for every morphism
$\psi : x \to y$ in $\mathcal{C}$ a morphism
$F(\psi) : F(y) \to F(x)$. These should satisfy the property
that, given another morphism
$\phi : y \to z$, we have $F(\phi \circ \psi)
= F(\psi) \circ F(\phi)$ as morphisms $F(z) \to F(x)$.
(Note the reverse of order.)
\begin{definition}
\label{definition-presheaf}
Let $\mathcal{C}$ be a category.
\begin{enumerate}
\item A {\it presheaf of sets on $\mathcal{C}$}
or simply a {\it presheaf} is a contravariant functor
$F$ from $\mathcal{C}$ to $\textit{Sets}$.
\item The category of presheaves is denoted $\textit{PSh}(\mathcal{C})$.
\end{enumerate}
\end{definition}
\noindent
Of course the category of presheaves is a proper class.
\begin{example}
\label{example-hom-functor}
Functor of points.
For any $U\in \Ob(\mathcal{C})$ there is a contravariant
functor
$$
\begin{matrix}
h_U & : & \mathcal{C}
&
\longrightarrow
&
\textit{Sets} \\
& &
X
&
\longmapsto
&
\Mor_\mathcal{C}(X, U)
\end{matrix}
$$
which takes an object $X$ to the set
$\Mor_\mathcal{C}(X, U)$. In other words $h_U$ is a presheaf.
Given a morphism $f : X\to Y$ the corresponding map
$h_U(f) : \Mor_\mathcal{C}(Y, U)\to \Mor_\mathcal{C}(X, U)$
takes $\phi$ to $\phi\circ f$. We will always denote
this presheaf $h_U : \mathcal{C}^{opp} \to \textit{Sets}$.
It is called the {\it representable presheaf} associated to $U$.
If $\mathcal{C}$ is the category of schemes this functor is
sometimes referred to as the
\emph{functor of points} of $U$.
\end{example}
\noindent
Note that given a morphism $\phi : U \to V$ in $\mathcal{C}$ we get a
corresponding natural transformation of functors
$h(\phi) : h_U \to h_V$ defined simply by composing with the morphism
$U \to V$. It is trivial to see that this turns
composition of morphisms in $\mathcal{C}$ into composition of
transformations of functors. In other words we get a functor
$$
h :
\mathcal{C}
\longrightarrow
\text{Fun}(\mathcal{C}^{opp}, \textit{Sets}) = \textit{PSh}(\mathcal{C})
$$
Note that the target is a ``big'' category, see
Remark \ref{remark-big-categories}. On the other hand,
$h$ is an actual mathematical object (i.e.\ a set), compare Remark
\ref{remark-functor-into-sets}.
\begin{lemma}[Yoneda lemma]
\label{lemma-yoneda}
Let $U, V \in \Ob(\mathcal{C})$.
Given any morphism of functors $s : h_U \to h_V$
there is a unique morphism $\phi : U \to V$
such that $h(\phi) = s$. In other words the
functor $h$ is fully faithful. More generally,
given any contravariant functor $F$ and any object
$U$ of $\mathcal{C}$ we have a natural bijection
$$
\Mor_{\textit{PSh}(\mathcal{C})}(h_U, F) \longrightarrow F(U),
\quad
s \longmapsto s_U(\text{id}_U).
$$
\end{lemma}
\begin{proof}
Just take $\phi = s_U(\text{id}_U) \in \Mor_\mathcal{C}(U, V)$.
\end{proof}
\begin{definition}
\label{definition-representable-functor}
A contravariant functor $F : \mathcal{C}\to \textit{Sets}$ is said
to be {\it representable} if it is isomorphic to the functor of
points $h_U$ for some object $U$ of $\mathcal{C}$.
\end{definition}
\noindent
Choose an object $U$ of $\mathcal{C}$ and an isomorphism $s : h_U \to F$.
The Yoneda lemma guarantees that the pair $(U, s)$
is unique up to unique isomorphism. The object
$U$ is called an object {\it representing} $F$.
\section{Products of pairs}
\label{section-products-pairs}
\begin{definition}
\label{definition-products}
Let $x, y\in \Ob(\mathcal{C})$.
A {\it product} of $x$ and $y$ is
an object $x \times y \in \Ob(\mathcal{C})$
together with morphisms
$p\in \Mor_{\mathcal C}(x \times y, x)$ and
$q\in\Mor_{\mathcal C}(x \times y, y)$ such
that the following universal property holds: for
any $w\in \Ob(\mathcal{C})$ and morphisms
$\alpha \in \Mor_{\mathcal C}(w, x)$ and
$\beta \in \Mor_\mathcal{C}(w, y)$
there is a unique
$\gamma\in \Mor_{\mathcal C}(w, x \times y)$ making
the diagram
$$
\xymatrix{
w \ar[rrrd]^\beta \ar@{-->}[rrd]_\gamma \ar[rrdd]_\alpha & & \\
& & x \times y \ar[d]_p \ar[r]_q & z \\
& & x &
}
$$
commute.
\end{definition}
\noindent
If a product exists it is unique up to unique
isomorphism. This follows from the Yoneda lemma as
the definition requires $x \times y$ to be an object
of $\mathcal{C}$ such that
$$
h_{x \times y}(w) = h_x(w) \times h_y(w)
$$
functorially in $w$. In other words the product $x \times y$
is an object representing the functor
$w \mapsto h_x(w) \times h_y(w)$.
\begin{definition}
\label{definition-has-products-of-pairs}
We say the category $\mathcal{C}$ {\it has products of pairs
of objects} if a product $x \times y$
exists for any $x, y \in \Ob(\mathcal{C})$.
\end{definition}
\noindent
We use this terminology to distinguish this notion from the notion
of ``having products'' or ``having finite products'' which usually means
something else (in particular it always implies there exists a
final object).
\section{Coproducts of pairs}
\label{section-coproducts-pairs}
\begin{definition}
\label{definition-coproducts}
Let $x, y \in \Ob(\mathcal{C})$.
A {\it coproduct}, or {\it amalgamated sum} of $x$ and $y$ is
an object $x \amalg y \in \Ob(\mathcal{C})$
together with morphisms
$i \in \Mor_{\mathcal C}(x, x \amalg y)$ and
$j \in \Mor_{\mathcal C}(y, x \amalg y)$ such
that the following universal property holds: for
any $w \in \Ob(\mathcal{C})$ and morphisms
$\alpha \in \Mor_{\mathcal C}(x, w)$ and
$\beta \in \Mor_\mathcal{C}(y, w)$
there is a unique
$\gamma \in \Mor_{\mathcal C}(x \amalg y, w)$ making
the diagram
$$
\xymatrix{
& y \ar[d]^j \ar[rrdd]^\beta \\
x \ar[r]^i \ar[rrrd]_\alpha & x \amalg y \ar@{-->}[rrd]^\gamma \\
& & & w
}
$$
commute.
\end{definition}
\noindent
If a coproduct exists it is unique up to unique
isomorphism. This follows from the Yoneda lemma (applied to the
opposite category) as
the definition requires $x \amalg y$ to be an object
of $\mathcal{C}$ such that
$$
\Mor_\mathcal{C}(x \amalg y, w) =
\Mor_\mathcal{C}(x, w) \times \Mor_\mathcal{C}(y, w)
$$
functorially in $w$.
\begin{definition}
\label{definition-has-coproducts-of-pairs}
We say the category $\mathcal{C}$ {\it has coproducts of pairs
of objects} if a coproduct $x \amalg y$
exists for any $x, y \in \Ob(\mathcal{C})$.
\end{definition}
\noindent
We use this terminology to distinguish this notion from the notion
of ``having coproducts'' or ``having finite coproducts'' which usually means
something else (in particular it always implies there exists an
initial object in $\mathcal{C}$).
\section{Fibre products}
\label{section-fibre-products}
\begin{definition}
\label{definition-fibre-products}
Let $x, y, z\in \Ob(\mathcal{C})$,
$f\in \Mor_\mathcal{C}(x, y)$
and $g\in \Mor_{\mathcal C}(z, y)$.
A {\it fibre product} of $f$ and $g$ is
an object $x \times_y z\in \Ob(\mathcal{C})$
together with morphisms
$p \in \Mor_{\mathcal C}(x \times_y z, x)$ and
$q \in \Mor_{\mathcal C}(x \times_y z, z)$ making the diagram
$$
\xymatrix{
x \times_y z \ar[r]_q \ar[d]_p & z \ar[d]^g \\
x \ar[r]^f & y
}
$$
commute, and such that the following universal property holds: for
any $w\in \Ob(\mathcal{C})$ and morphisms
$\alpha \in \Mor_{\mathcal C}(w, x)$ and
$\beta \in \Mor_\mathcal{C}(w, z)$ with
$f \circ \alpha= g\circ \beta$
there is a unique
$\gamma\in \Mor_{\mathcal C}(w, x \times_z y)$ making
the diagram
$$
\xymatrix{
w \ar[rrrd]^\beta \ar@{-->}[rrd]_\gamma \ar[rrdd]_\alpha & & \\
& & x \times_y z \ar[d]^p \ar[r]_q & z \ar[d]^g \\
& & x \ar[r]^f & y
}
$$
commute.
\end{definition}
\noindent
If a fibre product exists it is unique up to unique
isomorphism. This follows from the Yoneda lemma as
the definition requires $x \times_y z$ to be an object
of $\mathcal{C}$ such that
$$
h_{x \times_y z}(w) = h_x(w) \times_{h_y(w)} h_z(w)
$$
functorially in $w$. In other words the fibre product $x \times_y z$
is an object representing the functor
$w \mapsto h_x(w) \times_{h_y(w)} h_z(w)$.
\begin{definition}
\label{definition-cartesian}
We say a commutative diagram
$$
\xymatrix{
w \ar[r] \ar[d] &
z \ar[d] \\
x \ar[r] &
y
}
$$
in a category is {\it cartesian} if $w$ and the morphisms $w \to x$ and
$w \to z$ form a fibre product of the morphisms $x \to y$ and $z \to y$.
\end{definition}
\begin{definition}
\label{definition-has-fibre-products}
We say the category $\mathcal{C}$ {\it has fibre products} if
the fibre product exists for any $f\in \Mor_{\mathcal C}(x, z)$
and $g\in \Mor_{\mathcal C}(y, z)$.
\end{definition}
\begin{definition}
\label{definition-representable-morphism}
A morphism $f : x \to y$ of a category $\mathcal{C}$ is said to be
{\it representable}, if and only if for every morphism $z \to y$
in $\mathcal{C}$ the fibre product $z \times_y x$ exists.
\end{definition}
\begin{lemma}
\label{lemma-composition-representable}
Let $\mathcal{C}$ be a category.
Let $f : x \to y$, and $g : y \to z$ be representable.
Then $g \circ f : x \to z$ is representable.
\end{lemma}
\begin{proof}
Omitted.
\end{proof}
\begin{lemma}
\label{lemma-base-change-representable}
Let $\mathcal{C}$ be a category.
Let $f : x \to y$ be representable.
Let $y' \to y$ be a morphism of $\mathcal{C}$.
Then the morphism $x' := x \times_y y' \to y'$ is representable also.
\end{lemma}
\begin{proof}
Let $z \to y'$ be a morphism. The fibre product
$x' \times_{y'} z$ is supposed to represent the
functor
\begin{eqnarray*}
w & \mapsto & h_{x'}(w)\times_{h_{y'}(w)} h_z(w) \\
& = & (h_x(w) \times_{h_y(w)} h_{y'}(w)) \times_{h_{y'}(w)} h_z(w) \\
& = & h_x(w) \times_{h_y(w)} h_z(w)
\end{eqnarray*}
which is representable by assumption.
\end{proof}
\section{Examples of fibre products}
\label{section-example-fibre-products}
\noindent
In this section we list examples of fibre products and
we describe them.
\medskip\noindent
As a really trivial first example we observe
that the category of sets has fibred products and hence every
morphism is representable. Namely, if $f : X \to Y$
and $g : Z \to Y$ are maps of sets then we define
$X \times_Y Z$ as the subset of $X \times Z$ consisting
of pairs $(x, z)$ such that $f(x) = g(z)$. The morphisms
$p : X \times_Y Z \to X$ and $q : X \times_U Z \to Z$ are
the projection maps $(x, z) \mapsto x$, and $(x, z) \mapsto z$.
Finally, if $\alpha : W \to X$ and $\beta : W \to Z$
are morphisms such that $f \circ \alpha = g \circ \beta$
then the map $W \to X \times Y$, $w\mapsto (\alpha(w), \beta(w))$
obviously ends up in $X \times_Y Z$ as desired.
\medskip\noindent
In many categories whose objects are sets endowed with certain types of
algebraic structures the fibre product of the underlying sets also
provides the fibre product in the category. For example, suppose
that $X$, $Y$ and $Z$ above are groups and that $f$, $g$ are
homomorphisms of groups. Then the set-theoretic fibre product
$X \times_Y Z$ inherits the structure of a group, simply by
defining the product of two pairs by the formula
$(x, z) \cdot (x', z') = (xx', zz')$. Here we list those categories
for which a similar reasoning works.
\begin{enumerate}
\item The category $\textit{Groups}$ of groups.
\item The category $G\textit{-Sets}$ of sets
endowed with a left $G$-action for some fixed group $G$.
\item The category of rings.
\item The category of $R$-modules given a ring $R$.
\end{enumerate}
\section{Fibre products and representability}
\label{section-representable-map-presheaves}
\noindent
In this section we work out fibre products in the
category of contravariant functors from a category
to the category of sets. This will later be superseded
during the discussion of sites, presheaves, sheaves. Of some
interest is the notion of a ``representable morphism'' between
such functors.
\begin{lemma}
\label{lemma-fibre-product-presheaves}
Let $\mathcal{C}$ be a category.
Let $F, G, H : \mathcal{C}^{opp} \to \textit{Sets}$
be functors. Let $a : F \to G$ and $b : H \to G$ be
transformations of functors. Then the fibre product
$F \times_{a, G, b} H$ in the category
$\text{Fun}(\mathcal{C}^{opp}, \textit{Sets})$
exists and is given by the formula
$$
(F \times_{a, G, b} H)(X) =
F(X) \times_{a_X, G(X), b_X} H(X)
$$
for any object $X$ of $\mathcal{C}$.
\end{lemma}
\begin{proof}
Omitted.
\end{proof}
\noindent
As a special case suppose we have a morphism
$a : F \to G$, an object $U \in \Ob(\mathcal{C})$
and an element $\xi \in G(U)$. According to the Yoneda
Lemma \ref{lemma-yoneda} this gives a transformation
$\xi : h_U \to G$. The fibre product in this case
is described by the rule
$$
(h_U \times_{\xi, G, a} F)(X) =
\{ (f, \xi') \mid f : X \to U, \ \xi' \in F(X), \ G(f)(\xi) = a_X(\xi')\}
$$
If $F$, $G$ are also representable, then this is the functor representing the
fibre product, if it exists, see Section \ref{section-fibre-products}.
The analogy with Definition \ref{definition-representable-morphism}
prompts us to define a notion
of representable transformations.
\begin{definition}
\label{definition-representable-map-presheaves}
Let $\mathcal{C}$ be a category.
Let $F, G : \mathcal{C}^{opp} \to \textit{Sets}$
be functors. We say a morphism $a : F \to G$ is
{\it representable}, or that {\it $F$ is relatively representable
over $G$}, if for every $U \in \Ob(\mathcal{C})$
and any $\xi \in G(U)$ the functor
$h_U \times_G F$ is representable.
\end{definition}
\begin{lemma}
\label{lemma-representable-over-representable}
Let $\mathcal{C}$ be a category.
Let $a : F \to G$ be a morphism of contravariant functors
from $\mathcal{C}$ to $\textit{Sets}$. If $a$ is representable,
and $G$ is a representable functor, then $F$ is representable.
\end{lemma}
\begin{proof}
Omitted.
\end{proof}
\begin{lemma}
\label{lemma-representable-diagonal}
Let $\mathcal{C}$ be a category.
Let $F : \mathcal{C}^{opp} \to \textit{Sets}$ be a functor.
Assume $\mathcal{C}$ has products of pairs of objects and fibre products.
The following are equivalent:
\begin{enumerate}
\item The diagonal $F \to F \times F$ is representable.
\item For every $U$ in $\mathcal{C}$,
and any $\xi \in F(U)$ the map $\xi : h_U \to F$ is representable.
\end{enumerate}
\end{lemma}
\begin{proof}
Suppose the diagonal is representable, and let $U, \xi$ be given.
Consider any $V \in \Ob(\mathcal{C})$ and any
$\xi' \in F(V)$. Note that $h_U \times h_V = h_{U \times V}$
is representable. Hence the fibre product of the maps
$(\xi, \xi') : h_U \times h_V \to F \times F$
and $F \to F \times F$ is representable by assumption.
This means there exists $W \in \Ob(\mathcal{C})$,
morphisms $W \to U$, $W \to V$ and $h_W \to F$ such that
$$
\xymatrix{
h_W \ar[d] \ar[r] & F \ar[d] \\
h_U \times h_V \ar[r] & F \times F
}
$$
is cartesian. We leave it to the reader to see that this
implies that $h_W = h_U \times_F h_V$ as desired.
\medskip\noindent
Assume (2) holds. Consider any $V \in \Ob(\mathcal{C})$
and any $(\xi, \xi') \in (F \times F)(V)$. We have to show that
$h_V \times_{F \times F} F$ is representable. What we know is that
$h_V \times_{\xi, F, \xi'} h_V$ is representable, say by $W$
in $\mathcal{C}$ with corresponding morphisms $a, a' : W \to V$
(such that $\xi \circ a = \xi' \circ a'$).
Consider $W' = W \times_{(a, a'), V \times V} V$.
It is formal to show that $W'$ represents $h_V \times_{F \times F} F$
because
$$
h_{W'} = h_W \times_{h_V \times h_V} h_V
= (h_V \times_{\xi, F, \xi'} h_V) \times_{h_V \times h_V} h_V
= F \times_{F \times F} h_V.
$$
\end{proof}
\section{Pushouts}
\label{section-pushouts}
\noindent
The dual notion to fibre products is that of pushouts.
\begin{definition}
\label{definition-pushouts}
Let $x, y, z\in \Ob(\mathcal{C})$,
$f\in \Mor_\mathcal{C}(y, x)$
and $g\in \Mor_{\mathcal C}(y, z)$.
A {\it pushout} of $f$ and $g$ is
an object $x\amalg_y z\in \Ob(\mathcal{C})$
together with morphisms
$p\in \Mor_{\mathcal C}(x, x\amalg_y z)$ and
$q\in\Mor_{\mathcal C}(z, x\amalg_y z)$ making the diagram
$$
\xymatrix{
y \ar[r]_g \ar[d]_f & z \ar[d]^q \\
x \ar[r]^p & x\amalg_y z
}
$$
commute, and such that the following universal property holds:
For any $w\in \Ob(\mathcal{C})$ and morphisms
$\alpha \in \Mor_{\mathcal C}(x, w)$ and
$\beta \in \Mor_\mathcal{C}(z, w)$ with
$\alpha \circ f = \beta \circ g$ there is a unique
$\gamma\in \Mor_{\mathcal C}(x\amalg_z y, w)$ making
the diagram
$$
\xymatrix{
y \ar[r]_g \ar[d]_f & z \ar[d]^q \ar[rrdd]^\beta & & \\
x \ar[r]^p \ar[rrrd]^\alpha & x \amalg_y z \ar@{-->}[rrd]^\gamma & & \\
& & & w
}
$$
commute.
\end{definition}
\noindent
It is possible and straightforward to prove the uniqueness of the triple
$(x\amalg_y z, p, q)$ up to unique isomorphism (if it exists) by direct
arguments. Another possibility is to think of the coproduct as the
product in the opposite category, thereby getting this uniqueness for
free from the discussion in Section \ref{section-fibre-products}.
\begin{definition}
\label{definition-cocartesian}
We say a commutative diagram
$$
\xymatrix{
y \ar[r] \ar[d] & z \ar[d] \\
x \ar[r] & w
}
$$
in a category is {\it cocartesian} if $w$ and the morphisms $x \to w$ and
$z \to w$ form a pushout of the morphisms $y \to x$ and $y \to z$.
\end{definition}