-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notes.tex
8100 lines (6725 loc) · 549 KB
/
Notes.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
\documentclass[english,letterpaper]{article}%{scrartcl}
%\setkomafont{disposition}{\normalfont} %KOMA use serif font for sectioning
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2.5cm,lmargin=1cm,rmargin=1cm}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\usepackage{babel}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amsthm}
%\usepackage[amsthm]{ntheorem}
\usepackage{amssymb}
\usepackage{wasysym}
\usepackage{cancel}
\usepackage{imakeidx}
\usepackage{wrapfig}
\usepackage[stable]{footmisc}
\usepackage{stmaryrd}
\expandafter\def\csname opt@stmaryrd.sty\endcsname{only,shortleftarrow,shortrightarrow} %fake options for stmaryd so that loading extpfeil later doesn't cause a clash
\usepackage{extpfeil} % lets define multiple long arrows
\newextarrow{\toto}{{20}{20}{20}{20}}{\bigRelbar\bigRelbar{\bigtwoarrowsleft\rightarrow\rightarrow}}
\makeindex
\usepackage[footnotesize]{caption}
\captionsetup{width=0.6\textwidth}
\DeclareCaptionLabelFormat{bf-parens}{\textbf{Fig. #2}}
\captionsetup{labelformat=bf-parens}
\usepackage{comment}
\includecomment{comment}
%\excludecomment{comment}
%%%%%% FONTS
%\usepackage[onlytext,lf]{MinionPro} % enable all this to get custom fonts
%\usepackage[amsbb,subscriptcorrection,mtpcal,mtphrb]{mtpro2}
%OR
%\usepackage{pscyr}
%\usepackage[libertine]{newtxmath}
%OR
\usepackage{newtxtext}
\usepackage[varvw]{newtxmath}
\usepackage{tikz-cd}
%\usepackage{marginnote}
\usepackage[activate={true},step=1,tracking=true,kerning=true,spacing=false,factor=1100,stretch=20,shrink=20]{microtype}%text appearance improvements
\UseMicrotypeSet[protrusion]{basictext}
%\microtypecontext{spacing=nonfrench}
%\DisableLigatures[N]{encoding=*, family =*}
\usepackage{titlesec} %change title spacing for sections
\titlespacing*{\section}
{0pt}{0.7\baselineskip}{0.3\baselineskip}
\titlespacing*{\subsection}
{0pt}{0.7\baselineskip}{0.3\baselineskip}
%%%%%%%
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=true]
{hyperref}
\usepackage{tocbibind}
\usepackage{enumitem}
\setlist[enumerate]{leftmargin=2em}
\setlist[itemize]{leftmargin=2em}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Defining environments
\usepackage{silence}
\usepackage{mdframed} % for frames around theorem environments
\WarningFilter{mdframed}{You got a bad break} %block mdframed warnings about page breaks
\usepackage{xcolor} % For using `gray!20` for example
%--------------------------------
% Redefinition of `\newmdtheoremenv` for accepting a starred version
\DeclareDocumentCommand\newmdtheoremenv{s O{} m o m o }{%
\IfBooleanTF{#1}{%
\newtheorem*{#3}{#5}%
}{%
\ifboolexpr{ test {\IfNoValueTF {#4}} and test {\IfNoValueTF {#6}} }%
{\newtheorem{#3}{#5}}{%
\IfValueTF{#4}{\newtheorem{#3}[#4]{#5}}{}%
\IfValueTF{#6}{\newtheorem{#3}{#5}[#6]}{}%
}
}%
\BeforeBeginEnvironment{#3}{%
\begin{mdframed}[#2]}%
\AfterEndEnvironment{#3}{%
\end{mdframed}}%
}
%--------------------------------
\mdfdefinestyle{myshadedthm}{backgroundcolor=gray!20,linewidth=0pt,innerleftmargin=1ex,innerrightmargin=0.5ex,%
%--------------------------------
% If you use `amsthm` can adjust `innertopmargin` to avoid extra space in top.
innertopmargin=-0.5ex% % Comment or remove this line if you use `ntheorem`.
%--------------------------------
}
\mdfdefinestyle{linedthm}{linewidth=1pt,topline=false,bottomline=false,rightline=false,innertopmargin=-1ex,innerbottommargin=-0.3ex,innerleftmargin=1ex,innerrightmargin=0ex}
\mdfdefinestyle{indentthm}{hidealllines=true,innertopmargin=-1ex,innerbottommargin=-0.3ex,innerleftmargin=1ex,innerrightmargin=0ex}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\theoremstyle{definition}
%\newtheorem{defn}{\protect\definitionname}[section]
\newmdtheoremenv[style=linedthm]{defn}{Definition}[section]
\theoremstyle{definition}
%\newtheorem{example}{\protect\examplename}[section]
\newmdtheoremenv[style=indentthm]{example}{\protect\examplename}[section]
\theoremstyle{definition}
%\newtheorem{xca}{\protect\exercisename}[section]
\newmdtheoremenv[style=indentthm]{xca}{\protect\exercisename}[section]
\theoremstyle{plain}
%\newtheorem{prop}{\protect\propositionname}[section]
\newmdtheoremenv[style=myshadedthm]{prop}{\protect\propositionname}[section]
\theoremstyle{plain}
%\newtheorem{thm}[prop]{\protect\theoremname}%thm with counter inherited from prop
\newmdtheoremenv[style=myshadedthm]{thm}[prop]{\protect\theoremname}
\theoremstyle{plain}
%\newtheorem{lem}[prop]{Lemma}%lem with counter inherited from prop
\newmdtheoremenv[style=myshadedthm]{lem}[prop]{Lemma}
\theoremstyle{plain}
%\newtheorem{cor}[prop]{Corollary}%cor with counter inherited from prop
\newmdtheoremenv[style=myshadedthm]{cor}[prop]{Corollary}
\theoremstyle{remark}
%\newtheorem*{rem*}{\protect\remarkname}
\newmdtheoremenv*[style=linedthm]{rem*}{\protect\remarkname}
\theoremstyle{remark}
%\newtheorem{rem}{\protect\remarkname}[section]
\newmdtheoremenv[style=linedthm]{rem}{\protect\remarkname}[section]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\renewenvironment{align*}{\align}{\endalign}
\renewenvironment{alignat*}{\alignat}{\endalignat}
\renewenvironment{multline*}{\multline}{\endmultline}
\renewenvironment{gather*}{\gather}{\endgather}
\renewenvironment{equation*}{\equation}{\endequation}
\usepackage{color}
\def\white{\color{white}}
\def\black{\color{black}}
\def\red{\color{red}}
\def\green{\color{green}}
\def\blue{\color{blue}}
\def\cyan{\color{cyan}}
\def\magenta{\color{magenta}}
\def\yellow{\color{yellow}}
\newcommand{\bbR}{\mathbb{R}}
\newcommand{\bbN}{\mathbb{N}}
\newcommand{\bbC}{\mathbb{C}}
\newcommand{\bbZ}{\mathbb{Z}}
\newcommand{\bbH}{\mathbb{H}}
\newcommand{\bbQ}{\mathbb{Q}}
\newcommand{\calC}{\mathcal{C}}
\newcommand{\calD}{\mathcal{D}}
\newcommand{\calJ}{\mathcal{J}}
\newcommand{\calE}{\mathcal{E}}
\newcommand{\calU}{\mathcal{U}}
\newcommand{\calV}{\mathcal{V}}
\newcommand{\dd}{{\mathrm{d}}}
\newcommand{\bm}[1]{\boldsymbol{\mathrm{#1}}}
\renewcommand{\geq}{\geqslant}
\renewcommand{\leq}{\leqslant}
\renewcommand{\i}{\mathrm{i}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\mor}{Mor}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\ob}{Ob}
\DeclareMathOperator{\Mat}{Mat}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\Int}{int}
\DeclareMathOperator{\im}{im}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\pr}{pr}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Diff}{Diff}
\DeclareMathOperator{\Hol}{Hol}
\DeclareMathOperator{\GL}{GL}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\proj}{pr}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\Alt}{Alt}
\DeclareMathOperator{\Sym}{Sym}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\coker}{coker}
\DeclareMathOperator{\coim}{coim}
\DeclareMathOperator{\Ext}{Ext}
\DeclareMathOperator{\Tor}{Tor}
\let\div\relax
\DeclareMathOperator{\div}{div}
\DeclareMathOperator*{\res}{res}
\newcommand{\colimit}{\varinjlim}
\newcommand{\limit}{\varprojlim}
\newcommand{\Lie}{\mathcal{L}}
\newcommand{\fX}{\mathfrak{X}}
\newcommand{\sub}{\vartriangleleft}
\newcommand{\sube}{\trianglelefteqslant}
\newcommand{\bigslant}[2]{{\raisebox{.2em}{$#1$}\left/\raisebox{-.2em}{$#2$}\right.}}
\usepackage{xparse}
\DeclareDocumentCommand{\restr}{m m o}
{%
\IfNoValueTF{#3}
{
\left.\kern-\nulldelimiterspace % automatically resize the bar with \right
#1 % the function
\vphantom{\big|} % pretend it's a little taller at normal size
\right|_{#2}
}{
\left.\kern-\nulldelimiterspace % automatically resize the bar with \right
#1 % the function
\vphantom{\big|} % pretend it's a little taller at normal size
\right|_{#2}^{#3} }
}
\makeatletter %define \xoverline, automatically sized overline
\newsavebox\myboxA
\newsavebox\myboxB
\newlength\mylenA
\newcommand*\xoverline[2][0.75]{%
\sbox{\myboxA}{$\m@th#2$}%
\setbox\myboxB\null% Phantom box
\ht\myboxB=\ht\myboxA%
\dp\myboxB=\dp\myboxA%
\wd\myboxB=#1\wd\myboxA% Scale phantom
\sbox\myboxB{$\m@th\overline{\copy\myboxB}$}% Overlined phantom
\setlength\mylenA{\the\wd\myboxA}% calc width diff
\addtolength\mylenA{-\the\wd\myboxB}%
\ifdim\wd\myboxB<\wd\myboxA%
\rlap{\hskip 0.5\mylenA\usebox\myboxB}{\usebox\myboxA}%
\else
\hskip -0.5\mylenA\rlap{\usebox\myboxA}{\hskip 0.5\mylenA\usebox\myboxB}%
\fi}
\makeatother
\usepackage{graphicx}
\newcommand{\PRLsep}{ %decorative line used to separate sections
\noindent\makebox[\linewidth]{
\resizebox{0.5\linewidth}{1pt}{$\blacklozenge$}}}
\usepackage{graphicx,scalerel}
\newcommand\wh[1]{\hstretch{1.42}{\hat{\hstretch{.7}{#1\mkern2mu}}}\mkern-2mu} %requires \usepackage{graphicx,scalerel}
\newcommand\wt[1]{\hstretch{1.42}{\tilde{\hstretch{.7}{#1\mkern2mu}}}\mkern-2mu}
\newcommand\wb[1]{\hstretch{1.42}{\bar{\hstretch{.7}{#1\mkern2mu}}}\mkern-2mu}
\makeatother
\providecommand{\definitionname}{Definition}
\providecommand{\examplename}{Example}
\providecommand{\exercisename}{Exercise}
\providecommand{\propositionname}{Proposition}
\providecommand{\remarkname}{Remark}
\providecommand{\theoremname}{Theorem}
\usepackage[acronym]{glossaries}
\makeglossaries
% abbreviations:
\newacronym{pou}{POU}{partition of unity}
\newacronym{fb}{FB}{fiber bundle}
\newacronym{vb}{VB}{vector bundle}
\newacronym{pfb}{PFB}{principal fiber bundle}
\newacronym{wlog}{WLOG}{without loss of generality}
\newacronym{tfae}{TFAE}{the following are equivalent}
\newacronym{inmt}{InMT}{Inverse Mapping Theorem}
\newacronym{immt}{ImMT}{Implicit Mapping Theorem}
\newacronym{mv}{MV}{Mayer-Vietoris}
\begin{document}
\title{{\Large{}Mathematical Physics Seminar 2018/19:}\\
\textsc{Differential Geometry}}
\author{Alexander Bogatskiy and Umang Mehta\\
{Kadanoff Center For Theoretical Physics, University
of Chicago}}
\maketitle
\tableofcontents{}
\printglossary[type=\acronymtype,title=Abbreviations]
\newpage
\part{Basic Differential Geometry}
\section{Category Theory I}
\subsection{Categories}
\begin{defn}[Categories]
A category\index{Category} \textbf{$\mathcal{C}$} consists of
\begin{enumerate}
\item A class $\ob(\mathcal{C})$ of \emph{objects};
\item For any $X,Y\in\ob(\mathcal{C})$ there is a set $\mor_{\mathcal{C}}(X,Y)$ (also denoted by $\Hom_{\mathcal{C}}(X,Y)$) of \emph{morphisms}\index{Morphism} (arrows) from $X$ to $Y$ with the following properties:
\begin{enumerate}
\item The set of morphisms is closed under \emph{composition}: $\forall f\in\mor(A,B)$
and $\forall g\in\mor(B,C)$, $\exists h=fg=g\circ f\in\mor(A,C)$.
\item The composition is associative, $\left(fg\right)h=f\left(gh\right)$.
\item There is an identity morphism for every object: $\forall A\in\ob(\mathcal{C})$
$\exists\,\id_{A}\in\mor(A,A)$ such that for any morphisms $f,g$ with
appropriate domains and codomains, $\id_{A}f=f$ and $g\,\id_{A}=g$.
\end{enumerate}
\end{enumerate}
The set $\mor(A,A)=\Hom(A,A)$ is also denoted $\End(A,A)$, its elements are called \emph{endomorphisms}\index{Endomorphism} of $A$.
\end{defn}
Notice how the notation $fg$ for the composition where $f$ acts first and $g$ second is more natural for category theory than it is for set theory, because we usually don't refer to arguments of functions here, which means that we'll never have to write strange-looking formulas like $(fg)(x)=g(f(x))$. In the cases where we do need arguments, we will use the set-theoretical notation $g\circ f$. We will always use the set-theoretical notation outside of this section on categories.
A category can be visualized as a directed graph with the vertices
being the objects of the category and the arrows being the morphisms.
\begin{example}
\begin{enumerate}
\item A category with no objects is called the empty, or trivial, category: $\calC=\varnothing$.
\item A category with only identity morphisms is called \emph{discrete}.
\item A category with only one object is called \emph{monoidal}.
\end{enumerate}
\end{example}
\begin{example}
The most basic example of a large category is the category $\mathsf{Set}$\index{Category!of sets},
whose objects are all sets and the morphisms are all maps between
sets, i.e.\ $\mor\left(A,B\right)=\mathrm{Map}\left(A,B\right)$.
One \emph{subcategory} of $\mathsf{Set}$ is $\mathsf{FinSet}$,
i.e.\ the category of finite sets. $\mathsf{FinSet}$ is a \emph{full
subcategory} of $\mathsf{Set}$, meaning that $\mor_{\mathsf{FinSet}}(A,B)=\mor_{\mathsf{Set}}(A,B)$.
In other words, a full subcategory is a subcategory in which only
the class of objects is truncated and not the sets of morphisms.
\end{example}
%
\begin{example}
One can truncate the set of morphisms in $\mathsf{Set}$ to obtain
the categories $\mathsf{Bij}$, $\mathsf{Surj}$, $\mathsf{Inj}$,
where the morphisms are now bijections, surjections and injections,
respectively.
\end{example}
%
\begin{example}
We can also consider $\mathsf{Set}_{\bullet}$ \index{Category!of pointed sets}, the category of ``pointed
sets''. The objects of the category are doubles $(A,x)$ where $A$
is a set and $x\in A$ is an element of the set (a ``marked point'').
The morphisms $\mor((A,x),(B,y))$ are restricted to those maps $f:A\rightarrow B$
such that $f(x)=y$, i.e., maps that preserve marked points.
\end{example}
%
\begin{example}
A generalization of $\mathsf{Set}_{\bullet}$ is the category $\mathsf{SetPair}$\index{Category!of set pairs}
whose objects are pairs $(A,B)$ where $A$ is a set and $B\subset A$.
A morphism $f:(A,B)\rightarrow(C,D)$ must preserve this structure
in the sense that $f(B)\subset D$.
\end{example}
%
\begin{example}[Dual Category]
For any category $\mathcal{C}$ one can define its \emph{dual category}\index{Category!dual}
$\mathcal{C}^{\ast}$ by
\begin{align}
\ob\left(\mathcal{C}^{\ast}\right) & =\ob\left(\mathcal{C}\right),\nonumber \\
\mor_{\mathcal{C}^{\ast}}\left(A,B\right) & =\mor_{\mathcal{C}}\left(A,B\right).
\end{align}
In most cases, duals of categories are very difficult to interpret
in any other way than directed graphs. For instance, the dual of $\mathsf{Set}$
has $\mathrm{Mor}_{\mathsf{Set}^{\ast}}\left(\left\{ 1,2\right\} ,\left\{ 1\right\} \right)=\mathrm{Map}\left(\left\{ 1\right\} ,\left\{ 1,2\right\} \right)=\left\{ f_{1},f_{2}\right\} $,
but there aren't two maps from $\left\{ 1,2\right\} $ to $\left\{ 1\right\} $!
Thus the arrows in $\mathsf{Set}^{\ast}$ cannot be interpreted as
maps between sets.
\end{example}
\subsection{Functors}
We can construct ``maps'' from categories to categories as follows.
Crucially, we want these maps to preserve as much of the categorical
structure as possible, which is why they have to act not only on objects,
but also on morphisms, in a consistent way.
\begin{defn}[Functors]
A functor\index{Functor} $F:\mathcal{C}\rightarrow\mathcal{D}$ is a correspondence
between two categories $\mathcal{C}$ and $\mathcal{D}$ with the
following properties
\begin{enumerate}
\item $\forall A\in\ob(\mathcal{C})$, $F(A)\in\ob(\mathcal{D})$.
\item $F$ maps objects to objects, \emph{and} morphisms between objects to
morphisms between their images:
\begin{equation}
\forall f\in\mor_{\mathcal{C}}(A,B),\quad F(f)\in\begin{cases}
\mor_{\mathcal{D}}(F(A),F(B)), & \text{if \textit{covariant} functor},\\
\mor_{\mathcal{D}}(F(B),F(A)), & \text{if \textit{contravariant} functor}.
\end{cases}
\end{equation}
\item $F$ respects compositions: $\forall~A\in\ob(\mathcal{C})$ we have $F(\id_{A})=\id_{F(A)}$
and
\begin{equation}
F(fg)=\begin{cases}
F(f)F(g), & \text{if covariant},\\
F(g)F(f), & \text{if contravariant}.
\end{cases}
\end{equation}
\end{enumerate}
Covariant functors can be thought of as functors that preserve the direction
of arrows between objects while contravariant functors reverse the
arrows.
\end{defn}
``Functoriality'' is a general adjective that expresses the idea
that many useful constructions in mathematics respect morphisms. Very
roughly, this ``principle of naturality'' can be stated as:
\begin{gather*}
\boxed{\begin{array}{c}
\text{Isomorphic inputs must produce isomorphic outputs.}\\
\text{In particular, all constructions should not give preference to any specific representatives of isomorphism classes,}\\
\text{i.e.\ they must be \emph{natural}.}
\end{array}}
\end{gather*}
\begin{example}[Representable/hom- functors]\label{hom-functor example}
\label{Representable functors}\index{Functor!representable} One can always construct a functor
from any category $\mathcal{C}$ to $\mathsf{Set}$, as in the following
example: for a fixed object $A\in\ob(\mathcal{C})$ consider the quantity
\begin{equation}
h^{A}(\_)=\mor_{\mathcal{C}}(A,\_),
\end{equation}
where the $\_$ is where the argument of $h^{A}$ goes, i.e., $h_{A}(B)=\mor_{\mathcal{C}}(A,B)$.
Since the morphisms between any two objects by definition form a set,
$h^{A}$ is a map from $\ob(\mathcal{C})$ to $\ob(\mathsf{Set})$.
Can we extend $h^{A}$ to a functor by defining a correspondence between
morphisms? The answer is yes, and here's how.
Consider a morphism $f:B\rightarrow C$ in the category $\mathcal{C}$.
We require correspondingly a map $h^{A}(f):h^{A}(B)\rightarrow h^{A}(C)$.
$h^{A}(B)$ is the set of maps from $A$ to $B$ and $h^{A}(C)$ is
the set of maps from $A$ to $C$. Hence, what we require is the following:
Given a map from $B$ to $C$, how do we transform a map $g:A\rightarrow B$
into a map from $A$ to $C$? The answer is composition, of course! Hence the map $h^{A}(f)$ acts on $g$ by the action
\begin{equation}
h^{A}(f)(g)=gf=f\circ g.
\end{equation}
\begin{equation}
\begin{tikzcd}[column sep=small]
B \arrow[rr, "f"] & & C\\
& A \arrow[lu, "g"] \arrow[ru, "gf"'] &
\end{tikzcd}
\end{equation}
One can check that $h^{A}$ is now a \emph{covariant} functor (Exercise).
Similarly, we can also construct the \emph{contravariant} \emph{hom-functor}
by defining\begin{equation}
h_A(\_) = \mor_\mathcal{C}(\_, A).
\end{equation} In this case, its action on morphisms will be achieved by composition
in the opposite direction. These functors are called \emph{representable
functors}, or \emph{hom-functors}.
\end{example}
%
\begin{example}\label{poset example}
Any partially ordered set (``\emph{poset}'') $\left(I,\leq\right)$
can be represented by a directed graph where we draw an arrow from
$i\in I$ to $j\in I$ if and only if $i\leq j$. By reflexivity and
transitivity of inequality, this satisfies the definition of a category.
Therefore each poset $(I,\leq)$ is also a category $\mathcal{I}$.
\end{example}
%
\begin{defn}[Arrow category]\index{Category!of arrows}
For any category $\mathcal{C}$ we can construct its arrow category
$\mathsf{Arr}\left(\mathcal{C}\right)$ as follows:
\begin{enumerate}
\item Objects are all arrows in $\mathcal{C}$:
\[
\mathsf{Ob}\left(\mathsf{Arr}\left(\mathcal{C}\right)\right)=\bigcup_{A,B\in\mathsf{Ob}\left(\mathcal{C}\right)}\mathrm{Mor}_{\mathcal{C}}\left(A,B\right).
\]
\item Morphisms between arrows are pairs of morphisms between their ends
that form \emph{commuting squares}:\[\begin{tikzcd}[every matrix/.append style={name=m},
execute at end picture={\draw [<-] ([xshift=-2.2em,yshift=.3em]m-2-2.north) arc[start angle=-90,delta angle=270,radius=0.25cm];}]
A_1\arrow[r,"f_1" ]\arrow[d,swap,"\alpha" ]& B_1 \arrow[d,"\beta" ] \\
A_2\arrow[r,swap,"f_2" ]& B_2\\
\end{tikzcd}\]i.e.\ $f_{1}\beta=\alpha f_{2}$. The circular arrow is used to indicate
that the square commutes.
\end{enumerate}
\end{defn}
\begin{xca}
Check that this is a category.
\end{xca}
\begin{defn}[Categories of diagrams]\index{Category!of diagrams}\label{categories of diagrams}
We can generalize the definition of arrow categories to define \emph{categories
$\mathcal{J}\text{-}\mathsf{Diag}\left(\mathcal{C}\right)$ of $\mathcal{J}$-shaped
diagrams in} $\mathcal{C}$. First, let $\mathcal{J}$ be a so-called \emph{index
category}, which is an arbitrary, usually small (in most cases even finite), category.
It should be thought of as nothing but a directed graph. A \emph{$\mathcal{J}$-shaped
diagram} in $\mathcal{C}$ is defined as a covariant functor $F:\mathcal{J}\to\mathcal{C}$.
Note that we don't require this functor to be faithful (injective
on objects), so some of the ``vertices'' of $\mathcal{J}$ might
map to the same object in $\mathcal{C}$.
Now, the category of $\mathcal{J}$-shaped diagrams in $\mathcal{C}$
has all $\mathcal{J}$-shaped diagrams as its objects, and morphisms
between two $\mathcal{J}$-shaped diagrams $F_{1}$ and $F_{2}$ are
sets of pairwise morphisms $\alpha_{i}:F_{1}\left(i\right)\to F_{2}\left(i\right),$
$i\in\ob\left(\mathcal{J}\right)$, such that all ``vertical'' squares
commute: for $f_{1}:i\to j$ and $f_{2}:i\to j$, we have a commuting
square\[\begin{tikzcd}[every matrix/.append style={name=m},
execute at end picture={\draw [<-] ([xshift=-2.7em,yshift=.3em]m-2-2.north) arc[start angle=-90,delta angle=270,radius=0.25cm];}]
F_1(i)\arrow[r,"F_1(f_1)" ]\arrow[d,swap,"\alpha_i" ]& F_1(j) \arrow[d,"\alpha_j" ] \\
F_2(i)\arrow[r,swap,"F_2(f_2)" ]& F_2(j)\\
\end{tikzcd}\]A morphism in this category can be visualized as a prism with the
top and bottom sides being two copies of $\mathcal{J}$, all vertical
arrows in the same direction, and all side squares commuting. This
construction is also called a \emph{natural transformation} between
the functors $F_{1}$ and $F_{2}$ (written as $F_{1}\Longrightarrow F_{2}$)
and is a higher-level generalization of morphisms (acting on objects)
and functors (acting on morphisms), now acting on functors.
Of course, if the index category is just one arrow, $\mathcal{J}=\left\{ 1\to2\right\} $
(identity morphisms are implicit), then we get back the arrow category
$\mathsf{Arr}\left(\mathcal{C}\right)$.
\end{defn}
%
\begin{example}
A yet further generalization of the above construction is one where
some vertices and/or morphisms in $F\left(\mathcal{J}\right)$ are
fixed, which would be a full subcategory of $\mathcal{J}\text{-}\mathsf{Diag}\left(\mathcal{C}\right)$.
Moreover, in concrete categories some of the fixed vertices may even
belong to a different category than $\mathcal{C}$, with morphisms
attached to them being a special kind of maps between objects of different
categories (e.g. maps from a set into a group, which is an example
we will need when defining free groups).
\end{example}
%
\begin{example}
Let's consider some slightly more complicated examples of categories,
starting with $\mathsf{Pow}$, the power set category.\footnote{Recall that the power set $2^{X}$ of a set $X$ is defined as the
set of subsets of $X$.} The objects of this category are sets, as usual. But the morphisms
are defined as $\mor_{\mathsf{Pow}}(X,Y)=\text{Map}(2^{X},2^{Y})$.
One can always construct a map $P$ that takes a set $X$ to its power
set $2^{X}$. How can this map be extended to a functor from $\mathsf{Set}$
to itself? In other words, how can we define, for a morphism $f:X\rightarrow Y$,
a morphism $P(f):2^{X}\rightarrow2^{Y}$ for a covariant functor or
$2^{Y}\rightarrow2^{X}$ for a contravariant functor? The answer is
simple. For the covariant case, pick a subset $A\subset X$ and define
\begin{equation}
P_{+}(f)(A\subset X)=f(A),
\end{equation}
i.e., the image of $A$ in $Y$. It is easy to check the \emph{functoriality}
property $P_{+}\left(fg\right)=P_{+}\left(f\right)P_{+}\left(g\right)$.
For the contravariant case we can similarly define
\begin{equation}
P_{-}(f)(B\subset Y)=f^{-1}(B),
\end{equation}
where $f^{-1}(B)$ is the preimage of $B$ in $X$, i.e., the set
of elements of $X$ that map into $B$ under $f$. The two functors
above are called the \emph{power functors}.
\end{example}
\subsection{Further examples in concrete categories}
\emph{Concrete categories} are categories whose objects are sets
with some additional structure and whose morphisms are maps respecting
that structure. For instance, the category $\mathsf{Gr}$ of groups\footnote{Recal that groups are sets with a closed, associative, invertible
multiplication and an identity element.} with the morphisms being group homomorphisms.
\begin{example}[Commutant and abelianization functors]
For any group $G$, we can define its \emph{commutant} subgroup
$[G,G]$ as the group of elements of the form $\{ghg^{-1}h^{-1}\mid g,h\in G\}$.
Correspondingly, we can define a functor $F:\mathsf{Gr}\rightarrow\mathsf{Gr}$
that takes every group $G$ to its commutant subgroup $[G,G]$. The
functor acts on homomorphisms by restricting them to their action
on the commutant subgroup, i.e., for $f:G\rightarrow H$, $F(f)=\restr f{[G,G]}$.
Commutant subgroups are also normal subgroups\footnote{$H$is a normal subgroup of $G$ if $ghg^{-1}\in H~\forall~g\in G,h\in H$.}
and one can verify that the quotient\footnote{The quotient group is the group of equivalence classes under conjugation
with multiplication inherited from the original group.} $G/[G,G]$ is an Abelian group, called the \emph{abelianization}
of $G$. Hence, one can define the abelianization functor
$F:\mathsf{Gr}\rightarrow\mathsf{Ab}$ from the category of groups
to the category of Abelian groups (the morphisms are still group homomorphisms).
For a group homomorphism $f$ in $\mathsf{Gr}$, the homomorphism
$F(f)$ can be defined by considering it's action on any representative
element of an equivalence class (under the conjugation relation) in
$G$. The abelianization functor with be useful later when we study
the relation between homotopy and homology groups of a topological
space.
\end{example}
%
\begin{example}[Quotient functor]
\label{quotient functor}Another example from category theory is
the category $\mathsf{GrPair}$ of pairs $\left(G,H\right)$, where
$G$ is a group and $H$ is its normal subgroup, $H\trianglelefteqslant G$.
Morphisms are group homomorphisms $f:G_{1}\to G_{2}$ such that the
image of $H_{1}$ is contained in $H_{2}$, $f\left(H_{1}\right)\leq H_{2}$
(inequality sign signifies that the l.h.s is also a subgroup in the
r.h.s.). We can construct the \emph{quotient functor} $F:\mathsf{GrPair}\to\mathsf{Gr}$
such that $F\left(\left(G,H\right)\right)=G/H$ and $F\left(f\right):G_{1}/H_{1}\to G_{2}/H_{2}$
is the induced homomorphism of the quotients. The existence and uniqueness
(i.e.\ naturality) of this homomorphism (and that it preserves compositions)
is ensured by the \href{https://en.wikipedia.org/wiki/Fundamental_theorem_on_homomorphisms}{fundamental homomorphism theorem}.
Therefore the fundamental homomorphism theorem is nothing but the
statement that $F$\emph{ is naturally a functor}. Note that by
construction, $H_{1}\leq\ker F(f)$. If $H_{1}=\ker F\left(f\right)$,
then $H_{2}=\left\{ e\right\} $ and $F(f):G_{1}/\ker f\to G_{2}$
must be an isomorphism by uniqueness, so we get back the \href{https://en.wikipedia.org/wiki/Isomorphism_theorems\#First_isomorphism_theorem}{first isomorphism theorem}
that $f\left(G_{1}\right)=G_{2}\cong G_{1}/\ker f$.
\end{example}
%
\begin{example}\index{Category!of group-valued maps}
One more useful example of a category is the category $\mathcal{C}$
of all maps between sets and groups (both of these can be replaced
by other concrete categories):
\begin{enumerate}
\item $\ob\left(\mathcal{C}\right)=\bigcup_{X,G}\mathrm{Map}\left(X,G\right)$,
where the union is over all $X\in\ob\left(\mathsf{Set}\right)$ and
$G\in\ob\left(\mathsf{Gr}\right)$.
\item $\mor\left(X\overset{g}{\to}G,Y\overset{h}{\to}H\right)$ consists
of pairs of morphisms, $X\overset{\alpha}{\to}Y$ in $\mathsf{Set}$,
and $G\overset{\beta}{\to}H$ in $\mathsf{Gr}$, which make the following
square commute: \[\begin{tikzcd}[every matrix/.append style={name=m},
execute at end picture={\draw [<-] ([xshift=-2em,yshift=1mm]m-2-2.north) arc[start angle=-90,delta angle=270,radius=0.25cm];}]
X \arrow[r,"\alpha"]\arrow[d,swap,"g"]& Y\arrow[d,"h"] \\
G\arrow[r,swap,"\beta"]& H\\
\end{tikzcd}\]
\end{enumerate}
\end{example}
\begin{xca}
Come up with more examples of categories following the structure of
the last example, including where morphisms are not necessarily squares
(triangles, prisms,...).
\end{xca}
\begin{defn}[Rings]\index{Ring}
A ring $(R,+,\cdot)$ is defined as a set $R$ with two binary operations
$+$ and $\cdot$ such that
\begin{enumerate}
\item $(R,+)$ is an Abelian group.
\item $\cdot$ is distributive over $+$, i.e.\ $a\cdot(b+c)=a\cdot b+a\cdot c$.
\item (If the ring is associative) $\cdot$ is associative.
\item (If the ring is associative and has a unity) there is a multiplicative
neutral element denoted by $1$, and $1\neq0$, so that $R\neq\left\{ 0\right\} $.
\end{enumerate}
\end{defn}
Some examples of rings include the ring of integers $(\mathbb{Z},+,\cdot)$,
and the ring $\mathbb{R}[x]$ of polynomials in a variable $x$ with
real coefficients. Note that requirement associativity of multiplication
is sometimes relaxed in the definition of a ring.
We can define two categories:
\begin{itemize}
\item $\mathsf{Ring}$ of all rings, associative or not, with morphisms
being ring homomorphisms (maps that preserve addition, multiplication).
\item $\mathsf{AssRing}$ of associative rings with $1$, the multiplicative
identity, such that $1\neq0$, and the morphisms being ring homomorphisms
(preserving the unity).
\item $\mathsf{CommRing}$ of associative, commutative rings with $1\neq0$.
\end{itemize}
\begin{example}
Since every ring is an Abelian group with respect to $+$ by definition,
we can define a \emph{forgetful functor} $F:\mathsf{AssRing}\rightarrow\mathsf{Ab}$
that maps every ring to its corresponding Abelian group by 'forgetting'
the multiplication structure of the ring.
\end{example}
%
\begin{example}
We can also define a functor $F:\mathsf{Ring}\rightarrow\mathsf{Ring}$
that maps every ring $R$ to the ring $R[x]$ defined as the ring
of polynomials in $x$ whose coefficients are taken from $R$. Then
for a morphism $f$ acting on elements of the ring $R$, $F\left(f\right)$
simply applies $f$ to every coefficient of the polynomial.
\end{example}
%
\begin{example}
Just as we can define square matrices of real numbers, we can also
define square matrices with coefficients taken from a commutative
ring $R$, the set of matrices being denoted by $\Mat(n,R)$,
$n$ being the size of the matrix. $\Mat(n,R)$ forms an associative
ring. Hence, we have a covariant functor $F:\mathsf{CommRing}\rightarrow\mathsf{AssRing}$
that takes a commutative ring to matrices of the ring.
\end{example}
\begin{xca}
How does this functor act on morphisms? Check its functoriality.
\end{xca}
\begin{example}
If we restrict to invertible matrices the associative ring $\Mat(n,R)$
reduces to the group $\GL(n,R)$ of invertible matrices with
coefficients in $R$ and we have a functor $F:\mathsf{CommRing}\rightarrow\mathsf{Gr}$.
\end{example}
%
\begin{example}
For every associative ring $R$ we can define the \emph{opposite
ring} $R^{\text{op}}$ which has the same elements and addition as
$R$, but the ``opposite'' multiplication defined by $a\cdot^{\text{op}}b=b\cdot^{R}a$,
where $\cdot^{R}$ is the multiplication from $R$. This is a contravariant
functor $\mathsf{AssRing}\to\mathsf{AssRing}$.
\end{example}
\begin{defn}[Lie rings]\index{Lie ring}
A Lie ring is a set $R$ with a binary operation $[\cdot,\cdot]$
(called the \textsf{Lie bracket}) that obeys the following properties
$\forall~a,b,c\in R$
\begin{enumerate}
\item Alternativity: $[a,a]=0$;
\item Antisymmetry: $[a,b]=-[b,a]$;
\item Jacobi identity: $[a,[b,c]]+\mathrm{cyclic~permutations}=0$.\footnote{Alternatively, introducing the \emph{adjoint} operator $\mathrm{ad}_{a}b\equiv\left[a,b\right]$,
this can be written as $\mathrm{ad}_{a}\left[b,c\right]=\left[\mathrm{ad}_{a}b,c\right]+\left[b,\mathrm{ad}_{a}c\right]$,
i.e.\ $\mathrm{ad}_{a}$ is a \emph{derivation}, meaning
it follows the Leibniz (product) rule just like derivatives do when
acting on products (and in Lie algebras ``product'' means Lie bracket).
Therefore the Jacobi identity is nothing but the statement that the
Lie bracket must be a derivation.}
\end{enumerate}
The category $\mathsf{LieRing}$ consists of all Lie rings as objects
with Lie ring homomorphisms (maps that preserve the Lie bracket) as
the morphisms.
\end{defn}
\begin{example}
For any ring $R$ we can define an associated Lie ring $R^{(-)}$
by defining $[a,b]=a\cdot b-b\cdot a$ and ignoring the multiplication
and addition structure after defining the Lie bracket. One can check
that this obeys the properties of a Lie ring. This defines a functor
$F:\mathsf{AssRing}\rightarrow\mathsf{LieRing}$.
\end{example}
\begin{defn}[Fields]\index{Field}
A field $K$ is a set with two binary operations $+$ (addition)
and $\cdot$ (multiplication) such that
\begin{enumerate}
\item $(K,+,\cdot)$ is a \emph{commutative} ring;
\item Every element in $K^{\ast}=K\setminus\{0\}$ has a multiplicative
inverse ($0$ being the additive identity), i.e.\ $K^{\ast}$ is an
Abelian group.
\end{enumerate}
A morphism between fields is a map that preserves addition, multiplication,
zero and unity. The category of fields is rarely referred to because
of its much weaker properties than that of $\mathsf{Ring}$ and others
(it is not ``algebraic'' is some strict sense).
$K^{\ast}$ is called the multiplicative group of the field.
\end{defn}
%
\begin{defn}[Ring modules]\index{Ring module}\index{Module}
A (left) module $\mathcal{M}$ over a ring $R$ (also called a left
$R$-module) is an Abelian group $(\mathcal{M},+)$ with an operation
$\bullet:R\times\mathcal{M}\rightarrow\mathcal{M}$ such that $\forall~r,s\in R$
and $x,y\in\mathcal{M}$ the following properties hold
\begin{enumerate}
\item $r\bullet(x+y)=r\bullet x+r\bullet y$;
\item $(r+s)\bullet x=r\bullet x+s\bullet x$;
\item $(r\cdot s)\bullet x=r\bullet(s\bullet x)$;
\item (If the ring is unital, i.e., consists of a unit multiplicative element)
$1_{R}\bullet x=x$.
\end{enumerate}
Similarly one can define \emph{right} $R$-modules where elements
of the ring act from the right, $x\bullet r$. Note that a left $R$-module
is exactly the same as a right $R^{op}$-module, so for general constructions
and arguments left modules suffice.
An $R_{1}$\emph{-$R_{2}$-bimodule} is a left $R_{1}$-module and
a right $R_{2}$-module at the same time, with the compatibility requirement
$\left(r_{1}\bullet x\right)\bullet r_{2}=r_{1}\bullet\left(x\bullet r_{2}\right)$
(denoting both products by $\bullet$ because confusion is not possible
here).
A \emph{morphism} of (left) $R$-modules is a group homomorphism
$f:M\to L$ that respects the action of the ring, i.e.\ $f\left(r\bullet_{M}x\right)=r\bullet_{L}f\left(x\right)$.
The categories of left and right $R$-modules are denotes by $R\text{-}\mathsf{Mod}$
and $\mathsf{Mod}\text{-}R$, respectively.
\end{defn}
The symbol for ring multiplication is often omitted in order to simplify
notation and avoid confusion with the scalar multiplication operator
$\bullet$.
\begin{example}
For any ring $R$, its Cartesian powers $R^{n}$ are called \emph{free
$R$-modules}. The action of $R$ on it is defined component-wise:
$r\cdot\left(r_{1},\ldots,r_{n}\right)=\left(rr_{1},\ldots,rr_{n}\right)$.
\end{example}
%
\begin{example}
$R^{n}$ is an example of a left $\Mat\left(n,R\right)$-module,
where the action is defined by the usual matrix multiplication.
\end{example}
Vector spaces are nothing but a special case of ring modules, where
the ring is replaced by a field.
\begin{defn}[Vector spaces]\index{Vector space}
A vector space $V$ over a field $K$ is simply a $K$-module, i.e.
an Abelian group with a multiplicative action of the field $K$. Morphisms
between vector spaces are therefore $K$-module morphisms (a.k.a.
``linear maps''). The category of $K$-vector spaces is $\mathsf{Vect}_{K}$.
The category of finite-dimensional $K$-vector spaces is $\mathsf{FinVect}_{K}$.
\end{defn}
\begin{xca}
Show that Abelian groups are essentially the same as $\mathbb{Z}$-modules.
\end{xca}
\begin{defn}[Algebras over fields]\index{Algebra}
An algebra $\mathcal{A}$ over a field $K$ is a $K$-vector space
with a binary, $K$-bilinear multiplication operation $\cdot$. In
other words, $\forall x,y,z\in\mathcal{A}$ and $\forall a,b\in K$
\begin{enumerate}
\item $(x+y)\cdot z=x\cdot z+y\cdot z$;
\item $z\cdot(x+y)=z\cdot x+z\cdot y$;
\item $(ax)\cdot(by)=(ab)(x\cdot y)$.
\end{enumerate}
\end{defn}
Notice that we do not require all algebras to be associative (this
way Lie brackets are allowed as the multiplication operation). Algebra
morphisms are already defined by the above definitions. The category
of $K$-algebras is denoted by $\mathsf{Alg}_{K}$.
\begin{example}
Some examples of algebras are $\mathbb{R}[t]$, the algebra of polynomials
in $t$ with real coefficients; $\mathbb{C}$, the set of complex
numbers viewed as an algebra over $\mathbb{R}$; and $(\mathbb{R}^{3},+,\times)$
with $\times$ being the cross product for vectors\footnote{Note that $(\mathbb{R}^{3},\times)$ is a Lie algebra.}.
\end{example}
\begin{xca}
Give the definitions of:
\begin{itemize}
\item division rings (non-Abelian analog of fields, e.g. quaternions);
\item group modules (category $G\text{-}\mathsf{Mod}$);
\item algebras over a commutative ring $R$ (category $\mathsf{Alg}_{R}$);
\item Lie algebras (category $\mathsf{LieAlg})$.
\end{itemize}
\end{xca}
\subsection{Classes of Morphisms}
In set theory, maps between sets can have the special properties of
being surjective, injective or both, i.e., bijective. In this section
we introduce the analogs of such maps in category theory. Surjective
maps are those whose image spans the entire codomain, while for injective
maps, every element of the range of the map has a unique preimage.
these definitions can't be generalized to categories, since the objects
of a category may not have any internal structure similar to that
of a set. However, there is an alternate way to define surjective
and injective maps that does not rely upon the internal structure
of sets, and is equivalent to the previous definitions.
\[\text{"Epic" property:}\;
\begin{tikzcd}
X \arrow[r, "f"] & Y \arrow[r, bend left, "g"] \arrow[r, bend right, "h"'] & Z
\end{tikzcd}\]
Suppose $f:X\rightarrow Y$ is a surjective map. Consider two maps
$g,h:Y\rightarrow Z$ such that $g\circ f=h\circ f$ (see figure above).
Since $f$ is surjective, $g$ and $h$ have to agree on all of $Y$,
which implies that $g=h$. Conversely, if $g\circ f=h\circ f$ for
any $g,h$ implies $g=h$, we can conclude that $f$ is surjective.
This is the alternate definition of a surjective map. This property
is also known as \emph{right invertibility} or \emph{right cancellability}.
For injective maps, the alternate definition is similar. A function
$f:X\rightarrow Y$ is invertible iff $\forall~g,h:Z\rightarrow X,f\circ g=f\circ h\longleftrightarrow g=h$,
i.e., $f$ is injective iff it is \emph{left invertible} (or \emph{left
cancellable}).
The generalization of these definitions to categories is now straightforward
(up to switching ``left'' and ``right'' because our categorical
notation is opposite of the set theoretical one, $gf=f\circ g$).
\begin{defn}[Epimorphism]\index{Morphism!epi}
A morphism $f$ is an \emph{epimorphism} if $fg=fh$ for any $g,h$
implies $g=h$ (i.e.\ left cancellative). We use the arrow $\twoheadrightarrow$ to denote epimorphisms.
\end{defn}
%
\begin{defn}[Monomorphism]\index{Morphism!mono}
A morphism $f$ is a \emph{monomorphism} if $gf=hf$ for any $g,h$
implies $g=h$ (i.e.\ right cancellative). We use the arrow $\rightarrowtail$ to denote monomorphisms.
\end{defn}
%
\begin{defn}[Bimorphism]\index{Morphism!bi}
A morphism $f$ is a \emph{bimorphism} if it is both an epimorphism
and a monomorphism.
\end{defn}
%
\begin{defn}[Retraction/Split epi]\index{Morphism!split epi}\index{Retraction}
A morphism $f:A\rightarrow B$ is a \emph{retraction}, or a\emph{
split epi}, if $\exists\,g$ such that $gf=\id_{B}$ (i.e.\ $f$ is
left invertible in categorical notation). In this case $g$ is a split
mono.
\end{defn}
%
\begin{defn}[Coretraction/Section/Split mono]\index{Morphism!split mono}\index{Coretraction}\index{Section}
A morphism $f:A\rightarrow B$ is a \emph{coretraction}, or a \emph{section},
or a \emph{split mono}, if $\exists\,g$ such that $fg=\id_{A}$
(i.e.\ $f$ is right invertible). In this case $g$ is a split epi, $f$ is a section of $g$, and $g$ is a retraction of $f$.
\end{defn}
%
\begin{defn}[Isomorphism]\index{Morphism!iso}
A morphism $f$ is an \emph{isomorphism} if it's a retraction and
a coretraction (i.e.\ invertible). Sometimes we use the arrow $\leftrightarrow$ to denote isomorphisms. If two objects $A$ and $B$ are related by an isomorphism $f$, we might write $A\overset f\cong B$ or just $A\cong B$.
\end{defn}
Note in particular that, unlike for sets, left(right) invertibility
is not equivalent to left(right) cancellability. An important characteristic
of a category is whether all bimorphisms are isomorphisms.
\begin{prop}
In $\mathsf{Set}$, monomorphism = coretraction = injectivity, and
epimorphism = retraction = surjectivity.
\end{prop}
%
\begin{prop}
In $\mathsf{Gr}$, the category of groups, a monomorphism is equivalent
to an injective homomorphism and an epimorphism is identical to a
surjective homomorphism.
\end{prop}
In all concrete categories, the following implications hold
\begin{gather}
\text{Retraction}\implies\text{Surjectivity},\quad\text{Surjectivity}\implies\text{Epimorphism},\\
\text{Coretraction}\implies\text{Injectivity},\quad\text{Injectivity}\implies\text{Monomorphism.}
\end{gather}
while the converse don't. Here are some counterexamples.
\begin{example}[$\text{Epi}\nRightarrow\text{Surj}$]
Consider the inclusion map\footnote{The hooked arrow $\hookrightarrow$ is the standard symbol for an
inclusion map.} $i:\mathbb{Z}\hookrightarrow\mathbb{Q}$ in the category $\mathsf{Ring}$.
We will show that $i$ is an epimorphism in the category of rings,
while it is clearly not surjective. For two arbitrary ring morphisms
$f,g:\mathbb{Q}\rightarrow R,f\circ i=g\circ i\implies\restr{f}{\mathbb{Z}}=\restr{g}{\mathbb{Z}}$.
Since $f$ and $g$ are ring homomorphisms and any rational number
can be written as a ratio of integers, we see that
\begin{equation}
f\left(\frac{m}{n}\right)=\frac{f(m)}{f(n)}=\frac{g(m)}{g(n)}=g\left(\frac{m}{n}\right).
\end{equation}
Hence, $f=g$ for all rational numbers and $i$ is an epimorphism.
A nearly identical proof holds for the inclusion map $\mathbb{Q}\hookrightarrow\mathbb{R}$
in the category $\mathsf{TopRing}$ of topological rings\footnote{Topological rings are rings that have the additional structure of
a topological space such that $+$ and $\cdot$ are continuous maps.
More on this in later sections.} is an epimorphism, except that in this case we use the fact that
a continuous function defined on the rational numbers uniquely defines
a continuous function on the real line because rationals are dense
in the real line.
\end{example}
%
\begin{example}[$\text{Surj}\nRightarrow\text{Split epi}$]
Another example is the ''mod 2'' function $\mathbb{Z}\xrightarrow{\text{mod}~2}\mathbb{Z}/2\mathbb{Z}=\{0,1\}$,
which is clearly surjective but is not a split epimorphism. In order
for the map to be a split epimorphism, there must exist a morphism
$f$ from $\mathbb{Z}/2\mathbb{Z}$ to the integers such that $\left(\text{mod}\,2\right)\circ f=\id_{\mathbb{Z}/2\mathbb{Z}}$.
However, besides the trivial morphism $f=0$, there are no ring morphisms
$\mathbb{Z}/2\mathbb{Z}\to\mathbb{Z}$ at all! The identity element
0 must be mapped to itself, so all that remains is to pick an integer
$n$ that 1 maps into. But, in $\mathbb{Z}/2\mathbb{Z}$, $1+1=0$
while $n+n=2n\ne0$. Thus a section for $\text{mod}\,2$ does not exist.
\end{example}
\begin{xca}
Come up with examples that show that $\text{Mono}\nRightarrow\text{Inj}$
and $\text{Inj}\nRightarrow\text{Split mono}$.
\end{xca}
\begin{example}[Arithmetic isn't trivial]
Let $f:G\rightarrow K$ be a group homomorphism in $\mathsf{Gr}$.
By the first isomorphism theorem
\begin{equation}
f(G)\cong G/\ker(f)
\end{equation}
and $H=\ker(f)$ is a normal subgroup of $G$. Hence we can construct
the following sequence of maps
\begin{equation}
1\xhookrightarrow{\text{mono}}H\xhookrightarrow{\text{mono}}G\xrightarrow{f}G/H\xrightarrow{\text{epi}}1
\end{equation}
The first map is unique because $1$ has to map to $e\in H$. The second map is the inclusion of the subgroup $H\hookrightarrow G$. These two maps are monomorphisms because they are injective, while
the other two are epimorphisms because they are surjective. The question
we seek to answer is whether the group $G$ can always be written as
a direct product of its normal subgroup $H$ and the quotient group $G/H$.
This statement is equivalent to the statement that there exists a morphism
$g:G/H\rightarrow G$ such that $gf=\id_{G/H}$, i.e.\ $g$ is a section