-
Notifications
You must be signed in to change notification settings - Fork 359
/
main.tex
335 lines (256 loc) · 9.85 KB
/
main.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
% THIS IS NOT THE FILE YOU SHOULD PROCESS. IT IS THE "MAIN" FILE,
% BUT IT GETS INCLUDED BY ONE OF THE hott-xxx.tex FILES. THOSE ARE
% THE MAIN ONES.
% DOCUMENT CLASS
\documentclass[\OPTfontsize]{book}
\PassOptionsToPackage{table}{xcolor}
\usepackage{etex} % We're running out of registers and dimensions, or some such
% PAGE GEOMETRY
\usepackage[papersize={\OPTpagesize},
twoside,
includehead,
top=\OPTtopmargin,
bottom=\OPTbottommargin,
inner=\OPTinnermargin,
outer=\OPToutermargin,
bindingoffset=\OPTbindingoffset]{geometry}
% HYPERLINKING AND PDF METADATA
\usepackage[backref=page,
colorlinks,
citecolor=linkcolor,
linkcolor=linkcolor,
urlcolor=linkcolor,
unicode,
pdfauthor={Univalent Foundations Program},
pdftitle={Homotopy Type Theory: Univalent Foundations of Mathematics},
pdfsubject={Mathematics},
pdfkeywords={type theory, homotopy theory, univalence axiom}]{hyperref}
\renewcommand{\backref}[1]{}
\renewcommand{\backrefalt}[4]{%
\ifcase #1 %
(No citations.)
\or
(Cited on page\ #2.)
\else
(Cited on pages\ #2.)
\fi}
% OTHER PACKAGES
% Use this package and stick \layout somewhere in the text to see
% page margins, text size and width etc. Useful for debugging page format.
\usepackage{layout}
%%% Because Germans have umlauts and Slavs have even stranger ways of mangling letters
\usepackage[utf8]{inputenc}
%%% For table {tab:theorems}
\usepackage{pifont}
%%% Multi-Columns for long lists of names
\usepackage{multicol}
%%% Set the fonts
\usepackage{mathpazo}
\usepackage[scaled=0.95]{helvet}
\usepackage{courier}
\linespread{1.05} % Palatino looks better with this
\usepackage{ifpdf}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png}
\input{bmpsize-hack} % for bounding boxes in dvi mode
\usepackage{comment}
\usepackage{fancyhdr} % To set headers and footers
\usepackage{nextpage} % So we can jump to odd-numbered pages
\usepackage{amssymb,amsmath,amsthm,stmaryrd,mathrsfs,wasysym}
\usepackage{enumitem,mathtools,xspace}
\usepackage{xstring} % For generating singluars and plurals in \backref
\usepackage{xcolor} % For colored cells in tables we need \cellcolor
\usepackage{wallpaper} % For the background image on the cover page
\usepackage{booktabs} % For nice tables
\usepackage{array} % For nice tables
\definecolor{linkcolor}{rgb}{\OPTlinkcolor}
\usepackage{aliascnt}
\usepackage[capitalize]{cleveref}
\usepackage[all,2cell,cmtip]{xy}
\UseAllTwocells
\usepackage{braket} % used for \setof{ ... } macro
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,arrows}
\usepackage{etoolbox} % hacking commands for TOC
\usepackage{mathpartir} % for formal.tex appendix, section 3
\usepackage[numbered]{bookmark} % add chapter/section numbers to the toc in the pdf metadata
\input{macros}
%%%% Indexing
\usepackage{makeidx}
\makeindex
%%%% Header and footers
\pagestyle{fancyplain}
\setlength{\headheight}{15pt}
\renewcommand{\chaptermark}[1]{\markboth{\textsc{Chapter \thechapter. #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\textsc{\thesection\ #1}}}
\lhead[\fancyplain{}{{\thepage}}]%
{\fancyplain{}{\nouppercase{\rightmark}}}
\rhead[\fancyplain{}{\nouppercase{\leftmark}}]%
{\fancyplain{}{\thepage}}
\cfoot[]{}
\lfoot[]{}
\rfoot[]{}
%%%% Chapter & part style
\usepackage[raggedright]{titlesec}
\titleformat{\part}[display]{\fontsize{\OPTpartfont}{\OPTpartfont}\fontseries{m}\fontshape{sc}\selectfont}{\hfil\partname\ \Roman{part}}{\OPTpartskip}{\fontsize{\OPTparttitlefont}{\OPTparttitlefont}\fontseries{b}\fontshape{sc}\selectfont\hfil}
\titleformat{\chapter}[display]{\fontsize{\OPTchapterfont}{\OPTchapterfont}\fontseries{m}\fontshape{it}\selectfont}{\chaptertitlename\ \thechapter}{\OPTchapterskip}{\fontsize{\OPTchaptertitlefont}{\OPTchaptertitlefont}\fontseries{b}\fontshape{n}\selectfont}
% Patch bug in titlesec 2.10.1
\makeatletter
\@ifpackagelater{titlesec}{2016/03/21}{%
% Package titlesec is on version 2.10.2 or higher, nothing to do
}{\@ifpackagelater{titlesec}{2016/03/15}{%
% Package titlesec on version 2.10.1, patch accordingly
\usepackage{etoolbox}%
\patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}{}{}%
\patchcmd{\ttlh@hang}{\noindent}{}{}{}%
}{% Package titlesec is on version 2.10.0 or lower, nothing to do %
}}
\makeatother
% To avoid compiling stuff other than what you're working on right
% now, uncomment the following command and give your file as its
% argument.
%\includeonly{}
% For some reason \pagecolor overlays the cover image,
% unless we use it once before the document starts.
\definecolor{covercolor}{cmyk}{\OPTcovercolor}
\definecolor{covertext}{cmyk}{\OPTcovertextcolor}
\pagecolor{white}
\ifpdf
\nopagecolor
\fi
% Make a new page for each exercise, if the option is set
\ifdef{\OPTexerciseperpage}
{
\BeforeBeginEnvironment{ex}{\newpage}
}{}
\begin{document}
% NB: This does not actually appear anywhere because we have
% a custom title page.
\title{Homotopy Type Theory: Univalent Foundations of Mathematics}
\author{The Univalent Foundations Program}
\frontmatter % Turn on arabic page numbers and unnumbered chapters
% Half-title, title, copyright page do not have displayed page numbers
\pagestyle{empty}
\include{front} %%% Title page and copyright
\cleartooddpage
% Add Preface to PDF Metadata but not printed TOC
\hypertarget{preface}{}
\bookmark[dest=preface]{Preface}
% Preface and TOC have arabic numbers
\pagestyle{fancyplain}
\include{preface}
\cleartooddpage[\thispagestyle{empty}]
% Add TOC to PDF Metadata but not printed TOC
\hypertarget{toc}{}
\bookmark[dest=toc]{Table of Contents}
\setcounter{tocdepth}{1} % chapters and sections for the toc
\tableofcontents
\setcounter{tocdepth}{2} % chapters, sections, and subsections for the
% metadata of the pdf
\cleartooddpage[\thispagestyle{empty}]
\mainmatter % Turn on roman page numbers and numbered chapters
% Turn on headers and footers for mainmatter (must appear after \cleartooddpage)
\pagestyle{fancyplain}
\include{introduction}
\part{Foundations}
\label{part:foundations}
\include{preliminaries}
\include{basics}
\include{logic}
\include{equivalences}
\include{induction}
\include{hits}
\include{hlevels}
\cleartooddpage[\thispagestyle{empty}] % Needed for correct TOC
\part{Mathematics}
\label{part:mathematics}
\include{homotopy}
\include{categories}
\include{setmath}
\include{reals}
%%%% Appendix
\cleartooddpage[\thispagestyle{empty}] % Needed for correct TOC
\phantomsection % Needed for correct TOC also
\part*{Appendix}
% We use magic to get the appendix look like Bibliography and Index
\appendix
\renewcommand{\chaptermark}[1]{\markboth{\textsc{Appendix. \thechapter. #1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\textsc{\thesection\ #1}}}
\include{formal}
% Joke
\nocite{Angiuli13}
\nocite{BauerAcceptanceVideo}
%%%% Bibliography
\bibliographystyle{halpha}
\phantomsection % black magic to get TOC to point to correct page
\addcontentsline{toc}{part}{\bibname}
\markboth{}{\textsc{Bibliography}}
{\renewcommand{\markboth}[2]{} % Prevent bibliography from resetting the header to something silly
\OPTbibliographyfont
\bibliography{references}}
\cleartooddpage[\thispagestyle{empty}]
%%%% Index of symbols
\include{symbols}
\cleartooddpage[\thispagestyle{empty}]
%%%%% Index of terms
%% Global cross-references for index
\indexsee{principle}{axiom}
\indexsee{number!real}{real numbers}
\indexsee{abelian group}{group, abelian}
\indexsee{sequence!Cauchy}{Cauchy sequence}
\indexsee{adjunction}{adjoint functor}
\indexsee{higher topos}{$(\infty,1)$-topos}
\indexsee{topos!higher}{$(\infty,1)$-topos}
\indexsee{source!of a function}{domain}
\indexsee{target!of a function}{codomain}
\indexsee{type!truncation of}{truncation}
\indexsee{propositional!truncation}{truncation}
\indexsee{proof-relevant mathematics}{mathematics, proof-relevant}
\indexsee{classical!mathematics}{mathematics, classical}
\indexsee{classical!logic}{logic}
\indexsee{constructive!mathematics}{mathematics, constructive}
\indexsee{constructive!logic}{logic}
\indexsee{intuitionistic logic}{logic}
\indexsee{definition!inductive}{type, inductive}
\indexsee{inductive!definition}{type, inductive}
\indexsee{bounded!totally}{totally bounded}
\indexsee{sum!of numbers}{addition}
\indexsee{continuous map}{function, continuous}
\indexsee{function!continuity of@``continuity'' of}{``continuity''}
\indexsee{function!functoriality of@``functoriality'' of}{``functoriality''}
\indexsee{codes}{encode-decode method}
\indexsee{inequality}{order}
\indexsee{Coq@\Coq}{proof assistant}
\indexsee{Agda@\Agda}{proof assistant}
\indexsee{NuPRL@\NuPRL}{proof assistant}
\indexsee{generator!of an inductive type}{constructor}
\indexsee{groupoid!.infinity-@$\infty$-}{$\infty$-groupoid}
\indexsee{higher groupoid}{$\infty$-groupoid}
\indexsee{hierarchy!of n-types@of $n$-types}{$n$-type}
\indexsee{homotopy!n-type@$n$-type}{$n$-type}
\indexsee{homotopy!theory, classical}{classical homotopy theory}
\indexsee{homotopy!fiber}{fiber}
\indexsee{homotopy!limit}{limit of types}
\indexsee{homotopy!colimit}{colimit of types}
\indexsee{implementation}{proof assistant}
\indexsee{notation, abuse of}{abuse of notation}
\indexsee{language, abuse of}{abuse of language}
\indexsee{operator!induction}{induction principle}
\indexsee{operator!modal}{modality}
\indexsee{commutative!group}{group, abelian}
\indexsee{countable axiom of choice}{axiom of choice, countable}
% tell the index to get itself into the table of contents
\phantomsection % black magic to get TOC to point to correct page
\addcontentsline{toc}{part}{Index}
\markboth{}{\textsc{Index}}
\renewcommand{\markboth}[2]{}
{\OPTindexfont
\setlength{\columnsep}{\OPTindexcolumnsep}
\printindex}
% The back cover
\include{back}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "hott-online"
%%% End: