-
Notifications
You must be signed in to change notification settings - Fork 2
/
exercises.tex
2766 lines (2538 loc) · 147 KB
/
exercises.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
% Notes and exercises on Category Theory
\documentclass[letterpaper,12pt]{article}
\usepackage{amsmath,amssymb,amsthm,enumitem,fourier,diagrams,tikz-cd}
\usepackage[hidelinks]{hyperref}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\true}{\top}
\newcommand{\false}{\bot}
\newcommand{\vertex}{\bullet}
\newcommand{\iso}{\cong}
\newcommand{\eq}{\sim}
\newcommand{\eqv}{\simeq}
\newcommand{\xto}{\xrightarrow}
\newcommand{\parto}{\rightharpoondown}
\newcommand{\mono}{\rightarrowtail}
\newcommand{\epi}{\twoheadrightarrow}
\newcommand{\adj}{\dashv}
\newcommand{\radj}{\vdash}
\newcommand{\adjrule}{\frac}
\newcommand{\limplies}{\Rightarrow}
\newcommand{\ex}{\Rightarrow}
\newcommand{\edge}{\rightarrow}
\newcommand{\sect}{\cap}
\newcommand{\bigunion}{\bigcup}
\newcommand{\meet}{\wedge}
\newcommand{\bigmeet}{\bigwedge}
\newcommand{\join}{\vee}
\newcommand{\bigjoin}{\bigvee}
\newcommand{\compl}{\lnot}
\newcommand{\obj}{{\cdot}}
\newcommand{\after}{\circ}
\newcommand{\limit}{\varprojlim}
\newcommand{\colimit}{\varinjlim}
\newcommand{\eval}{\epsilon}
\newcommand{\term}{{!}}
\newcommand{\mult}{\cdot}
\newcommand{\mprod}{\otimes}
\newcommand{\tprod}{\otimes}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\cod}{cod}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\fdom}{\mathbf{dom}}
\DeclareMathOperator{\fst}{fst}
\DeclareMathOperator{\snd}{snd}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Sub}{Sub}
\DeclareMathOperator{\Diagrams}{\mathbf{Diagrams}}
\DeclareMathOperator{\Cone}{\mathbf{Cone}}
\DeclareMathOperator{\pow}{\mathcal{P}}
\DeclareMathOperator{\ult}{Ult}
\DeclareMathOperator{\up}{\uparrow}
\DeclareMathOperator{\down}{\downarrow}
\DeclareMathOperator{\ev}{ev}
\DeclareMathOperator{\id}{id}
\newcommand{\pair}[2]{\langle{#1},{#2}\rangle}
\newcommand{\pairing}[1]{\langle#1\rangle}
\newcommand{\copair}[2]{[{#1},{#2}]}
\newcommand{\copairing}[1]{[#1]}
\newcommand{\comp}[1]{\overline{#1}}
\newcommand{\inv}[1]{#1^{-1}}
\renewcommand{\star}[1]{#1^{*}}
\newcommand{\cat}[1]{\mathbf{#1}}
\newcommand{\dual}[1]{#1^{\mathrm{op}}}
\newcommand{\arr}[1]{#1^{\rightarrow}}
\newcommand{\under}[1]{|{#1}|}
\newcommand{\gen}[1]{\langle{#1}\rangle}
\newcommand{\curry}[1]{\lambda{#1}}
\newcommand{\uncurry}[1]{\overline{#1}}
\newcommand{\pull}[1]{#1^{*}}
\newcommand{\fin}[1]{#1_{\mathrm{fin}}}
\newcommand{\comma}[2]{(#1|#2)}
\newcommand{\tr}[1]{\overline{#1}}
\newcommand{\sprod}[2]{\langle#1,#2\rangle}
\newcommand{\2}{\cat{2}}
\newcommand{\A}{\cat{A}}
\newcommand{\B}{\cat{B}}
\newcommand{\C}{\cat{C}}
\newcommand{\Cop}{\dual{\C}}
\newcommand{\D}{\cat{D}}
\newcommand{\Dop}{\dual{\D}}
\newcommand{\E}{\cat{E}}
\newcommand{\Ee}{\mathcal{E}}
\newcommand{\J}{\cat{J}}
\renewcommand{\P}{\cat{P}}
\newcommand{\V}{\cat{V}}
\newcommand{\Vop}{\dual{\V}}
\newcommand{\X}{\cat{X}}
\newcommand{\Rel}{\cat{Rel}}
\newcommand{\Relop}{\dual{\Rel}}
\newcommand{\Sets}{\cat{Sets}}
\newcommand{\Setsop}{\dual{\Sets}}
\newcommand{\Setsp}{\Sets_*}
\newcommand{\Setsf}{\fin{\Sets}}
\newcommand{\Setsfop}{\dual{\Setsf}}
\newcommand{\SetsCop}{\Sets^{\Cop}}
\newcommand{\Par}{\cat{Par}}
\newcommand{\Mon}{\cat{Mon}}
\newcommand{\Grp}{\cat{Groups}}
\newcommand{\Pre}{\cat{Pre}}
\newcommand{\Pos}{\cat{Pos}}
\newcommand{\Posop}{\dual{\Pos}}
\newcommand{\Types}{\C(\lambda)}
\newcommand{\Cat}{\cat{Cat}}
\newcommand{\BA}{\cat{BA}}
\newcommand{\BAop}{\dual{\BA}}
\newcommand{\BAf}{\fin{\BA}}
\newcommand{\Ord}{\cat{Ord}}
\newcommand{\Ordf}{\fin{\Ord}}
\newcommand{\Grph}{\cat{Graphs}}
\newcommand{\Vect}{\cat{Vect}}
\newcommand{\Vectop}{\dual{\Vect}}
\newcommand{\powBA}{\pow^{\BA}}
\newcommand{\powBAop}{\dual{(\powBA)}}
\newcommand{\powU}{\pow^{\up}}
% Arrows
\newarrow{Mono} >--->
\newarrow{Epi} ----{>>}
% Theorems
\theoremstyle{definition}
\newtheorem*{exer}{Exercise}
\theoremstyle{remark}
\newtheorem*{rmk}{Remark}
\newtheoremstyle{direction}{0.5em}{0.5em}{}{}{}{}{0.5em}{}
\theoremstyle{direction}
\newtheorem*{fwd}{\(\implies\)}
\newtheorem*{bwd}{\(\impliedby\)}
% Meta
\title{\textit{Category Theory}\\Notes and Exercises}
\author{John Peloquin}
\date{}
\begin{document}
\maketitle
\section*{Introduction}
This document contains notes and exercises from~\cite{awodey}.
\newpage
\section*{Chapter 1}
\begin{rmk}
If \(\C\)~is a category and \(C\in\C\), then the identity arrow \(C\to C\) is terminal in~\(\C/C\);\footnote{The concept of a terminal object is defined in Chapter~2.} moreover if \(C\)~is terminal in~\(\C\), then \(\C/C\iso\C\). In this sense, \emph{taking a slice at an object amounts to making that object terminal}.
\end{rmk}
\begin{rmk}
If \(\C\)~is a category and \(X\to C\) is an arrow in~\(\C\), then
\[(\C/C)/(X/C)\iso\C/X\]
In other words, \emph{a slice of a slice is a slice}.
\end{rmk}
\begin{exer}[1]
In~\(\Rel\), let the objects be sets and the arrows be relations between sets,\footnote{An arrow \(A\to B\) between sets \(A\)~and~\(B\) is understood as a triple \((R,A,B)\) with \(R\subseteq A\times B\).} with identities and composites defined as usual for relations.
\begin{enumerate}[itemsep=0pt]
\item[(a)] \(\Rel\)~is a category.
\item[(b)] Let \(G:\Sets\to\Rel\) map sets to themselves and functions to their graphs, so \(G(A)=A\) and
\[G(f:A\to B)=\{\,\pair{x}{f(x)}\mid x\in A\,\}\subseteq A\times B\]
Then \(G\)~is a functor.
\item[(c)] Let \(C:\Relop\to\Rel\) map sets to themselves and relations to their inverses, so \(C(A)=A\) and
\[C(R\subseteq A\times B)=\inv{R}=\{\,\pair{y}{x}\mid\pair{x}{y}\in R\,\}\subseteq B\times A\]
Then \(C\)~is a functor.
\end{enumerate}
\begin{proof}\
\begin{enumerate}[itemsep=0pt]
\item[(a)] We must verify that composition of relations is associative and unital. Suppose \(R\subseteq A\times B\), \(S\subseteq B\times C\), and \(T\subseteq C\times D\). For \(\pair{w}{z}\in A\times D\), by the definition of composition we have
\begin{align*}
\pair{w}{z}\in(T\after S)\after R&\iff\exists x\in B[\pair{w}{x}\in R\land\pair{x}{z}\in T\after S]\\
&\iff\exists x\in B,y\in C[\pair{w}{x}\in R\land\pair{x}{y}\in S\land\pair{y}{z}\in T]\\
&\iff\exists y\in C[\pair{w}{y}\in S\after R\land\pair{y}{z}\in T]\\
&\iff\pair{w}{z}\in T\after(S\after R)
\end{align*}
So \((T\after S)\after R=T\after(S\after R)\). It is immediate that \(R\after 1_A=R=1_B\after R\), where \(1_X\)~denotes the identity relation on~\(X\).
\item[(b)] By construction, \(G\)~maps objects to objects and arrows to arrows, and \(G(f:A\to B)\)~is an arrow from \(G(A)=A\) to \(G(B)=B\). Clearly \(G(1_A)=1_A=1_{G(A)}\). If \(f:A\to B\) and \(g:B\to C\), then \((g\after f)(x)=z\) if and only if \(f(x)=y\) and \(g(y)=z\), so \(G(g\after f)=G(g)\after G(f)\).
\item[(c)] Recall for a relation \(R\subseteq A\times B\), \(R\)~is represented as an arrow in~\(\Rel\) by the triple~\((R,A,B)\), and in~\(\Relop\) by the triple~\((R,B,A)\), where it is denoted by~\(\star{R}\).\footnote{Importantly, \(R\)~is \emph{not} represented in~\(\Relop\) by~\((\inv{R},B,A)\). The arrow is reversed by swapping the domain and codomain, but the underlying relation (set of ordered pairs) is unchanged.} So in~\(\Rel\), \(\dom R=A\) and \(\cod R=B\), whereas in~\(\Relop\), \(\dom\star{R}=B=\star{B}\) and \(\cod\star{R}=A=\star{A}\), where \(R\)~and~\(\star{R}\) are here treated as arrows.
By construction, \(C\)~maps objects to objects and arrows to arrows. Now \(C((R,B,A))=(\inv{R},B,A)\), so \(C\)~preserves domains and codomains. Also
\[C(1_{\star{A}})=C(\star{1_A})=\inv{1_A}=1_A=1_{C(\star{A})}\]
For \(S\subseteq B\times C\),
\[C(\star{R}\after\star{S})=C(\star{(S\after R)})=\inv{(S\after R)}=\inv{R}\after\inv{S}=C(\star{R})\after C(\star{S})\qedhere\]
\end{enumerate}
\end{proof}
\end{exer}
\begin{exer}[2]\
\begin{enumerate}[itemsep=0pt]
\item[(a)] \(\Rel\iso\Relop\)
\item[(b)] \(\Sets\not\iso\Setsop\)
\item[(c)] For any set~\(X\) with powerset~\(P(X)\), \(P(X)\iso\dual{P(X)}\) as poset categories.
\end{enumerate}
\begin{proof}\
\begin{enumerate}[itemsep=0pt]
\item[(a)] The functor in Exercise~1(c) is its own inverse, hence is an isomorphism.
\item[(b)] The empty function is the only function into the empty set, but there is no set with exactly one function out of it.
\item[(c)] Recall in~\(P(X)\) there exists a unique arrow \(A\to B\) if and only if \(A\subseteq B\), hence in~\(\dual{P(X)}\) there exists a unique arrow \(A\to B\) if and only if \(A\supseteq B\).
For \(A\subseteq X\), write \(\comp{A}=X-A=\{\,x\in X\mid x\not\in A\,\}\). Define \(C:\dual{P(X)}\to P(X)\) by \(C(A)=\comp{A}\) and
\[C(A\to B)=\comp{A}\to\comp{B}=C(A)\to C(B)\]
which is well defined since \(A\supseteq B\) if and only if \(\comp{A}\subseteq\comp{B}\). Clearly \(C\)~maps objects to objects and arrows to arrows, and also preserves domains and codomains. Substituting \(A\)~for~\(B\) above shows that \(C\)~preserves identities. For \(X\supseteq A\supseteq B\supseteq D\),
\[C(A\to B\to D)=\comp{A}\to\comp{B}\to\comp{D}=C(A)\to C(B)\to C(D)\]
so \(C\)~preserves composites. Therefore \(C\)~is a functor. Since \(C\)~is clearly its own inverse, \(C\)~is an isomorphism.\qedhere
\end{enumerate}
\end{proof}
\end{exer}
\begin{exer}[3]\
\begin{enumerate}[itemsep=0pt]
\item[(a)] In~\(\Sets\), the isomorphisms are precisely the bijections.
\item[(b)] In~\(\Mon\), the isomorphisms are precisely the bijective homomorphisms.
\item[(c)] In~\(\Pos\), the isomorphisms are \emph{not} the bijective homomorphisms.
\end{enumerate}
\begin{proof}\
\begin{enumerate}[itemsep=0pt]
\item[(a)] A function \(f:A\to B\) has a (two-sided) inverse if and only if it is bijective. Indeed, suppose \(g:B\to A\) is an inverse of~\(f\). If \(a,a'\in A\) and \(f(a)=f(a')\), then
\[a=1_A(a)=(g\after f)(a)=g(f(a))=g(f(a'))=(g\after f)(a')=1_A(a')=a'\]
If \(b\in B\), then \(b=1_B(b)=(f\after g)(b)=f(g(b))\). Conversely, if \(f\)~is bijective, then for each \(b\in B\) we can let~\(g(b)\) be the unique \(a\in A\) with \(f(a)=b\). Then \(g:B\to A\) is clearly an inverse of~\(f\).
\item[(b)] A monoid homomorphism is, in particular, a function, hence an isomorphism is a bijective homomorphism by~(a). Conversely, if \(f:A\to B\) is a bijective homomorphism, then \(f\)~has an inverse \emph{function} \(g:B\to A\) by~(a). If \(b,b'\in B\), then
\[bb'=1_B(b)1_B(b')=(f\after g)(b)(f\after g)(b')=f(g(b))f(g(b'))=f(g(b)g(b'))\]
so
\[g(bb')=g(f(g(b)g(b')))=(g\after f)(g(b)g(b'))=1_A(g(b)g(b'))=g(b)g(b')\]
Therefore \(g\)~is a homomorphism and hence \(f\)~is an isomorphism.
\item[(c)] As in~(b), a poset homomorphism is, in particular, a function, hence an isomorphism is a bijective homomorphism by~(a). However, unlike in~(b), the inverse of a bijective homomorphism need not be a homomorphism. For example, consider a poset consisting of two copies of \(\N=(N,\le)\) with no relations between the copies. Map this poset into~\(\N\) by ``zipping'' the two copies together, sending one to the evens in order, and the other to the odds in order. This mapping is clearly a bijective homomorphism, but its inverse is not since, for example, \(0\le 1\) in the image, but the preimage of~\(0\) is not related to the preimage of~\(1\).\qedhere
\end{enumerate}
\end{proof}
\end{exer}
\begin{exer}[5]
Let \(\C\)~be a category and \(C\in\C\). Let \(U:\C/C\to\C\) ``forget about the base object~\(C\)'' by mapping each object \(f:A\to C\) to its domain~\(A\) and each arrow \(a:A\to B\) to ``itself.''\footnote{An arrow in~\(\C/C\) is understood as a triple \((a,f,f')\) where \(a:A\to B\), \(f:A\to C\), and \(f':B\to C\) are arrows in~\(\C\) with \(f=f'\after a\). So \(U((a,f,f'))=a\).} Then \(U\)~is a functor.
Let \(F:\C/C\to\arr{\C}\) map objects to themselves and each arrow \(a:A\to B\) to the pair~\((a,1_C)\), where \(1_C\)~is the identity arrow for~\(C\) in~\(\C\). Then \(F\)~is a functor, and \(\fdom\after F=U\), where \(\fdom:\arr{\C}\to\C\) is the functor mapping each object \(f:A\to B\) to its domain~\(A\) and each arrow \((g_1,g_2)\) to~\(g_1\).
\end{exer}
\begin{proof}
\(U\)~maps objects to objects and arrows to arrows, and preserves domains and codomains of arrows. Since \(\C/C\) inherits identities and composites from~\(\C\), \(U\)~also preserves identities and composites. Therefore \(U\)~is a functor.
\(F\)~maps objects to objects and arrows to arrows, and preserves domains and codomains of arrows, since if \(a:A\to B\) maps \(f:A\to C\) to \(f':B\to C\) in~\(\C/C\), then \(1_C\after f=f=f'\after a\), hence \((a,1_C)\)~maps~\(f\) to~\(f'\) in~\(\arr{\C}\). Since \(\arr{\C}\)~also inherits identities and composites from~\(\C\), \(F\)~also preserves identities and composites. Therefore \(F\)~is a functor. Clearly \(\fdom\after F=U\).
\end{proof}
\begin{exer}[8]
For a (small) category~\(\C\), let \(P(\C)\) consist of the objects from~\(\C\) ordered as follows:
\begin{center}
\(A\le B\) if and only if there exists an arrow \(A\to B\) in~\(\C\)
\end{center}
Then \(P(\C)\)~is a preorder, and \(P:\Cat\to\Pre\) determines a functor with \(P\after C=1_{\Pre}\), where \(C:\Pre\to\Cat\) is the evident inclusion functor.
\end{exer}
\begin{proof}
Reflexivity and transitivity of the order in~\(P(\C)\) follow from the existence of identities and composites in~\(\C\). So \(P\)~maps categories to preorders. For a functor \(F:\C\to\D\), let \(P(F)\)~be the restriction of~\(F\) to objects. If \(A\le B\) in~\(P(\C)\), there exists an arrow \(f:A\to B\) in~\(\C\). But then \(F(f):F(A)\to F(B)\) is an arrow in~\(\D\), so \(F(A)\le F(B)\) in~\(P(\D)\). Therefore \(P(F)\)~is monotone, and hence \(P\)~maps functors to preorder homomorphisms. Since \(P\)~just restricts functors to objects, it preserves domains and codomains, identities, and composites, hence it is a functor. It is obvious that \(P\after C=1_{\Pre}\).
\end{proof}
\begin{rmk}
In general \(C\after P\ne 1_{\Cat}\) because \(P\)~loses information about the arrow structure of categories. Specifically, multiple arrows from one object to another will be represented by a single relation between those objects under~\(P\).
\end{rmk}
\begin{exer}[11]
There exists a functor \(M:\Sets\to\Mon\) mapping each set~\(A\) to the free monoid on~\(A\).
\end{exer}
\begin{proof}
We prove this in two ways.
\begin{enumerate}[itemsep=0pt]
\item[(a)] Let \(M(A)=\star{A}\) and for \(f:A\to B\) define \(M(f):\star{A}\to\star{B}\) by
\[M(f)(a_1\cdots a_k)=f(a_1)\cdots f(a_k)\quad a_1,\ldots,a_k\in A\]
\(M(f)\)~is well defined on~\(\star{A}\) since every element in~\(\star{A}\) can be expressed uniquely as a product of elements of~\(A\), and by construction \(M(f)\)~is a monoid homomorphism extending~\(f\). So \(M\)~maps objects to objects and arrows to arrows. Clearly \(M\)~preserves domains and codomains of arrows and \(M(1_A)=1_{\star{A}}\). If \(g:B\to C\), then
\begin{align*}
M(g\after f)(a_1\cdots a_k)&=(g\after f)(a_1)\cdots(g\after f)(a_k)\\
&=g(f(a_1))\cdots g(f(a_k))\\
&=M(g)(f(a_1)\cdots f(a_k))\\
&=M(g)(M(f)(a_1\cdots a_k))\\
&=(M(g)\after M(f))(a_1\cdots a_k)
\end{align*}
So \(M(g\after f)=M(g)\after M(f)\) and \(M\)~preserves composites. Therefore \(M\)~is a functor.
\item[(b)] Let \(M(A)\)~be ``the'' free monoid on~\(A\) satisfying the universal mapping property (Propositions 1.9~and~1.10). For \(f:A\to B\to\under{M(B)}\), let \(M(f)\)~be the unique monoid homomorphism from~\(M(A)\) to~\(M(B)\) extending~\(f\). Clearly \(M\)~maps objects to objects and arrows to arrows, and preserves domains and codomains of arrows. Now \(1_{M(A)}\)~extends~\(1_A\), hence we must have \(M(1_A)=1_{M(A)}\). Similarly if \(g:B\to C\to\under{M(C)}\), then \(M(g)\after M(f)\) extends~\(g\after f\), hence we must have \(M(g\after f)=M(g)\after M(f)\). Therefore \(M\)~is a functor.\qedhere
\end{enumerate}
\end{proof}
\begin{rmk}
A homomorphism \(h:M(A)\to B\) is uniquely determined by its action on~\(A\), where this action is \(\under{h}\after i:A\to\under{M(A)}\to\under{B}\). This is trivially true by the universal mapping property since \(h\)~extends~\(\under{h}\after i\) to~\(M(A)\), that is, \(\under{h}\after i=\under{h}\after i\). This is a familiar concept in mathematics (for example, a linear transformation of a vector space is uniquely determined by its action on a basis, etc.).
\end{rmk}
\newpage
\section*{Chapter~2}
\begin{rmk}
Recall that a monoid homomorphism \(h:M(A)\to B\) is uniquely determined by its action on~\(A\). For inclusion \(i:A\to\under{M(A)}\) and homomorphisms \(j,k:M(A)\to B\), this implies that if \(\under{j}\after i=\under{k}\after i\) then \(j=k\). So while \(i\)~is not an epi in~\(\Sets\) (it is not a surjection) and is not even an arrow in~\(\Mon\) (it is not a homomorphism), it is like an epi \emph{if} we blur the line between \(\Sets\)~and~\(\Mon\). It is ``structurally surjective'' in the sense that once a homomorphic structure is determined on~\(A\), it is determined on~\(M(A)\).\footnote{Compare with Example~2.5.}
\end{rmk}
\begin{exer}[1]
In~\(\Sets\), the epis are precisely the surjections. Therefore the isos are precisely the epi-monos.
\end{exer}
\begin{proof}
If \(f:A\to B\) is a surjection, then \(f\)~has a right inverse (AC), hence \(f\)~is a split epi. Conversely, if \(f\)~is not a surjection, there exists \(b\in B\) with \(b\not\in f[A]\). Define \(g:B\to 2\) by
\[g(x)=\begin{cases}
1&\text{if }x=b\\
0&\text{otherwise}
\end{cases}\]
Then \(g\ne0\), but \(g\after f=0\after f\), so \(f\)~is not an epi. Therefore the epis are precisely the surjections.
Now by this result and Proposition~2.2, the epi-monos are precisely the bijections. By Exercise~1.3, the bijections are precisely the isos. Therefore the epi-monos are precisely the isos.
\end{proof}
\begin{exer}[2]
In a poset category, every arrow is an epi-mono since there is at most one arrow between any two objects.
\end{exer}
\begin{exer}[3]
Inverses are unique.
\end{exer}
\begin{proof}
If \(f:A\to B\) and \(g,g':B\to A\) are inverses of~\(f\), then
\[g=g\after 1_B=g\after(f\after g')=(g\after f)\after g'=1_A\after g'=g'\qedhere\]
\end{proof}
\begin{exer}[4]
Let \(f:A\to B\), \(g:B\to C\), and \(h:A\to C\) form a commutative triangle (\(h=g\after f\)):
\begin{diagram}[nohug]
A &\rTo^f &B\\
&\rdTo_h&\dTo>g\\
& &C
\end{diagram}
\begin{enumerate}[itemsep=0pt]
\item[(a)] If \(f\)~and~\(g\) are monic [epic, iso], so is~\(h\).
\item[(b)] If \(h\)~is monic, so is~\(f\).
\item[(c)] If \(h\)~is epic, so is~\(g\).
\item[(d)] If \(h\)~is monic, \(g\)~need not be.
\item[(e)] If \(h\)~is epic, \(f\)~need not be.
\end{enumerate}
\begin{proof}\
\begin{enumerate}[itemsep=0pt]
\item[(a)] Suppose \(f\)~and~\(g\) are monic. If \(x,y:D\to A\) and \(h\after x=h\after y\), then
\[g\after(f\after x)=(g\after f)\after x=h\after x=h\after y=(g\after f)\after y=g\after(f\after y)\]
so \(f\after x=f\after y\) since \(g\)~is monic, and \(x=y\) since \(f\)~is monic. Therefore \(h\)~is monic.
Suppose \(f\)~and~\(g\) are epic. If \(i,j:C\to D\) and \(i\after h=j\after h\), then
\[(i\after g)\after f=i\after (g\after f)=i\after h=j\after h=j\after(g\after f)=(j\after g)\after f\]
so \(i\after g=j\after g\) since \(f\)~is epic, and \(i=j\) since \(g\)~is epic. Therefore \(h\)~is epic.\footnote{This also follows from the previous result by duality. If \(f\)~and~\(g\) are epic in~\(\C\), then \(\star{f}\)~and~\(\star{g}\) are monic in~\(\Cop\), so \(\star{h}\)~is monic in~\(\Cop\), so \(h\)~is epic in~\(\C\).}
If \(f\)~and~\(g\) are isos, then \(\inv{h}=\inv{f}\after\inv{g}\), so \(h\)~is an iso.
\item[(b)] If \(f\)~is not monic, choose \(x\ne y\) such that \(f\after x=f\after y\). Then
\[h\after x=(g\after f)\after x=g\after(f\after x)=g\after(f\after y)=(g\after f)\after y=h\after y\]
So \(h\)~is not monic.
\item[(c)] If \(g\)~is not epic, choose \(i\ne j\) such that \(i\after g=j\after g\). Then
\[i\after h=i\after(g\after f)=(i\after g)\after f=(j\after g)\after f=j\after(g\after f)=j\after h\]
So \(h\)~is not epic.\footnote{This also follows from the previous result by duality. If \(h\)~is epic in~\(\C\), then \(\star{h}=\star{f}\after\star{g}\)~is monic in~\(\Cop\), so \(\star{g}\)~is monic in~\(\Cop\), so \(g\)~is epic in~\(\C\).}
\item[(d),(e)] In~\(\Sets\), let \(A=C=1\) and \(B=2\) and let \(f=0_{A\to B}\) and \(g=0_{B\to C}\). Then \(h=0_{A\to C}\) is both monic and epic, but \(g\)~is not monic and \(f\)~is not epic.\qedhere
\end{enumerate}
\end{proof}
\end{exer}
\begin{exer}[5]
For \(f:A\to B\), the following are equivalent:
\begin{enumerate}[itemsep=0pt]
\item[(a)] \(f\)~is an iso.
\item[(b)] \(f\)~is a mono and a split epi.
\item[(c)] \(f\)~is a split mono and an epi.
\item[(d)] \(f\)~is a split mono and a split epi.
\end{enumerate}
\begin{proof}
It is immediate that (a)~\(\implies\)~(d)~\(\implies\)~(b),(c).
For (b)~\(\implies\)~(a), suppose that \(f\)~is monic and \(g:B\to A\) satisfies \(f\after g=1_B\). We claim \(g\)~also satisfies \(g\after f=1_A\), so \(f\)~is an iso. But this follows from
\[f\after(g\after f)=(f\after g)\after f=1_B\after f=f=f\after 1_A\]
since \(f\)~is monic.
For (c)~\(\implies\)~(a), suppose that \(f\)~is epic and \(g:B\to A\) satisfies \(g\after f=1_A\). We claim \(g\)~also satisfies \(f\after g=1_B\), so \(f\)~is an iso. But this follows from
\[(f\after g)\after f=f\after(g\after f)=f\after 1_A=f=1_B\after f\]
since \(f\)~is epic.\footnote{This also follows from the previous result by duality. If \(f\)~is epic and \(g\)~is a left inverse of~\(f\) in~\(\C\), then \(\star{f}\)~is monic and \(\star{g}\)~is a right inverse of~\(\star{f}\) in~\(\Cop\). Therefore \(\star{f}\)~is an iso in~\(\Cop\), so \(f\)~is an iso in~\(\C\).}
\end{proof}
\end{exer}
\begin{exer}[7]
A retract of a projective object is projective.
\end{exer}
\begin{proof}
Let \(P\)~be projective and \(R\)~be a retract of~\(P\) where \(s:R\to P\), \(r:P\to R\), and \(r\after s=1_R\). Suppose \(f:R\to Y\) and \(e:X\epi Y\). Note \(f\after r:P\to Y\), so by projectivity of~\(P\) there exists \(p:P\to X\) such that \(e\after p=f\after r\):
\begin{diagram}[nohug]
& & & &X\\
& & &\ruTo(4,2)^p &\dEpi>e\\
P &\pile{\rTo^r\\\lTo_s} &R &\rTo_f &Y
\end{diagram}
Now \(p\after s:R\to X\) and
\[e\after(p\after s)=(e\after p)\after s=(f\after r)\after s=f\after(r\after s)=f\after 1_R=f\]
Therefore \(R\)~is projective.
\end{proof}
\begin{exer}[8]
In~\(\Sets\), every set is projective.
\end{exer}
\begin{proof}
If \(f:P\to Y\) and \(g:X\epi Y\), then since \(g\)~is surjective (Exercise~1), \(g\)~has a right inverse \(h:Y\to X\) with \(g\after h=1_Y\). Set \(p=h\after f:P\to X\):
\begin{diagram}[nohug]
& &X\\
&\ruTo^{p=h\after f}&\dEpi<g\uTo>h\\
P &\rTo_f &Y
\end{diagram}
Then
\[g\after p=g\after(h\after f)=(g\after h)\after f=1_Y\after f=f\]
Therefore \(P\)~is projective.
\end{proof}
\begin{rmk}
Projectivity is more interesting in categories of structured sets, where it implies ``freeness'' of structure allowing factoring of outgoing morphisms.
\end{rmk}
\begin{exer}[11]
For a set~\(A\), let \(A\text{-}\Mon\) be the category of \(A\)-monoids \((M,m)\), where \(M\)~is a monoid and \(m:A\to U(M)\), with arrows \(h:(M,m)\to(N,n)\), where \(h:M\to N\) is a monoid homomorphism and \(n=U(h)\after m\).
An initial object in \(A\text{-}\Mon\) is just a free monoid on~\(A\) in~\(\Mon\).
\end{exer}
\begin{proof}
The \(A\)-monoid~\((M,m)\) is initial if and only if for all \(A\)-monoids~\((N,n)\), there is a unique \(A\)-monoid homomorphism \(h:(M,m)\to(N,n)\). This is just to say that \(m:A\to U(M)\) and for all monoids~\(N\) with \(n:A\to U(N)\) there is a unique monoid homomorphism \(h:M\to N\) with \(n=U(h)\after m\). But this is just the universal mapping property for the free monoid on~\(A\) in~\(\Mon\).
\end{proof}
\begin{exer}[12]
For a Boolean algebra~\(B\), Boolean homomorphisms \(p:B\to\2\) correspond exactly to ultrafilters in~\(B\).
\end{exer}
\begin{proof}
If \(p:B\to\2\) is a homomorphism, then \(U_p=\inv{p}(1)\) is an ultrafilter in~\(B\). Indeed, \(U_p\ne\emptyset\) since \(p(1)=1\), and \(U_p\ne B\) since \(p(0)=0\ne 1\). If \(a\in U_p\) and \(a\le b\), then \(1=p(a)\le p(b)\), so \(p(b)=1\) and \(b\in U_p\). If \(a\in U_p\) and \(b\in U_p\), then
\[p(a\meet b)=p(a)\meet p(b)=1\meet 1=1\]
so \(a\meet b\in U_p\). Finally, if \(a\not\in U_p\) then \(p(a)=0\), so \(p(\compl a)=\compl p(a)=1\) and \(\compl a\in U_p\). On the other hand, \(p(a)\meet p(\compl a)=0\), so we cannot have \(a\in U_p\) and \(\compl a\in U_p\).
Conversely, if \(U\)~is an ultrafilter in~\(B\) and \(p_U:B\to\2\) is defined by
\[
p_U(x)=\begin{cases}
1&\text{if }x\in U\\
0&\text{otherwise}
\end{cases}
\]
then \(p\)~is a homomorphism, by reasoning similar to that above. Clearly the maps \(p\mapsto U_p\) and \(U\mapsto p_U\) are mutually inverse.
\end{proof}
\begin{exer}[13]
In any category with binary products,
\[(A\times B)\times C\iso A\times (B\times C)\]
\end{exer}
\begin{proof}
Instead of using the universal property of a ternary product, we use only the universal properties of the binary products. Define
\[f=\pair{p_A\after p_{A\times B}}{\pair{p_B\after p_{A\times B}}{p_C}}:(A\times B)\times C\to A\times(B\times C)\]
where the \(p\)'s are the obvious projections, and
\[g=\pair{\pair{q_A}{q_B\after q_{B\times C}}}{q_C\after q_{B\times C}}:A\times(B\times C)\to(A\times B)\times C\]
where the \(q\)'s are the obvious projections. Then \(f\) and~\(g\) are inverses, so they are isomorphisms. For example,
\begin{align*}
f\after g&=\pair{p_A\after p_{A\times B}}{\pair{p_B\after p_{A\times B}}{p_C}}\after g\\
&=\pair{p_A\after p_{A\times B}\after g}{\pair{p_B\after p_{A\times B}\after g}{p_C\after g}}\\
&=\pair{p_A\after \pair{q_A}{q_B\after q_{B\times C}}}{\pair{p_B\after \pair{q_A}{q_B\after q_{B\times C}}}{q_C\after q_{B\times C}}}\\
&=\pair{q_A}{\pair{q_B\after q_{B\times C}}{q_C\after q_{B\times C}}}\\
&=\pair{q_A}{q_{B\times C}}\\
&=1_{A\times(B\times C)}\qedhere
\end{align*}
\end{proof}
\begin{exer}[15]
For a category~\(\C\) and objects \(A,B\in\C\), let \(\C_{A,B}\)~be the category with objects \((X,x_1,x_2)\), where \(x_1:X\to A\) and \(x_2:X\to B\) in~\(\C\), and with arrows \(f:(X,x_1,x_2)\to(Y,y_1,y_2)\), where \(f:X\to Y\) and \(x_i=y_i\after f\) in~\(\C\).
A terminal object in~\(\C_{A,B}\) is just a product of \(A\)~and~\(B\) in~\(\C\).
\end{exer}
\begin{proof}
Object \((P,p_1,p_2)\) in~\(\C_{A,B}\) is terminal if and only if for all objects \((X,x_1,x_2)\) there is a unique \(p:(X,x_1,x_2)\to(P,p_1,p_2)\). This is just to say that \(p_1:P\to A\), \(p_2:P\to B\), and for all objects \(X\in\C\) with arrows \(x_1:X\to A\) and \(x_2:X\to B\) there is a unique \(p:X\to P\) with \(x_i=p_i\after p\). But this is just the universal mapping property for the product~\(A\times B\) in~\(\C\).
\end{proof}
\begin{rmk}
The objects in~\(\C_{A,B}\) are just pairs of ``generalized elements'' of \(A\)~and~\(B\) in~\(\C\). A terminal object in~\(\C_{A,B}\) has a unique ``generalized element'' for every such pair, hence it is just the product~\(A\times B\).
\end{rmk}
\begin{exer}[16]
Let \(\Types\)~be the category of types in the \(\lambda\)-calculus. Then the product functor \(\times:\Types\times\Types\to\Types\) maps objects \(A\)~and~\(B\) to~\(A\times B\) and arrows \(f:A\to B\) and \(g:A'\to B'\) to \(f\times g:A\times A'\to B\times B'\) where
\[f\times g=\lambda c.\pair{f(\fst(c))}{g(\snd(c))}\]
For any fixed type~\(A\), there is a functor~\(A\to(-)\) on~\(\Types\) taking each type~\(X\) to the type~\(A\to X\).
\end{exer}
\begin{proof}
We know \(\Types\)~has products, so the product functor is defined on~\(\Types\). For \(f:A\to B\) and \(g:A'\to B'\), if
\[A\lTo^{p_1}A\times A'\rTo^{p_2}A'\]
where \(p_1=\lambda z.\fst(z)\) and \(p_2=\lambda z.\snd(z)\), then
\begin{align*}
f\times g&=\pair{f\after p_1}{g\after p_2}\\
&=\lambda c.\pair{f(p_1c)}{g(p_2c)}\\
&=\lambda c.\pair{f(\fst(c))}{g(\snd(c))}
\end{align*}
Fix a type~\(A\). Let \(A\to(-)\)~map each type~\(X\) to the type~\(A\to X\) and map each function \(f:X\to Y\) to the function \(\overline{f}:(A\to X)\to(A\to Y)\) given by \(\overline{f}=\lambda g.f\after g\), where \(f\after g=\lambda x.f(gx)\). We claim this mapping is a functor.
Indeed, this mapping clearly maps objects to objects and arrows to arrows and it preserves domains and codomains of arrows. It also clearly preserves identities. If \(g:Y\to Z\), then
\begin{align*}
\overline{g\after f}&=\lambda h.(g\after f)\after h\\
&=\lambda h.g\after(f\after h)\\
&=\lambda h.\overline{g}(\overline{f}h)\\
&=\overline{g}\after\overline{f}
\end{align*}
So the mapping also preserves composites.\footnote{Note preservation of identities and composites relies on \(\beta\eta\)-equivalence for \emph{equality} of the functions involved.} Therefore it is a functor.
\end{proof}
\begin{rmk}
This result shows that in functional programming languages such as Haskell, functions of a fixed input type are ``functorial'' types. This implies that functions on arbitrary types can be lifted to operate on such functions through composition.
\end{rmk}
\begin{exer}[17]
In any category~\(\C\) with products, define the \emph{graph} of an arrow \(f:A\to B\) by
\[\Gamma(f)=\pair{1_A}{f}:A\mono A\times B\]
Then \(\Gamma(f)\)~is a mono for every arrow~\(f\).
In~\(\Sets\), \(\Gamma\)~determines a functor \(G:\Sets\to\Rel\) mapping sets to themselves and functions to their graphs.
\end{exer}
\begin{proof}
To see that \(\Gamma(f)\)~is a mono, suppose \(x,y:X\to A\) and \(\Gamma(f)\after x=\Gamma(f)\after y\). By the universal mapping property of~\(A\times B\),
\[\Gamma(f)\after x=\pair{1_A}{f}\after x=\pair{1_A\after x}{f\after x}=\pair{x}{f\after x}\]
Similarly \(\Gamma(f)\after y=\pair{y}{f\after y}\). Therefore \(\pair{x}{f\after x}=\pair{y}{f\after y}\), so \(x=y\).
Define \(G:\Sets\to\Rel\) by \(G(A)=A\) and \(G(f:A\to B)=\Gamma(f)[A]\subseteq A\times B\). Then clearly \(G\)~is just the map from Exercise~1.1(b), which is a functor.
\end{proof}
\newpage
\section*{Chapter~3}
\begin{exer}[1]
Let \(\C\)~be a (locally small) category. Then
\[A\rTo^{c_1}C\lTo^{c_2}B\]
is a coproduct if and only if for all objects~\(Z\) the function
\begin{align*}
\Hom(C,Z)&\to\Hom(A,Z)\times\Hom(B,Z)\\
f&\mapsto\pair{f\after c_1}{f\after c_2}
\end{align*}
is an iso.
\end{exer}
\begin{proof}
By duality, the given diagram is a coproduct in~\(\C\) if and only if
\[\star{A}\lTo^{\star{c_1}}\star{C}\rTo^{\star{c_2}}\star{B}\]
is a product in~\(\Cop\). We know this diagram is a product in~\(\Cop\) if and only if for all objects~\(\star{Z}\), the function
\begin{align*}
\Hom_{\Cop}(\star{Z},\star{C})&\to\Hom_{\Cop}(\star{Z},\star{A})\times\Hom_{\Cop}(\star{Z},\star{B})\\
\star{f}&\mapsto\pair{\star{c_1}\after\star{f}}{\star{c_2}\after\star{f}}
\end{align*}
is an iso (Proposition~2.20). But by definition of~\(\Cop\),
\[\Hom_{\Cop}(\star{Z},\star{X})=\Hom_{\C}(X,Z)\]
for all objects \(X\in\C\) and \(\star{c_i}\after\star{f}=\star{(f\after c_i)}\) for all arrows \(f\in\C\), so the functions are the same.
\end{proof}
\begin{exer}[2]
The free monoid functor preserves coproducts, that is,
\[M(A+B)\iso M(A)+M(B)\]
\end{exer}
\begin{proof}
By the universal property of~\(M(A)\), let \(i_1:M(A)\to M(A+B)\) extend the inclusion \(A\to A+B\to\under{M(A+B)}\).\footnote{The inclusion \(A\to A+B\) is from the coproduct construction, and the inclusion \(A+B\to\under{M(A+B)}\) is from the free monoid construction. Observe \(A\to A+B\) is lifted to~\(i_1\) by the free monoid functor.} Similarly let \(i_2:M(B)\to M(A+B)\) extend the inclusion \(B\to A+B\to\under{M(A+B)}\). We claim
\[M(A)\rTo^{i_1}M(A+B)\lTo^{i_2}M(B)\]
is a coproduct of \(M(A)\)~and~\(M(B)\), from which the desired result follows by uniqueness of the coproduct (Proposition~3.12).
Given \(x:M(A)\to N\) and \(y:M(B)\to N\), let \(\under{x}_A:A\to\under{N}\) be the composite of the inclusion \(A\to\under{M(A)}\) with \(\under{x}:\under{M(A)}\to\under{N}\), and similarly let \(\under{y}_B:B\to\under{N}\) be the composite of the inclusion \(B\to\under{M(B)}\) with \(\under{y}:\under{M(B)}\to\under{N}\). By the universal property of~\(A+B\), there is a unique copairing~\(\copair{\under{x}_A}{\under{y}_B}:A+B\to\under{N}\), and by the universal property of~\(M(A+B)\) this copairing extends uniquely to a homomorphism \(z:M(A+B)\to N\).
It follows from the copairing and the universal property of~\(M(A)\) that \(z\after i_1=x\) since both \(z\after i_1\)~and~\(x\) extend~\(\under{x}_A\) to~\(M(A)\), and similarly \(z\after i_2=y\). Moreover it follows from uniqueness of the copairing and the extension that \(z\)~uniquely satisfies these equations. Therefore \(z\)~is a copairing~\(\copair{x}{y}\), and \(M(A+B)\)~is a coproduct of \(M(A)\)~and~\(M(B)\) as claimed.
\end{proof}
\begin{exer}[4]
If \(\powBA:\Setsop\to\BA\) denotes the (contravariant) powerset Boolean algebra functor, then
\[\powBA(A+B)\iso\powBA(A)\times\powBA(B)\]
\end{exer}
\begin{proof}
We have \(\powBA\iso\Hom_{\Sets}(-,2)\),\footnote{See Chapter~7.} and the contravariant representable functors map coproducts to products by the dual of Corollary~2.22.
\end{proof}
\begin{exer}[5]
Let \(\C\)~be the category of proofs in a natural deduction system with disjunction introduction rules
\[\begin{array}{c}
\varphi\\
\hline
\varphi\lor\psi
\end{array}
\qquad
\begin{array}{c}
\psi\\
\hline
\varphi\lor\psi
\end{array}\]
and disjunction elimination rule
\[\begin{array}{ccc}
&[\varphi]&[\psi]\\
&\vdots&\vdots\\
\varphi\lor\psi&\vartheta&\vartheta\\
\hline
&\vartheta&
\end{array}\]
Note the introduction rules give proofs \(i_1:\varphi\to\varphi\lor\psi\) and \(i_2:\psi\to\varphi\lor\psi\), and the elimination rule gives a proof \(\copair{p}{q}:\varphi\lor\psi\to\vartheta\) from proofs \(p:\varphi\to\vartheta\) and \(q:\psi\to\vartheta\).
For any proofs \(p:\varphi\to\vartheta\), \(q:\psi\to\vartheta\), and \(r:\varphi\lor\psi\to\vartheta\), identify proofs under the equations
\[\copair{p}{q}\after i_1=p\qquad \copair{p}{q}\after i_2=q\qquad [r\after i_1,r\after i_2]=r\]
to disregard unnecessary introduction and elimination of disjunction.
Then \(\C\)~has coproducts, and in fact \(\varphi+\psi=\varphi\lor\psi\).
\end{exer}
\begin{proof}
To see that
\[\varphi\rTo^{i_1}\varphi\lor\psi\lTo^{i_2}\psi\]
is a coproduct, suppose \(p:\varphi\to\vartheta\) and \(q:\psi\to\vartheta\) are proofs. Let \(r:\varphi\lor\psi\to\vartheta\) be the proof given by application of the elimination rule to \(p\)~and~\(q\). Then by the first two identification rules, \(r\after i_1=p\) and \(r\after i_2=q\). If \(s:\varphi\lor\psi\to\vartheta\) also satisfies these properties, then by the second identification rule
\[s=[s\after i_1,s\after i_2]=[p,q]=[r\after i_1,r\after i_2]=r\]
Therefore \(r\)~is unique, and so \(\varphi\lor\psi\)~is a coproduct.
\end{proof}
\begin{rmk}
Dually, it can be shown that the category of proofs in a system with conjunction elimination rules
\[\begin{array}{c}
\varphi\land\psi\\
\hline
\varphi
\end{array}
\qquad
\begin{array}{c}
\varphi\land\psi\\
\hline
\psi
\end{array}\]
determining proofs \(p_1:\varphi\land\psi\to\varphi\) and \(p_2:\varphi\land\psi\to\psi\), together with conjunction introduction rule
\[\begin{array}{ccc}
&[\vartheta]&[\vartheta]\\
&\vdots&\vdots\\
\vartheta&\varphi&\psi\\
\hline
&\varphi\land\psi&
\end{array}\]
determining a proof \(\pair{p}{q}:\vartheta\to\varphi\land\psi\) from proofs \(p:\vartheta\to\varphi\) and \(q:\vartheta\to\psi\), all under identification rules
\[p_1\after\pair{p}{q}=p\qquad p_2\after\pair{p}{q}=q\qquad\pair{p_1\after r}{p_2\after r}=r\]
for arbitrary proofs \(p:\vartheta\to\varphi\), \(q:\vartheta\to\psi\), and \(r:\vartheta\to\varphi\land\psi\), has products, and in fact \(\varphi\times\psi=\varphi\land\psi\).
\end{rmk}
\begin{exer}[6]
The category~\(\Mon\) has all equalizers.
\end{exer}
\begin{proof}
Given any monoid homomorphisms \(f,g:A\to B\), define the set
\[E=\{\,x\in A\mid f(x)=g(x)\,\}\]
We claim \(E\)~is a submonoid of~\(A\). Indeed, \(u_A\in E\) since \(f(u_A)=u_B=g(u_A)\), and if \(x,y\in E\) then \(xy\in E\) since
\[f(xy)=f(x)f(y)=g(x)g(y)=g(xy)\]
Let \(i:E\to A\) be the inclusion homomorphism. It follows that \(i\)~is an equalizer of \(f\)~and~\(g\), by the same argument used in~\(\Sets\).
\end{proof}
\begin{exer}[7]
Let \(\C\)~be a category with coproducts. If \(P\)~and~\(Q\) are projective, then \(P+Q\)~is projective.
\end{exer}
\begin{proof}
Suppose
\[P\rTo^{i_1}P+Q\lTo^{i_2}Q\]
is a coproduct diagram. If \(f:P+Q\to X\) and \(e:E\epi X\), then by projectivity of \(P\)~and~\(Q\) there exist arrows \(\overline{f\after i_1}:P\to E\) and \(\overline{f\after i_2}:Q\to E\) satisfying equations \(e\after\overline{f\after i_k}=f\after i_k\). Define \(\overline{f}=\copair{\overline{f\after i_1}}{\overline{f\after i_2}}\). Then
\[e\after\overline{f}
=e\after\copair{\overline{f\after i_1}}{\overline{f\after i_2}}
=\copair{e\after\overline{f\after i_1}}{e\after\overline{f\after i_2}}
=\copair{f\after i_1}{f\after i_2}
=f\]
Therefore \(P+Q\)~is projective.
\end{proof}
\begin{exer}[8]
An object~\(Q\) is \emph{injective} in a category~\(\C\) if \(\star{Q}\)~is projective in~\(\Cop\), that is, if for all arrows \(f:X\to Q\) and monos \(m:X\mono A\), there exists \(\overline{f}:A\to Q\) such that \(\overline{f}\after m=f\):
\begin{diagram}[nohug]
X &\rTo^f &Q\\
\dMono<m&\ruTo_{\overline{f}} &\\
A & &
\end{diagram}
In~\(\Pos\), the empty poset is not injective, but the singleton poset is injective.
\end{exer}
\begin{proof}
For the empty poset, consider any nonempty~\(A\).
\end{proof}
\begin{exer}[11]
The category~\(\Sets\) has all coequalizers.
\end{exer}
\begin{proof}
Given any functions \(f,g:A\to B\), let \(\eq\)~be the equivalence relation on~\(B\) generated by pairs \(f(x)\eq g(x)\) for all \(x\in A\).\footnote{This is defined as the intersection of all equivalence relations on~\(B\) containing all such pairs, which is the smallest equivalence relation containing all such pairs. Note this intersection is well defined since \(B\times B\) is an equivalence relation on~\(B\) containing all such pairs.} Let \(C\)~be the quotient~\(B/\eq\). We claim the projection \(\pi:B\to C\) given by \(y\mapsto[y]\) is a coequalizer of \(f\)~and~\(g\).
Clearly \(\pi\after f=\pi\after g\) since for \(x\in A\), \(f(x)\eq g(x)\), hence
\[\pi(f(x))=[f(x)]=[g(x)]=\pi(g(x))\]
Suppose \(h:B\to D\) satisfies \(h\after f=h\after g\). Let \(\eq_h\)~be the equivalence relation on~\(B\) defined by
\[y\eq_h z\iff h(y)=h(z)\]
Note \(f(x)\eq_h g(x)\) for all \(x\in A\) since \(h\after f=h\after g\). This implies \({\eq}\subseteq{\eq_h}\), so if \(y\eq z\) then \(h(y)=h(z)\). In other words, \(h\)~respects~\(\eq\). Define \(\overline{h}:C\to D\) by \([y]\mapsto h(y)\). Then \(\overline{h}\)~is well defined since \(h\)~respects~\(\eq\), and \(\overline{h}\after\pi=h\). Moreover, \(\overline{h}\)~is unique since \(\pi\)~is epic (surjective).
Therefore \(\pi\)~is a coequalizer of \(f\)~and~\(g\).
\end{proof}
\begin{exer}[14]
In the category~\(\Sets\):
\begin{enumerate}[itemsep=0pt]
\item[(a)] If \(f:A\to B\) and
\[A\lTo^{p_1}A\times A\rTo^{p_2}A\]
then the equalizer of \(f\after p_1\)~and~\(f\after p_2\) is an equivalence relation on~\(A\), called the \emph{kernel} of~\(f\).
\item[(b)] If \(R\)~is an equivalence relation on~\(A\) and \(\pi:A\to A/R\) is the projection \(x\mapsto[x]\), then \(\ker\pi=R\).
\item[(c)] If \(R\)~is a binary relation on~\(A\) and \(\gen{R}\)~is the equivalence relation on~\(A\) generated by~\(R\), then the projection \(\pi:A\to A/\gen{R}\) is a coequalizer of the projections \(p_1,p_2:R\to A\).
\item[(d)] If \(R\)~is a binary relation on~\(A\), then \(\gen{R}\)~is just the kernel of the coequalizer of the projections \(p_1,p_2:R\to A\).
\end{enumerate}
\end{exer}
\begin{proof}\
\begin{enumerate}[itemsep=0pt]
\item[(a)] We know (Example~3.15) that the equalizer is just (the inclusion of)
\begin{align*}
E&=\{\,(x,y)\mid f\after p_1(x,y)=f\after p_2(x,y)\,\}\\
&=\{\,(x,y)\mid f(x)=f(y)\,\}\subseteq A\times A
\end{align*}
It is immediate that \(E\)~is an equivalence relation on~\(A\).
\item[(b)] We have
\begin{align*}
(x,y)\in\ker\pi&\iff\pi(x)=\pi(y)\\
&\iff[x]=[y]\\
&\iff(x,y)\in R
\end{align*}
\item[(c)] By the proof of Exercise~11 with \(f=p_1\) and \(g=p_2\).
\item[(d)] By part~(b) we know \(\gen{R}=\ker\pi\) where \(\pi:A\to A/\gen{R}\) is the projection \(x\mapsto[x]\), and by part~(c) we know \(\pi\)~is a coequalizer of the projections \(p_1,p_2:R\to A\).\qedhere
\end{enumerate}
\end{proof}
\begin{rmk}
The kernel of a function is just the set of pairs of elements identified or equated by the function. For projecton under an equivalence relation, this is obviously just the relation itself. If we want to identify elements under an \emph{arbitrary} relation (using a quotient construction), then we must also identify elements under the equivalence relation generated by that relation.
\end{rmk}
\newpage
\section*{Chapter~4}
\begin{rmk}
For a group in a category, the characterizing ``equations''
\begin{gather*}
m(m(x,y),z)=m(x,m(y,z))\\
m(x,u)=x=m(u,x)\\
m(x,ix)=u=m(ix,x)
\end{gather*}
must be understood to \emph{mean} that the following diagrams commute:
\begin{diagram}
(Z\times Z)\times Z & &\rTo^{\iso} & &Z\times(Z\times Z)\\
\dTo<{(m\after(x\times y))\times z} & & & &\dTo>{x\times(m\after(y\times z))}\\
G\times G &\rTo_m &G &\lTo_m &G\times G
\end{diagram}
\begin{diagram}
Z\times 1 &\lTo^{\pair{1_Z}{!}}_{\iso}&Z &\rTo^{\pair{!}{1_Z}}_{\iso} &1\times Z\\
\dTo<{x\times u}& &\dTo<x & &\dTo>{u\times x}\\
G\times G &\rTo_m &G &\lTo_m &G\times G
\end{diagram}
\begin{diagram}
Z\times Z &\lTo^{\Delta} &Z &\rTo^{\Delta} &Z\times Z\\
\dTo<{x\times ix} & &\dTo<{u!} & &\dTo>{ix\times x}\\
G\times G &\rTo_m &G &\lTo_m &G\times G
\end{diagram}
Note that a ``pair'' like \((x,y)\) in an ``equation'' is interpreted as a product arrow \(x\times y\) in the corresponding diagram.
The defining diagrams for~\(G\) commute if and only if the above diagrams commute for all \(x,y,z:Z\to G\). Indeed, for the forward direction, the above diagrams can be factored through the diagrams for~\(G\); for the reverse direction, taking \(x=y=z=1_G\) in the above diagrams yields the diagrams for~\(G\).
\end{rmk}
\begin{rmk}
We can also consider the concept of a \emph{group (or monoid) in a monoidal category}, which has the monoidal product~\(\mprod\) instead of~\(\times\) in its definition. For example, a \emph{monad} on a category~\(\C\) is a monoid in the monoidal category~\(\C^{\C}\) of endofunctors of~\(\C\) under composition.\footnote{See Chapters 7 and~10.}
\end{rmk}
\begin{rmk}
The homomorphism theorem for groups (Theorem~4.10) shows that for a group homomorphism \(h:G\to H\), \(\ker h\)~is universal among the normal subgroups of~\(G\) factorization through which preserves~\(h\). Equivalently, \(G/\ker h\) is universal among quotients through which \(h\)~is preserved.
In detail, \(K=\ker h\) is a normal subgroup of~\(G\) making the following diagram commute:
\begin{diagram}[nohug]
G &\rTo^h &H\\
\dTo<{\pi_K}&\ruTo>{\overline{h_K}} &\\
G/K & &
\end{diagram}
Given any normal subgroup \(N\)~of~\(G\) making the following diagram commute:
\begin{diagram}[nohug]
G &\rTo^h &H\\
\dTo<{\pi_N}&\ruTo>{\overline{h_N}} &\\
G/N & &
\end{diagram}
there exists a unique homomorphism \(\pi_{K/N}:G/N\to G/K\) making the following diagram commute:
\begin{diagram}[nohug]
G/N &\rTo^{\overline{h_N}} &H\\
\dTo<{\pi_{K/N}}&\ruTo>{\overline{h_K}} &\\
G/K & &
\end{diagram}
Indeed, \(\pi_{K/N}([x]_N)=[x]_K\) is a well defined homomorphism since \(N\subseteq K\), and
\[(\overline{h_K}\after\pi_{K/N})([x]_N)=\overline{h_K}(\pi_{K/N}([x]_N))=\overline{h_K}([x]_K)=h(x)=\overline{h_N}([x]_N)\]
Also \(\pi_{K/N}\)~is unique since \(\overline{h_K}\)~is injective. In other words, \(\overline{h_N}\)~factors uniquely through~\(\overline{h_K}\).
Intuitively, as \(N\)~ranges from \(1\)~to~\(K\), \(G/N\)~``collapses'' more and more of the structure of~\(G\) while still preserving~\(h\). Since \(G/K\)~is the ``smallest'' with this property, it is always possible to collapse from~\(G/N\) to \(G/K\) and still preserve~\(h\).
Observe \(\pi_{K/N}\)~is surjective and \(\ker\pi_{K/N}=K/N\), from which it follows that
\[(G/N)/(K/N)\iso G/K\]
This is just the third isomorphism theorem for groups.
\end{rmk}
\begin{exer}[1]
Let \(G\)~be a group. A categorical congruence~\(\eq\) on~\(G\) (viewed as a category\footnote{Recall a group is a category with only one object in which every arrow is an iso.}) is the same thing as an equivalence relation on~\(G\) determined by a normal subgroup \(N\subseteq G\). Moreover, \(G/{\eq}=G/N\).
\end{exer}
\begin{proof}
If \(\eq\)~is a categorical congruence on~\(G\), then \(\eq\)~determines an equivalence relation on the arrows of~\(G\), which are just the elements of~\(G\). Let \(N=[1]\) be the equivalence class of the identity \(1\in G\). For \(x,y\in G\), observe
\begin{align*}
x\eq y&\iff xy^{-1}\eq yy^{-1}=1&&\text{by closure of~\(\eq\)}\\
&\iff xy^{-1}\in [1]=N
\end{align*}
Now \(1\in N\), and if \(x,y\in N\) then \(x\eq y\), so \(xy^{-1}\in N\). Hence \(N\)~is a subgroup of~\(G\). Moreover, if \(x\in N\) and \(y\in G\), then again by closure
\[yxy^{-1}\eq y1y^{-1}=yy^{-1}=1\]
so \(yxy^{-1}\in N\). Hence \(N\)~is normal. The above biconditional shows that \(\eq\)~is just the equivalence relation determined by~\(N\).
Conversely, if \(N\)~is a normal subgroup of~\(G\), then the equivalence relation defined by
\[x\eq y\iff xy^{-1}\in N\]
is a categorical congruence. Indeed, if \(x\eq y\) then \(x\)~is trivially parallel to~\(y\) since all arrows are parallel (there being only one object). If \(x\eq y\), then \(xy^{-1}\in N\), so for \(w,z\in G\),
\[wxz(wyz)^{-1}=wxzz^{-1}y^{-1}w^{-1}=w(xy^{-1})w^{-1}\in N\]
since \(N\)~is normal, so \(wxz\eq wyz\). Hence \(\eq\)~is closed under composition.
Now for congruence~\(\eq\), \(G/{\eq}\)~consists of one object and arrows which are the equivalence classes of the arrows in~\(G\) under~\(\eq\), composed by \([x][y]=[xy]\). This arrow structure matches the element structure of~\(G/N\), where \(N\)~is the normal subgroup of~\(G\) corresponding to~\(\eq\). Therefore \(G/{\eq}=G/N\).
\end{proof}
\begin{rmk}
This exercise shows that the homomorphism theorem for categories (Theorem~4.13) is in fact a generalization of the homomorphism theorem for groups (Theorem~4.10).
\end{rmk}
\begin{exer}[3]
If \(G\)~is an abelian group, then \(G\)~is a group in the category of groups.
\end{exer}
\begin{proof}
Since \(G\)~is a group, \(G\)~is an object in the category. Define \(m:G\times G\to G\) by \(m(x,y)=xy\). Then for \((x,y),(x',y')\in G\times G\),
\begin{align*}
m((x,y)(x',y'))&=m(xx',yy')&&\text{since }(x,y)(x',y')=(xx',yy')\\
&=xx'yy'&&\\
&=xyx'y'&&\text{since \(G\)~is abelian}\\
&=m(x,y)m(x',y')&&
\end{align*}
So \(m\)~is a homomorphism, that is, an arrow in the category. Define \(u:1\to G\) by \(u(u)=u\) and \(i:G\to G\) by \(i(x)=x^{-1}\). Clearly \(u\)~is a homomorphism. If \(x,y\in G\), then
\[i(xy)=(xy)^{-1}=y^{-1}x^{-1}=x^{-1}y^{-1}=i(x)i(y)\]
since \(G\)~is abelian. So \(i\)~is a homomorphism.
Now for \(x,y,z\in G\), we have
\[m(m(x,y),z)=m(xy,z)=(xy)z=x(yz)=m(x,yz)=m(x,m(y,z))\]
and
\[m(x,u)=xu=x=ux=m(u,x)\]
and
\[m(x,i(x))=m(x,x^{-1})=xx^{-1}=u=x^{-1}x=m(x^{-1},x)=m(i(x),x)\]
So \(m\)~is associative, \(u\)~is a unit for~\(m\), and \(i\)~is an inverse for~\(m\), for elements of~\(G\). It follows that this is also true for generalized elements of~\(G\), by definition of the homomorphism composition and pairing operations in the category. Therefore \(G\)~is a group in the category.
\end{proof}
\begin{exer}[7]
Let \(\eq\)~be a congruence in~\(\C\). If \(f,f':A\to B\), \(g,g':B\to C\), \(f\eq f'\), and \(g\eq g'\), then \(gf\eq g'f'\).
\end{exer}
\begin{proof}
By two applications of closure, we have
\[gf\eq gf'\eq g'f'\qedhere\]
\end{proof}
\begin{rmk}
Together with the fact that congruent arrows are parallel, this exercise shows that composition in the congruence category~\(\C^{\eq}\) is well defined.
\end{rmk}
\begin{exer}[8]
Let \(F,G:\C\to\D\) be functors such that \(F(X)=G(X)\) for all objects \(X\in\C\). Define a relation~\(\eq\) on the arrows of~\(\D\) as follows:
\begin{quote}
\(f\eq g\) \(\iff\) \(f\)~and~\(g\) are parallel and for all functors \(H:\D\to\E\) with \(HF=HG\), \(H(f)=H(g)\).
\end{quote}
Then \(\eq\)~is a congruence on~\(\D\), and \(\D/{\eq}\)~is a coequalizer of \(F\)~and~\(G\).
\end{exer}
\begin{proof}
It is immediate that \(\eq\)~is an equivalence relation on parallel arrows. If \(f,g:A\to B\), \(a:X\to A\), \(b:B\to Y\), and \(f\eq g\), we claim \(bfa\eq bga\). Indeed, \(bfa\)~and~\(bga\) are parallel since \(f\)~and~\(g\) are parallel, and if \(H:\D\to\E\) is a functor with \(HF=HG\), then
\[H(bfa)=H(b)H(f)H(a)=H(b)H(g)H(a)=H(bga)\]
So \(\eq\)~is closed under composition, and hence is a congruence.
Now if \(f\in\C\), then \(F(f)\)~and~\(G(f)\) are parallel since \(F\)~and~\(G\) agree on objects, and if \(H:\D\to\E\) with \(HF=HG\), then
\[H(F(f))=HF(f)=HG(f)=H(G(f))\]
Therefore \(F(f)\eq G(f)\) for all \(f\in\C\).\footnote{In fact, \(\eq\)~is the congruence generated by pairs \(F(f)\eq G(f)\) for all arrows \(f\in\C\). Compare with Exercise~3.13.}
Let \(P:\D\to\D/{\eq}\) be the projection functor \(f\mapsto[f]\). Then \(PF\)~and~\(PG\) agree on objects since \(F\)~and~\(G\) do, and \(PF\)~and~\(PG\) agree on arrows since \(F(f)\eq G(f)\) for all \(f\in\C\). Therefore \(PF=PG\). If \(H:\D\to\E\) is any functor with \(HF=HG\), then \(H\)~respects the congruence by definition of the congruence, so the functor \(\overline{H}:\D/{\eq}\to\E\) given by \([f]\mapsto H(f)\) is well defined with \(\overline{H}P=H\). Moreover, \(\overline{H}\)~is unique in this regard since \(P\)~is epic.
\end{proof}
\newpage
\section*{Chapter~5}
\begin{rmk}
The pullback functor \(\Cop\to\Cat\) (Proposition 5.10) is closely related to the slice functor \(\C/(-):\C\to\Cat\) (Section 1.6). They both map an object~\(C\) to the slice category~\(\C/C\). The former maps an arrow to a functor taking the ``inverse image'' (pullback) under that arrow, while the latter maps an arrow to a functor taking the image (composite) under that arrow.
\end{rmk}
\begin{rmk}
If \(\J\)~is an index category with initial object \(i\in\J\), then for any diagram \(D:\J\to\C\),
\[\limit_{j\in\J}D_j=D_i\]
Dually if \(i\in\J\) is a terminal object, then
\[\colimit_{j\in\J}D_j=D_i\]
\end{rmk}
\begin{rmk}
If \(F:\C\to\D\) creates limits of type~\(\J\), and \(\D\)~has all limits of type~\(\J\), then \(F\)~also preserves limits of type~\(\J\). In other words, \emph{creating limits is a stronger condition than preserving limits}, provided the target category has limits.
\end{rmk}
\begin{proof}
If \(C:\J\to\C\) is a diagram of type~\(\J\) in~\(\C\) with limit \(p_j:L\to C_j\) in~\(\C\), then \(Fp_j:FL\to FC_j\) is a cone to~\(FC\) in~\(\D\). Let \(q_j:\limit_j FC_j\to FC_j\) denote the limit of~\(FC\) in~\(\D\). Since \(F\)~creates limits, there is a limit \(p_j':L'\to C_j\) to~\(C\) in~\(\C\) with \(FL'=\limit_j FC_j\) and \(Fp_j'=q_j\). By uniqueness of limits in~\(\C\), there is \(u:L\iso L'\) with \(p_j'\after u=p_j\), so \(Fu:FL\iso FL'=\limit_j FC_j\) with
\[q_j\after Fu=Fp_j'\after Fu=F(p_j'\after u)=Fp_j\]
That is, the cone \(Fp_j:FL\to FC_j\) is isomorphic to the cone \(q_j:\limit_j FC_j\to FC_j\) in~\(\D\), so \(Fp_j:FL\to FC_j\) is a limit to~\(FC\) in~\(\D\).
\end{proof}
\begin{exer}[1]
Let \(\C\)~be a category and \(X\in\C\). A pullback in~\(\C\) over~\(X\) is just a product in~\(\C/X\).
\end{exer}
\begin{proof}
This follows directly from the universal mapping properties. Alternately, we know (Example~5.20) that a pullback is a limit of a diagram of this type:
\begin{diagram}
& &\obj\\
& &\dTo\\
\obj&\rTo &\obj
\end{diagram}
Similarly (Example~5.17), a product is a limit of a diagram of this type:
\[\obj\qquad\obj\]
A diagram of the former type in~\(\C\) over~\(X\) is just a diagram of the latter type in~\(\C/X\), so the limits coincide.
\end{proof}
\begin{exer}[3]
A pullback of a mono is a mono.
\end{exer}
\begin{proof}
Suppose \(m:M\mono A\) is a mono and \(m':M'\to A'\) is a pullback of~\(m\) along \(f:A'\to A\). Further suppose \(x,y:X\to M'\) with \(m'x=m'y\):
\begin{diagram}
X &\pile{\rTo^x\\\rTo_y} &M' &\rTo^{f'} &M\\
&\rdTo &\dTo<{m'} & &\dMono>m\\
& &A' &\rTo_f &A
\end{diagram}
Then
\[m(f'x)=(mf')x=(fm')x=f(m'x)=f(m'y)=(fm')y=(mf')y=m(f'y)\]
It follows that \(f'x=f'y\) since \(m\)~is monic. Set \(g=m'x=m'y\) and \(h=f'x=f'y\). Since \(M'\)~is a pullback, there is a unique \(z:X\to M'\) with \(m'z=g\) and \(f'z=h\), and since \(x\)~and~\(y\) both satisfy these equations, it follows that \(x=y\). Therefore \(m'\)~is monic as desired.
\end{proof}
\begin{exer}[4]
Let \(\C\)~be a category, \(A\in\C\), and \(M,N\in\Sub_{\C}(A)\). Then
\[M\subseteq N\iff\forall z:Z\to A\ (z\in_A M\implies z\in_A N)\]
\end{exer}
\begin{proof}
If \(M\subseteq N\), let \(i:M\to N\) satisfy \(m=ni\). For \(z:Z\to A\) with \(z\in_A M\), let \(\overline{z}:Z\to M\) satisfy \(z=m\overline{z}\):
\begin{diagram}[nohug]
Z &\rTo^{\overline{z}}&M &\rTo^i &N\\
&\rdTo_z &\dMono>m &\ldMono>n &\\
& &A & &
\end{diagram}
Then
\[z=m\overline{z}=(ni)\overline{z}=n(i\overline{z})\]
So \(i\overline{z}:Z\to N\) witnesses \(z\in_A N\).
Conversely, if \(z\in_A M\) implies \(z\in_A N\), then since \(m\in_A M\) trivially (\(m=m1_A\)), we have \(m\in_A N\). This means there is \(i:M\to N\) with \(m=ni\), so \(M\subseteq N\).
\end{proof}
\begin{exer}[5]
Let \(\C\)~be a category, \(A\in\C\), and \(M,N\in\Sub_{\C}(A)\). Then
\[M\equiv N\iff\forall z:Z\to A\ (z\in_A M\iff z\in_A N)\]
\end{exer}
\begin{proof}
Immediate from Exercise~4.
\end{proof}
\begin{rmk}
The previous two results justify the abuse of subset notation for subobjects through the abuse of set membership notation for generalized elements.
\end{rmk}
\begin{exer}[6]
Let \(\C\)~be a category with products and pullbacks. Then \(\C\)~has equalizers.
\end{exer}
\begin{proof}
Given \(f,g:A\to B\), construct this pullback:
\begin{diagram}
E &\rTo^h &B\\
\dTo<e & &\dTo>{\pair{1_B}{1_B}}\\
A &\rTo_{\pair{f}{g}} &B\times B
\end{diagram}
We claim that \(e:E\to A\) is an equalizer of \(f\)~and~\(g\). Indeed, since the diagram commutes,
\[\pair{fe}{ge}=\pair{f}{g}e=\pair{1_B}{1_B}h=\pair{h}{h}\]
Therefore \(fe=ge\). And if \(z:Z\to A\) with \(fz=gz\), then this square commutes:
\begin{diagram}
Z &\rTo^{fz=gz} &B\\
\dTo<z & &\dTo>{\pair{1_B}{1_B}}\\
A &\rTo_{\pair{f}{g}} &B\times B
\end{diagram}
Since \(E\)~is a pullback, there exists a unique \(u:Z\to E\) with \(z=eu\).
\end{proof}
\begin{exer}[7]
Let \(\C\)~be a locally small category with all small limits and \(C\in\C\). Then the representable functor
\[\Hom_{\C}(C,-):\C\to\Sets\]
is continuous.
\end{exer}
\begin{proof}
We prove this directly from the definition of limit, not using products and equalizers.\footnote{Compare the proof of Proposition~5.25.}
Write \(H=\Hom_{\C}(C,-)\). Let \(D:\J\to\C\) be a diagram of type~\(\J\) in~\(\C\), and let \(p_j:\limit_j D_j\to D_j\) be a limit for~\(D\) in~\(\C\). We claim \(H(p_j):H(\limit_j D_j)\to H(D_j)\) is a limit for~\(HD\) in~\(\Sets\). Indeed, clearly it is a cone to~\(HD\) in~\(\Sets\) since \(H\)~is a functor. Suppose \((X,x_j)\)~is a cone to~\(HD\) in~\(\Sets\), so the arrows \(x_j:X\to H(D_j)\) form commutative triangles of the following form for \(\alpha:i\to j\) in~\(\J\):
\begin{diagram}[nohug]
& &X & &\\
&\ldTo<{x_i}& &\rdTo>{x_j}&\\
H(D_i) & &\rTo_{H(D_{\alpha})} & &H(D_j)
\end{diagram}
We must show there is a unique \(u:X\to H(\limit_j D_j)\) in~\(\Sets\) with \(x_j=H(p_j)u\). To this end, observe that for \(x\in X\), \((C,x_j(x))\)~is a cone to~\(D\) in~\(\C\). Indeed, from the above diagram it follows that for \(j\in\J\), \(x_j(x):C\to D_j\) in~\(\C\) and for \(\alpha:i\to j\in\J\), this diagram commutes:
\begin{diagram}[nohug]
& &C & &\\
&\ldTo<{x_i(x)} & &\rdTo>{x_j(x)} &\\
D_i & &\rTo_{D_{\alpha}} & &D_j
\end{diagram}
Let \(u(x)\)~be the unique \(C\to\lim_j D_j\) in~\(\C\) with \(x_j(x)=p_ju(x)\). Then for \(x\in X\),
\[(H(p_j)u)(x)=H(p_j)(u(x))=p_ju(x)=x_j(x)\]
So \(H(p_j)u=x_j\). Moreover, if \(u':X\to H(\limit_j D_j)\) in~\(\Sets\) satisfies \(x_j=H(p_j)u'\), then for \(x\in X\), \(u'(x):C\to\limit_j D_j\) in~\(\C\) with \(x_j(x)=H(p_j)u'(x)\), so \(u'(x)=u(x)\) by uniqueness of~\(u(x)\). Therefore \(u'=u\), so \(u\)~is unique as needed.
\end{proof}
\begin{exer}[9]
Let \(\C\)~be a category with limits of type~\(\J\). There exists a category \(\Diagrams(\J,\C)\) of diagrams of type~\(\J\) in~\(\C\), and a limit functor
\[\limit_{\J}:\Diagrams(\J,\C)\to\C\]
In particular, there exists a product functor
\[\prod_{i\in I}:\Sets^{I}\to\Sets\]
for \(I\)-indexed families of sets.
\end{exer}
\begin{proof}
The objects in \(\Diagrams(\J,\C)\) are functors \(F:\J\to\C\), and the arrows are natural transformations between those functors.\footnote{In other words, \(\Diagrams(\J,\C)\) is just the functor category~\(\C^{\J}\). See Chapter~7.} More specifically, an arrow \(\theta:F\to G\) between \(F:\J\to\C\) and \(G:\J\to\C\) is a family of arrows \(\theta_j:Fj\to Gj\) for each \(j\in\J\) such that for \(\alpha:i\to j\in\J\), this square commutes:
\begin{diagram}
Fi &\rTo^{\theta_i} &Gi\\
\dTo<{F\alpha} & &\dTo>{G\alpha}\\
Fj &\rTo_{\theta_j} &Gj
\end{diagram}
The identity~\(1_F\) consists of the identity arrows~\(1_{Fj}\) for \(j\in\J\). If \(\theta:F\to G\) and \(\lambda:G\to H\), then \(\lambda\theta:F\to H\) consists of the composite arrows~\(\lambda_j\theta_j\) for \(j\in\J\). Indeed, the diagrams involved obviously commute, and associativity and unity of composition are inherited from~\(\C\).
For \(F:\J\to\C\), let \(\limit F\)~be the vertex of the limit of~\(F\) in~\(\C\). For \(\theta:F\to G\), let \(f_j:\limit F\to Fj\) and \(g_j:\limit G\to Gj\) in~\(\C\) and observe that \(\theta_jf_j:\limit F\to Gj\) is a cone to~\(G\) in~\(\C\). Let \(\limit \theta\)~be the unique \(u_{\theta}:\limit F\to\limit G\) in~\(\C\) such that \(\theta_jf_j=g_ju_{\theta}\). We claim \(\limit\)~is a functor. Indeed, it clearly maps objects to objects and arrows to arrows and preserves domains and codomains of arrows. It is also clear that \(\limit 1_F=1_{\limit F}\). If \(\theta:F\to G\) and \(\lambda:G\to H\), then \(\limit\lambda\theta\) is the unique \(u_{\lambda\theta}:\limit F\to\limit H\) such that \(\lambda_j\theta_j f_j=h_ju_{\lambda\theta}\). Now \(u_{\lambda}u_{\theta}:\limit F\to\limit H\) and it follows from \(\theta_jf_j=g_ju_{\theta}\) and \(\lambda_jg_j=h_ju_{\lambda}\) that \(\lambda_j\theta_jf_j=h_ju_{\lambda}u_{\theta}\). Therefore \(u_{\lambda\theta}=u_{\lambda}u_{\theta}\) by uniqueness of~\(u_{\lambda\theta}\), that is, \(\limit\lambda\theta=(\limit\lambda)(\limit\theta)\), as desired.
Now viewing the set~\(I\) as a discrete category, an \(I\)-indexed family of sets is just a diagram of type~\(I\) in~\(\Sets\), and in this case the limit is just the product. Hence \(\prod\)~is a functor by the above.
\end{proof}