<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://invarians.org/index.php?action=history&amp;feed=atom&amp;title=Lean_theorem_prover%2FApplications%2FTeaching_with_Lean</id>
	<title>Lean theorem prover/Applications/Teaching with Lean - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://invarians.org/index.php?action=history&amp;feed=atom&amp;title=Lean_theorem_prover%2FApplications%2FTeaching_with_Lean"/>
	<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Applications/Teaching_with_Lean&amp;action=history"/>
	<updated>2026-10-21T09:18:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://invarians.org/index.php?title=Lean_theorem_prover/Applications/Teaching_with_Lean&amp;diff=6812&amp;oldid=prev</id>
		<title>PMA Publisher: Published from the Principia Machina source</title>
		<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Applications/Teaching_with_Lean&amp;diff=6812&amp;oldid=prev"/>
		<updated>2026-10-15T19:35:41Z</updated>

		<summary type="html">&lt;p&gt;Published from the Principia Machina source&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:35, 15 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:Teaching with Lean}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:Teaching with Lean}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Lean theorem prover map}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Lean is used to teach mathematical proof, the logic behind it, and programming. This page describes the main free materials, from a puzzle game for beginners to textbooks for undergraduates and researchers, and some university courses built on them. It also says what a proof checker adds to teaching and what it does not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Lean is used to teach mathematical proof, the logic behind it, and programming. This page describes the main free materials, from a puzzle game for beginners to textbooks for undergraduates and researchers, and some university courses built on them. It also says what a proof checker adds to teaching and what it does not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PMA Publisher</name></author>
	</entry>
	<entry>
		<id>https://invarians.org/index.php?title=Lean_theorem_prover/Applications/Teaching_with_Lean&amp;diff=6605&amp;oldid=prev</id>
		<title>PMA Publisher: Published from the Principia Machina source</title>
		<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Applications/Teaching_with_Lean&amp;diff=6605&amp;oldid=prev"/>
		<updated>2026-10-14T18:01:18Z</updated>

		<summary type="html">&lt;p&gt;Published from the Principia Machina source&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Teaching with Lean}}&lt;br /&gt;
Lean is used to teach mathematical proof, the logic behind it, and programming. This page describes the main free materials, from a puzzle game for beginners to textbooks for undergraduates and researchers, and some university courses built on them. It also says what a proof checker adds to teaching and what it does not.&lt;br /&gt;
&lt;br /&gt;
== What a proof checker gives a learner ==&lt;br /&gt;
&lt;br /&gt;
A student writing a proof on paper waits for a teacher to mark it. A student writing a proof in Lean is answered at once: each step is accepted, or refused with the goal that is still open (see [[Lean theorem prover/Explainers/Holes and goals|Holes and goals]]). The checker never tires, and it does not accept a step because it looks plausible. It cannot tell a student whether a proof is well written or why it works; those remain the teacher&amp;#039;s work.&lt;br /&gt;
&lt;br /&gt;
== The Natural Number Game ==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Natural Number Game&amp;#039;&amp;#039;&amp;#039; is a browser game that teaches the first steps of proof in Lean. It starts from a definition of the natural numbers made from zero and a successor operation, and asks the player to prove facts about them in order: first that 2 + 2 = 4, then that &amp;lt;math&amp;gt;x + y = y + x&amp;lt;/math&amp;gt;, and so on through a sequence of &amp;quot;worlds&amp;quot;, each made of levels that are theorems.&amp;lt;ref name=&amp;quot;nngsrc&amp;quot;&amp;gt;Kevin Buzzard, Jon Eugster et al., &amp;#039;&amp;#039;Natural Number Game&amp;#039;&amp;#039;, Lean 4 version, game text and credits. https://github.com/leanprover-community/NNG4&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The game was written for Lean 3 by Kevin Buzzard and Mohammad Pedramfar. Its Lean 4 version is credited to Buzzard and Jon Eugster, on a game engine by Alexander Bentkamp, Eugster and Patrick Massot.&amp;lt;ref name=&amp;quot;nngsrc&amp;quot; /&amp;gt; It runs on the Lean Game Server, which also hosts games maintained by other authors, among them a set theory game (Dan Velleman), a real analysis game (Alex Kontorovich) and &amp;#039;&amp;#039;Reintroduction to Proofs&amp;#039;&amp;#039; (Emily Riehl).&amp;lt;ref name=&amp;quot;gameserver&amp;quot;&amp;gt;Alexander Bentkamp, Jon Eugster et al., &amp;quot;Lean 4 Game&amp;quot;, the source of the Lean Game Server: project description and list of hosted games, read 14 October 2026. https://github.com/leanprover-community/lean4game&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A small piece in the game&amp;#039;s style shows the idea. The natural numbers are defined from scratch, addition is defined by recursion on its second argument, and adding zero on the left then needs a proof by induction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
inductive MyNat where&lt;br /&gt;
  | zero : MyNat&lt;br /&gt;
  | succ : MyNat → MyNat&lt;br /&gt;
