Jekyll2020-10-19T12:51:38+02:00http://math.andrej.com/feed.xmlMathematics and ComputationA blog about mathematics for computersA general definition of dependent type theories2020-09-14T00:00:00+02:002020-09-14T00:00:00+02:00http://math.andrej.com/2020/09/14/a-general-definition-of-dependent-type-theories<p>The preprint version of the paper <a href="https://arxiv.org/abs/2009.05539">A general definition of dependent type
theories</a> has finally appeared on the arXiv! Over three
years ago <a href="http://peterlefanulumsdaine.com">Peter Lumsdaine</a> invited me to work on the
topic, which I gladly accepted, and dragged my student <a href="http://haselwarter.org/~philipp/">Philipp
Haselwarter</a> into it. We set out to give <em>an</em> answer to
the queation:</p>
<blockquote>
<p><strong>What is type theory, precisely?</strong></p>
</blockquote>
<p>At least for me the motivation to work on such a thankless topic came from Vladimir
Voevodsky, who would ask the question to type-theoretic audiences. Some took him to be a
troll and others a newcomer who just had to learn more type theory. I was among the
latter, but eventually the question got through to me – I could point to any number of
<em>specific</em> examples of type theories, but not a comprehensive and mathematically precise
definition of the <em>general</em> concept.</p>
<p>It is too easy to dismiss the question by claiming that type theory is an open-ended concept
which therefore cannot be completely captured by any mathematical definition. Of
course it is open-ended, but it does not follow at all that we should not even
attempt to define it. If geometers were equally fatalistic about the open-ended notion of
space we would never have had modern geometry, topology, sheaves – heck, half of 20th
century mathematics would not be there!</p>
<p>Of course, we are neither the first nor the last to give a definition of type theory, and
that is how things should be. We claim no priority or supremacy over other definitions and
views of type theory. Our approach could perhaps be described as "concrete" and
"proof-theoretic":</p>
<ol>
<li>We wanted to <em>stay close to traditional syntax</em>.</li>
<li>We gave a <em>complete</em> and <em>precise</em> definition.</li>
<li>We aimed for a level of generality that allows useful meta-theory of a wide range of type theories.</li>
</ol>
<p>One can argue each of the above points, and we have done so among ourselves many times.
Nevertheless, I feel that we have accomplished something worthwhile – but the ultimate
judges will be our readers, or lack of them. You are kindly invited to take a look at the
paper.</p>
<p><strong>Download PDF:</strong> <a href="https://arxiv.org/pdf/2009.05539.pdf"><code class="highlighter-rouge">arxiv.org/pdf/2009.05539.pdf</code></a></p>
<p>I should not forget to mention that Peter, with modest help from Philipp and me,
formalized almost the entire paper in Coq! See the repository
<a href="https://github.com/peterlefanulumsdaine/general-type-theories"><code class="highlighter-rouge">general-type-theories</code></a> at
GitHub.</p>Andrej BauerThe preprint version of the paper A general definition of dependent type theories has finally appeared on the arXiv! Over three years ago Peter Lumsdaine invited me to work on the topic, which I gladly accepted, and dragged my student Philipp Haselwarter into it. We set out to give an answer to the queation: What is type theory, precisely? At least for me the motivation to work on such a thankless topic came from Vladimir Voevodsky, who would ask the question to type-theoretic audiences. Some took him to be a troll and others a newcomer who just had to learn more type theory. I was among the latter, but eventually the question got through to me – I could point to any number of specific examples of type theories, but not a comprehensive and mathematically precise definition of the general concept. It is too easy to dismiss the question by claiming that type theory is an open-ended concept which therefore cannot be completely captured by any mathematical definition. Of course it is open-ended, but it does not follow at all that we should not even attempt to define it. If geometers were equally fatalistic about the open-ended notion of space we would never have had modern geometry, topology, sheaves – heck, half of 20th century mathematics would not be there! Of course, we are neither the first nor the last to give a definition of type theory, and that is how things should be. We claim no priority or supremacy over other definitions and views of type theory. Our approach could perhaps be described as "concrete" and "proof-theoretic": We wanted to stay close to traditional syntax. We gave a complete and precise definition. We aimed for a level of generality that allows useful meta-theory of a wide range of type theories. One can argue each of the above points, and we have done so among ourselves many times. Nevertheless, I feel that we have accomplished something worthwhile – but the ultimate judges will be our readers, or lack of them. You are kindly invited to take a look at the paper. Download PDF: arxiv.org/pdf/2009.05539.pdf I should not forget to mention that Peter, with modest help from Philipp and me, formalized almost the entire paper in Coq! See the repository general-type-theories at GitHub.Every proof assistant: Cubical Agda – A Dependently Typed Programming Language with Univalence and Higher Inductive Types2020-09-10T00:00:00+02:002020-09-10T00:00:00+02:00http://math.andrej.com/2020/09/10/cubical-agda<p>I am happy to announce that we are restarting the "Every proof assistants" series of talks
with Anders Mörtberg who will talk about Cubical Agda. Note that we are moving the seminar
time to a more reasonable hour, at least as far as the working people in Europe are
concerned.</p>
<blockquote>
<h5 id="cubical-agda-a-dependently-typed-programming-language-with-univalence-and-higher-inductive-types">Cubical Agda: A Dependently Typed Programming Language with Univalence and Higher Inductive Types</h5>
<p><strong>Time:</strong> Thursday, September 17, 2020 from 15:00 to 16:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/98904788985">Zoom ID 989 0478 8985</a><br />
<strong>Speaker:</strong> <a href="https://staff.math.su.se/anders.mortberg/">Anders Mörtberg</a> (Stockholm University)<br />
<strong>Proof assistant:</strong> <a href="https://github.com/agda/cubical">Cubical Agda</a></p>
<p><strong>Abstract:</strong>
The dependently typed programming language Agda has recently been
extended with a cubical mode which provides extensionality principles
for reasoning about equality, such as function and propositional
extensionality. These principles are typically added axiomatically to
proof assistants based on dependent type theory which disrupts the
constructive properties of these systems. Cubical type theory provides
a solution by giving computational meaning to Homotopy Type Theory and
Univalent Foundations, in particular to the univalence axiom and
higher inductive types. In the talk I will discuss how Agda was
extended to a full-blown proof assistant with native support for
univalence and a general schema of higher inductive types. I will also
show a variety of examples of how to use Cubical Agda in practice to
reason about mathematics and computer science.</p>
<p>The talk <a href="https://vimeo.com/459020971">video recording</a> is available.</p>
</blockquote>
<p>We have more talks in store, but we will space them out a bit to give slots to our local seminar.</p>Andrej BauerI am happy to announce that we are restarting the "Every proof assistants" series of talks with Anders Mörtberg who will talk about Cubical Agda. Note that we are moving the seminar time to a more reasonable hour, at least as far as the working people in Europe are concerned. Cubical Agda: A Dependently Typed Programming Language with Univalence and Higher Inductive Types Time: Thursday, September 17, 2020 from 15:00 to 16:00 (Central European Summer Time, UTC+2) Location: online at Zoom ID 989 0478 8985 Speaker: Anders Mörtberg (Stockholm University) Proof assistant: Cubical Agda Abstract: The dependently typed programming language Agda has recently been extended with a cubical mode which provides extensionality principles for reasoning about equality, such as function and propositional extensionality. These principles are typically added axiomatically to proof assistants based on dependent type theory which disrupts the constructive properties of these systems. Cubical type theory provides a solution by giving computational meaning to Homotopy Type Theory and Univalent Foundations, in particular to the univalence axiom and higher inductive types. In the talk I will discuss how Agda was extended to a full-blown proof assistant with native support for univalence and a general schema of higher inductive types. I will also show a variety of examples of how to use Cubical Agda in practice to reason about mathematics and computer science. The talk video recording is available. We have more talks in store, but we will space them out a bit to give slots to our local seminar.Every proof assistant: Cur - Designing a less devious proof assistant2020-06-22T00:00:00+02:002020-06-22T00:00:00+02:00http://math.andrej.com/2020/06/22/cur-designing-a-less-devious-proof-assistant<p>We shall finish the semester with a "Every proof assistant" talk by William Bowman.
Note that we start an hour later than usual, at 17:00 UTC+2.</p>
<blockquote>
<h5 id="cur-designing-a-less-devious-proof-assistant">Cur: Designing a less devious proof assistant</h5>
<p><strong>Time:</strong> Thursday, June 25, 2020 from 17:00 to 18:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/98904788985">Zoom ID 989 0478 8985</a><br />
<strong>Speaker:</strong> <a href="https://williamjbowman.com">William J. Bowman</a> (University of British Columbia)<br />
<strong>Proof assistant:</strong> <a href="https://github.com/wilbowma/cur">Cur</a></p>
<p><strong>Abstract:</strong></p>
<p>Dijkstra said that our tools can have a profound and devious influence on our thinking. I
find this especially true of modern proof assistants, with "devious" out-weighing
"profound". Cur is an experiment in design that aims to be less devious. The design
emphasizes language extension, syntax manipulation, and DSL construction and integration.
This enables the user to be in charge of how they think, rather than requiring the user to
contort their thinking to that of the proof assistant. In this talk, my goal is to
convince you that you want similar capabilities in a proof assistant, and explain and
demonstrate Cur's attempt at solving the problem.</p>
<p>The talk <a href="https://vimeo.com/432569820">video recording</a> and <a href="https://williamjbowman.com/#epa-less-devious">slides with notes and demo code</a> are available.</p>
</blockquote>
<p>Upcoming talks: Anders Mörtberg's talk on Cubical Agda will take place in September 2020.</p>Andrej BauerWe shall finish the semester with a "Every proof assistant" talk by William Bowman. Note that we start an hour later than usual, at 17:00 UTC+2. Cur: Designing a less devious proof assistant Time: Thursday, June 25, 2020 from 17:00 to 18:00 (Central European Summer Time, UTC+2) Location: online at Zoom ID 989 0478 8985 Speaker: William J. Bowman (University of British Columbia) Proof assistant: Cur Abstract: Dijkstra said that our tools can have a profound and devious influence on our thinking. I find this especially true of modern proof assistants, with "devious" out-weighing "profound". Cur is an experiment in design that aims to be less devious. The design emphasizes language extension, syntax manipulation, and DSL construction and integration. This enables the user to be in charge of how they think, rather than requiring the user to contort their thinking to that of the proof assistant. In this talk, my goal is to convince you that you want similar capabilities in a proof assistant, and explain and demonstrate Cur's attempt at solving the problem. The talk video recording and slides with notes and demo code are available. Upcoming talks: Anders Mörtberg's talk on Cubical Agda will take place in September 2020.Every proof assistant: Epigram 2 - Autopsy, Obituary, Apology2020-06-09T00:00:00+02:002020-06-09T00:00:00+02:00http://math.andrej.com/2020/06/09/epigram-2-autopsy-obituary-apology<p>This week shall witness a performance by Conor McBride.</p>
<blockquote>
<h5 id="epigram-2-autopsy-obituary-apology">Epigram 2: Autopsy, Obituary, Apology</h5>
<p><strong>Time:</strong> Thursday, June 11, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/98904788985">Zoom ID 989 0478 8985</a><br />
<strong>Speaker:</strong> <a href="http://strictlypositive.org">Conor McBride</a> (University of Strathclyde)<br />
<strong>Proof assistant:</strong> <a href="https://github.com/mietek/epigram2">Epigram 2</a></p>
<p><strong>Abstract:</strong>
"A good pilot is one with the same number of take-offs and landings."
runs the old joke, which makes me a very bad pilot indeed. The Epigram
2 project was repeatedly restarted several times in the late 2000s and
never even reached cruising altitude. This talk is absolutely not an
attempt to persuade you to start using it. Rather, it is an
exploration of the ideas which drove it: proof irrelevant
observational equality, first class datatype descriptions, nontrivial
equational theories for neutral terms. We may yet live to see such
things. Although the programming language elaborator never happened,
the underlying proof engine was accessible via an imperative interface
called "Cochon": we did manage some interesting constructions, at
least one of which I can walk through. I'll also explore the reasons,
human and technological, why the thing did not survive the long dark.</p>
<p>The <a href="https://vimeo.com/428161108">video recording of the talk</a>.</p>
</blockquote>
<p>Upcoming talks:</p>
<ul>
<li>June 25, 2020: <a href="https://www.williamjbowman.com">William J. Bowman</a>, <a href="https://github.com/wilbowma/cur">Cur</a></li>
<li>July 2, 2020: <a href="https://staff.math.su.se/anders.mortberg/">Anders Mörtberg</a> - <a href="https://agda.readthedocs.io/en/v2.6.1/language/cubical.html">Cubical Agda</a></li>
</ul>Andrej BauerThis week shall witness a performance by Conor McBride. Epigram 2: Autopsy, Obituary, Apology Time: Thursday, June 11, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2) Location: online at Zoom ID 989 0478 8985 Speaker: Conor McBride (University of Strathclyde) Proof assistant: Epigram 2 Abstract: "A good pilot is one with the same number of take-offs and landings." runs the old joke, which makes me a very bad pilot indeed. The Epigram 2 project was repeatedly restarted several times in the late 2000s and never even reached cruising altitude. This talk is absolutely not an attempt to persuade you to start using it. Rather, it is an exploration of the ideas which drove it: proof irrelevant observational equality, first class datatype descriptions, nontrivial equational theories for neutral terms. We may yet live to see such things. Although the programming language elaborator never happened, the underlying proof engine was accessible via an imperative interface called "Cochon": we did manage some interesting constructions, at least one of which I can walk through. I'll also explore the reasons, human and technological, why the thing did not survive the long dark. The video recording of the talk. Upcoming talks: June 25, 2020: William J. Bowman, Cur July 2, 2020: Anders Mörtberg - Cubical AgdaEvery proof assistant: redtt2020-06-01T00:00:00+02:002020-06-01T00:00:00+02:00http://math.andrej.com/2020/06/01/redtt-and-the-future-of-cartesian-cubical-type-theory<p>This week the speaker will be Jon Sterling, and we are getting two proof assistants for the price of one!</p>
<blockquote>
<h5 id="redtt-and-the-future-of-cartesian-cubical-type-theory"><code class="highlighter-rouge">redtt</code> and the future of Cartesian cubical type theory</h5>
<p><strong>Time:</strong> Thursday, June 4, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/98904788985">Zoom ID 989 0478 8985</a><br />
<strong>Speaker:</strong> <a href="https://www.jonmsterling.com">Jon Sterling</a> (Carnegie Mellon University)<br />
<strong>Proof assistant:</strong> <a href="https://github.com/RedPRL/redtt">redtt</a> and <a href="https://github.com/RedPRL/cooltt">cooltt</a></p>
<p><strong>Abstract:</strong>
<code class="highlighter-rouge">redtt</code> is an interactive proof assistant for Cartesian cubical type theory, a version of
Martin-Löf type theory featuring computational versions of function extensionality, higher
inductive types, and univalence. Building on ideas from Epigram, Agda, and Idris, <code class="highlighter-rouge">redtt</code>
introduces a new cubical take on interactive proof development with holes. We will first
introduce the basics of cubical type theory and then dive into an interactive
demonstration of <code class="highlighter-rouge">redtt</code>’s features and its mathematical library.</p>
<p>After this we will catch a first public glimpse of the future of <code class="highlighter-rouge">redtt</code>, a new prototype
that our team is building currently code-named “<code class="highlighter-rouge">cooltt</code>”: <code class="highlighter-rouge">cooltt</code> introduces syntax to
split on disjunctions of cofibrations in arbitrary positions, implementing the full
definitional eta law for disjunction. While <code class="highlighter-rouge">cooltt</code> is still in the early stages, it
already has full support for univalence and cubical interactive proof development.</p>
<p>The <a href="https://vimeo.com/425917591">video recording of the talk</a>.</p>
</blockquote>
<p>Upcoming talks:</p>
<ul>
<li>June 11, 2020: <a href="http://strictlypositive.org">Conor McBride</a> - <a href="https://github.com/mietek/epigram2">Epigram 2</a></li>
<li>June 25, 2020: <a href="https://www.williamjbowman.com">William J. Bowman</a>, <a href="https://github.com/wilbowma/cur">Cur</a></li>
<li>July 2, 2020: <a href="https://staff.math.su.se/anders.mortberg/">Anders Mörtberg</a> - <a href="https://agda.readthedocs.io/en/v2.6.1/language/cubical.html">Cubical Agda</a></li>
</ul>Andrej BauerThis week the speaker will be Jon Sterling, and we are getting two proof assistants for the price of one! redtt and the future of Cartesian cubical type theory Time: Thursday, June 4, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2) Location: online at Zoom ID 989 0478 8985 Speaker: Jon Sterling (Carnegie Mellon University) Proof assistant: redtt and cooltt Abstract: redtt is an interactive proof assistant for Cartesian cubical type theory, a version of Martin-Löf type theory featuring computational versions of function extensionality, higher inductive types, and univalence. Building on ideas from Epigram, Agda, and Idris, redtt introduces a new cubical take on interactive proof development with holes. We will first introduce the basics of cubical type theory and then dive into an interactive demonstration of redtt’s features and its mathematical library. After this we will catch a first public glimpse of the future of redtt, a new prototype that our team is building currently code-named “cooltt”: cooltt introduces syntax to split on disjunctions of cofibrations in arbitrary positions, implementing the full definitional eta law for disjunction. While cooltt is still in the early stages, it already has full support for univalence and cubical interactive proof development. The video recording of the talk. Upcoming talks: June 11, 2020: Conor McBride - Epigram 2 June 25, 2020: William J. Bowman, Cur July 2, 2020: Anders Mörtberg - Cubical AgdaEvery proof assistant: Beluga2020-05-25T00:00:00+02:002020-05-25T00:00:00+02:00http://math.andrej.com/2020/05/25/mechanizing-meta-theory-in-beluga<p>We are marching on with the Every proof assistant series!</p>
<blockquote>
<h5 id="mechanizing-meta-theory-in-beluga">Mechanizing Meta-Theory in Beluga</h5>
<p><strong>Time:</strong> Thursday, May 28, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/98904788985">Zoom ID 989 0478 8985</a><br />
<strong>Speaker:</strong> <a href="https://www.cs.mcgill.ca/~bpientka/">Brigitte Pientka</a> (McGill University)<br />
<strong>Proof assistant:</strong> <a href="http://complogic.cs.mcgill.ca/beluga/">Beluga</a></p>
<p><strong>Abstract:</strong> Mechanizing formal systems, given via axioms and inference rules, together
with proofs about them plays an important role in establishing trust in formal
developments. In this talk, I will survey the proof environment Beluga. To specify formal
systems and represent derivations within them, Beluga relies on the logical framework LF;
to reason about formal systems, Beluga provides a dependently typed functional language
for implementing (co)inductive proofs about derivation trees as (co)recursive functions
following the Curry-Howard isomorphism. Key to this approach is the ability to model
derivation trees that depend on a context of assumptions using a generalization of the
logical framework LF, i.e. contextual LF which supports first-class contexts and
simultaneous substitutions.</p>
<p>Our experience demonstrated that Beluga enables direct and compact
mechanizations of the meta-theory of formal systems, in particular programming
languages and logics.</p>
<p>The <a href="https://vimeo.com/423668919">video recording of the talk</a>.</p>
</blockquote>
<p>Upcoming talks:</p>
<ul>
<li>June 4, 2020: <a href="https://www.jonmsterling.com">Jon Sterling</a> - <a href="https://github.com/RedPRL/redtt">redtt</a></li>
<li>June 11, 2020: <a href="http://strictlypositive.org">Conor McBride</a> - <a href="https://github.com/mietek/epigram2">Epigram 2</a></li>
<li>June 25, 2020: <a href="https://www.williamjbowman.com">William J. Bowman</a>, <a href="https://github.com/wilbowma/cur">Cur</a></li>
<li>July 2, 2020: <a href="https://staff.math.su.se/anders.mortberg/">Anders Mörtberg</a> - <a href="https://agda.readthedocs.io/en/v2.6.1/language/cubical.html">Cubical Agda</a></li>
</ul>Andrej BauerWe are marching on with the Every proof assistant series! Mechanizing Meta-Theory in Beluga Time: Thursday, May 28, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2) Location: online at Zoom ID 989 0478 8985 Speaker: Brigitte Pientka (McGill University) Proof assistant: Beluga Abstract: Mechanizing formal systems, given via axioms and inference rules, together with proofs about them plays an important role in establishing trust in formal developments. In this talk, I will survey the proof environment Beluga. To specify formal systems and represent derivations within them, Beluga relies on the logical framework LF; to reason about formal systems, Beluga provides a dependently typed functional language for implementing (co)inductive proofs about derivation trees as (co)recursive functions following the Curry-Howard isomorphism. Key to this approach is the ability to model derivation trees that depend on a context of assumptions using a generalization of the logical framework LF, i.e. contextual LF which supports first-class contexts and simultaneous substitutions. Our experience demonstrated that Beluga enables direct and compact mechanizations of the meta-theory of formal systems, in particular programming languages and logics. The video recording of the talk. Upcoming talks: June 4, 2020: Jon Sterling - redtt June 11, 2020: Conor McBride - Epigram 2 June 25, 2020: William J. Bowman, Cur July 2, 2020: Anders Mörtberg - Cubical AgdaEvery proof assistant: MMT2020-05-15T00:00:00+02:002020-05-15T00:00:00+02:00http://math.andrej.com/2020/05/15/mmt-a-foundation-independent-logical-system<p>I am happy to announce the next seminar in the "Every proof assistant" series.</p>
<blockquote>
<h5 id="mmt-a-foundation-independent-logical-system">MMT: A Foundation-Independent Logical System</h5>
<p><strong>Time:</strong> Thursday, May 21, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/98904788985">Zoom ID 989 0478 8985</a><br />
<strong>Speaker:</strong> <a href="https://kwarc.info/people/frabe/">Florian Rabe</a> (University of Erlangen)<br />
<strong>Proof assistant:</strong> <a href="https://uniformal.github.io/">The MMT Language and System</a></p>
<p><strong>Abstract:</strong> Logical frameworks are meta-logics for defining other logics. MMT follows this
approach but abstracts even further: it avoids committing to any foundational features like function
types or propositions. All MMT algorithms are parametric in a set of rules, which are self-contained
objects plugged in by the language designer. That results in a framework general enough to develop
many formal systems including other logical frameworks in it, enabling the rapidly prototyping of
new language features.</p>
<p>Despite this high level of generality, it is possible to develop sophisticated results in MMT. The
current release includes, e.g., parsing, type reconstruction, module system, IDE-style editor, and
interactive library browser. MMT is systematically designed to be extensible, providing multiple
APIs and plugin interfaces, and thus provides a versatile infrastructure for system development and
integration.</p>
<p>This talk gives an overview of the current state of MMT and its future challenges. Examples are
drawn from the LATIN project, a long-running project of building a modular, highly inter-related
suite of formalizations of logics and related formal systems.</p>
<p>The <a href="https://vimeo.com/421123419">video recording of the talk</a>.</p>
</blockquote>
<p>The spring schedule of talks is planned as follows:</p>
<ul>
<li>May 28, 2020: <a href="https://www.cs.mcgill.ca/~bpientka/">Brigitte Pientka</a> - <a href="http://complogic.cs.mcgill.ca/beluga/">Beluga</a></li>
<li>June 4, 2020: <a href="https://www.jonmsterling.com">Jon Sterling</a> - <a href="https://github.com/RedPRL/redtt">redtt</a> (to be confirmed)</li>
<li>June 11, 2020: <a href="http://strictlypositive.org">Conor McBride</a> - <a href="https://github.com/mietek/epigram2">Epigram 2</a></li>
<li>June 25, 2020: <a href="https://www.williamjbowman.com">William J. Bowman</a>, <a href="https://github.com/wilbowma/cur">Cur</a></li>
<li>July 2, 2020: <a href="https://staff.math.su.se/anders.mortberg/">Anders Mörtberg</a> - <a href="https://agda.readthedocs.io/en/v2.6.1/language/cubical.html">Cubical Agda</a></li>
</ul>Andrej BauerI am happy to announce the next seminar in the "Every proof assistant" series. MMT: A Foundation-Independent Logical System Time: Thursday, May 21, 2020 from 16:00 to 17:00 (Central European Summer Time, UTC+2) Location: online at Zoom ID 989 0478 8985 Speaker: Florian Rabe (University of Erlangen) Proof assistant: The MMT Language and System Abstract: Logical frameworks are meta-logics for defining other logics. MMT follows this approach but abstracts even further: it avoids committing to any foundational features like function types or propositions. All MMT algorithms are parametric in a set of rules, which are self-contained objects plugged in by the language designer. That results in a framework general enough to develop many formal systems including other logical frameworks in it, enabling the rapidly prototyping of new language features. Despite this high level of generality, it is possible to develop sophisticated results in MMT. The current release includes, e.g., parsing, type reconstruction, module system, IDE-style editor, and interactive library browser. MMT is systematically designed to be extensible, providing multiple APIs and plugin interfaces, and thus provides a versatile infrastructure for system development and integration. This talk gives an overview of the current state of MMT and its future challenges. Examples are drawn from the LATIN project, a long-running project of building a modular, highly inter-related suite of formalizations of logics and related formal systems. The video recording of the talk. The spring schedule of talks is planned as follows: May 28, 2020: Brigitte Pientka - Beluga June 4, 2020: Jon Sterling - redtt (to be confirmed) June 11, 2020: Conor McBride - Epigram 2 June 25, 2020: William J. Bowman, Cur July 2, 2020: Anders Mörtberg - Cubical AgdaEvery proof assistant: Arend2020-04-28T00:00:00+02:002020-04-28T00:00:00+02:00http://math.andrej.com/2020/04/28/every-theorem-prover<p>For a while now I have been contemplating a series of seminars titled <em>"Every
proof assistant"</em> that would be devoted to all the different proof assistants
out there. Apart from the established ones
(<a href="https://isabelle.in.tum.de">Isabelle/HOL</a>, <a href="https://coq.inria.fr">Coq</a>,
<a href="https://wiki.portal.chalmers.se/agda/pmwiki.php">Agda</a>,
<a href="https://leanprover.github.io">Lean</a>), there are other interesting experimental
proof assistants, and some that are still under development, or just proofs of
concept. I would like to know more about them, and I suspect I am not the only
one.</p>
<!--more-->
<p>Getting the authors of proof assistants to travel to Ljubljana and giving talks
at our <a href="https://www.fmf.uni-lj.si/si/obvestila/agregator/seminar-temelji/">Foundations of mathematics and theoretical computer
science</a>
seminar has largely become impossible. But luckily research seminars world-wide
are rapidly moving online, and so is our Foundations seminar. I am therefore
delighted to announce the first "Every proof assistant" seminar:</p>
<blockquote>
<h5 id="arend-proof-assistant">Arend proof assistant</h5>
<p><strong>Time:</strong> Thursday, April 30, 2020 from 18:00 to 19:00 (Central European Summer Time, UTC+2)<br />
<strong>Location:</strong> online at <a href="https://zoom.us/j/96544395816">Zoom ID 965 4439 5816</a><br />
<strong>Speaker:</strong> <a href="https://research.jetbrains.org/researchers/valis">Valery Isaev</a> (JetBrains research)
<strong>Proof assistant:</strong> <a href="https://arend-lang.github.io">Arend proof assistant</a></p>
<p><strong>Abstract:</strong> I will discuss Arend, a proof assistant developed at JetBrains
Research. The aim of Arend is to provide a powerful system for formalization
results in homotopy type theory and in ordinary mathematics. To achieve the
latter goal, we prove a flexible class system with subtyping, universe
polymorphism with a powerful level inference mechanism, quotient sets with a
convenient pattern matching principles for them. We also recently implemented
a tactic framework which can be used to automate routine proofs and implement
various EDSLs. Homotopic features of Arend include built-in universes of
finite homotopy level, higher inductive types, univalence, and path types in
the style of cubical type theories. I will talk about these features and also
about our plans to implement language extensions that can be used to simplify
reasoning about various higher structures.</p>
<p><a href="https://vimeo.com/413726748">Video recording</a> of the talk is available.</p>
</blockquote>
<p>I have a couple more in the pipeline, so follow this blog, the <a href="https://www.fmf.uni-lj.si/si/obvestila/agregator/seminar-temelji/">Foundations seminar announcements</a> or my Twitter account <a href="https://twitter.com/andrejbauer">@andrejbauer</a>.</p>Andrej BauerFor a while now I have been contemplating a series of seminars titled "Every proof assistant" that would be devoted to all the different proof assistants out there. Apart from the established ones (Isabelle/HOL, Coq, Agda, Lean), there are other interesting experimental proof assistants, and some that are still under development, or just proofs of concept. I would like to know more about them, and I suspect I am not the only one.On fixed-point theorems in synthetic computability2019-11-07T00:00:00+01:002019-11-07T00:00:00+01:00http://math.andrej.com/2019/11/07/on-fixed-point-theorems-in-synthetic-computability<p>I forgot to record the fact that already two years ago I wrote a paper on
Lawvere's fixed-point theorem in synthetic computability:</p>
<blockquote>
<p>Andrej Bauer: <a href="/asset/data/recursion-theorem.pdf"><em>On fixed-point theorems in synthetic computability</em></a>.
Tbilisi Mathematical Journal, Volume 10: Issue 3, pp. 167–181.</p>
</blockquote>
<p>It was a special issue in honor of Professors <a href="https://en.wikipedia.org/wiki/Peter_J._Freyd">Peter J.
Freyd</a> and <a href="https://en.wikipedia.org/wiki/William_Lawvere">F. William
Lawvere</a> on the occasion of their
80th birthdays.</p>
<p>Lawvere's paper <a href="http://tac.mta.ca/tac/reprints/articles/15/tr15abs.html">"Diagonal arguments and cartesian closed
categories</a> proves a
beautifully simple fixed point theorem.</p>
<blockquote>
<p><strong>Theorem:</strong> (Lawvere) <em>If $e : A \to B^A$ is a surjection then every $f : B \to B$ has a fixed point.</em></p>
</blockquote>
<p><em>Proof.</em> Because $e$ is a surjection, there is $a \in A$ such that $e(a) = \lambda x : A \,.\, f(e(x)(x))$, but then $e(a)(a) = f(e(a)(a)$. $\Box$</p>
<p>Lawvere's original version is a bit more general, but the one given here makes is very clear that Lawvere's fixed point theorem is the diagonal argument in crystallized form. Indeed, the contrapositive form of the theorem, namely</p>
<blockquote>
<p><strong>Corollary:</strong> <em>If $f : B \to B$ has no fixed point then there is no surjection $e : A \to B^A$.</em></p>
</blockquote>
<p>immediately implies a number of famous theorems that rely on the diagonal argument. For example, there can be no surjection $A \to \lbrace 0, 1\rbrace^A$ because the map $x \mapsto 1 - x$ has no fixed point in $\lbrace 0, 1\rbrace$ -- and that is Cantors' theorem.</p>
<p>It not easy to find non-trivial instances to which Lawvere's theorem applies. Indeed, if excluded middle holds, then having a surjection $e : A \to B^A$ implies that $B$ is the singleton. We should look for interesting instances in categories other than classical sets. In my paper I do so: I show that countably based $\omega$-cpos in the effective topos are countable and closed under countable products, which gives us a rich supply of objects $B$ such that there is a surjection $\mathbb{N} \to B^\mathbb{N}$.</p>
<p>Enjoy the paper!</p>Andrej BauerI forgot to record the fact that already two years ago I wrote a paper on Lawvere's fixed-point theorem in synthetic computability: Andrej Bauer: On fixed-point theorems in synthetic computability. Tbilisi Mathematical Journal, Volume 10: Issue 3, pp. 167–181. It was a special issue in honor of Professors Peter J. Freyd and F. William Lawvere on the occasion of their 80th birthdays. Lawvere's paper "Diagonal arguments and cartesian closed categories proves a beautifully simple fixed point theorem. Theorem: (Lawvere) If $e : A \to B^A$ is a surjection then every $f : B \to B$ has a fixed point. Proof. Because $e$ is a surjection, there is $a \in A$ such that $e(a) = \lambda x : A \,.\, f(e(x)(x))$, but then $e(a)(a) = f(e(a)(a)$. $\Box$ Lawvere's original version is a bit more general, but the one given here makes is very clear that Lawvere's fixed point theorem is the diagonal argument in crystallized form. Indeed, the contrapositive form of the theorem, namely Corollary: If $f : B \to B$ has no fixed point then there is no surjection $e : A \to B^A$. immediately implies a number of famous theorems that rely on the diagonal argument. For example, there can be no surjection $A \to \lbrace 0, 1\rbrace^A$ because the map $x \mapsto 1 - x$ has no fixed point in $\lbrace 0, 1\rbrace$ -- and that is Cantors' theorem. It not easy to find non-trivial instances to which Lawvere's theorem applies. Indeed, if excluded middle holds, then having a surjection $e : A \to B^A$ implies that $B$ is the singleton. We should look for interesting instances in categories other than classical sets. In my paper I do so: I show that countably based $\omega$-cpos in the effective topos are countable and closed under countable products, which gives us a rich supply of objects $B$ such that there is a surjection $\mathbb{N} \to B^\mathbb{N}$. Enjoy the paper!Runners in action2019-10-28T00:00:00+01:002019-10-28T00:00:00+01:00http://math.andrej.com/2019/10/28/runners-in-action<p>It has been almost a decade since <a href="http://matija.pretnar.info">Matija Pretnar</a>
and I posted the <a href="http://math.andrej.com/category/eff/">first blog posts</a> about
programming with algebraic effects and handlers and the programming language
<a href="http://www.eff-lang.org">Eff</a>. Since then handlers have become a well-known
control mechanism in programming languages.</p>
<p>Handlers and monads excel at <em>simulating</em> effects, either in terms of other
effects or as pure computations. For example, the familiar <a href="https://wiki.haskell.org/State_Monad">state
monad</a> implements mutable state with
(pure) state-passing functions, and there are many more examples. But I have
always felt that handlers and monads are not very good at explaining how a
program interacts with its external environment and how it gets to perform
<em>real-world</em> effects.</p>
<p><a href="https://danel.ahman.ee">Danel Ahman</a> and I have worked for a while on attacking
the question on how to better model external resources and what programming
constructs are appropriate for working with them. The time is right for us to
show what we have done so far. The theoretical side of things is explained in
our paper <a href="http://arxiv.org/abs/1910.11629"><strong>Runners in action</strong></a>, Danel
implemented a Haskell library
<a href="https://github.com/danelahman/haskell-coop"><strong>Haskell-Coop</strong></a> to go with the
paper, and I implemented a programming language
<a href="https://github.com/andrejbauer/coop"><strong>Coop</strong></a>.</p>
<!--more-->
<p>General-purpose programming languages, even the so-called pure ones, have to have
<em>some</em> account of interaction with the external environment. A popular choice is
to provide a foreign-function interface that connects the language with an
external library, and through it with an operating system and the universe. A
more nuanced approach would differentiate between a function that just happens
to be written in a different language, and one that actually performs an effect.
The latter kind is known as an <em>algebraic operation</em> in the
algebraic-effects-and-handlers way of doing things.</p>
<p>A <em>bad</em> approach to modeling the external world is to pretend that it is
internal to the language. One would think that this is obvious but it is not.
For instance, Haskell represents the interface to the external world through the
<a href="https://www.haskell.org/onlinereport/haskell2010/haskellch41.html#x49-32100041.1"><code class="highlighter-rouge">IO</code>
monad</a>.
But what is this monad <em>really</em>? How does it get to interact with the external
world? The Haskell Wiki page which answers this question has <a href="https://wiki.haskell.org/IO_inside#Welcome_to_the_RealWorld.2C_baby">the following
disclaimer</a>:</p>
<blockquote>
<p><em>"Warning: The following story about <code class="highlighter-rouge">IO</code> is incorrect in that it cannot
actually explain some important aspects of <code class="highlighter-rouge">IO</code> (including interaction and
concurrency). However, some people find it useful to begin developing an
understanding."</em></p>
</blockquote>
<p>The Wiki goes on to say how <code class="highlighter-rouge">IO</code> is a bit like a state monad with an imaginary
<code class="highlighter-rouge">RealWorld</code> state, except that of course <code class="highlighter-rouge">RealWorld</code> is not really a Haskell
type, or at least not one that actually holds the state of the real world.</p>
<p>The situation with Eff is not much better: it treats some operations at the
top-level in a special way. For example, if <code class="highlighter-rouge">print</code> percolates to the top level,
it turns into a <em>real</em> <code class="highlighter-rouge">print</code> that actually causes an effect. So it looks like
there is some sort of "top level handler" that models the real world, but that
cannot be the case: a handler may discard the continuation or run it twice, but
Eff hardly has the ability to discard the external world, or to make it
bifurcate into two separate realities.</p>
<p>If <code class="highlighter-rouge">IO</code> monad is not an honest monad and a top-level handler is not really a
handler, then what we have is a case of ingenious hackery in need of proper
programming-language design.</p>
<p>How precisely does an operation call in the program cause an effect in the
external world? As we have just seen, some sort of runtime environment or top
level needs to relate it to the external world. From the viewpoint of the
program, the external world appears as state which is not directly accessible,
or even representable in the language. The effect of calling an operation
$\mathtt{op}(a,\kappa)$ is to change the state of the world, and to get back a
result. We can model the situation with a map $\overline{\mathtt{op}} : A \times
W \to B \times W$, where $W$ is the set of all states of the world, $A$ is the
set of parameters, and $B$ the set of results of the operation. The operation
call $\mathtt{op}(a, \kappa)$ is "executed" in the current world $w \in W$ by
computing $\overline{\mathtt{op}}(a,w) = (b, w')$ to get the next world $w'$ and
a result $b$. The program then proceeds with the continuation $\kappa\,b$ in the
world $w'$. Notice how the world $w$ is an external entity that is manipulated
by the external map $\overline{\mathtt{op}}$ realistically in a <em>linear</em>
fashion, i.e., the world is neither discarded nor copied, just transformed.</p>
<p>What I have just described is <em>not</em> a monad or a handler, but a <em>comodel</em>, also
known as a <em>runner</em>, and the map $\overline{\mathtt{op}}$ is not an operation,
but a <em>co-operation</em>. This was all observed a while ago by <a href="http://homepages.inf.ed.ac.uk/gdp/">Gordon
Plotkin</a> and <a href="https://scholar.google.co.uk/citations?user=aOCekqQAAAAJ">John
Power</a>, <a href="https://www.ioc.ee/~tarmo/">Tarmo
Uustalu</a>, and generalized by <a href="http://www.itu.dk/people/mogel/">Rasmus
Møgelberg</a> and <a href="https://www.cs.ox.ac.uk/people/samuel.staton/main.html">Sam
Staton</a>, see our paper
for references. Perhaps we should replace "top-level" handlers and "special"
monads with runners?</p>
<p>Danel and I worked out how <em>effectful</em> runners (a generalization of runners that
supports other effects in addition to state) provide a mathematical model of
resource management. They also give rise to a programming concept that models
top-level external resources, as well as allows programmers to modularly define
their own “virtual machines” and run code inside them. Such virtual machines can
be nested and combined in interesting ways. We capture the core ideas of
programming with runners in an equational calculus $\lambda_{\mathsf{coop}}$,
that guarantees the linear use of resources and execution of finalization code.</p>
<p>An interesting practical aspect of $\lambda_{\mathsf{coop}}$, that was begotten by
theory, is modeling of extra-ordinary circumstances. The external environment
should have the ability to signal back to the program an extra-ordinary
circumstance that prevents if from returning a result. This is normally
accomplished by an exception mechanism, but since the external world is
stateful, there are <em>two</em> ways of combining it with exceptions, namely the sum
and the tensor of algebraic theories. Which one is the right one? Both! After a
bit of head scratching we realized that the two options are (analogous to) what
is variously called <a href="https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html">"checked" and "non-checked"
exceptions</a>,
<a href="http://man7.org/linux/man-pages/man3/errno.3.html">errors</a> and
<a href="http://man7.org/linux/man-pages/man7/signal.7.html">signals</a>, or <a href="https://www.repository.cam.ac.uk/bitstream/handle/1810/283239/paper.pdf?sequence=3&isAllowed=y">synchronous
and asynchronous
exceptions</a>.
And so we included in $\lambda_{\mathsf{coop}}$ both mechanisms: ordinary
<em>exceptions</em>, which are special events that disrupt the flow of user code but
can be caught and attended to, and <em>signals</em> which are unrecoverable failures
that irrevocably <em>kill</em> user code, but can still be finalized. We proved a finalization
theorem which gives strong guarantees about resources always being properly
finalized.</p>
<p>If you are familiar with handlers, as a first approximation you can think of
runners as handlers that use the continuation at most once in a tail-call
position. Many handlers are already of this form but not all. Non-determinism,
probability, and handlers that hijack the continuation (<code class="highlighter-rouge">delimcc</code>, threads, and
selection functionals) fall outside of the scope of runners. Perhaps in the
future we can resurrect some of these (in particular it seems like threads, or
even some form of concurrency would be worth investigating). There are many
other directions of possible future investigations: efficient compilation, notions
of correctness, extensions to the simple effect subtyping discipline that we
implemented, etc.</p>
<p>To find out more, we kindly invite you to have a look at the
<a href="http://arxiv.org/abs/1910.11629">paper</a>, and to try out the implementations.
The prototype programming language <a href="https://github.com/andrejbauer/coop">Coop</a>
implements and extends $\lambda_{\mathsf{coop}}$. You can start by skimming the
<a href="https://github.com/andrejbauer/coop/blob/master/Manual.md">Coop manual</a> and the
<a href="https://github.com/andrejbauer/coop/tree/master/examples">examples</a>. If you
prefer to experiment on your own, you might prefer the
<a href="https://github.com/danelahman/haskell-coop">Haskell-Coop</a> library, as it allows
you to combine runners with everything else that Haskell has to offer.</p>Andrej BauerIt has been almost a decade since Matija Pretnar and I posted the first blog posts about programming with algebraic effects and handlers and the programming language Eff. Since then handlers have become a well-known control mechanism in programming languages. Handlers and monads excel at simulating effects, either in terms of other effects or as pure computations. For example, the familiar state monad implements mutable state with (pure) state-passing functions, and there are many more examples. But I have always felt that handlers and monads are not very good at explaining how a program interacts with its external environment and how it gets to perform real-world effects. Danel Ahman and I have worked for a while on attacking the question on how to better model external resources and what programming constructs are appropriate for working with them. The time is right for us to show what we have done so far. The theoretical side of things is explained in our paper Runners in action, Danel implemented a Haskell library Haskell-Coop to go with the paper, and I implemented a programming language Coop.