Remove some TODO-notes, add section on motifs
This commit is contained in:
parent
fc7e504359
commit
2d0dfab12a
|
@ -1,22 +1,24 @@
|
||||||
\chapter{Conclusion}
|
\chapter{Conclusion}
|
||||||
This thesis highlighted some issues with the standard inductive definition of
|
This thesis highlighted some issues with the standard inductive
|
||||||
propositional equality used in Agda. Functional extensionality and univalence
|
definition of propositional equality used in Agda. Functional
|
||||||
are examples of two propositions not admissible in Intensional Type Theory
|
extensionality and univalence are examples of two propositions not
|
||||||
(ITT). This has a big impact on what is provable and the reusability of proofs.
|
admissible in Intensional Type Theory (ITT). This has a big impact on
|
||||||
This issue is overcome with an extension to Agda's type system called Cubical
|
what is provable and the reusability of proofs. This issue is overcome
|
||||||
Agda. With Cubical Agda both functional extensionality and univalence are
|
with an extension to Agda's type system called Cubical Agda. With
|
||||||
admissible. Cubical Agda is more expressive, but there are certain issues that
|
Cubical Agda both functional extensionality and univalence are
|
||||||
arise that are not present in standard Agda. For one thing ITT and standard Agda
|
admissible. Cubical Agda is more expressive, but there are certain
|
||||||
enjoys Uniqueness of Identity Proofs (UIP). This is not the case in Cubical
|
issues that arise that are not present in standard Agda. For one thing
|
||||||
Agda. In stead there exists a hierarchy of types with increasing
|
ITT and standard Agda enjoys Uniqueness of Identity Proofs (UIP). This
|
||||||
\nomen{homotopical structure}{homotopy levels}. It turns out to be useful to built the
|
is not the case in Cubical Agda. In stead there exists a hierarchy of
|
||||||
formalization with this hierarchy in mind as it can simplify proofs
|
types with increasing \nomen{homotopical structure}{homotopy levels}.
|
||||||
considerably. Another issue one must overcome in Cubical Agda is when a type has
|
It turns out to be useful to built the formalization with this
|
||||||
a field whose type depends on a previous field. In this case paths between such
|
hierarchy in mind as it can simplify proofs considerably. Another
|
||||||
types will be heterogeneous paths. This problem is related to Cubical Agda not
|
issue one must overcome in Cubical Agda is when a type has a field
|
||||||
having the K-rule \TODO{Not mentioned anywhere in the report}. In practice it
|
whose type depends on a previous field. In this case paths between
|
||||||
turns out to be considerably more difficult to work heterogeneous paths than
|
such types will be heterogeneous paths. This problem is related to
|
||||||
with homogeneous paths. The thesis demonstrated some techniques to overcome
|
Cubical Agda not having the K-rule. In practice it turns out to be
|
||||||
|
considerably more difficult to work heterogeneous paths than with
|
||||||
|
homogeneous paths. The thesis demonstrated some techniques to overcome
|
||||||
these difficulties, such as based path-induction.
|
these difficulties, such as based path-induction.
|
||||||
|
|
||||||
This thesis formalized some of the core concepts from category theory including;
|
This thesis formalized some of the core concepts from category theory including;
|
||||||
|
|
|
@ -54,17 +54,18 @@ Judgmental equality in Cubical Agda is encapsulated with the type:
|
||||||
\Path \tp (P \tp I → \MCU) → P\ 0 → P\ 1 → \MCU
|
\Path \tp (P \tp I → \MCU) → P\ 0 → P\ 1 → \MCU
|
||||||
\end{equation}
|
\end{equation}
|
||||||
%
|
%
|
||||||
$I$ is a special data type (\TODO{that also has special computational properties
|
$I$ is a special data type called the index set. $I$ can be thought of
|
||||||
AFAIK}) called the index set. $I$ can be thought of simply as the interval on
|
simply as the interval on the real numbers from $0$ to $1$. $P$ is a
|
||||||
the real numbers from $0$ to $1$. $P$ is a family of types over the index set
|
family of types over the index set $I$. I will sometimes refer to $P$
|
||||||
$I$. I will sometimes refer to $P$ as the \nomenindex{path space} of some path $p \tp
|
as the \nomenindex{path space} of some path $p \tp \Path\ P\ a\ b$. By
|
||||||
\Path\ P\ a\ b$. By this token $P\ 0$ then corresponds to the type at the
|
this token $P\ 0$ then corresponds to the type at the left-endpoint
|
||||||
left-endpoint and $P\ 1$ as the type at the right-endpoint. The type is called
|
and $P\ 1$ as the type at the right-endpoint. The type is called
|
||||||
$\Path$ because it is connected with paths in homotopy theory. The intuition
|
$\Path$ because it is connected with paths in homotopy theory. The
|
||||||
behind this is that $\Path$ describes paths in $\MCU$ -- i.e.\ between types. For
|
intuition behind this is that $\Path$ describes paths in $\MCU$ --
|
||||||
a path $p$ for the point $p\ i$ the index $i$ describes how far along the path
|
i.e.\ between types. For a path $p$ for the point $p\ i$ the index $i$
|
||||||
one has moved. An inhabitant of $\Path\ P\ a_0\ a_1$ is a (dependent-) function,
|
describes how far along the path one has moved. An inhabitant of
|
||||||
$p$, from the index-space to the path space:
|
$\Path\ P\ a_0\ a_1$ is a (dependent-) function, $p$, from the
|
||||||
|
index-space to the path space:
|
||||||
%
|
%
|
||||||
$$
|
$$
|
||||||
p \tp \prod_{i \tp I} P\ i
|
p \tp \prod_{i \tp I} P\ i
|
||||||
|
@ -194,7 +195,7 @@ indeed both $\top$ and $\bot$ are propositions:
|
||||||
The term $\varnothing$ is used here to denote an impossible pattern. It is a
|
The term $\varnothing$ is used here to denote an impossible pattern. It is a
|
||||||
theorem that if a mere proposition $A$ is inhabited, then so is it contractible.
|
theorem that if a mere proposition $A$ is inhabited, then so is it contractible.
|
||||||
If it is not inhabited it is equivalent to the empty-type (or false
|
If it is not inhabited it is equivalent to the empty-type (or false
|
||||||
proposition).\TODO{Cite!!}
|
proposition).\TODO{Cite}
|
||||||
|
|
||||||
I will refer to a type $A \tp \MCU$ as a \emph{mere} proposition if I want to
|
I will refer to a type $A \tp \MCU$ as a \emph{mere} proposition if I want to
|
||||||
stress that we have $\isProp\ A$.
|
stress that we have $\isProp\ A$.
|
||||||
|
@ -242,11 +243,16 @@ Let $\left\Vert A \right\Vert = n$ denote that the level of $A$ is $n$.
|
||||||
Proposition: For any homotopic level $n$ this is a mere proposition.
|
Proposition: For any homotopic level $n$ this is a mere proposition.
|
||||||
%
|
%
|
||||||
\section{A few lemmas}
|
\section{A few lemmas}
|
||||||
Rather than getting into the nitty-gritty details of Agda I venture to take a
|
Rather than getting into the nitty-gritty details of Agda I venture to
|
||||||
more ``combinator-based'' approach. That is, I will use theorems about paths
|
take a more ``combinator-based'' approach. That is, I will use
|
||||||
already that have already been formalized. Specifically the results come from
|
theorems about paths already that have already been formalized.
|
||||||
the Agda library \texttt{cubical} (\TODO{Cite}). I have used a handful of
|
Specifically the results come from the Agda library \texttt{cubical}
|
||||||
results from this library as well as contributed a few lemmas myself.\footnote{The module \texttt{Cat.Prelude} lists the upstream dependencies. As well my contribution to \texttt{cubical} can be found in the git logs \TODO{Cite}.}
|
(\cite{cubical-demo}). I have used a handful of results from this
|
||||||
|
library as well as contributed a few lemmas myself.\footnote{The
|
||||||
|
module \texttt{Cat.Prelude} lists the upstream dependencies. As well
|
||||||
|
my contribution to \texttt{cubical} can be found in the git logs
|
||||||
|
which are available at
|
||||||
|
\hrefsymb{https://github.com/Saizan/cubical-demo}{\texttt{https://github.com/Saizan/cubical-demo}}.}
|
||||||
|
|
||||||
These theorems are all purely related to homotopy theory and cubical Agda and as
|
These theorems are all purely related to homotopy theory and cubical Agda and as
|
||||||
such not specific to the formalization of Category Theory. I will present a few
|
such not specific to the formalization of Category Theory. I will present a few
|
||||||
|
|
|
@ -97,10 +97,25 @@ a significant impact on the complexity of these kinds of proofs.
|
||||||
|
|
||||||
\TODO{Universe levels.}
|
\TODO{Universe levels.}
|
||||||
|
|
||||||
|
\subsection{Motifs}
|
||||||
|
An oft-used technique in this development is using based path
|
||||||
|
induction to prove certain properties. One particular challenge that
|
||||||
|
arises when doing so is that Agda is not able to automatically infer
|
||||||
|
the family that one wants to do induction over. For instance in the
|
||||||
|
proof $\var{sym}\ (\var{sym}\ p) ≡ p$ from \ref{eq:sym-invol} the
|
||||||
|
family that we chose to do induction over was $D\ b'\ p' \defeq
|
||||||
|
\var{sym}\ (\var{sym}\ p') ≡ p'$. However, if one interactively tries
|
||||||
|
to give this hole, all the information that Agda can provide is that
|
||||||
|
one must provide an element of $𝒰$. Agda could be more helpful in this
|
||||||
|
context, perhaps even infer this family in some situations. In this
|
||||||
|
very simple example this is of course not a big problem, but there are
|
||||||
|
examples in the source code where this gets more involved.
|
||||||
|
|
||||||
\section{Future work}
|
\section{Future work}
|
||||||
\subsection{Agda \texttt{Prop}}
|
\subsection{Agda \texttt{Prop}}
|
||||||
Jesper Cockx' work extending the universe-level-laws for Agda and the
|
Jesper Cockx' work extending the universe-level-laws for Agda and the
|
||||||
\texttt{Prop}-type.
|
\texttt{Prop}-type.
|
||||||
|
\TODO{Do I want to include this?}
|
||||||
|
|
||||||
\subsection{Compiling Cubical Agda}
|
\subsection{Compiling Cubical Agda}
|
||||||
\label{sec:compiling-cubical-agda}
|
\label{sec:compiling-cubical-agda}
|
||||||
|
@ -117,3 +132,8 @@ library exposes could provide one particularly interesting case-study.
|
||||||
\subsection{Higher inductive types}
|
\subsection{Higher inductive types}
|
||||||
This library has not explored the usefulness of higher inductive types
|
This library has not explored the usefulness of higher inductive types
|
||||||
in the context of Category Theory.
|
in the context of Category Theory.
|
||||||
|
|
||||||
|
\subsection{Initiality conjecture}
|
||||||
|
A fellow student here at Chalmers, Andreas Källberg, is currently
|
||||||
|
working on proving the initiality conjecture\TODO{Citation}. He will
|
||||||
|
be using this library to do so.
|
||||||
|
|
|
@ -277,16 +277,19 @@ $i$ becomes the triple:
|
||||||
\end{aligned}
|
\end{aligned}
|
||||||
\end{equation}
|
\end{equation}
|
||||||
%
|
%
|
||||||
I have found this to be a general pattern when proving things in homotopy type
|
I have found this to be a general pattern when proving things in
|
||||||
theory, namely that you have to wrap and unwrap equalities at different levels.
|
homotopy type theory, namely that you have to wrap and unwrap
|
||||||
It is worth noting that proving this theorem with the regular inductive equality
|
equalities at different levels. It is worth noting that proving this
|
||||||
type would already not be possible, since we at least need extensionality (the
|
theorem with the regular inductive equality type would already not be
|
||||||
projections are all $\prod$-types). Assuming we had functional extensionality
|
possible, since we at least need functional
|
||||||
available to us as an axiom, we would use functional extensionality \TODO{in
|
extensionality\index{functional extensionality} (the projections are
|
||||||
reverse?} to retrieve the equalities in $a$ and $b$, pattern-match on them to
|
all $\prod$-types). Assuming we had functional extensionality
|
||||||
see that they are both $\refl$ and then close the proof with $\refl$.
|
available to us as an axiom, we would use functional extensionality
|
||||||
Of course this theorem is not so interesting in the setting of ITT since we know
|
\TODO{in reverse?} to retrieve the equalities in $a$ and $b$,
|
||||||
a priori that equality proofs are unique.
|
pattern-match on them to see that they are both $\refl$ and then close
|
||||||
|
the proof with $\refl$. Of course this theorem is not so interesting
|
||||||
|
in the setting of ITT since we know a priori that equality proofs are
|
||||||
|
unique.
|
||||||
|
|
||||||
The situation is a bit more complicated when we have a dependent type.
|
The situation is a bit more complicated when we have a dependent type.
|
||||||
For instance, when we want to show that $\IsCategory$ is a mere
|
For instance, when we want to show that $\IsCategory$ is a mere
|
||||||
|
@ -326,8 +329,8 @@ $$
|
||||||
And this finishes the proof that being-a-category is a mere proposition
|
And this finishes the proof that being-a-category is a mere proposition
|
||||||
(\ref{eq:propIsPreCategory}).
|
(\ref{eq:propIsPreCategory}).
|
||||||
|
|
||||||
When we have a proper category we can make precise the notion of ``identifying
|
When we have a proper category we can make precise the notion of
|
||||||
isomorphic types'' \TODO{cite Awodey here}. That is, we can construct the
|
``identifying isomorphic types''. That is, we can construct the
|
||||||
function:
|
function:
|
||||||
%
|
%
|
||||||
$$
|
$$
|
||||||
|
@ -345,7 +348,11 @@ terminal objects are propositional:
|
||||||
It follows from the usual observation that any two terminal objects are
|
It follows from the usual observation that any two terminal objects are
|
||||||
isomorphic - and since categories are univalent, so are they equal. The proof is
|
isomorphic - and since categories are univalent, so are they equal. The proof is
|
||||||
omitted here, but the curious reader can check the implementation for the
|
omitted here, but the curious reader can check the implementation for the
|
||||||
details. \TODO{The proof is a bit fun, should I include it?}
|
details. It is in the module:
|
||||||
|
%
|
||||||
|
\begin{center}
|
||||||
|
\sourcelink{Cat.Category}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
\section{Equivalences}
|
\section{Equivalences}
|
||||||
\label{sec:equiv}
|
\label{sec:equiv}
|
||||||
|
@ -744,15 +751,18 @@ the two pairs:
|
||||||
\left( \fst\ u \equiv \fst\ v \right) \to u \equiv v
|
\left( \fst\ u \equiv \fst\ v \right) \to u \equiv v
|
||||||
\end{align*}
|
\end{align*}
|
||||||
%
|
%
|
||||||
The proof that these are indeed inverses has been omitted. \TODO{Do I really
|
The proof that these are indeed inverses has been omitted. The details
|
||||||
want to omit it?}\QED
|
can be found in the module:
|
||||||
|
\begin{center}
|
||||||
|
\sourcelink{Cat.Categories.Sets}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
Now to prove \ref{eq:equivSig}: Let $e \tp \prod_{a \tp A} \left( P\ a \simeq
|
Now to prove \ref{eq:equivSig}: Let $e \tp \prod_{a \tp A} \left( P\ a
|
||||||
Q\ a \right)$ be given. To prove the equivalence, it suffices to give an
|
\simeq Q\ a \right)$ be given. To prove the equivalence, it suffices
|
||||||
isomorphism between $\sum_{a \tp A} P\ a$ and $\sum_{a \tp A} Q\ a$, but since
|
to give an isomorphism between $\sum_{a \tp A} P\ a$ and $\sum_{a \tp
|
||||||
they have identical first components it suffices to give an isomorphism between
|
A} Q\ a$, but since they have identical first components it suffices
|
||||||
$P\ a$ and $Q\ a$ for all $a \tp A$. This is exactly what we can get from
|
to give an isomorphism between $P\ a$ and $Q\ a$ for all $a \tp A$.
|
||||||
the equivalence $e$.\QED
|
This is exactly what we can get from the equivalence $e$.\QED
|
||||||
|
|
||||||
Lastly we prove \ref{eq:equivIso}. Let $f \tp A \to B$ be given. For the maps we
|
Lastly we prove \ref{eq:equivIso}. Let $f \tp A \to B$ be given. For the maps we
|
||||||
choose:
|
choose:
|
||||||
|
@ -1050,7 +1060,10 @@ $b_0, b_1$ corresponds to a pair of paths between $a_0,b_0$ and $a_1,b_1$ (check
|
||||||
the implementation for the details).
|
the implementation for the details).
|
||||||
|
|
||||||
\emph{Proposition} \ref{eq:univ-1} is isomorphic to \ref{eq:univ-2}:
|
\emph{Proposition} \ref{eq:univ-1} is isomorphic to \ref{eq:univ-2}:
|
||||||
\TODO{Super complicated}
|
This proof of this has been omitted but can be found in the module:
|
||||||
|
\begin{center}
|
||||||
|
\sourcelink{Cat.Categories.Span}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
\emph{Proposition} \ref{eq:univ-2} is isomorphic to \ref{eq:univ-3}: For this I
|
\emph{Proposition} \ref{eq:univ-2} is isomorphic to \ref{eq:univ-3}: For this I
|
||||||
will show two corollaries of \ref{eq:coeCod}: For an isomorphism $(\iota,
|
will show two corollaries of \ref{eq:coeCod}: For an isomorphism $(\iota,
|
||||||
|
@ -1067,7 +1080,10 @@ f & \equiv g \lll \iota \\
|
||||||
g & \equiv f \lll \inv{\iota}
|
g & \equiv f \lll \inv{\iota}
|
||||||
\end{align}
|
\end{align}
|
||||||
%
|
%
|
||||||
Proof: \TODO{\ldots}
|
The proof is omitted but can be found in the module:
|
||||||
|
\begin{center}
|
||||||
|
\sourcelink{Cat.Category}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
Now we can prove the equivalence in the following way: Given $(f, \inv{f},
|
Now we can prove the equivalence in the following way: Given $(f, \inv{f},
|
||||||
\var{inv}_f) \tp X \cong Y$ and two heterogeneous paths
|
\var{inv}_f) \tp X \cong Y$ and two heterogeneous paths
|
||||||
|
|
|
@ -207,14 +207,13 @@ implementations of category theory in Agda:
|
||||||
%
|
%
|
||||||
The contribution of this thesis is to explore how working in a cubical setting
|
The contribution of this thesis is to explore how working in a cubical setting
|
||||||
will make it possible to prove more things and to reuse proofs and to try and
|
will make it possible to prove more things and to reuse proofs and to try and
|
||||||
compare some aspects of this formalization with the existing ones.\TODO{How can
|
compare some aspects of this formalization with the existing ones.
|
||||||
I live up to this?}
|
|
||||||
|
|
||||||
There are alternative approaches to working in a cubical setting where
|
There are alternative approaches to working in a cubical setting where
|
||||||
one can still have univalence and functional extensionality. One
|
one can still have univalence and functional extensionality. One
|
||||||
option is to postulate these as axioms. This approach, however, has
|
option is to postulate these as axioms. This approach, however, has
|
||||||
other shortcomings, e.g. you lose \nomenindex{canonicity}
|
other shortcomings, e.g. you lose \nomenindex{canonicity}
|
||||||
(\TODO{Pageno!} \cite{huber-2016}).
|
(\cite[p. 3]{huber-2016}).
|
||||||
|
|
||||||
Another approach is to use the \emph{setoid interpretation} of type
|
Another approach is to use the \emph{setoid interpretation} of type
|
||||||
theory (\cite{hofmann-1995,huber-2016}). With this approach one works
|
theory (\cite{hofmann-1995,huber-2016}). With this approach one works
|
||||||
|
@ -227,16 +226,17 @@ relation a priori. So this must be verified manually by the developer.
|
||||||
Furthermore, functions between different setoids must be shown to be
|
Furthermore, functions between different setoids must be shown to be
|
||||||
setoid homomorphism, that is; they preserve the relation.
|
setoid homomorphism, that is; they preserve the relation.
|
||||||
|
|
||||||
This approach has other drawbacks; it does not satisfy
|
This approach has other drawbacks; it does not satisfy all
|
||||||
all propositional equalities of type theory (\TODO{Citation needed}), is
|
propositional equalities of type theory a priori. That is, the
|
||||||
cumbersome to work with in practice (\cite[p. 4]{huber-2016}) and makes
|
developer must manually show that e.g.\ the relation is a congruence.
|
||||||
equational proofs less reusable since equational proofs $a \sim_{X} b$ are
|
Equational proofs $a \sim_{X} b$ are in some sense `local' to the
|
||||||
inherently `local' to the extensional set $(X , \sim)$.
|
extensional set $(X , \sim)$. To e.g.\ prove that $x ∼ y → f\ x ∼
|
||||||
|
f\ y$ for some function $f \tp A → B$ between two extensional sets $A$
|
||||||
|
and $B$ it must be shown that $f$ is a groupoid homomorphism. This
|
||||||
|
makes it very cumbersome to work with in practice (\cite[p.
|
||||||
|
4]{huber-2016}).
|
||||||
|
|
||||||
\section{Conventions}
|
\section{Conventions}
|
||||||
\TODO{Talk a bit about terminology. Find a good place to stuff this little
|
|
||||||
section.}
|
|
||||||
|
|
||||||
In the remainder of this paper I will use the term
|
In the remainder of this paper I will use the term
|
||||||
\nomenindex{Type} to describe --
|
\nomenindex{Type} to describe --
|
||||||
well, types. Thereby diverging from the notation in Agda where the keyword
|
well, types. Thereby diverging from the notation in Agda where the keyword
|
||||||
|
|
Loading…
Reference in a new issue