Formalizing Hironaka’s Resolution of Singularities
Introduction
In 1964, Heisuke Hironaka proved the existence of a resolution of singularities for arbitrary algebraic varieties In characteristic zero.. This became a pillar of modern algebraic geometry and is celebrated as one of the great mathematical accomplishments of the 20th century.
In the words of Hauser (2003), Hironaka showed that “singular curves are the shadow of smooth curves in higher dimensional space.” Stated more generally, it is always possible to reparametrize a singular variety with a smooth manifold embedded in a higher-dimensional space.
Examples of resolution of singularities
Cusp
Click the background to start or stop slow rotation. A hold or drag stops rotation. Drag the background or use arrow keys to rotate. Home resets the view. In the last step, drag a marked point or use arrow keys to move it.
Algebraic geometry studies the zeros of polynomials.
Hironaka’s resolution of singularities makes it possible to bring in techniques for studying smooth manifolds to the more complicated singular setting, which has opened up new ways to analyze and prove theorems about a wide range of objects across many different mathematical fields.
One of those fields is statistical learning theory. Sumio Watanabe showed, using resolution of singularities, that the asymptotic behavior of the (Bayes) generalization error in the large-data limit is determined by a geometric invariant of the population loss called the real log canonical threshold (RLCT). That is, resolution of singularities is a key step linking the geometry of the loss landscape to model generalization. Watanabe’s synthesis of Bayesian statistics, statistical physics, and algebraic geometry is now known as “singular learning theory” (SLT).
At Resolution (which is named, in part, after the resolution of singularities), we are pursuing SLT as a starting point to develop a more complete theory of generalization, because we believe that understanding and controlling generalization are key questions in AI alignment. In this context, autoformalizing the resolution of singularities lays the groundwork for further automated research into the relationship between loss landscape geometry and generalization.
This post describes how we established that groundwork. As it turns out, there is still a large gap between autoformalizing a theorem and structuring the associated proof so that it can be built on in further research. That gap leaves room, for now, for human judgment and taste to guide the process of research automation. Below, we discuss how this new way of interacting with mathematics through AI agents presents new obstacles and questions for the burgeoning science of research automation.
The result
Resolution of singularities is a family of theorems, for algebraic varieties in the language of schemes and for real and complex analytic spaces. Hironaka’s original statement, Main Theorem I, is the simplest. It says that every variety over a field of characteristic zero becomes smooth after a blow-up centered on its singular points. We can state this theorem using Mathlib plus a definition of blow-up:
-- Hironaka (1964), Main Theorem I
theorem exists_isBlowUpAlong_smooth {k : Type u} [Field k] [CharZero k]
(X : Scheme.{u}) (f : X ⟶ Spec (.of k)) [LocallyOfFiniteType f] [QuasiCompact f]
[IsSeparated f] [IsIntegral X] :
∃ (X' : Scheme.{u}) (π : X' ⟶ X) (I : X.IdealSheafData),
-- `π` is a blow-up of `X` along `I`
π.IsBlowUpAlong I ∧
-- the centre `I` is supported exactly on the singular locus of `X`
(I.support : Set X) = (f.smoothLocus : Set X)ᶜ ∧
-- `X'` is smooth over `k`
Smooth (π ≫ f) ∧
-- `π` is proper
IsProper π ∧
-- `π⁻¹(X_sm) → X_sm` is an isomorphism, `X_sm` the smooth locus of `X` over `k`
IsIso (π ∣_ f.smoothLocus)
Our Lean library, hironaka, proves this theorem and its stronger modern forms for schemes and for analytic spaces. The entry point is the project documentation, which contains a blueprint comparing each theorem with its source, and the API reference. The statements themselves are in the challenge files: the algebraic, analytic and Mathlib-only main theorems.
The proof follows several lines of work. On the algebraic side, the main sources are Hironaka’s original theorems, Kollár’s account of principalization and resolution, and Włodarczyk’s embedded resolution theorem, with a step patched using Bravo and Villamayor’s stronger form of embedded desingularization. The analytic results also use Bierstone and Milman’s principalization theorem and Włodarczyk’s compatible-family formulation. The source record maps these works to the Lean statements and records changes to their hypotheses and conclusions.
Earlier work in this line includes Jean Giraud’s theory of maximal contact, Orlando Villamayor’s constructive resolution and local uniformization, and work by Santiago Encinas with Villamayor and Herwig Hauser. These earlier papers provide historical context; they are not separate claims that the library formalizes each paper in full.
The process
This project had two stages: first, the autoformalization itself; second, a substantial refactoring effort to turn the proof into something that is more approachable for humans and, perhaps, machines.
Growing a proof
Divide the proof into small tasks across twelve branches.
Stage 1: Autoformalization. On September 4th, inspired by Anthropic’s autoformalization of Fermat’s Last Theorem, Chris Elliott decided to attempt an autoformalization of the resolution of singularities.
Elliott started by working with agents to develop two plans: a high-level, human-interpretable version and a detailed (112-page) plan divided into atomic steps that closely followed the existing literature (favoring the more modern approaches of Kollár and Włodarczyk over Hironaka’s original). The plan drew on ideas from public formalization efforts like Prove2Me, Tau Ceti, and Palomar, such as freezing the statements to be proved separately from their proofs and using checked proof sketches. Elliott then deputized an orchestrator agent to carry out the plan, spinning up agents to do pen-and-paper math, write Lean, and handle support functions like checking that things were staying on track.
The execution phase required little scaffolding beyond the initial plan and some agent skills distilled from earlier internal autoformalization efforts. By contrast, Anthropic reported that using Prove2Me was integral to autoformalizing Fermat’s Last Theorem. Beyond borrowing ideas during planning, we didn’t need the platform itself (with features like strict immutability and a shared-state model). We don’t know how much more scaffolding would have helped, or how much less we could have gotten away with. But the relative lack of scaffolding suggests that the bitter lesson holds here too.
During the execution phase, the agents Predominantly Fable 5.1 with occasional checks by Astra. operated largely autonomously. They finished the proof within a week, on September 10th, and completed a final audit on September 11th. In total, this took on the order of 100B input tokens (90% cache reads) and about 300 million output tokens (totaling an estimated $135,000 in token spend), and produced about 600k lines of Lean.
Elliott intervened in only a few cases. At the start, he gave input on the proposed proof approach; during the formalization, he stepped in at ~30 points, providing both minor feedback and guidance when the models got stuck, which happened especially at the interfaces between different human pieces of mathematics. We think we could have gotten by with even less human input, at the cost of a higher token spend.
Stage 2: Refactoring. Much of the refactoring was the prosaic work of renaming various intermediate steps and factoring out common definitions. Other parts of the clean-up were more subtle and required judgment. Organizing Lean code isn’t quite like organizing other kinds of code, since it relies more on grouping statements and definitions by their meaning rather than how they’re used for the specific proof at hand. Doing this well requires taste in ways the models don’t always exhibit spontaneously.
Figures 3 and 4 show the effect of the refactor, separating the general mathematics from the proof machinery, and moving definitions used in the statements of main theorems into compact Defs.lean files.
Mathematics and proof machinery
Before September 23 · coloured by where each file ended up
177k241k28k16k44k lines
After October 3 · folders by mathematical object, proofs in Resolution
191k259k38k lines
What you have to read to check the theorem statements
Before September 23
After October 3
This was the most human-intensive part of the project, though at half a million lines of Lean, even that human taste had to be exercised through the AIs. Billy Snikkers and Adam Newgas spent two weeks managing several parallel coding agents throughout the refactor. Throughout this stage, the main practical bottleneck both for humans and for AIs was Lean compilation times. In a codebase this large, every sweeping change triggers expensive recompilations.
We also set up Comparator, so that others can trust the result without reading the whole library. It checks that the proof establishes exactly the statements in the trusted challenge files, using only permitted axioms.
Proofs > statements
At the start, we were skeptical that formalizing resolution of singularities was worth it. Even for the applications we care about in Watanabe’s textbook, the result is just a black box. Why not assume it as an axiom and move on?
Autoformalization is a prerequisite for future mathematics. We began this project to see whether we could successfully replicate large-scale autoformalization efforts outside the frontier labs. We expect that mathematics will increasingly be developed alongside Lean, and projects like this are practice for that future. As automated research floods the field, formalization will become an increasingly necessary quality-control measure for filtering through the slop. We expect that including a Lean proof will become basic hygiene, and omitting one will be as unacceptable as omitting proper attribution.
Axiomatization is nontrivial. With statements as complex as resolution of singularities, it is easy to write down an incorrect axiomatization. The best way to avoid this is to formalize the full thing. So the question isn’t so much whether we should go back to autoformalize old results, but when: should we start building the foundations now, or wait for next year’s models that will accomplish the same at a fraction of the price?
We’re not sure what the answer is, but we were surprised by two benefits that argue for starting now:
Often you need the proof, not just the statement. If you want to build on a result, you will often need the internals of its proof. You may need a variation of the canonical statement; even if the variant appears in existing literature, assuming each one as its own axiom invites error. Some extensions also require reusing ingredients from the proof or reapplying its techniques. Having the formalization prevents a profusion of black-box hypotheses that become ever more baroque and uncertain.
Models seem easier to direct when given access to the formalization. In our experience, we’ve found that models seem to work better when they can access the formalization, even when they already have the prose mathematics in context. We haven’t yet quantified the size of this effect, partly because it’s a new question and partly because large-scale autoformalization experiments are expensive to iterate on.
We have already seen both benefits from autoformalization in using this library to extend parts of singular learning theory. Formalizing resolution of singularities lets us automate more of the theory, for example, to better understand sampling, and that understanding is what lets us shape how models learn, which is the goal of what we call patterning. We are excited to share these results in the coming months.
Soon, our autoformalization efforts will exhaust the fundamental mathematics that our teams need to build on. After that, the point of autoformalization shifts towards accelerating subsequent research and helping us understand what the automated research is doing.
We expect the coming industrialization of mathematics to make possible a new, rigorous science of research automation. For the first time, questions like how much human involvement and scaffolding a project like this needs can be studied systematically. That is part of the work we plan to do.
We are hiring!
If this kind of work excites you, we’d like to hear from you. We’re looking for people who know Lean and want to build the formal foundations for a science of learning, and for research engineers who want to work on research automation, from agent orchestration to making large Lean builds fast.
Acknowledgments
Chris Elliott did the initial work of managing the autoformalization. Most of the autoformalization was conducted by Claude Fable-5.1 instances, with occasional checks by Astra instances. Billy Snikkers and Adam Newgas led the refactoring effort. Chris also contributed to the cleanup and refactoring of the library. Jesse Hoogland led the writeup. Daniel Murfet provided feedback on a draft of this post.
This work depends on the work of several generations of mathematics. The library follows Hironaka, Kollár, Włodarczyk, Bierstone and Milman, and other authors listed in the references below. We also depend on the work of the Lean and Mathlib communities.
Mathematical background
The repository bibliography also records the sources used to develop the underlying algebra and analysis. The code cites the following works in addition to the main proof sources:
- Resolution and geometry: Bierstone and Milman on semianalytic and subanalytic sets and functoriality; Hauser’s introductions to resolution and blowups.
- Algebra and schemes: the Stacks Project, Hartshorne (1977), Matsumura (1989), and Atiyah & Macdonald (1969).
- Complex analytic spaces and sheaves: Gunning & Rossi (1965); Grauert and Remmert (1971, 1984); Narasimhan (1966); Freitag (2017); and Demailly (2012).
- Real analytic geometry: Cartan (1957) and Bruhat & Whitney (1959).
Learn more
- Proof repository: the code and build instructions.
- README: the main theorems with their sources, and how to check them.
- The main theorems: algebraic, analytic and Mathlib-only.
- Statement checks: the challenge files and Comparator instructions.
- The API reference and proof blueprint.
- Hauser’s geometric introduction: start with the cusp and cone on page 326.
- Kollár’s lectures: the structure of resolution and its proof. The Seattle lecture is available on arXiv.
- Watanabe on singular learning theory: resolution, Bayesian evidence, and the real log canonical threshold.
References
- Heisuke Hironaka (1964). Resolution of singularities of an algebraic variety over a field of characteristic zero. I, II. Annals of Mathematics. Second Series, 79, pp. 109-203, 205-326. Part II: https://doi.org/10.2307/1970547. ↩1 ↩2 ↩3
- Herwig Hauser (2003). The Hironaka theorem on resolution of singularities (or: A proof we always wanted to understand). Bulletin of the American Mathematical Society, 40, pp. 323-403. ↩1 ↩2 ↩3
- Ravi Vakil (2004). Intersection Theory, Class 14. Lecture notes, November 8, 2004. The cusp blowup is on page 3. ↩
- Sumio Watanabe (2001). Algebraic geometrical methods for hierarchical learning machines. Neural Networks, 14(8), pp. 1049-1060. ↩
- Sumio Watanabe (2009). Algebraic Geometry and Statistical Learning Theory. Cambridge University Press. ↩1 ↩2
- János Kollár (2007). Lectures on Resolution of Singularities. Annals of Mathematics Studies. Princeton University Press, 166. Chapter 3 circulated as Resolution of Singularities: Seattle Lecture, arXiv:math/0508332, first posted in 2005 and revised in 2007 (v3). The formalization follows item numbers in the 2007 arXiv revision. ↩1 ↩2
- Jarosław Włodarczyk (2005). Simple Hironaka resolution in characteristic zero. Journal of the American Mathematical Society, 18, pp. 779-822. ↩
- Ana Bravo, Orlando E. Villamayor U. (2003). A strengthening of resolution of singularities in characteristic zero. Proceedings of the London Mathematical Society, 86(2), pp. 327-357. ↩
- Edward Bierstone, Pierre D. Milman (1997). Canonical desingularization in characteristic zero by blowing up the maximum strata of a local invariant. Inventiones Mathematicae, 128, pp. 207-302. Item numbers follow the arXiv version. ↩
- Jarosław Włodarczyk (2009). Resolution of singularities of analytic spaces. Proceedings of the 15th Gökova Geometry–Topology Conference (2008). International Press, pp. 31-63. ↩
- Jean Giraud (1974). Sur la théorie du contact maximal. Mathematische Zeitschrift, 137(4), pp. 285-310. ↩
- Orlando Villamayor (1989). Constructiveness of Hironaka's resolution. Annales scientifiques de l'École Normale Supérieure, 22(1), pp. 1-32. ↩
- Orlando E. Villamayor U. (1992). Patching local uniformizations. Annales scientifiques de l'École Normale Supérieure, 25(6), pp. 629-677. ↩
- Santiago Encinas, Orlando E. Villamayor U. (1998). Good points and constructive resolution of singularities. Acta Mathematica, 181(1), pp. 109-158. ↩
- Santiago Encinas, Herwig Hauser (2002). Strong resolution of singularities in characteristic zero. Commentarii Mathematici Helvetici, 77(4), pp. 821-845. ↩
- Anthropic (2026). Formalizing Fermat's Last Theorem. September 4, 2026. ↩1 ↩2
- Shuze Chen, Kunal Marwaha, Xiaoyang Lu, Henry Yuen, Tianyi Peng (2026). Prove2Me: An Open Collaborative Platform for Scaling Math Formalization. arXiv:2608.28433, version 2, August 31, 2026. ↩1 ↩2
- Tau Ceti contributors (n.d.). Tau Ceti. Software project and review process. Accessed October 1, 2026. ↩
- Jeremy Avigad, Matthew Ballard, Jaume De Dios, Nestor Guillen, Bryna Kra, Kim Morrison, Terence Tao, Ravi Vakil, Akshay Venkatesh (2026). Palomar: a registry of Lean-verified mathematics. Founding statement, August 18, 2026. ↩
- Lean FRO (n.d.). Comparator. Software repository. Accessed October 1, 2026. ↩1 ↩2
- Leonardo de Moura, Sebastian Ullrich (2021). The Lean 4 Theorem Prover and Programming Language. Automated Deduction, CADE 28. Springer, pp. 625-635. The Hironaka repository uses Lean 4.33.1. ↩
- The mathlib Community (2020). The Lean Mathematical Library. Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs. ACM. Project-recommended citation. The Hironaka repository uses Mathlib 4 at v4.33.1. ↩
- Edward Bierstone, Pierre D. Milman (1988). Semianalytic and subanalytic sets. Publications Mathématiques de l'IHÉS, 67, pp. 5-42. ↩
- Edward Bierstone, Pierre D. Milman (2008). Functoriality in resolution of singularities. Publications of the Research Institute for Mathematical Sciences, 44, pp. 609-639. ↩
- Herwig Hauser (2014). Blowups and resolution. The Resolution of Singular Algebraic Varieties. Clay Mathematics Proceedings. American Mathematical Society, 20, pp. 1-80. ↩
- The Stacks Project Authors (n.d.). Stacks Project. Cited by tag. ↩
- Robin Hartshorne (1977). Algebraic Geometry. Graduate Texts in Mathematics. Springer, 52. ↩
- Hideyuki Matsumura (1989). Commutative Ring Theory. Cambridge Studies in Advanced Mathematics. Cambridge University Press, 8. First paperback edition with corrections, 1989. English edition first published in 1986. Translated by Miles Reid. ↩
- Michael F. Atiyah, Ian G. Macdonald (1969). Introduction to Commutative Algebra. Addison-Wesley. ↩
- Robert C. Gunning, Hugo Rossi (1965). Analytic Functions of Several Complex Variables. Prentice-Hall. Reprinted, AMS Chelsea Publishing, 2009. ↩
- Hans Grauert, Reinhold Remmert (1971). Analytische Stellenalgebren. Grundlehren der mathematischen Wissenschaften. Springer, 176. ↩
- Hans Grauert, Reinhold Remmert (1984). Coherent Analytic Sheaves. Grundlehren der mathematischen Wissenschaften. Springer, 265. ↩
- Raghavan Narasimhan (1966). Introduction to the Theory of Analytic Spaces. Lecture Notes in Mathematics. Springer, 25. ↩
- Eberhard Freitag (2017). Complex Spaces. Lecture notes, Universität Heidelberg. ↩
- Jean-Pierre Demailly (2012). Complex Analytic and Differential Geometry. Université de Grenoble I. Online book. ↩
- Henri Cartan (1957). Variétés analytiques réelles et variétés analytiques complexes. Bulletin de la Société Mathématique de France, 85, pp. 77-99. ↩
- François Bruhat, Hassler Whitney (1959). Quelques propriétés fondamentales des ensembles analytiques-réels. Commentarii Mathematici Helvetici, 33, pp. 132-160. ↩
- Sumio Watanabe (2013). A Widely Applicable Bayesian Information Criterion. Journal of Machine Learning Research, 14(27), pp. 867-897. ↩