mathematical equations

Lean

Programming language and theorem prover

What is Lean?

LEAN Theorem Prover graphic

Lean is a functional programming language and interactive theorem prover. Our project strives to revolutionize mathematics by empowering anyone with an interest to grow in the field using Lean as their assistant. Lean was developed by Microsoft Research in 2013 as an initial effort to help mathematicians and engineers solve complex math problems. Lean is an open-source development environment for formal mathematics, also known as machine-checkable mathematics, used by and contributed to by an active community of mathematicians around the world.

The digital revolution has been driven by mathematical innovation. The complexity of mathematical problems is increasing massively. Yet today’s math is hard to referee, seldom read, or cited. We now have proofs that cannot be manually refereed. Collaboration in math is difficult and still limited to small groups. Historically, technical achievements through verified proofs have been gatekept by peer validation, keeping the upper most levels of the field exclusive and causing a trust bottleneck in novel explorations. Deconstructing the thought process used to achieve a result into widely checkable commentary is fertile for introductory methods. Lean is eliminating the bottleneck by digitizing mathematics and enabling computers to verify mathematical theorems. We are building the platform for the next wave of mathematicians to embrace formal mathematics.

Microsoft Research collaborates with the academic and Lean community in pursuit of our mission to democratize mathematics, accelerate the frontiers of mathematical research, and improve equal access to math education. Our community of students, professors, and mathematicians actively contribute to Lean’s mathematical library (Mathlib (opens in new tab)). The community has digitized over half of the undergraduate mathematics curriculum into Lean as well as concepts at the frontiers of mathematics (such as Perfectoid Spaces) and is over one million lines of code. The community’s goal is to reach 10 million lines of code in the next five years to completely digitize the undergraduate mathematics curriculum and further the progress of formalized proofs, such as Fermat’s Last Theorem. Lean has already demonstrated its potential to revolutionize and radically accelerate mathematics, for example, helping Fields Medalist Peter Scholze confirm a new theorem in the Liquid Tensor Experiment (opens in new tab). At Microsoft Research, we are working on the algorithms, data structures, and proof automation for the Lean platform to support a digital library of this scale effectively and greatly reduce formal mathematics overhead. We will claim the formal mathematics revolution is complete by reaching a de Bruijn factor of 1, when the ratio of proof length in Lean is equal to the proof length in mathematical prose. We believe Lean is spearheading the formal mathematics revolution and will empower the next generation of mathematicians to prove major open conjectures previously deemed impossible.

Hoskinson Center for Formal Mathematics
Kevin Buzzard: The rise of formalism in mathematics
2020’s Biggest Breakthroughs in Math and Computer Science

Finally, we are in collaboration with our academic partners to develop high-quality university courses in Lean and supporting literature (opens in new tab), such as our upcoming textbook Functional Programming in Lean, (opens in new tab) that will fuel the adoption of Lean as the ultimate mathematics democratizer. Our long-term goal is to make Lean available in all classrooms, providing access to formal mathematics to kids, teens, and anyone who might not think of themselves as a mathematician. Our hope is to fully democratize mathematics and to help developing students and future scientists.

Formal mathematics is our primary focus, but formal methods have proven to be propitious for other applications. Lean has the potential to radically change any scope of logic that can be formalized, such as computational law and civil procedures.