Skip to content

Commit a02f510

Browse files
exercises: add solution to disjoint-or
1 parent 0adceec commit a02f510

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

exercise_solutions.tex

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ \subsection*{Solution to \cref{ex:prop-endocontr}}
342342

343343
\subsection*{Solution to \cref{ex:lem-mereprop}}
344344

345-
Let $h:\isprop(A)$, and let $x,y:A+(\neg A)$. We want to show that $x=y$.
346-
We proceed by cases using the induction principle for coproducts.
345+
Assume $A$ is a proposition, and let $x,y:A+(\neg A)$. We want to show that
346+
$x=y$. We proceed by cases using the induction principle for coproducts.
347347
\begin{enumerate}
348348
\item Assume $x\jdeq \inl(a)$ and $y\jdeq \inr(n)$. Then
349349
$n(a):\emptyt$ gives us a contradiction.
@@ -362,6 +362,24 @@ \subsection*{Solution to \cref{ex:lem-mereprop}}
362362
$\id[]{n_1}{n_2}$.
363363
\end{enumerate}
364364

365+
\subsection*{Solution to \cref{ex:disjoint-or}}
366+
367+
Assume $h:\neg(A\times B)$, and let $x,y:A+B$. We want to show that
368+
$x=y$. We proceed by cases using the induction principle for coproducts.
369+
\begin{enumerate}
370+
\item Assume $x\jdeq \inl(a)$ and $y\jdeq \inr(b)$ for $a:A$ and $b:B$.
371+
Then $h(a,b):\emptyt$, and we can use the destructor for $\emptyt$ to
372+
conclude anything we wish.
373+
\item Assume $x\jdeq \inr(b)$ and $y\jdeq \inl(a)$. Then $h(a,b):\emptyt$, and
374+
we're done.
375+
\item Assume $x\jdeq \inl(a_1)$ and $y\jdeq \inl(a_2)$. By the
376+
characterization of paths in coproduct types (\cref{sec:compute-coprod}), we
377+
know $\eqv{(\id[]xy)}{(\id[]{a_1}{a_2})}$, and we have $\id[]{a_1}{a_2}$
378+
since $A$ is a proposition.
379+
\item Assume $x\jdeq \inr(b_1)$ and $y\jdeq \inr(b_2)$. Just as above,
380+
we have $\eqv{(\id[]xy)}{(\id[]{b_1}{b_2})}$, and $\id[]{b_1}{b_2}$.
381+
\end{enumerate}
382+
365383
\subsection*{Solution to \cref{ex:decidable-choice}}
366384

367385
The hypotheses imply that

0 commit comments

Comments
 (0)