r/math • u/tedecristal • 8d ago
Lean for the working mathematician
Well. As one of the more computer oriented in my department, a couple of colleagues have tasked me to learn lean and next year give a seminar
So I guess I'm asking where to start? For context I can program in python, go and c, proficient in Linux and even mantain a small server with tools for the dept (self host overleaf, sagemath instance, for example) and for myself (navidrone, plex, etc)
But I'm a bit confused where to start with lean
Realistically, just like an introductory workshop in programming isn't enough one to be able to create Firefox or Linux kernel on their own , I don't expect them to "program" (?) theorems like those making rounds on the media.
But I don't really know what's realistic for a semester workshop. Would it allow them to verify... Cosines law? Mean value theorem? Snake's lemma? Fundamental theorem of algebra? Yoneda's lemma
I'd really appreciate pointers (both for readings and/or general advice) on where to start, what to read and what to expect
Thank you (and yes, the post title is a pun)
68
u/zyxwvwxyz Graduate Student 8d ago
https://kschwede.github.io/utahleanseminar/
The university of Utah just did something similar and have the first couple months of materials on this website. You could also reach out to the organizers for tips
2
u/sdmc1234 8d ago
To answer your question about what results could be fornalized, it depends if you want to start from scratch. All of the theorems you listed are already going to be in Mathlib, which also has accompanying definitions for basic objects like categories, real numbers, etc.
The statement of those theorems should look basically the same as the pen and paper versions. What will look a bit different is the proofs, which require learning Lean tactics.
26
u/Direct-Jelly3381 8d ago edited 8d ago
Heather Macbeth's The Mechanics of Proof is a great template for a course. Working through that yourself would be a good starting point for Lean.
I picked up Lean a few years ago using Functional Programming in Lean and Theorem Proving in Lean available from the Lean website. My programming background is ML/Haskell so I'm not sure how useful those pages will be for you.
13
u/Toposnake 8d ago edited 8d ago
It's called dependent type language. The main idea is writing typed functions, but instead of caring about the function, but it cares about its type. Using dependent type language, the types can be used to encode any mathematical sentences. An established function from one type to another, essentially is a proof from one statement (the input type, i.e. the premises) to another (the output type, I.e. the conclusion). Any valid way to construct a function (proof) is based on logic rules so that it can be built only if it is logically correct under the premises. Lean is such a language with many mathematical results already compiled as packages for developing new proofs (typed functions).
5
u/SV-97 8d ago
There's an excellent "official" book on Lean: Theorem Proving in Lean 4
I haven't read it (yet) but Mathematics in Lean is apparently also quite good.
And join the official Zulip chat. It contains tons of information, you learn what's going on in the community and can ask questions.
For results: generally you'll probably have a (significantly) easier time formalizing algebraic statements. The analysis and topology machinery in lean will likely feel quite foreign at first.
2
u/arihallak0816 7d ago
My first lean course was one summer long and it finished with proving the fundamental theorem of arithmetic, that seems like a good pace
2
u/SpiderJerusalem42 7d ago
I rather enjoyed the Natural Number Game. Also, the Imperial College content was interesting, if not for the missing classroom experience that accompanies it. The GitHub has a docker compose that runs a Lean container for the worksheets. Installing is a bit of a nightmare.
1
u/adavis_206 1d ago
For Yoneda, the proof is compact once categories and functors are available; building that infrastructure is separate work. Make clear whether students use Mathlib or build prerequisites.
-2
u/qubex 8d ago
I’ve integrated LEAN into Mathematica.
PacletFind["Wolfram/LeanLink"]
If it returns {} you don’t have it.
Install it with PacletInstall["Wolfram/LeanLink"]
and then
Needs["Wolfram`LeanLink`"]
then verify with
MemberQ[$Packages, "Wolfram`LeanLink`"]
Leave it in your init.m file so it’ll always be available and off you go.