-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.tex
298 lines (220 loc) · 10.4 KB
/
macros.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
% Basic Category Theory
% Tom Leinster <Tom.Leinster@ed.ac.uk>
%
% Copyright (c) Tom Leinster 2014-2016
%
% Macros
%
% PACKAGES
\usepackage{latexsym}
\usepackage{amssymb,amsmath}
\usepackage{bbm}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage{color}
\usepackage{multicol}
\usepackage{txfonts}
\usepackage{url}
\urlstyle{same}
\usepackage{makeidx}
\makeindex
\usepackage[all,2cell]{xy}
\UseAllTwocells
\xyoption{arc}
\xyoption{rotate}
\usepackage{hyperref}
\hypersetup{colorlinks, % Don't put a box around links
breaklinks, % Allow line breaks inside links
linkcolor=black, % Cross-references to theorems etc
urlcolor=black} % Web addresses
% STYLE PARAMETERS AND HYPHENATION
\def\makeRRlabeldot#1{\hss\llap{#1}} % Redefines macro in cambridge7A.cls
\renewcommand{\theenumi}{\rm(\alph{enumi})}
\renewcommand{\theequation}{\thechapter.\arabic{equation}}
\hyphenation{mo-noi-dal mo-noid co-do-main pre-sh-eaf pre-sh-ea-ves}
% FORMATTING AND ENGLISH TYPOGRAPHIC
\newcommand{\demph}[1]{\textbf{#1}} % Emphasis used for terms being
% defined
\newenvironment{displaytext}% % Used for several text-display environments
{\begin{list}{}%
{\setlength{\leftmargin}{2em}%
\setlength{\rightmargin}{\leftmargin}}%
\item}%
{\end{list}}
\newenvironment{setprop}{\begin{displaytext}\itshape}{\end{displaytext}}
% Properties in set theory chapter
\newenvironment{slogan}{\begin{displaytext}\itshape}{\end{displaytext}}
\newenvironment{citedsource}{\begin{displaytext}}{\end{displaytext}}
% Cited sources in Further Reading chapter
\newcommand{\minihead}[1]{\subsection*{#1}}
% Unnumbered heading in text
\newcommand{\subjectchange}{\bigskip}
% Small vertical space in text for change of subject
\newcommand{\exs}{\minihead{Exercises}}
\newcommand{\exone}{\minihead{Exercise}}
% MATHEMATICAL TYPOGRAPHIC
\newcommand{\cat}[1]{\mathscr{#1}} % Arbitrary category
\newcommand{\scat}[1]{\mathbf{#1}} % Arbitrary small category
\newcommand{\fcat}[1]{\mathbf{#1}} % Typeface for fixed categories
\newcommand{\ovln}[1]{\overline{#1}}
\newcommand{\lwr}[1]{\mathbf{#1}} % \lwr{n} denotes n-element set
\newcommand{\rreg}[1]{\underline{#1}} % Regular representation
\newcommand{\ynt}[1]{\tilde{#1}} % Nat transf in Yoneda lemma
\newcommand{\yel}[1]{\hat{#1}} % Element in Yoneda lemma
\newcommand{\wideyel}[1]{\widehat{#1}} % Wide version of \yel
% CONSTANTS (LETTERS)
\newcommand{\epsln}{\varepsilon} % \epsilon is not used anywhere
\newcommand{\nat}{\mathbb{N}} % Natural numbers
\newcommand{\integers}{\mathbb{Z}}
\newcommand{\rationals}{\mathbb{Q}}
\newcommand{\reals}{\mathbb{R}}
\newcommand{\complexes}{\mathbb{C}}
\DeclareMathOperator{\cset}{\cat{C}} % Set of closed subsets
\DeclareMathOperator{\Cl}{Cl} % Closure
\DeclareMathOperator{\Cone}{Cone} % Cones (in limit sense)
\DeclareMathOperator{\End}{\fcat{End}} % Endomorphisms
\DeclareMathOperator{\Eq}{Eq} % Equalizer
\DeclareMathOperator{\ev}{ev} % Evaluation
\DeclareMathOperator{\Hom}{Hom} % Hom-set/functor
\DeclareMathOperator{\HOM}{\fcat{Hom}} % Homs between vector spaces
\DeclareMathOperator{\im}{im} % Image
\DeclareMathOperator{\Lan}{Lan} % Left Kan extension
\DeclareMathOperator{\ob}{ob} % Object-set
\DeclareMathOperator{\oset}{\cat{O}} % Set of open subsets
\DeclareMathOperator{\pr}{pr} % Projection
\DeclareMathOperator{\pset}{\cat{P}} % Power set
\DeclareMathOperator{\Sub}{Sub} % Set of subobjects
\newcommand{\h}{H} % Homs (e.g. \h_A means Hom(-, A))
\newcommand{\op}{\mathrm{op}} % Opposite category
\newcommand{\true}{\texttt{true}} % Truth value "true"
\newcommand{\false}{\texttt{false}} % Truth value "false"
\newcommand{\One}{\mathbf{1}} % Terminal category
\newcommand{\Two}{\mathbf{2}} % Single-arrow category
\newcommand{\Ab}{\fcat{Ab}} % Abelian groups
\newcommand{\Bilin}{\fcat{Bilin}} % Bilinear maps
\newcommand{\Cat}{\fcat{Cat}} % Small categories
\newcommand{\CAT}{\fcat{CAT}} % All categories
\newcommand{\CptHff}{\fcat{CptHff}} % Compact Hausdorff spaces
\newcommand{\CRing}{\fcat{CRing}} % Commutative rings
\newcommand{\FDVect}{\fcat{FDVect}} % Fin-dim vector spaces
\newcommand{\Field}{\fcat{Field}} % Fields
\newcommand{\FinSet}{\fcat{FinSet}} % Finite sets
\newcommand{\Fix}{\fcat{Fix}} % Fixed-point category
\newcommand{\Grp}{\fcat{Grp}} % Groups
\newcommand{\Mt}{\fcat{Mat}} % Matrices
\newcommand{\Mon}{\fcat{Mon}} % Monoids
\newcommand{\Ord}{\fcat{Ord}} % Total orders
\newcommand{\Ring}{\fcat{Ring}} % Rings
\newcommand{\Set}{\fcat{Set}} % Sets
\newcommand{\Sym}{\fcat{Sym}} % Permutations
\newcommand{\Tp}{\fcat{Top}} % Topological spaces
\newcommand{\Toph}{\fcat{Toph}} % Topo spaces + hty classes of maps
\newcommand{\Vect}{\fcat{Vect}} % Vector spaces
% CONSTANT SYMBOLS
\newcommand{\such}{\mathrel{|}} % Separator in set-builder notation
\newcommand{\Bigsuch}{\mathrel{\big|}} % Big version of \such
\newcommand{\without}{\setminus} % Set complement
\newcommand{\emptybk}{\hspace*{.5em}} % Empty space used as blank
\newcommand{\blank}{(\emptybk)} % Generic blank
\newcommand{\dashbk}{-} % Dash used as blank
\newcommand{\bl}{\bullet} % Bullet used as blank
\newcommand{\from}{{\colon}\linebreak[0]} % Colon for f: A --> B
\newcommand{\iso}{\cong} % Isomorphism
\newcommand{\eqv}{\simeq} % Equivalence
\newcommand{\sub}{\subseteq} % Subset (possibly not proper)
\newcommand{\ladj}{\dashv} % Left adjoint
\newcommand{\divides}{\mathbin{\mid}} % For divisibility of integers
\newcommand{\of}{\mathbin{\circ}} % Composition
\newcommand{\meet}{\wedge} % Joins and meets in ordered sets
\newcommand{\Meet}{\bigwedge}
\newcommand{\join}{\vee}
\renewcommand{\Join}{\bigvee}
% MATHEMATICAL EXPRESSIONS TAKING ARGUMENTS
\newcommand{\ftrcat}[2]{[#1,#2]} % Functor category
\newcommand{\pshf}[1]{\ftrcat{#1^\op}{\Set}} % Presheaf category
\newcommand{\psh}[1]{\hat{#1}} % Alternative pshf cat
\newcommand{\elt}[1]{\scat{E}(#1)} % Category of elements
\newcommand{\colt}[1]{\lim\limits_{\rightarrow #1}} % Colimit
\newcommand{\lt}[1]{\lim\limits_{\leftarrow #1}} % Limit
\newcommand{\abel}[1]{#1_{\mathrm{ab}}} % Abelianization
\newcommand{\comma}[2]{(#1 \mathbin{\Rightarrow} #2)} % Comma cat
\newcommand{\qer}[2]{#1/\mathord{#2}} % Eq reln for use after slash
\newcommand{\crd}[1]{\left|#1\right|} % Cardinality
% ARROWS
\newcommand{\oppairu}{\rightleftarrows} % Unlabelled opposing pair
\newcommand{\oppairua}{\leftrightarrows} % Same, but reversed
\newcommand{\parpairu}{\rightrightarrows} % Unlabelled parallel pair
\newcommand{\ot}{\leftarrow} % Left-pointing arrow
\newcommand{\toby}[1]{\stackrel{#1}{\longrightarrow}} % Labelled arrow
\newcommand{\otby}[1]{\stackrel{#1}{\longleftarrow}} % Left lblld arrow
\newcommand{\longto}{\longrightarrow} % Long labelled arrow
\newcommand{\toiso}{\toby{\textstyle{}_\sim}} % Isomorphism arrow
\newcommand{\incl}{\hookrightarrow} % Inclusion arrow
\newcommand{\mapsfrom}{\mathrel{\reflectbox{\ensuremath{\mapsto}}}}
% Left-pointing \mapsto
\newcommand{\textiff}{\Longleftrightarrow} % Iff arrow for use in text
\newcommand{\textif}{\Longleftarrow} % If arrow for use in text
\newcommand{\textonlyif}{\Longrightarrow} % Only if arrow for text
\newcommand{\nent}{\rotatebox{45}{$\Rightarrow$}}
% North-east-pointing arrow for natural transformations
\newcommand{\nwnt}{\rotatebox{-45}{$\Leftarrow$}} % North-west
\newcommand{\swnt}{\rotatebox{45}{$\Leftarrow$}} % South-west
\newcommand{\sent}{\rotatebox{-45}{$\Rightarrow$}} % South-east
\newcommand{\neeq}{\rotatebox{45}{$=$}}
% North-east pointing equality
\newcommand{\oppair}[4]{%
\xymatrix{%
#1 \ar@<.5ex>[r]^-{#3} &{#2}\ar@<.5ex>[l]^-{#4}%
}}
% Opposite-pointing pair of arrows, with arguments, for use in displays
\newcommand{\oppairi}[4]{%
\xymatrix@1{%
#1 \ar@<.5ex>[r]^{#3} &{#2}\ar@<.5ex>[l]^{#4}%
}}
% Opposite-pointing pair of arrows, with arguments, for use in text
\newcommand{\parpair}[4]{%
\xymatrix{%
#1 \ar@<.5ex>[r]^{#3} \ar@<-.5ex>[r]_{#4} %
}}
% Parallel pair of arrows, with arguments, for use in displays
\newcommand{\parpairi}[4]{%
\xymatrix@1{%
#1 \ar@<.5ex>[r]^{#3} \ar@<-.5ex>[r]_{#4} %
}}
% Parallel pair of arrows, with arguments, for use in text
\newcommand{\adjn}[4]{%
\xymatrix{
#1 \ar@{}[d]|\ladj \ar@<1ex>[d]^{#4} \\
#2 \ar@<1ex>[u]^{#3}
}}
% Adjunction, with arguments, for use in displays
\newcommand{\hadjnli}[4]{%
\xymatrix@1{
#1 \ar@<1.1ex>[r]^-{#3} \ar@{}[r]|-\bot  \ar@<1.1ex>[l]^-{#4}}}
% Adjunction, with arguments, for use in text (left adjt on top)
\newcommand{\hadjnri}[4]{%
\xymatrix@1{
#1 \ar@<1.1ex>[r]^-{#3} \ar@{}[r]|-\top  \ar@<1.1ex>[l]^-{#4}}}
% Adjunction, with arguments, for use in text (left adjt on bottom)
\newcommand{\searrows}{\makebox[1em]{$\downarrow$%
\hspace*{-.2em}\raisebox{-1ex}{$\rightarrow$}}}
% Little diagram of anticlockwise path around a commutative square
\newcommand{\esarrows}{\makebox[1em]{%
\raisebox{1ex}{$\rightarrow$}\hspace*{-.2em}$\downarrow$}}
% Little diagram of clockwise path around a commutative square
% PICTURE ENVIRONMENT
\newcommand{\cell}[4]{\put(#1,#2){\makebox(0,0)[#3]{\ensuremath{#4}}}}
% Places a label in picture environment
% REFERENCES, CITATIONS AND INDEXING
\newcommand{\bref}[1]{\ref{#1}} % \ref in brackets
\newcommand{\citestyle}[1]{#1} % Style for sources cited
\newcommand{\citeGow}{\citestyle{Gowers (2002)}}
\newcommand{\citeKel}{\citestyle{Kelly (1982)}}
\newcommand{\citeLR}{\citestyle{Lawvere and Rosebrugh (2003)}}
\newcommand{\citeRST}{\citestyle{Leinster (2014)}}
\newcommand{\citeCWM}{\citestyle{Mac~Lane (1971)}}
% The following commands are for the index of notation
\newcommand{\ntn}[1]{\label{notn:#1}} % Make label
\newcommand{\nref}[1]{\pageref{notn:#1}}% Refers to page where notn is used
\newcommand{\nuse}[2]{#2, #1\\}
% First arg is page ref; second is description of notation