&lt;br /&gt;
namespace MyNat&lt;br /&gt;
&lt;br /&gt;
def add : MyNat → MyNat → MyNat&lt;br /&gt;
  | a, zero   =&amp;gt; a&lt;br /&gt;
  | a, succ b =&amp;gt; succ (add a b)&lt;br /&gt;
&lt;br /&gt;
/-- Adding zero on the right is the definition; on the left it needs induction. -/&lt;br /&gt;
theorem zero_add (n : MyNat) : add zero n = n := by&lt;br /&gt;
  induction n with&lt;br /&gt;
  | zero =&amp;gt; rfl&lt;br /&gt;
  | succ k ih =&amp;gt; rw [add, ih]&lt;br /&gt;
&lt;br /&gt;
end MyNat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lean 4.34.1 accepts it. A beginner who offers &amp;lt;code&amp;gt;rfl&amp;lt;/code&amp;gt; as the whole proof is refused: Lean reports that the left-hand side, &amp;lt;code&amp;gt;zero.add n&amp;lt;/code&amp;gt;, is not definitionally equal to the right-hand side, &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;. The definition of addition says nothing directly about &amp;lt;code&amp;gt;add zero n&amp;lt;/code&amp;gt; while &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is unknown. That refusal is the point at which induction is learned. The explainer [[Lean theorem prover/Explainers/Induction, as the machine sees it|Induction, as the machine sees it]] says more.&lt;br /&gt;
&lt;br /&gt;
== Textbooks ==&lt;br /&gt;
&lt;br /&gt;
The standard free books are published by the Lean community and the Lean developers.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Theorem Proving in Lean 4&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, by Jeremy Avigad, Leonardo de Moura, Soonho Kong and Sebastian Ullrich, with contributions from the community, teaches Lean&amp;#039;s logic itself: dependent type theory, propositions and proofs, tactics, inductive types, structures, type classes and the axioms.&amp;lt;ref name=&amp;quot;tpil&amp;quot;&amp;gt;Jeremy Avigad, Leonardo de Moura, Soonho Kong and Sebastian Ullrich, &amp;#039;&amp;#039;Theorem Proving in Lean 4&amp;#039;&amp;#039;, online book, read 14 October 2026. https://lean-lang.org/theorem_proving_in_lean4/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Mathematics in Lean&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, by Avigad and Patrick Massot, teaches how to do mathematics with Mathlib, in chapters running from basic logic and number theory through structures, algebra and linear algebra to topology, differential calculus, and integration and measure theory.&amp;lt;ref name=&amp;quot;mil&amp;quot;&amp;gt;Jeremy Avigad and Patrick Massot, &amp;#039;&amp;#039;Mathematics in Lean&amp;#039;&amp;#039;, online book, read 14 October 2026. https://leanprover-community.github.io/mathematics_in_lean/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Functional Programming in Lean&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, by David Thrane Christiansen, is a free book on Lean as a programming language, from its basics through type classes, monads and dependent types to proofs about programs and performance.&amp;lt;ref name=&amp;quot;fpil&amp;quot;&amp;gt;David Thrane Christiansen, &amp;#039;&amp;#039;Functional Programming in Lean&amp;#039;&amp;#039;, online book, read 14 October 2026. https://lean-lang.org/functional_programming_in_lean/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Logic and Proof&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, written by Avigad, Lewis and van Doorn and adapted to Lean 4 by Hua, is an introduction to symbolic logic and mathematical proof. Its stated goals are that a reader learn to write clear proofs, to model deductive proof formally, and to use an interactive proof assistant.&amp;lt;ref name=&amp;quot;lap&amp;quot;&amp;gt;J. Avigad, J. Hua, R. Y. Lewis and F. van Doorn, &amp;#039;&amp;#039;Logic and Proof&amp;#039;&amp;#039;, online textbook, Lean 4 edition, read 14 October 2026. https://leanprover-community.github.io/logic_and_proof/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== University courses ==&lt;br /&gt;
&lt;br /&gt;
Two published course texts show Lean in use at different levels.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;The Mechanics of Proof&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, by Heather Macbeth, was written for the course Math 2001 at Fordham University and is aimed at the early university level. It describes itself as a book about writing careful, rigorous proofs, and it is paired with Lean code throughout, with an appendix on moving on to mainstream Lean.&amp;lt;ref name=&amp;quot;mop&amp;quot;&amp;gt;Heather Macbeth, &amp;#039;&amp;#039;The Mechanics of Proof&amp;#039;&amp;#039;, online book for Math 2001, Fordham University, 2022–2024. https://hrmacbeth.github.io/math2001/&amp;lt;/ref&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Formalising Mathematics&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, by Kevin Buzzard, is the handbook for his course of that name at Imperial College London, aimed at students with some mathematical background, such as those in the final year of a mathematics degree. It teaches how to formalise mathematics in Lean using Mathlib, and includes a catalogue of basic tactics.&amp;lt;ref name=&amp;quot;fm&amp;quot;&amp;gt;Kevin Buzzard, &amp;#039;&amp;#039;Formalising Mathematics&amp;#039;&amp;#039;, course handbook, Imperial College London, 2024 edition. https://www.ma.imperial.ac.uk/~buzzard/xena/formalising-mathematics-2024/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Courses are offered elsewhere too; this page lists only those whose published materials could be checked.&lt;br /&gt;
&lt;br /&gt;
== How quickly mathematicians learn ==&lt;br /&gt;
&lt;br /&gt;
The authors of the formalisation of perfectoid spaces reported that mathematicians without training in computer science can become proficient with a proof assistant within a short time.&amp;lt;ref name=&amp;quot;perfectoid&amp;quot;&amp;gt;Kevin Buzzard, Johan Commelin and Patrick Massot, &amp;quot;Formalising perfectoid spaces&amp;quot;, in &amp;#039;&amp;#039;CPP 2020: Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs&amp;#039;&amp;#039;, 2020, pp. 299–312. doi:10.1145/3372885.3373830. arXiv:1910.12320&amp;lt;/ref&amp;gt; Buzzard hoped that his Fermat project would be a good source of smaller Lean projects for doctoral students in number theory who want to learn the language.&amp;lt;ref name=&amp;quot;general&amp;quot;&amp;gt;Kevin Buzzard, &amp;quot;A Lean formalisation of Fermat&amp;#039;s Last Theorem&amp;quot; (the project&amp;#039;s general information), written December 2023. https://github.com/ImperialCollegeLondon/FLT/blob/main/GENERAL.md&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What it does not teach ==&lt;br /&gt;
&lt;br /&gt;
Lean checks that a proof is correct. It does not show which proof is clearest, and a proof written for Lean can be longer and harder to read than one written for people. Course texts such as Macbeth&amp;#039;s present themselves as books about writing careful, rigorous proofs, with Lean as the companion that checks them.&amp;lt;ref name=&amp;quot;mop&amp;quot; /&amp;gt; The gap between a proof that Lean accepts and a proof a reader understands is discussed in [[Lean theorem prover/Explainers/Checking instead of convincing|Checking instead of convincing]].&lt;br /&gt;
&lt;br /&gt;
== Next ==&lt;br /&gt;
&lt;br /&gt;
* [[Lean theorem prover/Applications/Machine learning and theorem proving|Machine learning and theorem proving]].&lt;br /&gt;
* [[Lean theorem prover/Explainers/What a proof assistant does|What a proof assistant does]], for a reader starting from the beginning.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>PMA Publisher</name></author>
	</entry>
</feed>