Polyfold and Fredholm Theory (Hofer, Wysocki, Zehnder; Springer 2021, about 1,000 pages), all four parts, formalized in Lean 4: every numbered statement set beside its formal version and classified, and every step the text leaves to the reader written out.
1,508 statements compared · 275 steps left to the reader, written out · 31,302 results checked by Lean, nothing assumed · ~642,000 linespolyfold_faithful → · math_faithful → · Every statement, book beside Lean → · Sign-off page → · A worked example →
What was built
Since September 2026, AI agents (Claude models), directed by me on a personal compute budget, have produced two research-level formalizations in Lean 4 and Mathlib: Milnor’s Topology from the Differentiable Viewpoint (111 statements) and Morse Theory (452 items), and Hofer–Wysocki–Zehnder’s Polyfold and Fredholm Theory.
The polyfold book, about a thousand pages, builds a framework for the moduli spaces of pseudoholomorphic curves from which symplectic Floer theories, Gromov–Witten theory and symplectic field theory are made, where bubbling, symmetries and transversality put the problem beyond classical tools. All four parts are formalized, Chapters 1–19, and the main theorems are proved.
The polyfold library has about 642,000 lines in 1,505 files. Lean confirms that each of its 31,302 declarations rests only on Lean’s three standard axioms: nothing is assumed without proof. Each of the book’s 1,508 numbered statements is set beside its Lean counterpart and classified (same, restated, stronger, hypotheses explicit, extra, narrower, nothing to formalize), and the 275 places where the formal version needs more than a translation of the text are recorded, each with how it is formalized. Around 900 agent sessions did the work, coordinated by a lead model that kept a state log, a memory of rules and written briefs.
Most of those places are not problems in the book. They are the habits of written mathematics: a step called standard, an example the text does not give, a convention left implicit, a claim made in passing in a remark. A reader fills these in without noticing; Lean cannot. Almost always the agents filled them in with a proof. Where a formal statement uses a convention the text leaves implicit, the convention is recorded with its reason; a reader who knows the subject may well find it unnecessary.
A worked example carries the book’s main invariant, Theorem 16.6.6, through on one small polyfold, the orbifold ℂ/ℤ5, where multisections are genuinely needed; every hypothesis holds together, and the invariant is 2/5, also with an infinite-dimensional factor.
What has not been checked. Lean checks every proof. Whether the definitions and statements say what the authors meant is for readers who know the subject; the sign-off pages, which need no Lean, are there for anyone who wants to look. Every audit described on this page was done by AI agents, not by people.
Research approach
I conceived and directed this AI-assisted formalization program, selecting the mathematical problems, defining the standards of correctness, and developing the verification and auditing strategy.
The central challenge was not simply generating machine-checked proofs, but establishing whether those proofs faithfully represented the original mathematics. This required independent audits by separate agents, systematic comparisons with the source texts, and investigations of discrepancies that ordinary Lean verification could not detect.
Claude agents generated the Lean code and accompanying reports under my direction. The project also became a study of the capabilities and limitations of long-horizon AI agents, particularly the gap between satisfying formal checks and accomplishing the intended task.
What I found: failures Lean could not see
- Vacuous hypotheses. A hypothesis of the form “every compatible chart is tame” is false over any nonempty base, so every theorem using it was true and empty. It passed the type checker for weeks before it was caught. A second vacuity came from allowing an empty index set; the witness offered for it only worked when the boundary was empty.
- Definitions weaker than the source. One structure’s version of a definition was weaker than the book’s, while a later definition built on it had been marked as formalized. It was found only when a later agent, working on something else, ran into it.
- Degenerate witnesses. An agent showed a hypothesis was satisfiable using zero fibres and an empty boundary, which shows nothing about the case the theorem is for.
- Statements narrower than their names. A re-check of the 64 main theorems by separate Claude agents, which saw only the book and the Lean code and none of our reports, found six whose names promised more than they stated: part of the theorem was proved under another name, or a hypothesis was read more strongly than printed. None was vacuous, and each was recorded somewhere, but not where a reader would look.
The fix each time was a written rule. After the second vacuity, the lead model wrote “satisfiability witnesses must be non-degenerate” into its memory and into every later brief, and began proposing witnesses before being asked. In this project a rule added to the briefs was a more reliable improvement than a better model, and a cheap one.
What I did not find
Agents did not learn to audit themselves. Self-check language in the sessions did not rise after budget pauses or check prompts; the habit lived in the lead’s memory and briefs, not in the agents. Agents also did not claim to have finished work they had not finished: about two-thirds handed back partial work with an accurate list of what remained, and the rest finished. Their overconfidence ran the other way: in about a hundred places agents wrote that the book was misprinted, false or refuted, where the evidence showed only that a statement does not hold as we read it. A final pass rewrote every one.
Why it matters beyond mathematics
Empty specifications, weakened definitions, degenerate tests and claims narrower than their labels arise wherever agents produce long pieces of work that are checked only automatically: code with passing tests, specifications, proofs. Formal mathematics is a place where they can be measured exactly.