[Agda] [Coq-Club] Why dependent type theory?
Thorsten Altenkirch
Thorsten.Altenkirch at nottingham.ac.uk
Wed Mar 4 10:42:19 CET 2020
First of all I don’t like the word “dependent type theory”. Dependent types are one important feature of modern Type Theory but hardly the only one.
To me the most important feature of Type Theory is the support of abstraction in Mathematics and computer science. Using types instead of sets means that you can hide implementation choices which is essential if you want to build towers of abstraction. Set theory fails here badly. Just as a very simple example: in set theory you have the notion of union, so for example
{0,1} \cup {0,1,2,3} = {0,1,2,3}
However, if we change the representation of the first set and use lets say {true,false} we get a different result:
{true , false} \cup {0,1,2,3} = {true,false,0,1,2,3}
This means that \cup exposes implementation details because the results are not equivalent upto renaming. In Type Theory we have the notion of sum, sometimes called disjoint union, which is well behaved
{0,1} + {0,1,2,3} = {in1 0,in1 1,in2 0,in2 1,in2 2,in2 3}
{true , false} + {0,1,2,3} = {in1 true,in1 false ,in2 0,in2 1,in2 2,in2 3}
Unlike \cup, + doesn’t reveal any implementation details it is a purely structural operation. Having only structural operations means that everything you do is stable under equivalence, that is you can replace one object with another one that behaves the same. This is the essence of Voevodsky’s univalence principle.
There are other nice aspects of Type Theory. From a constructive point of view (which should come naturally to a computer scientists) the proporsitions as types explanation provides a very natural way to obtain “logic for free” and paedagogically helpful since it reduces logical reasoning to programming.
There are performance issues with implementations of Type Theory, however, in my experience (mainly agda) the execution of functions at compile time isn’t one of them. In my experience the main problem is to deal with a loss of sharing when handling equational constraints which can blow up the time needed for type checking. I think this is an engineering problem and there are some suggestions how to fix this.
Thorsten
From: "coq-club-request at inria.fr" <coq-club-request at inria.fr> on behalf of Jason Gross <jasongross9 at gmail.com>
Reply to: "coq-club at inria.fr" <coq-club at inria.fr>
Date: Tuesday, 3 March 2020 at 19:44
To: coq-club <coq-club at inria.fr>, agda-list <agda at lists.chalmers.se>, "coq+miscellaneous at discoursemail.com" <coq+miscellaneous at discoursemail.com>, lean-user <lean-user at googlegroups.com>
Subject: [Coq-Club] Why dependent type theory?
I'm in the process of writing my thesis on proof assistant performance bottlenecks (with a focus on Coq), and there's a large class of performance bottlenecks that come from (mis)using the power of dependent types. So in writing the introduction, I want to provide some justification for the design decision of using dependent types, rather than, say, set theory or classical logic (as in, e.g., Isabelle/HOL). And the only reasons I can come up with are "it's fun" and "lots of people do it"
So I'm asking these mailing lists: why do we base proof assistants on dependent type theory? What are the trade-offs involved?
I'm interested both in explanations and arguments given on list, as well as in references to papers that discuss these sorts of choices.
Thanks,
Jason
This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment.
Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored
where permitted by law.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chalmers.se/pipermail/agda/attachments/20200304/267ddd82/attachment.html>
More information about the Agda
mailing list