MSR
MSR
mathematics?
Kevin Buzzard
Introduction
What is this talk
about?
Who am I?
Why Lean?
The Xena
Project.
The future of mathematics?
What can a
mathematics
undergraduate do?
Lean in
Research
Kevin Buzzard
Can Lean handle
modern maths?
Yes it can. Imperial College London
What next?
Summary
MSR, 5th September 2019.
1 / 15
The future of
mathematics?
• I am a pure mathematician, a professor at Imperial
Kevin Buzzard College London.
• Two years ago I started experimenting with the Lean
Introduction
What is this talk
about?
Theorem Prover (written by Leo de Moura at MSR).
Who am I?
Why Lean?
• I now clearly understand that software such as Lean is
The Xena part of the inevitable future of mathematics. And right now,
Project.
What can a
I can say with high confidence that Lean is easily the most
mathematics
undergraduate do? promising of the theorem provers currently available.
Lean in • Clear: tools such as Lean will one day help us
Research
Can Lean handle
modern maths?
mathematicians search for theorems in the literature, and
Yes it can.
What next?
help us to prove theorems. These tools may also change
Summary
the way we teach.
• Possible: tools such as Lean will begin to do research
semi-autonomously, perhaps uncover problems in the
literature. Maybe these tools will replace research
mathematicians.
• In April, Christian Szegedy from Google told me that he
believes that computers will be beating humans at math
within ten years.
2 / 15
The future of
mathematics?
Kevin Buzzard
Who am I?
Introduction
What is this talk
about?
Who am I? • I am a number theorist, so interested in questions about
N := {0, 1, 2, 3, . . .}.
Why Lean?
The Xena
Project.
What can a
• For example, I am interested in Fermat’s Last Theorem (If
mathematics
undergraduate do? x , y , z , n ∈ N and n ≥ 3 then x n + y n = z n only has the
Lean in obvious solutions with x = 0 or y = 0).
Research
Can Lean handle
modern maths?
• The proof of Fermat’s Last Theorem is long, and
Yes it can.
What next? structurally extremely complex. The advent of the internet
Summary means that proofs are getting longer.
• Nervousness about the state of the mathematical literature
was one reason I started to experiment with computer
theorem provers.
3 / 15
The future of
mathematics?
• Four years ago: I tried and failed to learn Haskell.
Kevin Buzzard • Three years ago: I was given Imperial College’s
Introduction “Introduction to proof” course to teach.
What is this talk
about? • Two and a half years ago : I tried to learn Haskell again.
Who am I?
Why Lean? • June 2017 : I stumbled upon a mathoverflow question
The Xena about the Coq proof of the odd order theorem.
Project.
What can a
mathematics
• I spent two weeks playing with Coq.
undergraduate do?
• And then I saw Tom Hales’ talk at Big Proof 2017.
Lean in
Research • I realised there was perhaps nothing stopping us from
Can Lean handle
modern maths?
Yes it can.
formalising all of mathematics, in theory.
What next?
• I chose Lean, because of Hales. I stayed with Lean
Summary
because of a firm belief that it is the only system ready for
this lofty goal.
• And now I never want to go back to pen and paper
mathematics – I am beginning to mistrust it.
• So my personal main goal at this point is to bring other
mathematicans into the area, so things begin to happen
more quickly.
4 / 15
The future of
mathematics? My work with mathematics undergraduates:
Kevin Buzzard
• In 2017 I started a blog, and an undergraduate club (the
Introduction
What is this talk
Xena project – follow me on Twitter!). We meet on
about?
Who am I? Thursday nights. The objective: I teach them Lean, they
Why Lean?
try to use Lean to do the maths they’re learning, or want to
The Xena
Project. learn.
What can a
mathematics
undergraduate do? • October 2017: Spike in week 1 quickly receded when we
Lean in realised nobody knew what they were doing.
Research
Can Lean handle
modern maths?
• Only two survivors – Chris Hughes and Kenny Lau. Both
Yes it can.
What next?
now experts – better than me.
Summary • Summer 2018 – summer project with me and 20
undergradutes, formalising our curriculum, funded by
Imperial.
• October 2018 – surge in week one took a lot longer to die
down. We sort-of knew what we were doing.
• October 2019 – it’s going to be interesting.
5 / 15
The future of Now it’s 2019, and what have Imperial maths undergraduates
mathematics?
Kevin Buzzard
formalised in Lean?
Introduction
• The theorem of quadratic reciprocity,
What is this talk
about? • Sylow’s theorems,
Who am I?
Why Lean? • the fundamental theorem of algebra,
The Xena
Project. • matrices and bilinear maps,
What can a
mathematics
undergraduate do?
• the theory of localisation of rings,
Lean in • the sine, cosine and exponential functions,
Research
Can Lean handle
modern maths?
• tensor products of modules,
Yes it can.
What next?
• Lots and lots of other undergraduate and MSc level things.
Summary
Ellen Arlt, Chris Hughes, Sangwoo Jo, Kenny Lau, Guy Leroy,
Amelia Livingston, Jean Lo, Rohan Mitta, Blair Shi, Abhimanyu
Pallavi Sudhir, Calle Sönne, Andreas Swerdlow – all of these
people have formalised something in Lean which has ended up
in Lean’s maths library.
Sian Carey, Anca Ciobanu, Clara List and Ramon Fernandez
Mir have all formalised mathematics in Lean as part of projects.
6 / 15
The future of See Computers and Mathematics, London Mathematical
mathematics?
Kevin Buzzard
Society newsletter, September 2019 (pages 32 to 36) for more
details of my work with undergraduates.
Introduction
What is this talk
about?
The main frustrations for undergraduates were pragmatic
Who am I?
Why Lean?
rather than foundational. For example, lack of appropriate
The Xena documentation (I will fix this).
Project.
What can a
Genuine dumb problem: it’s hard for a maths UG to install Lean
mathematics
undergraduate do? and its maths library on Windows, because they need to use
Lean in
Research
the command line. We can use CoCalc instead – it costs
Can Lean handle
modern maths?
money, but I have run some successful webinars on it.
Yes it can.
What next? Conclusions: it is possible to teach undergraduate
Summary mathematicians how to do some of their homework in Lean.
Forthcoming paper by Iannone and Thoma will say something
more formal about what I have achieved so far.
In October 2019 all of the homework in my course will be in
Lean format, and all of the course notes too. Like this. My job
is to teach the undergraduates what a proof is. Lean is a
wonderful tool for this. My goal here is to digitise our curriculum
in Lean. And spread the word. 7 / 15
The future of
mathematics?
Kevin Buzzard
Introduction
What is this talk Example of what I have learnt myself from using Lean:
about?
Who am I? First part of first question on first problem sheet of my course:
“True or false – if x is a real number, and x 2 − 3x + 2 = 0, then
Why Lean?
The Xena
Project. x = 1.”
What can a
mathematics
undergraduate do?
My answer “False – set x = 2.
Lean in
Research
Can Lean handle
Lean: “OK, so it now suffices to prove that (a)
modern maths?
Yes it can.
22 − 3 × 2 + 2 = 0 and that (b) 2 , 1.
What next?
Summary Me in 2017: “. . . ”
A few weeks later, this was fixed by computer scientists, who
wrote a tactic which solved these goals.
8 / 15
The future of
mathematics?
Despite successes and popularity with students, my “proper
Kevin Buzzard mathematician” colleagues at Imperial are less interested.
“Can the software tell us anything new? ” Not yet.
Introduction
What is this talk
about?
• There’s a long and really low-level formal proof of the four
Who am I?
Why Lean?
colour theorem in Coq.
The Xena
Project.
• There’s a very long and quite low-level formal proof of the
What can a
mathematics
odd order theorem in Coq.
undergraduate do?
Lean in
• Lean is like Coq but better. So it will be able to handle
Research
Can Lean handle
these things.
modern maths?
Yes it can. • So why is no “proper mathematician” interested?
What next?
Summary
• Two reasons!
1 [Aesthetics / fashion] Because “proper mathematicians”
like me don’t care about these results – we like high-level
proofs about modern objects.
2 [Belief system] We don’t need formal proof anyway – we
have a system of elders, which has worked for centuries.
• I think there is a non-zero chance that some of our great
castles are built on sand. But I think it’s small.
9 / 15
The future of
mathematics? The statement of Fermat’s Last Theorem can be explained to a
Kevin Buzzard high school kid. What does the proof of Fermat’s Last Theorem
Introduction
look like?
What is this talk
about? • First you invent elliptic curves.
Who am I?
Why Lean?
• Then you invent modular forms.
The Xena
Project. • Then you invent finite flat group schemes, automorphic
What can a
mathematics
undergraduate do?
representations, p-adic Galois representations, Hecke
Lean in algebras, universal deformation rings, Galois cohomology,
Research
Can Lean handle
local and global class field theory, harmonic analysis,
modern maths?
Yes it can. algebraic geometry, arithmetic geometry, nonabelian
What next?
Fourier theory. This took us about 350 years. Note that
Summary
these are not undergraduate or MSc level things. So
undergraduates are of limited use here.
• Then you prove some really profound theorems about
some of these objects, using the rest of these objects.
• And then Fermat’s Last Theorem comes out in the wash.
• The full proof takes thousands of pages.
10 / 15
The future of
mathematics?
Kevin Buzzard Give me 100 million dollars and 10 years and I believe I could
Introduction
get a team together to formalise a proof of Fermat’s Last
What is this talk
about?
Theorem. No mathematician I have met disputes this.
Who am I?
Why Lean?
Currently prohibitively expensive.
The Xena
Project.
But what is worse, no proper mathematician would care.
What can a
mathematics
undergraduate do? The elders have decreed that the proof is OK.
Lean in
Research I believe that no human, alive or dead, knows all the details of
Can Lean handle
modern maths? the proof of Fermat’s Last Theorem. But the community accept
Yes it can.
What next? the proof nonetheless, because the proof is modular.
Summary
Our community even accepts proofs if the author says “There
are now 100 missing pages, which we will get to later on.”
We accepted the proof of the odd order theorem in 1970 –
that’s why we gave John Thompson a Fields Medal. We don’t
care that it got formalised – it was already “checked”.
11 / 15
The future of
mathematics?
Kevin Buzzard So if proper mathematicians aren’t interested in a proof of the
Introduction
odd order theorem, what are they interested in?
What is this talk
about?
Who am I?
Example: Perfectoid spaces.
Why Lean?
The Xena
Proof of odd Perfectoid
Project. order theorem spaces
What can a
mathematics
undergraduate do? Got author a Fields Medal? Yes (1970) Yes (2018)
Lean in High level mathematics? No Yes
Research
Can Lean handle
modern maths?
Lots of PhD students
Yes it can. and post-docs working No Yes
What next?
Summary
in the area?
Talks happening about
these things all No Yes
over the world?
Mathematicans
interested in 2019? No Yes
12 / 15
The future of
mathematics? Earlier this year, Patrick Massot, Johan Commelin and myself
Kevin Buzzard
formalised the definition of a perfectoid space in Lean.
Introduction
What is this talk I am getting invitations from across the EU to speak in
about?
Who am I? mathematics departments about the work. Serious piece of
Why Lean?
The Xena
research, or elaborate PR stunt? Maybe both. It doesn’t tell us
Project. any new theorems, but it does prove that Lean can understand
What can a
mathematics
undergraduate do?
the question.
Lean in
Research Mathematical aside: why is formalising a definition hard work?
Can Lean handle
modern maths?
Yes it can. A real manifold is a topological space which locally looks like a
What next?
ball. For this to typecheck we need to know that a ball is a
Summary
topological space. This is not difficult.
A perfectoid space is a locally ringed space which locally looks
like an affinoid perfectoid space. For this to typecheck we need
to show that affinoid perfectoid spaces are locally ringed
spaces (or actually something slightly weaker). This is a
theorem, and it’s hard work.
13 / 15
The future of As I’ve said, my next step is to get more research
mathematics?
Kevin Buzzard
mathematicians using the software.
Lean in
The Coq theorem prover was written in 1989. Thirty years later,
Research
Can Lean handle
a modern mathematician will find that there is still a very high
modern maths?
Yes it can.
chance that they cannot formalise the statements of what they
What next?
are working on in any of the available theorem provers.
Summary
We mathematicians don’t see the modern complex
mathematical objects which we use every day, in theorem
provers. Yet. I just wrote some EU grant proposal to fund
post-docs who will write a bunch of Lean code defining the
objects which “make a mathematican tick”. And then (following
Tom Hales) we can start to make a database, or a network,
mapping out the state of the beliefs of the elders.
14 / 15
The future of
mathematics?
Kevin Buzzard Conclusions:
Introduction
• Lean’s type theory seems to be perfect for modern pure
What is this talk
about? mathematics.
Who am I?
Why Lean? • Crucial next step: put some modern pure mathematics
The Xena
Project.
into it.
What can a
mathematics • Need professional mathematicians, trained to use the
undergraduate do?
Lean in
software, to do this.
Research
Can Lean handle
• Only then we can take the first steps towards Tom Hales’
modern maths?
Yes it can. idea of a formalised database of definitions and theorem
What next?
statements. A new kind of database.
Summary
• And then we’re looking at: (1) search for mathematicians,
(2) tools to help mathematicians do computations, (3)
automatic marking and instant feedback, (4) world
domination by computer AI and I can retire early.
Thanks for coming!
15 / 15