forked from HoTT/book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise_solutions.tex
222 lines (164 loc) · 9.29 KB
/
exercise_solutions.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
% This is the exercise solution document for the homotopy type theory book.
% This file supports two book sizes:
% - Letter size (8.5" x 11")
% - US Trade size (6" x 9")
%
% To activate one or the other, uncomment the appropriate font size in
% the documentclass below, and then one of the two page geometry incantations
%
% NOTE: The 6" x 9" format is only experimental. It will break the
% title page, for example.
\PassOptionsToPackage{table}{xcolor}
% DOCUMENT CLASS
\documentclass[
%
%10pt % for US Trade 6" x 9" book
%
11pt % for Letter size book
]{article}
\usepackage{etex} % We're running out of registers and dimensions, or some such
\newcounter{chapter} % So that macros.tex doesn't choke
% PAGE GEOMETRY
%
% Uncomment one of these
% We make the page 40pt taller than the standard LaTeX book.
% OPTION 1: Letter
\usepackage[papersize={8.5in,11in},
twoside,
includehead,
top=1in,
bottom=1in,
inner=0.75in,
outer=1.0in,
bindingoffset=0.35in]{geometry}
% OPTION 2: US Trade
% \usepackage[papersize={6in,9in},
% twoside,
% includehead,
% top=0.75in,
% bottom=0.75in,
% inner=0.5in,
% outer=0.75in,
% bindingoffset=0.35in]{geometry}
% HYPERLINKING AND PDF METADATA
\usepackage[pagebackref,
colorlinks,
citecolor=darkgreen,
linkcolor=darkgreen,
unicode,
pdfauthor={Univalent Foundations Program},
pdftitle={Homotopy Type Theory: Univalent Foundations of Mathematics},
pdfsubject={Mathematics},
pdfkeywords={type theory, homotopy theory, univalence axiom}]{hyperref}
% 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{graphicx}
\usepackage{comment}
\usepackage{wallpaper} % For the background image on the cover page
\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{xcolor} % For colored cells in tables we need \cellcolor
\usepackage{booktabs} % For nice tables
\usepackage{array} % For nice tables
\usepackage{supertabular} % For index of symbols
\definecolor{darkgreen}{rgb}{0,0.45,0}
\usepackage{aliascnt}
\usepackage[capitalize]{cleveref}
\usepackage[all,2cell]{xy}
\UseAllTwocells
\usepackage{natbib}
\usepackage{braket} % used for \setof{ ... } macro
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\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{\sectionmark}[1]{\markright{\textsc{\thesection\ #1}}}
\lhead[\fancyplain{}{{\thepage}}]%
{\fancyplain{}{\nouppercase{\rightmark}}}
\rhead[\fancyplain{}{\nouppercase{\leftmark}}]%
{\fancyplain{}{\thepage}}
\cfoot{\textsc{\scriptsize \textcolor{gray}{[Draft of \today]}}}
\lfoot[]{}
\rfoot[]{}
%%%% Chapter & part style
\usepackage{titlesec}
\titleformat{\part}[display]{\fontsize{40}{40}\fontseries{m}\fontshape{sc}\selectfont}{\hfil\partname\ \Roman{part}}{20pt}{\fontsize{60}{60}\fontseries{b}\fontshape{sc}\selectfont\hfil}
\titleformat{\chapter}[display]{\fontsize{23}{25}\fontseries{m}\fontshape{it}\selectfont}{\chaptertitlename\ \thechapter}{20pt}{\fontsize{35}{35}\fontseries{b}\fontshape{n}\selectfont}
\input{main.labels}
\title{Solutions to selected exercises}
\begin{document}
\maketitle
\section*{Exercises from \autoref{cha:logic}}
\subsection*{Solution to \autoref{ex:decidable-choice}}
The hypotheses imply that
\[ \Parens{\sm{n:\nat}P(n)} \;\to\; \sm{n:\nat}\Parens{P(n) \times \prd{m:\nat} \big((m<n) \to \neg P(m)\big)}. \]
In words, given $n$ such that $P(n)$, we can find the least such $n$: we test every $m<n$ in turn, using decidability to do a case analysis, until we find the first one that satisfies $P(m)$.
However, the right-hand side of the above implication is a mere proposition: if both $n$ and $n'$ are least numbers satisfying~$P$ then they must be equal.
Therefore, we also have
\[ \Brck{\sm{n:\nat}P(n)} \;\to\; \sm{n:\nat}\Parens{P(n) \times \prd{m:\nat} \big((m<n) \to \neg P(m)\big)} \]
from which the claim follows.
\section*{Exercises from \autoref{cha:hlevels}}
\subsection*{Solution to \autoref{ex:ntype-from-nconn-const}}
Let $\modal$ be a modality; it remains to show that if all maps into $B$ out of a $\modal$-connected type are constant, then $B$ is $\modal$-modal.
We show under that hypothesis that $\eta:B\to \modal B$ is an equivalence, by showing that its fibers are contractible.
Since $\eta$ is always $\modal$-connected, its fibers are $\modal$-connected, and thus the inclusion of $\hfib{\eta}{z}$ into $B$ is constant.
Thus, there is an $a:B$ such that for any $b:B$ and $p:\eta b=z$ we have $q(b,p):a=b$.
Then $\apfunc{\eta}(q(b,p))\ct p : \eta a=z$ for any $(b,p):\hfib\eta z$, so we have a map $\hfib\eta z \to (\eta a=z)$.
But $\modal B$ is $\modal$-modal, hence so is $\eta a = z$.
Thus, by \autoref{thm:nconn-to-ntype-const}, this map is constant; hence we have $r:\eta a=z$ such that $\apfunc{\eta}(q(b,p))\ct p = r$ for all $(b,p)$.
But using the characterization of paths in fibers, this means exactly that $(b,p)=(a,r)$ for all $(b,p)$; hence $\hfib\eta z$ is contractible with center $(a,r)$.
\subsection*{Solution to \autoref{ex:connectivity-inductively}}
If $A$ is $n$-connected, then since $\trunc{-1}A = \trunc{-1}{\trunc{n}A}$, also $A$ is $(-1)$-connected.
And since $\trunc{n-1}{\id[A]ab} = (\id[\trunc n A]{\tproj na}{\tproj nb})$ by \autoref{thm:path-truncation} and the path spaces of a contractible type are contractible, each $\id[A]ab$ is $(n-1)$-connected.
Conversely, suppose $A$ is $(-1)$-connected and all its path spaces are $(n-1)$-connected.
Firstly, we claim $\trunc nA$ is a mere proposition, i.e.\ that for all $x,y:\trunc nA$, the type $x=y$ is contractible.
Since contractibility of $x=y$ is a mere proposition, it suffices to assume that $x$ and $y$ are of the form $\tproj na$ and $\tproj nb$ respectively.
But $\id[\trunc n A]{\tproj na}{\tproj nb}$ is contractible by \autoref{thm:path-truncation} and the assumption.
Thus, $\trunc nA$ is a mere proposition.
Since it is also $(-1)$-connected by assumption, it is therefore contractible, so $A$ is $n$-connected.
\subsection*{Solution to \autoref{ex:lemnm}}
Evidently $\mathsf{LEM}$ is the same as $\mathsf{LEM}_{-1,-1}$, so for the first part it suffices to assume $\mathsf{LEM}$ and prove $\mathsf{LEM}_{n,-1}$ and $\mathsf{LEM}_{-1,m}$ for all $n,m$.
For the latter, note that if $A$ is a mere proposition, then by \autoref{ex:lem-mereprop} so is $A+\neg A$, and thus $\trunc m{A+\neg A}= A+\neg A$ for any $m\ge -1$.
For the former, note that assuming LEM, by \autoref{ex:lem-brck} we have $\trunc{-1}{B} = \neg\neg B$ for any $B$, while $\neg\neg(A+\neg A)$ is always true for any type $A$ (\autoref{ex:not-not-lem}).
For the second part, it suffices to derive a contradiction from $\mathsf{LEM}_{0,0}$; but the proof of \autoref{thm:not-lem} already uses an $A$ that is a set (namely $\bool$).
\subsection*{Solution to \autoref{ex:acconn}}
Suppose the $(-1)$-connected AC, and by induction suppose also the $n$-connected AC.
Let $X$ be a set and $Y:X\to \type$ a family of $(n+1)$-connected types.
By \autoref{ex:connectivity-inductively}, to show that $\prd{x:X} Y(x)$ is $(n+1)$-connected, it suffices to show that it is $(-1)$-connected and that all its path-types are $n$-connected.
But also by \autoref{ex:connectivity-inductively}, each $Y(x)$ is $(-1)$-connected and all its path types are $n$-connected.
Applying function extensionality to characterize the path types of $\prd{x:X} Y(x)$, the claim follows from the $(-1)$-connected and $n$-connected axioms of choice.
\section*{Exercises from \autoref{cha:category-theory}}
\subsection*{Solution to \autoref{ex:stack}}
Define $K$ to be the precategory with $K_0 \defeq Y$ and $\hom_K(y_1,y_2) \defeq (p(y_1)=p(y_2))$.
Then $\mathrm{Desc}(A,p)\defeq A^K$ is a good definition.
Moreover, the obvious functor $K\to X$ (where $X$ denotes the discrete category on itself) is a weak equivalence, so \autoref{ct:esofull-precomp-ff,ct:cat-weq-eq} yield the second and third parts.
Finally, $K$ is a strict category, so if it is a stack, then $p$ has a section, while conversely if $p$ has a section then $K\to X$ is a (strong) equivalence.
\section*{Exercises from \autoref{cha:set-math}}
\subsection*{Solution to \autoref{ex:prop-ord}}
Define $A<B$ iff $B \land \neg A$.
\subsection*{Solution to \autoref{ex:ninf-ord}}
Define $a<b$ iff $\exis{n:\nat} (b_n < a_n)$.
\end{document}