Discussion of Homotopy Type Theory and Univalent Foundations
 help / color / mirror / Atom feed
From: Kevin Buzzard <kevin.m.buzzard@gmail.com>
To: Bas Spitters <b.a.w.spitters@gmail.com>
Cc: Noah Snyder <nsnyder@gmail.com>,
	 Homotopy Type Theory <HomotopyTypeTheory@googlegroups.com>,
	Juan Ospina <jospina65@gmail.com>
Subject: Re: [HoTT] doing "all of pure mathematics" in type theory
Date: Sun, 26 May 2019 18:00:01 +0100	[thread overview]
Message-ID: <CAH52Xb1uvc=AA6Pe=Z98K-rJ+Q1xzLf4LDAwWQhJWW62bO5L3A@mail.gmail.com> (raw)
In-Reply-To: <CAOoPQuTnM2F9a5VTGKjfxemPCizRyiAoM_VDYNgfTnF89gCBKg@mail.gmail.com>

I would like to again thank the people who have been responding to my
posts this weekend with links and further reading. I know the Lean
literature but I knew very little indeed about HoTT / UniMath at the
start of this weekend; at least now I feel like I know where you guys
are.

On Sun, 26 May 2019 at 13:09, Bas Spitters <b.a.w.spitters@gmail.com> wrote:

> It's a slow process, but I believe we are making progress.

I agree that it's a slow process! I think that in any computer science
department you can find people who know about these tools, indeed in
the computer science department at my university there are people
using things like Coq for program verification. I think that one
measure of success would be when in most mathematics departments you
can find someone who knows about this stuff. My personal experience is
that we seem to be far from this, at this point. Bas points out the
EU-funded project ForMath and I know that Paulson has an EU grant in
Cambridge for Isabelle (my impression is that it is centred in the
computer science department) and there is a Lean one based in
Amsterdam which I know has mathematicians involved. For me the shock
is that now I've seen what these things can do, I am kind of stunned
that mathematicians don't know more about them.

> You seem to be mixing at least two issues.
> - HoTT/UF as a foundation
> - Current implementations in proof assistants.

Yes; when I started this thread I was very unclear about how
everything fitted together. I asked a bit on the Lean chat but I guess
many people are like me -- they know one system, and are not experts
at all in what is going on with the other systems.

I had forgotten about the mathcomp book! Someone pointed it out to me
a while ago but I knew far less then about everything so it was a bit
more intimidating. Thanks for reminding me.

I think I have basically said all I had to say (and have managed to
get my ideas un-muddled about several things). But here is a parting
shot. Voevodsky was interested in formalising mathematics in a proof
assistant. Before that, Voevodsky was a "traditional mathematician"
and proved some great theorems and made some great constructions using
mathematical objects called schemes. Theorems about schemes (his
development of a homotopy theory for schemes) are what got him his
Fields Medal. Schemes were clearly close to his heart. But looking at
the things he formalised, he was doing things like the p-adic numbers,
and lots and lots of category theory. I am surprised that he did not
attempt to formalise the basic theory of schemes. Grothendieck's EGA
is written in quite a "formal" way (although nowhere near as formal as
what would be needed to formalise it easily in a proof assistant) and
Johan de Jong's Stacks Project https://stacks.math.columbia.edu/ is
another very solid attempt to lay down the foundations of the theory.
I asked Johan whether he now considered his choice of "nice web pages"
old-fashioned when it was now possible to formalise things in a proof
assistant, and he said that he did not have time to learn how to use a
proof assistant. But Voevodsky was surely aware of this work, and also
how suitable it looks for formalisation.

Thanks again to this community for all the comments and all the links
and all the corrections. If anyone is going to Big Proof in Edinburgh
this coming week I'd be happy to talk more.

Kevin

