Jekyll2019-09-13T21:02:22+02:00http://math.andrej.com/feed.xmlMathematics and ComputationA blog about mathematics for computersOn complete ordered fields2019-09-09T00:00:00+02:002019-09-09T00:00:00+02:00http://math.andrej.com/2019/09/09/on-complete-ordered-fields<p><a href="http://jdh.hamkins.org">Joel Hamkins</a> advertised the following theorem on Twitter:</p>
<blockquote>
<p><strong>Theorem:</strong> <em>All <a href="https://en.wikipedia.org/wiki/Least-upper-bound_property">complete</a> <a href="https://en.wikipedia.org/wiki/Ordered_field">ordered</a> fields are isomorphic.</em></p>
</blockquote>
<p><a href="https://twitter.com/JDHamkins/status/1169935061480804352?s=20">The standard proof</a> posted by Joel has two parts:</p>
<ol>
<li>A complete ordered field is archimedean.</li>
<li>Using the fact that the rationals are dense in an archimedean field, we construct an isomorphism between any two complete ordered fields.</li>
</ol>
<p>The second step is constructive, but the first one is proved using excluded middle, as follows. Suppose $F$ is a complete ordered field. If $b \in F$ is an upper bound for the natural numbers, construed as a subset of $F$, then so $b - 1$, but then no element of $F$ can be the least upper bound of $\mathbb{N}$. By excluded middle, above every $x \in F$ there is $n \in \mathbb{N}$.</p>
<p>So I asked myself and the <a href="https://groups.google.com/forum/#!topic/constructivenews/4jncQ9axrxI">constructive news mailing list</a> what the constructive status of the theorem is. But something was amiss, as <a href="http://math.fau.edu/richman/">Fred Richman</a> immediately asked me to provide an example of a complete ordered field. Why would he do that, don't we have the <a href="https://ncatlab.org/nlab/show/MacNeille+real+number">MacNeille reals</a>? After agreeing on definitions, <a href="http://tobybartels.name">Toby Bartels</a> gave the answer, which I am taking the liberty to adapt a bit and present here. I am probably just reinventing the wheel, so if someone knows an original reference, please provide it in the comments.</p>
<p>The theorem holds constructively, but for a bizarre reason: if there exists a complete ordered field, then the law of excluded middle holds, and the standard proof is valid!</p>
<!--more-->
<p>As there are many constructive versions of order and completeness, let me spell out the definitions that are well adapted to the oddities of constructive mathematics. In classical logic these are all equivalent to the usual ones. Having to disentangle definitions when passing to constructive mathematics is a bit like learning how to be careful when passing from commutative to non-commutative algebra.</p>
<p>A <strong>partial order</strong> $\leq$ on a set $P$ is a reflexive, transitive and antisymmetric relation on $P$.</p>
<p>We are interested in <strong>linearly</strong> ordered fields, but constructively we need to take care, as the usual linearity, $x \leq y \lor y \leq x$, is quite difficult to satisfy, and may fail for reals.</p>
<p>A <strong>strict order</strong> on a set $P$ is a relation $<$ which is:</p>
<ul>
<li>irreflexive: $\lnot (x < x)$,</li>
<li>tight: $\lnot (x < y \lor y < x) \Rightarrow x = y$,</li>
<li>weakly linear: $x < y \Rightarrow x < z \lor z < y$</li>
</ul>
<p>The <strong>associated</strong> partial order is defined by $x \leq y \Leftrightarrow \lnot (y \leq x)$. The reflexivity, antisymmetry and transitivity of $\leq$ follow respectively from irreflexivity, tightness, and weak linearity of $<$.</p>
<p>Next, an element $x \in P$ is an <strong>upper bound</strong> for $S \subseteq P$ when $y \leq x$ for all $y \in P$. An element $x \in P$ is the <em>supremum</em> of $S \subseteq P$ if it is an upper bound for $S$, and for every $y < x$ there exists $z \in S$ such that $y < z$. A poset $P$ is <strong>(Dedekind-MacNeille) complete</strong> when every inhabited bounded subset has a supremum (for the classically trained, $S \subseteq P$ is <em>inhabited</em> when there exists $x \in S$, and this is <em>not</em> the same as $S \neq \emptyset$).</p>
<p>A basic exercise is to give a non-trivial complete order, i.e., a strict order $<$ whose associated partial order $\leq$ is complete.</p>
<blockquote>
<p><strong>Theorem:</strong> <em>If there exists a non-trivial complete order then excluded middle holds.</em></p>
</blockquote>
<p><em>Proof.</em> Suppose $<$ is a strict order on a set $P$ whose associated order $\leq$ is complete, and there exist $a, b \in P$ such that $a < b$. Let $\phi$ be any proposition. Consider the set $S = \lbrace x \in P \mid x = a \lor (\phi \land x = b)\rbrace$. Observe that $\phi$ is equivalent to $b \in S$. Because $a \in S \subseteq \lbrace a, b\rbrace$, the set $S$ is inhabited and bounded, so let $s$ be its supremum. We know that $a < s$ or $s < b$, from which we can decide $\phi$:</p>
<ol>
<li>If $a < s$ then $b \in S$: indeed, there exists $c \in S$ such that $a < c$, but then $c = b$. In this case $\phi$ holds.</li>
<li>If $s < b$ then $\lnot(b \in S)$: if we had $b \in S$ then $S = \lbrace a, b \rbrace$ and $b = s < b$, which is impossible. In this case $\lnot\phi$. $\Box$</li>
</ol>
<p>This immediately gives us the desired theorem.</p>
<blockquote>
<p><strong>Theorem (constructive):</strong> <em>All complete ordered fields are isomorphic.</em></p>
</blockquote>
<p><em>Proof.</em> The definition of a complete ordered field requires $0 < 1$, therefore excluded middle holds. Now proceed with the usual classical proof. $\Box$</p>
<p>This is very odd, as I always thought that the MacNeille reals form a MacNeille complete ordered field. Recall that a <a href="https://ncatlab.org/nlab/show/MacNeille+real+number">MacNeille real</a> is a pair $(L, U)$ of subsets of $\mathbb{Q}$ such that:</p>
<ol>
<li>$U$ is the set of upper bounds of $L$: $u \in U$ if, and only if, $\ell \leq u$ for all $\ell \in L$,</li>
<li>$L$ is the set of lower bounds of $U$: $\ell \in L$ if, and only if, $\ell \leq u$ for all $u \in U$,</li>
<li>$L$ and $U$ are inhabited.</li>
</ol>
<p>Furthermore, the MacNeille reals are complete, as they are just the <a href="https://ncatlab.org/nlab/show/MacNeille+completion">MacNeille completion</a> of the rationals. We may define a strict order on them by
stipulating that, for $x = (L_x, U_x)$ and $y = (L_y, U_y)$,
$$x < y \iff \exists q \in U_x . \exists r \in L_y \,.\, q < r.$$
According to Peter Johnstone (Sketches of an Elephant, D4.7), the MacNeille reals form a commutative unital ring in which $x$ is invertible if, and only if, $x < 0 \lor x > 0$. So apparently, the weak linearity of the strict order is problematic.</p>
<p>What if we relax completeness? Two standard notions of completeness are:</p>
<ol>
<li>An ordered field $F$ is <strong>Cauchy-complete</strong> if every Cauchy sequence has a limit in $F$.</li>
<li>An ordered field $F$ is <strong>Dedekind-complete</strong> if every Dedekind cut determines an element of $F$.</li>
</ol>
<p>It is easy enough to find non-isomorphic Cauchy-complete fields. Order the field $\mathbb{Q}(x)$ of rational functions with rational coefficients by stipulating that it extends the order of $\mathbb{Q}$ and that $q < x$ for all $q \in \mathbb{Q}$. The Cauchy-completion of $\mathbb{Q}(x)$ is a Cauchy complete field which is not isomorphic to $\mathbb{Q}$. Caveat: I am speaking off the top of my head, do not trust this paragraph! (Or any other for that matter.)</p>
<p>Regarding Dedekind completeness, it is important constructively that we take
<em>two-sided</em> Dedekind cuts, i.e., pairs $(L, U)$ of subsets of $F$ such that</p>
<ul>
<li>$L$ is lower-rounded: $q \in L \iff \exists r \in L . q < r$,</li>
<li>$U$ is upper-rounded: $r \in U \iff \exists q \in U . q < r$,</li>
<li>the cut is bounded: $L$ and $U$ are inhabited,</li>
<li>the cut is disjoint: $L \cap U = \emptyset$,</li>
<li>the cut is located: if $q < r$ then $L \in q$ or $r \in U$.</li>
</ul>
<p>Dedekind completeness states that for every Dedekind cut $(L, U)$ in $F$ there exists a unique $x \in F$ such that $L = \lbrace y \in F \mid y < x\rbrace$ and $U = \lbrace y \in F \mid x < y\rbrace$. Constructively this is a weaker form of completeness than the Dedekind-MacNeille one, but classically they coincide. Thus we cannot hope to exhibit constructively two non-isomorphic Dedekind-complete ordered fields (because constructive results are also classically valid). But perhaps there is a model of constructive mathematics where such strange fields exist. Does anyone know of one?</p>Andrej BauerJoel Hamkins advertised the following theorem on Twitter: Theorem: All complete ordered fields are isomorphic. The standard proof posted by Joel has two parts: A complete ordered field is archimedean. Using the fact that the rationals are dense in an archimedean field, we construct an isomorphism between any two complete ordered fields. The second step is constructive, but the first one is proved using excluded middle, as follows. Suppose $F$ is a complete ordered field. If $b \in F$ is an upper bound for the natural numbers, construed as a subset of $F$, then so $b - 1$, but then no element of $F$ can be the least upper bound of $\mathbb{N}$. By excluded middle, above every $x \in F$ there is $n \in \mathbb{N}$. So I asked myself and the constructive news mailing list what the constructive status of the theorem is. But something was amiss, as Fred Richman immediately asked me to provide an example of a complete ordered field. Why would he do that, don't we have the MacNeille reals? After agreeing on definitions, Toby Bartels gave the answer, which I am taking the liberty to adapt a bit and present here. I am probably just reinventing the wheel, so if someone knows an original reference, please provide it in the comments. The theorem holds constructively, but for a bizarre reason: if there exists a complete ordered field, then the law of excluded middle holds, and the standard proof is valid!The blog moved from Wordpress to Jekyll2019-09-03T00:00:00+02:002019-09-03T00:00:00+02:00http://math.andrej.com/2019/09/03/the-blog-moved-from-wordpress-to-jekyll<p>You may have noticed that lately I have had trouble with the blog. It was dying
periodically because the backend database kept crashing. It was high time I
moved away from Wordpress anyway, so I bit the bullet and ported the blog.</p>
<!--more-->
<p>All in all, it was a typical system administration experience: lots of
installing Ruby and Node.js packages, figuring out which of several equivalent
tools actually is worth using, dealing with scarce and obsolete documentation (a
blog post is <em>not</em> a good substitute for proper documentation), etc. But all the
tools are out there, it's just a simple matter of installing them:</p>
<ul>
<li><a href="https://wordpress.org/plugins/jekyll-exporter/">Jekyll Exporter</a> - an exporter from Wordpress to Jekyll</li>
<li><a href="https://jekyllrb.com">Jekyll</a> - static pages blog, free of databases, with support for Markdown</li>
<li><a href="https://staticman.net">Staticman</a> - a backend for blog comments</li>
</ul>
<p>I decided to make the blog repository
<a href="https://github.com/andrejbauer/mathematics-and-computation"><code class="highlighter-rouge">mathematics-and-computation</code></a>
public, as there is no good reason to keep it private. In fact, this way people
can contribute by making pull requests (see the
<a href="https://github.com/andrejbauer/mathematics-and-computation/blob/master/README.md"><code class="highlighter-rouge">README.md</code></a>.</p>
<p>I will use this post to test the working on the new blog, and especially the
comments, so please excuse silly comments below.</p>Andrej BauerYou may have noticed that lately I have had trouble with the blog. It was dying periodically because the backend database kept crashing. It was high time I moved away from Wordpress anyway, so I bit the bullet and ported the blog.What is algebraic about algebraic effects?2019-09-03T00:00:00+02:002019-09-03T00:00:00+02:00http://math.andrej.com/2019/09/03/what-is-algebraic-about-algebraic-effects<p>Published as <a href="https://arxiv.org/abs/1807.05923"><code class="highlighter-rouge">arXiv:1807.05923</code></a>.</p>
<p><strong>Abstract:</strong> This note recapitulates and expands the contents of a tutorial on the mathematical theory of algebraic effects and handlers which I gave at the Dagstuhl seminar 18172 <a href="https://www.dagstuhl.de/en/program/calendar/semhp/?semnr=18172">"Algebraic effect handlers go mainstream"</a>. It is targeted roughly at the level of a doctoral student with some amount of mathematical training, or at anyone already familiar with algebraic effects and handlers as programming concepts who would like to know what they have to do with algebra. We draw an uninterrupted line of thought between algebra and computational effects. We begin on the mathematical side of things, by reviewing the classic notions of universal algebra: signatures, algebraic theories, and their models. We then generalize and adapt the theory so that it applies to computational effects. In the last step we replace traditional mathematical notation with one that is closer to programming languages.</p>Andrej BauerPublished as arXiv:1807.05923. Abstract: This note recapitulates and expands the contents of a tutorial on the mathematical theory of algebraic effects and handlers which I gave at the Dagstuhl seminar 18172 "Algebraic effect handlers go mainstream". It is targeted roughly at the level of a doctoral student with some amount of mathematical training, or at anyone already familiar with algebraic effects and handlers as programming concepts who would like to know what they have to do with algebra. We draw an uninterrupted line of thought between algebra and computational effects. We begin on the mathematical side of things, by reviewing the classic notions of universal algebra: signatures, algebraic theories, and their models. We then generalize and adapt the theory so that it applies to computational effects. In the last step we replace traditional mathematical notation with one that is closer to programming languages.Derivations as computations (ICFP 2019 slides)2019-08-21T11:02:57+02:002019-08-21T11:02:57+02:00http://math.andrej.com/2019/08/21/derivations-as-computations<p>I gave a <a href="https://icfp19.sigplan.org/details/icfp-2019-Keynotes-and-Reports/3/Derivations-as-computations">keynote talk "Derivations as Computations"</a> at <a href="https://icfp19.sigplan.org">ICFP 2019</a>.</p>
<ul>
<li>Slides with speaker notes: <a href="http://math.andrej.com/wp-content/uploads/2019/08/derivations-as-computations-icfp-2019.pdf">derivations-as-computations-icfp-2019.pdf</a></li>
<li>Demo file: <a href="http://math.andrej.com/wp-content/uploads/2019/08/demo-icfp2019.m31">demo-icfp2019.m31</a></li>
</ul>
<!--more-->
<p><strong>Abstract:</strong> According to the propositions-as-types reading, programs correspond to proofs, i.e., a term <code class="highlighter-rouge">t</code> of type <code class="highlighter-rouge">A</code> encodes a derivation <code class="highlighter-rouge">D</code> whose conclusion is <code class="highlighter-rouge">t : A</code>. But to be quite precise, <code class="highlighter-rouge">D</code> may have parts which are not represented in <code class="highlighter-rouge">t</code>, such as subderivations of judgmental equalities. In general, a term does not record an entire derivation, but only its <em>proof relevant</em> part. This is not a problem, as long as the missing subderivations can be reconstructed algorithmically. For instance, an equation may be re-checked, as long as we work in a type theory with decidable equality checking.</p>
<p>But what happens when a type theory misbehaves? For instance, the extensional type theory elides arbitrarily complex term through applications of the equality reflection principle. One may take the stance that good computational properties are paramount, and dismiss any type theory that lacks them – or one may look into the matter with an open mind.</p>
<p>If there is more to a derivation than its conclusion, then we should not equate the two. Instead, we can adopt a fresh perspective in which the conclusion is the <em>result</em> of a derivation. That is, we think of a derivation as a <em>computation tree</em> showing how to compute its conclusion. Moreover, the computation encoded by the derivation is <em>effectful</em>: proof irrelevance is the computational effect of discarding data, while checking a side condition is the effect of consulting an oracle. Where there are two computational effects, surely many others can be found.</p>
<p>Indeed, we may set up type theory so that any terminating computation represents a derivation, as long as the computational steps that construct type-theoretic judgments are guaranteed to be validated by corresponding inference rules. Common techniques found in proof assistants (implicit arguments, coercions, equality checking, etc.) become computational effects. If we allow the user to control the effects, say through the mechanism of Plotkin and Pretnar’s handlers for algebraic effects, we obtain a very flexible proof assistant capable of dealing with a variety type theories.</p>Andrej BauerI gave a keynote talk "Derivations as Computations" at ICFP 2019. Slides with speaker notes: derivations-as-computations-icfp-2019.pdf Demo file: demo-icfp2019.m31What is an explicit bijection? (FPSAC 2019 slides)2019-07-04T12:08:17+02:002019-07-04T12:08:17+02:00http://math.andrej.com/2019/07/04/what-is-an-explicit-bijection-fpsac-2019-slides<p>Here are the slides with speaker notes for the talk <em>What is an explicit bijection</em> which I gave at the <a href="http://fpsac2019.fmf.uni-lj.si">31st International Conference on Formal Power Series and Algebraic Combinatorics</a> (FPSAC 2019). It was the "outsider" talk, where they invite someone to tell them something outside of their area.</p>
<p>So how does one sell homotopy type theory to people who are interested in combinatorics? That is a tough sell. I used my MathOverflow question <a href="https://mathoverflow.net/questions/323779/what-is-an-explicit-bijection-in-combinatorics">"What is an explicit bijection?"</a> to give a stand-up comedy introduction, after which I plunged into type theory. I am told I plunged a little too hard. For instance, people asked "why are we doing this" because I did not make it clear enough that we are trying to make a distinction between "abstractly exists" and "concretely constructed". Oh well, it’s difficult to explain homotopy type theory in 50 minutes. Anyhow, I hope you can get something useful from the slides.</p>
<p>Download slides: <a href="/wp-content/uploads/2019/07/What-is-an-explicit-bijection-FPSAC-2019-slides-with-presenter-notes.pdf">what-is-an-explicit-bijection.pdf</a></p>
<p><a href="http://videolectures.net/FPSAC2019_bauer_explicit_bijection/">Video recording</a> of the lecture is now available.</p>Andrej BauerHere are the slides with speaker notes for the talk What is an explicit bijection which I gave at the 31st International Conference on Formal Power Series and Algebraic Combinatorics (FPSAC 2019). It was the "outsider" talk, where they invite someone to tell them something outside of their area. So how does one sell homotopy type theory to people who are interested in combinatorics? That is a tough sell. I used my MathOverflow question "What is an explicit bijection?" to give a stand-up comedy introduction, after which I plunged into type theory. I am told I plunged a little too hard. For instance, people asked "why are we doing this" because I did not make it clear enough that we are trying to make a distinction between "abstractly exists" and "concretely constructed". Oh well, it’s difficult to explain homotopy type theory in 50 minutes. Anyhow, I hope you can get something useful from the slides. Download slides: what-is-an-explicit-bijection.pdf Video recording of the lecture is now available.A course on homotopy (type) theory2019-05-08T21:04:48+02:002019-05-08T21:04:48+02:00http://math.andrej.com/2019/05/08/a-course-on-homotopy-type-theory<p>This semester my colleague <a href="https://www.fmf.uni-lj.si/~smrekar/">Jaka Smrekar</a> and I are teaching a graduate course on homotopy theory and homotopy type theory. The first part was taught by Jaka and was a nice review of classical homotopy theory leading up to Quillen model categories. In the second part I am covering basic homotopy type theory.</p>
<p>The course materials are available at the GitHub repository <a href="https://github.com/andrejbauer/homotopy-type-theory-course"><code class="highlighter-rouge">homotopy-type-theory-course</code></a>. The homotopy type theory lectures are also <a href="https://vimeo.com/channels/1457250">recorded on video</a>.</p>Andrej BauerThis semester my colleague Jaka Smrekar and I are teaching a graduate course on homotopy theory and homotopy type theory. The first part was taught by Jaka and was a nice review of classical homotopy theory leading up to Quillen model categories. In the second part I am covering basic homotopy type theory. The course materials are available at the GitHub repository homotopy-type-theory-course. The homotopy type theory lectures are also recorded on video.How to implement type theory in an hour2018-08-25T11:31:17+02:002018-08-25T11:31:17+02:00http://math.andrej.com/2018/08/25/how-to-implement-type-theory-in-an-hour<p>I was purging the disk on my laptop of large files and found a video lecture which I forgot to publish. Here it is with some delay. I lectured on how to implement type theory at the <a href="https://unimath.github.io/bham2017/">School and Workshop on Univalent Mathematics</a> in December 2017, at the University of Birmingham (UK).</p>
<p>You may <a href="https://vimeo.com/286652934">watch the video</a> and visit the accompanying GitHub repository <a href="https://github.com/andrejbauer/spartan-type-theory">spartan-type-theory</a>.</p>Andrej BauerI was purging the disk on my laptop of large files and found a video lecture which I forgot to publish. Here it is with some delay. I lectured on how to implement type theory at the School and Workshop on Univalent Mathematics in December 2017, at the University of Birmingham (UK). You may watch the video and visit the accompanying GitHub repository spartan-type-theory.Algebraic effects and handlers at OPLSS 20182018-07-22T03:39:42+02:002018-07-22T03:39:42+02:00http://math.andrej.com/2018/07/22/algebraic-effects-and-handlers-at-oplss-2018<p>I have had the honor to lecture at the <a href="https://www.cs.uoregon.edu/research/summerschool/summer18/index.php">Oregon Programming Language Summer School 2018</a> on the topic of algebraic effects and handlers. The notes, materials and the lectures are available online:</p>
<ul>
<li>the GitHub repository with the <a href="https://github.com/OPLSS/introduction-to-algebraic-effects-and-handlers">course material</a></li>
<li>the <a href="https://www.cs.uoregon.edu/research/summerschool/summer18/topics.php">OPLSS lecture materials</a>, including notes and video recordings of the lectures</li>
</ul>
<p>I gave four lectures which started with the mathematics of algebraic theories, explained how they can be used to model computational effects, how we make a programming language out of them, and how to program with handlers.</p>Andrej BauerI have had the honor to lecture at the Oregon Programming Language Summer School 2018 on the topic of algebraic effects and handlers. The notes, materials and the lectures are available online: the GitHub repository with the course material the OPLSS lecture materials, including notes and video recordings of the lectures I gave four lectures which started with the mathematics of algebraic theories, explained how they can be used to model computational effects, how we make a programming language out of them, and how to program with handlers.Spartan type theory2017-12-11T14:52:01+01:002017-12-11T14:52:01+01:00http://math.andrej.com/2017/12/11/spartan-type-theory<p>The slides from the talk “Spartan type theory”, given at the <a href="https://unimath.github.io/bham2017/">School and Workshop on Univalent Mathematics</a>.</p>
<p><strong>Download slides with speaker notes: <a href="http://math.andrej.com/wp-content/uploads/2017/12/Spartan-Type-Theory.pdf">Spartan Type Theory</a> [PDF]</strong></p>Andrej BauerThe slides from the talk “Spartan type theory”, given at the School and Workshop on Univalent Mathematics. Download slides with speaker notes: Spartan Type Theory [PDF]A modular formalization of type theory in Coq2017-05-29T17:01:43+02:002017-05-29T17:01:43+02:00http://math.andrej.com/2017/05/29/a-modular-formalization-of-type-theory-in-coq<p>Here are the slides for the talk I just gave at <a href="http://types2017.elte.hu">TYPES 2017</a> in Budapest. It is joint work with <a href="http://www.haselwarter.org/~philipp/">Philipp Haselwarter</a> and <a href="http://www.dptinfo.ens-cachan.fr/~twinterh/">Théo Winterhalter</a>. The abstract for the talk is <a href="http://types2017.elte.hu/proc.pdf#page=39">available online</a>.</p>
<p>It describes a complete formalization of dependent type theory which allows you to turn various features of type theory on and off, and it proves several basic formal theorems.</p>
<p><strong>GitHub repository:</strong> <a href="https://github.com/TheoWinterhalter/formal-type-theory">formal-type-theory<br />
</a> <strong>Slides:</strong> <a href="http://math.andrej.com/wp-content/uploads/2017/05/TYPES-2017-–-Bauer-Haselwarter-Winterhalter-–-A-modular-formalization-of-type-theory-in-Coq-with-presenter-notes.pdf">TYPES 2017 – A modular formalization of type theory in Coq</a> [PDF]</p>Andrej BauerHere are the slides for the talk I just gave at TYPES 2017 in Budapest. It is joint work with Philipp Haselwarter and Théo Winterhalter. The abstract for the talk is available online. It describes a complete formalization of dependent type theory which allows you to turn various features of type theory on and off, and it proves several basic formal theorems. GitHub repository: formal-type-theory Slides: TYPES 2017 – A modular formalization of type theory in Coq [PDF]