Tuomo Kuusi and I have formalized some of the main results of our recent paper on quantitative stochastic homogenization in the Lean 4 proof assistant. The repository is available here.
In that paper we developed a coarse-graining theory for elliptic equations in divergence form, which was applied to obtain quantitative stochastic homogenization results in the high ellipticity contrast regime (see my previous post). This formalization project is significantly more complex compared to my previous work with Julia Kempe on the formalization of De Giorgi-Nash-Moser theory. As for that project, the Lean code was written entirely by LLMs: in this case, it was GPT-5.5 (primarily) and Claude Opus 4.6–4.8, under our supervision, using the Claude Code and Codex agentic coding tools. The total project contains 449k lines of lean code built on top of mathlib, which is 20% of the total size of mathlib. It compiles (starting from mathlib) in about 26 minutes on an 8-core/32GB ubuntu machine.
Formalizing our paper required rewriting the theory as a self-contained manuscript, which is in effect a new set of lecture notes on the subject. The manuscript was itself written with the aid of GPT 5.5, under our close supervision.
The manuscript and the Lean development are kept in exact correspondence: every numbered statement in the manuscript maps to a specific Lean declaration, recorded theorem by theorem in a correspondence document in the repository. The manuscript is included with the formalization and is available here. We plan to further develop and polish it in the near future.
The development contains no sorry and no custom axiom. The main theorems reduce to Mathlib’s three standard foundational axioms:propext, Classical.choice, and Quot.sound. This is checked by an axiom-audit file in the repository. Every numbered statement in the manuscript is formalized; where a formalized statement is less general than the manuscript statement or carries an additional hypothesis, this is recorded in the correspondence document and flagged in the manuscript (there are only a few of these, and they are minor).
Quantitative stochastic homogenization is a comparatively demanding target. The argument is not a single deterministic estimate but a combination of deterministic elliptic PDE theory, probability — stationary random fields, concentration inequalities, independence — and a renormalization-group scheme that passes between scales. Each of these is substantial on its own; the formalization required all of them to interlock. We also needed to formalize a lot of background material (function spaces, elliptic estimates) that is not yet available in mathlib.
That a proof of this kind can be carried through in full suggests that the formalization of contemporary research papers is now broadly feasible, and not limited to classical or self-contained results.