>
> If you want to restrict to classical maths. Then please have a careful
> look at how its done in mathematical components:
> https://math-comp.github.io/mcb/
> and the analysis library that is currently under development.
> https://github.com/math-comp/analysis
>
> If you went to help connecting this to the HoTT library, it will be
> much appreciated.
> https://github.com/HoTT/HoTT
>
> Best wishes,
>
> Bas
>
> On Sun, May 26, 2019 at 1:41 PM Kevin Buzzard <kevin.m.buzzard@gmail.com> wrote:
> >
> > It seems to me, now I understand much better what is going on (many thanks to all the people who replied) that dependent type theory + impredicative prop "got lucky", in that Coq has been around for a long time, and Lean 3 is an attempt to model basically the same type theory but in a way more suited to mathematics, written by someone who knows what they're doing (de Moura). Using nonconstructive maths e.g. LEM or AC etc in Lean 3 is just a matter of writing some incantation at the top of a file and then not thinking about it any more. HoTT might be more appropriate for mathematics -- or at least for some kinds of mathematics -- but its implementation in an actual piece of software seems a bit more hacky at this point ("use Coq, but don't use these commands or these tactics"), which maybe raises the entry barrier for mathematicians a bit (and speaking from personal experience, already this entry barrier is quite high). High level tactics are absolutely crucial for mathematical Lean users. This is one of the reasons that the Lean documentation is not ideal for mathematicians -- mathematicians need very early on to be able to use tactics such as `ring` or `norm_num` to do calculations with real numbers or in commutative rings, and these tactics are not even mentioned in the standard Lean documentation.
> >
> > I am a working mathematician who two years ago knew nothing about this way of doing mathematics on a computer. Now I have seen what is possible I am becoming convinced that it can really change mathematics. In my experience the biggest obstruction to it changing mathematics is simply that mathematicians do not see the point of it, or what it has to offer a modern working mathematician; they can see no immediate benefits in learning how this stuff works. In short, I think type theory has an image problem. Sure there are category theorists who know about it, but how many category theorists are there in an average maths department? In the UK at least, the answer is "much less than 1", and I cannot see that changing any time soon. I would love to draw the mathematics and computer science communities closer together over ideas like this, but it's hard work. I am wondering whether developing accessible databases of undergraduate level mathematics would at least make mathematicians sit up and take notice, but when I look at what has been done in these various systems I do not see this occurring. This weekend I've learnt something about UniMath, but whilst it might do bicategories very well (which are not on our undergraduate curriculum), where is the basic analysis? Where is the stuff which draws mathematicians in? This by no means a criticism of unimath -- it is in fact a far more broad criticism of all of the systems out there. Lean 3 might have schemes but they still can't prove that the derivative of sin is cos, and Isabelle/HOL might never have schemes. I know that Gonthier and his coauthors had to make a lot of undergraduate level maths (Galois theory, algebraic number theory, group theory) when formalising the odd order theorem in Coq, but it turns out that the odd order theorem is perhaps not a good "selling point" for mathematics formalisation when you're trying to sell to "normal research mathematicians", and I don't know what is. I'm now wondering making formalised undergraduate mathematics more accessible to untrained mathematicians is a better approach, but who knows. Obviously "AI which can solve the Riemann hypothesis" will work, but that looks to me like a complete fantasy at this point.
> >
> > One thing I have learnt over the last two years is that a whole bunch of extremely smart people, both mathematicians and computer scientists, have invested a lot of time in thinking about how to do mathematics with type theory. I find it very frustrating that mathematicians are not beginning to notice. Of course there are exceptions. One day though -- will there simply be a gigantic wave which crashes through mathematics and forces mathematicians to sit up and take notice? I guess we simply do not know, but if there is, I hope I'm still around.
> >
> > Kevin
> >
> >
> >
> > On Sun, 26 May 2019 at 06:50, Bas Spitters <b.a.w.spitters@gmail.com> wrote:
> >>
> >> There has been progress in making a cleaner interface with the standard Coq tactics. (Some abstractions were broken at the ocaml level)
> >> I'm hopeful that this can be lead to a clean connection between the HoTT library and more of the Coq developments in the not too distant future.
> >> As it exists in agda now.
> >>
> >> IIUC, UniMath does not allow any of the standard library or it's tactics, or even record types, since Vladimir wanted to have a very tight connection between type theory and it's semantics in simplicial sets. So, I don't expect them to connect to other developments, but I could be wrong.
> >>
> >> About the bundled/unbundled issue, which also exists in Coq, there's some recent progress "frame type theory" which should be applicable to both Coq and lean:
> >>  http://www.ii.uib.no/~bezem/abstracts/TYPES_2019_paper_51
> >>
> >> Coming back to Kevin's question, yes, HoTT (plus classical logic for sets), seems to be the most natural foundation for mathematics as is currently published in the Annals.
> >>
> >> On Sat, May 25, 2019 at 6:42 PM Noah Snyder <nsnyder@gmail.com> wrote:
> >>>
> >>> UniMath vs HoTT wasn’t exactly my point, UniMath = Book-HoTT is of a category from “Coq with the indices-matter option plus the HoTT library."   “Coq with the indices-matter option plus the HoTT library" is of the same category as "Lean plus the math library" and then it makes sense to compare how practically useful they are for math.
> >>>
> >>> Here it's important to note that most advanced things that you can do in Coq are broken by using the "indices-matter" option and relatedly not using the built-in type Prop.  Quoting from https://arxiv.org/abs/1610.04591 "This small change makes the whole standard library unusable, and many tactics stop working, too.  The solution was rather drastic: we ripped out the standard library and replaced it with a minimal core that is sufficient for the basic tactics to work."
> >>>
> >>> (In particular, I was in error in my previous email, *some* tactics are available in Coq+indices-matter+HoTT, but not many of the more advanced ones, and to my knowledge, not tactics needed for complicated homotopical calculations.)
> >>>
> >>> I should say I've never used Coq, just Agda.  (When I was using Agda the situation was even worse, things like pattern matching secretly assumed k even if you used the without-k option, and HITs were put in by a hack that wasn't totally clear if it worked, etc.)  So I'm likely wrong in some places above.
> >>>
> >>> So I think from a practical point of view, “Coq with the indices-matter option plus the HoTT library" is well behind ordinary Coq (and also Lean) for doing ordinary mathematics.  However, if and when it does catch up some of the pain points involving transporting from my previous email should go away automatically.  (Side comment: once you start talking about transporting stuff related to categories across equivalences of categories it's only going to get more painful in ordinary type theory, but will remain easy in HoTT approaches.)
> >>>
> >>> Best,
> >>>
> >>> Noah
> >>>
> >>> p.s. Installed Lean last week.  Looking forward to using it next year when Scott and I are both at MSRI.
> >>>
> >>> On Sat, May 25, 2019 at 11:36 AM Kevin Buzzard <kevin.m.buzzard@gmail.com> wrote:
> >>>>
> >>>> Hi Noah. Thank you for pointing out the category error. It seems to me that sometimes when I say "HoTT" I should be saying, for example, "UniMath".
> >>>>
> >>>> Tactics in Lean are absolutely crucial for library development. Coq has some really powerful tactics, right? UniMath can use those tactics, presumably?
> >>>>
> >>>> I understand that UniMath, as implemented in Coq, takes Coq and adds some "rules" of the form "you can't use this functionality" and also adds at least one new axiom (univalence).
> >>>>
> >>>> On Sat, 25 May 2019 at 15:50, Noah Snyder <nsnyder@gmail.com> wrote:
> >>>>>
> >>>>> I’d also imagine that a “practical” implementation would likely have some kind of “two-level” type theory where you can use types that behave classically when that’s better and HoTT types when that’s better.
> >>>>
> >>>>
> >>>> But plain Coq has such types, right?
> >>>>
> >>>> OK so this has all been extremely informative. There are other provers being developed which will implement some flavour of HoTT more "faithfully", and it might be easier to develop maths libraries in such provers.
> >>>>
> >>>>> For example, if G and H are isomorphic groups and you want to translate a theorem or construction across the isomorphism.  In ordinary type theory this is going to involve annoying book-keeping which it seems like you’d have to do separately for each kind of mathematical object.
> >>>>
> >>>>
> >>>> Yes. This is a pain point in Lean. It's a particularly nasty one too, as far as mathematicians are concerned, because when you tell a mathematician "well this ring R is Cohen-Macauley, and here's a ring S which is isomorphic to R, but we cannot immediately deduce in Lean that S is Cohen-Macauley" then they begin to question what kind of crazy system you are using which cannot deduce this immediately. As an interesting experiment, find your favourite mathematician, preferably one who does not know what a Cohen-Macauley ring is, and ask them whether they think it will be true that if R and S are isomorphic rings and R is Cohen-Macauley then S is too. They will be very confident that this is true, even if they do not know the definition; standard mathematical definitions are isomorphism-invariant. This is part of our code of conduct, in fact.
> >>>>
> >>>> However in Lean I believe that the current plan is to try and make a tactic which will resolve this issue. This has not yet been done, and as far as I can see this is a place where UniMath is a more natural fit for "the way mathematicians think". However now I've looked over what has currently been formalised in UniMath I am wondering whether there are pain points for it, which Lean manages to get over more easily. That is somehow where I'm coming from.
> >>>>
> >>>>>
> >>>>>  For example, say you have a theorem about bimodules over semisimple rings whose proof starts “wlog, by Artin-Wedderburn, we can assume both algebras are multimatrix algebras over division rings.”  Is that step something you’d be able to deal with easily in Lean?  If not, that’s somewhere that down the line HoTT might make things more practical.
> >>>>
> >>>>
> >>>> This is a great example! To be honest I am slightly confused about why we are not running into this sort of thing already. As far as I can see this would be a great test case for the (still very much under development) transport tactic. Maybe we don't have enough classification theorems. I think that our hope in general is that this sort of issue can be solved with automation.
> >>>>
> >>>> Kevin
> >>>>
> >>>>
> >>>>>
> >>>>> But mostly I just want to say you’re making a category error in your question.  HoTT is an abstract type theory, not a proof assistant.
> >>>>>
> >>>>> Best,
> >>>>>
> >>>>> Noah
> >>>>>
> >>>>> On Sat, May 25, 2019 at 9:34 AM Juan Ospina <jospina65@gmail.com> wrote:
> >>>>>>
> >>>>>> On page 117 of https://arxiv.org/pdf/1808.10690.pdf appears the "additivity axiom".  Please let me know if the following formulation of the such axiom is correct:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Saturday, May 25, 2019 at 5:22:41 AM UTC-5, awodey wrote:
> >>>>>>>
> >>>>>>> A useful example for you might be Floris van Doorn’s formalization of
> >>>>>>> the Atiyah-Hirzebruch and Serre spectral sequences for cohomology
> >>>>>>> in HoTT using Lean:
> >>>>>>>
> >>>>>>>  https://arxiv.org/abs/1808.10690
> >>>>>>>
> >>>>>>> Regards,
> >>>>>>>
> >>>>>>> Steve
> >>>>>>>
> >>>>>>> > On May 25, 2019, at 12:12 PM, Kevin Buzzard <kevin....@gmail.com> wrote:
> >>>>>>> >
> >>>>>>> > Hi from a Lean user.
> >>>>>>> >
> >>>>>>> > As many people here will know, Tom Hales' formal abstracts project https://formalabstracts.github.io/ wants to formalise many of the statements of modern pure mathematics in Lean. One could ask more generally about a project of formalising many of the statements of modern pure mathematics in an arbitrary system, such as HoTT. I know enough about the formalisation process to know that whatever system one chooses, there will be pain points, because some mathematical ideas fit more readily into some foundational systems than others.
> >>>>>>> >
> >>>>>>> > I have seen enough of Lean to become convinced that the pain points would be surmountable in Lean. I have seen enough of Isabelle/HOL to become skeptical about the idea that it would be suitable for all of modern pure mathematics, although it is clearly suitable for some of it; however it seems that simple type theory struggles to handle things like tensor products of sheaves of modules on a scheme, because sheaves are dependent types and it seems that one cannot use Isabelle's typeclass system to handle the rings showing up in a sheaf of rings.
> >>>>>>> >
> >>>>>>> > I have very little experience with HoTT. I have heard that the fact that "all constructions must be isomorphism-invariant" is both a blessing and a curse. However I would like to know more details. I am speaking at the Big Proof conference in Edinburgh this coming Wednesday on the pain points involved with formalising mathematical objects in dependent type theory and during the preparation of my talk I began to wonder what the analogous picture was with HoTT.
> >>>>>>> >
> >>>>>>> > Everyone will have a different interpretation of "modern pure mathematics" so to fix our ideas, let me say that for the purposes of this discussion, "modern pure mathematics" means the statements of the theorems publishsed by the Annals of Mathematics over the last few years, so for example I am talking about formalising statements of theorems involving L-functions of abelian varieties over number fields, Hodge theory, cohomology of algebraic varieties, Hecke algebras of symmetric groups, Ricci flow and the like; one can see titles and more at http://annals.math.princeton.edu/2019/189-3 . Classical logic and the axiom of choice are absolutely essential -- I am only interested in the hard-core "classical mathematician" stance of the way mathematics works, and what it is.
> >>>>>>> >
> >>>>>>> > If this is not the right forum for this question, I would be happily directed to somewhere more suitable. After spending 10 minutes failing to get onto ##hott on freenode ("you need to be identified with services") I decided it was easier just to ask here. If people want to chat directly I am usually around at https://leanprover.zulipchat.com/ (registration required, full names are usually used, I'll start a HoTT thread in #mathematics).
> >>>>>>> >
> >>>>>>> > Kevin Buzzard
> >>>>>>> >
> >>>>>>> > --
> >>>>>>> > You received this message because you are subscribed to the Google Groups "Homotopy Type Theory" group.
> >>>>>>> > To unsubscribe from this group and stop receiving emails from it, send an email to HomotopyTypeTheory+unsubscribe@googlegroups.com.
> >>>>>>> > To view this discussion on the web visit https://groups.google.com/d/msgid/HomotopyTypeTheory/a57315f6-cbd6-41a5-a3b7-b585e33375d4%40googlegroups.com.
> >>>>>>> > For more options, visit https://groups.google.com/d/optout.
> >>>>>>>
> >>>>>> --
> >>>>>> You received this message because you are subscribed to the Google Groups "Homotopy Type Theory" group.
> >>>>>> To unsubscribe from this group and stop receiving emails from it, send an email to HomotopyTypeTheory+unsubscribe@googlegroups.com.
> >>>>>> To view this discussion on the web visit https://groups.google.com/d/msgid/HomotopyTypeTheory/18681ec4-dc8d-42eb-b42b-b9a9f639d89e%40googlegroups.com.
> >>>>>> For more options, visit https://groups.google.com/d/optout.
> >>>>>
> >>>>> --
> >>>>> You received this message because you are subscribed to the Google Groups "Homotopy Type Theory" group.
> >>>>> To unsubscribe from this group and stop receiving emails from it, send an email to HomotopyTypeTheory+unsubscribe@googlegroups.com.
> >>>>>
> >>>>> To view this discussion on the web visit https://groups.google.com/d/msgid/HomotopyTypeTheory/CAO0tDg4dyjZHueTPQEYKQaojSw6SDKNUC8y49JHMoR9oTQOmMw%40mail.gmail.com.
> >>>>>
> >>>>>
> >>>>> For more options, visit https://groups.google.com/d/optout.
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups "Homotopy Type Theory" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send an email to HomotopyTypeTheory+unsubscribe@googlegroups.com.
> >>> To view this discussion on the web visit https://groups.google.com/d/msgid/HomotopyTypeTheory/CAO0tDg7LAv8A%2BoXRLhsN3O7uXCh3D%2BSfBSsr-hmwRsr1iwztPg%40mail.gmail.com.
> >>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Homotopy Type Theory" group.
To unsubscribe from this group and stop receiving emails from it, send an email to HomotopyTypeTheory+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/HomotopyTypeTheory/CAH52Xb1uvc%3DAA6Pe%3DZ98K-rJ%2BQ1xzLf4LDAwWQhJWW62bO5L3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2019-05-26 17:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25 10:12 Kevin Buzzard
2019-05-25 10:22 ` Steve Awodey
2019-05-25 12:23   ` Kevin Buzzard
     [not found]   ` <B7D67BBA-5E0B-4438-908D-4EF316C8C1F1@chalmers.se>
     [not found]     ` <CAH52Xb1Y=Xq=012v_-KSDUuwgnKpEp5qjrxgtUJf+qc_0RWJUg@mail.gmail.com>
