From Z3 at Boulder to Lean at New Hampshire — what I built, what I learned, and how I tracked it, in date order. This page summarizes my own works and learning on theorem proving, not a general stance on the subject — and ends with the November 2026 news, and why a public Lean tutor matters.
Watch the video: https://youtu.be/WuoO5fCQK78
3:13 at 1.25× — the version posted on YouTube. Subtitles are here.
My test was simple, and it came from Markov Logic Networks. Smoking causes cancer. Friends share habits. Alice smokes. Can Bob get cancer? I was motivated by that example by my own allergy to smoking. Logic alone is too strict, so I added probability: logic handles complexity, probability handles uncertainty.
In the Markov Logic Networks deck (DTSC 5000, Prof. James Bird, Fall 2021), the weights are 1.5 for ∀x, smokes(x) ⇒ cancer(x), and 1.1 for ∀x,y friends(x,y) ⇒ (smokes(x) ⇔ smokes(y)). Not everyone who smokes gets cancer. Not all friends smoke.
At Colorado Boulder, in spring 2022 (ATLS 5241), I built a prover on Hilbert's Entscheidungsproblem, with Microsoft's Z3. Z3 proves by refutation: it first tries to prove a claim wrong from the axioms. If it cannot, the claim stands.
Coincidentally, I gave that presentation on World No Tobacco Day, and the whole class laughed, in supportive good humor. Colorado was a really cool experience.
Natural Logic group, Prof. Mihai Surdeanu. Before giving these presentations, in 2021 and 2022, I had attended ESSLI workshops, and NeurIPS, ICLR, and more.
Theorem provers, formal verification, category theory, and SAT and SMT solvers. My generalized approach: formalize the proof, implement it, prove the code correct, run it inside the prover. Example: compilers.
On FOLIO data, a T5 model scored 0.00064 without fine-tuning, and 46.69 on evaluation after fine-tuning. Its errors were telling: Talent Shows became Alent Shows.
First-order logic gives a concrete, deterministic line of reasoning — a white box, not a black box. I tested LangPro, with its analytic tableau proofs.
From September to December 2024, I volunteered to learn Lean for Professor Marek Petrik's RLLab. To understand its deep mathematics, I completed MIT's Functional Analysis and Measure Theory, and worked on proving E[E[x|y]] = E[x].
Lean builds bottom-up: sigma-algebras, measures, function maps in a measure space. Expectation is noncomputable — an integral over theoretical, symbolic functions. My proof-planning steps: write down the original proof; write down the relevant lemmas and axioms; check Lean's documentation for what is already available; what we want to prove may differ from what Lean provides; writing everything from scratch may be reinventing the wheel; tactics matter — for some claims, prove LHS = RHS and RHS = LHS.
My main project, October 24 to December 1, 2024, was verifying the Principle of Optimality — the foundational theorem of deterministic dynamic programming — in Lean4. The two theorems: the Principle of Optimality (an optimal control sequence stays optimal from every state along the way) and the Dynamic Programming Equations (the optimal value function is the unique solution of v*_T(s) = r_T(s), v*_t(s) = max_a [r_t(s, a) + v*_{t+1}(f_t(s, a))]). I proved the equations by backward induction, following a five-step plan, and implemented the definitions in Lean4 as a rough draft — FiniteProbability and MDP structures, value functions, and example principle_of_optimality … := by rfl — which gives errors and is not complete, as was expected from the start. The full content and discussion are on my Lean page: Main Project: the Principle of Optimality in Lean4.
Below is the entire README from my lean-theorem-proving repo, exactly as written there — my volunteer work for the CS department at UNH, September 10 to December 5, 2024, with Prof. Marek Petrik's RLLab.
I started initially as a volunteer participant for giving knowledge transfer and as a courtesy participation, for the CS department, UNH. Thanks for the invite to participate and RLLab organized by Prof. Marek Petrik for Fall 2024.
The following contains weekly summaries from Oct 1st 2024. Presently this covers from Nov 4th 2024, work-in-progress to update from Oct 1st 2024. Please click on corresponding time-wise options to see the respective statuses.
The following notes with MM-DD-YYYY format is my notes of my own study that I included here.
I previously studied about Proof systems, Theory of Computation, Linguistics, First Order Logic, Second Order Logic, Decidability, Godel's theorem, Symbolic Logic, Semiotics, etc. My powerpoint slides attempt to depict how proof theory and systems intersect with each one of these theoretical topics and can help with assimilating the information for better understanding:
The list of topics covered in this presentation are as follows:
The actual weekly meeting minutes and discussions are noted here:
lean-meeting-notes The tabs in this document provide information of weekly meetings and the zulip chats.
To understand the implementation of Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic, I completed two MIT courses: "Introduction of Functional Analysis" and "MeasureTheory". Both are available on MIT Opencourseware. After completing this course, understanding MeasureTheory implementation on LeanProver - helped to make sense why the Lean developers implemented it the way they did. These two courses are each 8 - 10 hours duration along with pausing to understand some additional stuff. MIT Opencourseware has a 100+ page lecture notes for each one of this.
YouTube playlist, lectures 1, 2,4,6,7,8,9, and 10 are sufficient. Introduction to Functional Analysis
The LeanProver's implementation is bottom up - for example, to build a theorem on conditional expectation, define sigma-algebras, measures, function maps in Measurespace, define probability as a Measure space, define random variable as a map to probability to generate a measurespace.
My proof for E[E[x|y]] = E[x] in one of homework questions also contains one proof using Omega notations i.e. Measure theoretic but its not as deep as that of LeanProver. But then I thought, I could create my own functions, theorems, axioms but in reverse direction - create something abstract like E as a function, P as a probability as a function, define axioms involving probability, just that which is required for Conditional Expectation. But as per Marek's suggestion on Nov 4th 2024's meeting, I understand why this direction of top to-bottom approach i.e. abstract implementation to specific is more work and possibly re-work.
After completing the MIT courses, I went over the implementation of Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic.
variable {Ω : Type*} [MeasurableSpace Ω] {X : Ω → ℝ } (hX : Measurable X)
There is one keyword called as noncomputable which is interesting which explains a lot why lean is not SymPy or NumPy.
A function such as Expectation i.e. E[x] is noncomputable since in real, if an integral needs to be computed, we compute over the data. But since this is theoretical, we do not necessarily need to implement algorithms that calculate the integral since Integral itself is over a theoretical and symbolic functions.
Although for binomial we can actually compute as it finite and countable, but for Expectations, due to integrals and continuous spaces, we leave it noncomputable.
Real.hasPow is noncomputable since lean cannot calculate e^e but can calculate 2^2 = 4.
We could theoretically call recursive operations, so Lean is going to compute something like (a^n)^k where a has some recursive function, but then lean would be like a SymPy but it is not.
-- I was hoping this should have been defined by the axioms of the probability, but I dont know PMF is defined by itself as a standalone function that can be overwritten or extended.
-- Basically a function mapping α → ℝ0∞ such that Σf = 1.
HasSum is a Topological Monoid, since we do not actually compute the probabilities, but only need a condition that verifies sum is equal to 1 but theoretically in Measure Theory and Algebraic notations.
HasSum is a monoid.
It may be easier to prove using Omega notations (measure theory implementations that already exist in Lean4).
Tactic reflexive applied on any type no matter how complex the type maybe
Reference: Tactics in Lean
Review comments from Marek for DeterministicDP.lean
Write the proof first, check what the prover already has, and do not reinvent the wheel.
119 → 333
Problems solved — until 2025, then in 2026. That count is as shown in the video in the post below; it was not independently verified here.
“Mathematicians have been building castles in the sky, at a rate of a couple lovingly handcrafted bricks per year. The industrial age of math has begun in 2026.”
Axiom claimed two results in Lean: the Extended Riemann Hypothesis (RH for Dedekind zeta functions) of totally real and CM fields, and a new route to the generalized Ramanujan–Petersson conjecture using the Weil conjectures. A skill I never thought would help is suddenly everywhere. Yet LeanTutor is still a Berkeley classroom tool, not a public one.
Here is the pattern: first, AI claims challenge age-old science. Then, the tool used to verify it is released, to fast-track learning. But right now, LeanTutor is still not publicly available.
And that matters, because Lean is a language in itself. Switching from English to Lean, or from Python to Lean, is a huge context jump, and a cognitively overloading task. Lean also changes versions fast, so there is always significant catching up. That is why a public Lean tutoring tool matters, so many mathematicians and scientists can access it and keep up.