2019-05-25 13:13       ` Fwd: " Kevin Buzzard
2019-05-25 13:34   ` Juan Ospina
2019-05-25 14:50     ` Noah Snyder
2019-05-25 15:36       ` Kevin Buzzard
2019-05-25 16:41         ` Noah Snyder
2019-05-26  5:50           ` Bas Spitters
2019-05-26 11:41             ` Kevin Buzzard
2019-05-26 12:09               ` Bas Spitters
2019-05-26 17:00                 ` Kevin Buzzard [this message]
2019-05-27  2:33                   ` Daniel R. Grayson
2019-06-02 16:30                   ` Bas Spitters
2019-06-02 17:55                     ` Kevin Buzzard
2019-06-02 20:46                       ` Nicola Gambino
2019-06-02 20:59                         ` Valery Isaev
2019-06-04 20:32                       ` Michael Shulman
2019-06-04 20:58                         ` Kevin Buzzard
2019-06-06 16:30                         ` Matt Oliveri
2019-05-27 13:09                 ` Assia Mahboubi
2019-05-28  9:50                   ` Michael Shulman
2019-05-28 10:13                     ` Nils Anders Danielsson
2019-05-28 10:22                       ` Michael Shulman
2019-05-29 19:04                         ` Martín Hötzel Escardó
2019-05-30 17:14                           ` Michael Shulman
2019-06-02 17:49                             ` Kevin Buzzard
2019-06-04 20:50                               ` Martín Hötzel Escardó
2019-06-05 17:11                                 ` Thorsten Altenkirch
2019-05-28 15:20                     ` Joyal, André
2019-05-27  8:41           ` Nils Anders Danielsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH52Xb1uvc=AA6Pe=Z98K-rJ+Q1xzLf4LDAwWQhJWW62bO5L3A@mail.gmail.com' \
    --to=kevin.m.buzzard@gmail.com \
    --cc=HomotopyTypeTheory@googlegroups.com \
    --cc=b.a.w.spitters@gmail.com \
    --cc=jospina65@gmail.com \
    --cc=nsnyder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).