Google DeepMind published formal-papers on GitHub, an open Lean 4 collection of machine-checked mathematical and computer science formalizations built on PaperLib, a shared library atop Mathlib, TauCeti, cslib, and cslib-frontier. The README says content was AI generated, warns readers to expect mistakes, and documents megatheorems: unproved but statement-visible axioms when missing theory would otherwise block formalization.
Why PaperLib exists
Formalizing a research paper often needs lemma infrastructure absent from Mathlib. DeepMind centralizes that backlog in PaperLib, then splits finished papers into formal-papers-YYYY repositories (2026 back through historical buckets, plus pre-1500).
PaperLib is broader and less curated than upstream libraries. Maintainers plan to delete PaperLib modules when Mathlib absorbs them.
Megatheorems and axiom honesty
Formal verification seal: puzzle pieces fitting with a green check
When a paper needs a famous theorem whose proof requires large missing libraries, PaperLib can declare a megatheorem: a tagged statement backed by a private axiom visible to Lean's kernel. Dependents pick up megatheorem_corollary tags.
Tools:
lake exe axioms --root Paperslake exe axioms --module Papers.arxiv_2407_14091.MainTheorem#print axiomsvialake env lean --stdin
Each paper package records dependencies in formalization.yaml. When someone later proves the megatheorem, the axiom drops automatically for downstream theorems.
That design matters after Opus Lean CPython bugs post and AlphaProof Signal verification taught readers to ask what exactly was checked.
Expect mistakes: README guardrails
DeepMind repeats four cautions:
- Kernel-checked proofs do not stop wrong statements.
- Megatheorem misformulations slip past proof checking.
- Per-paper README notes document translation discrepancies; they are not accusations against original authors.
- Formalized version may not be the latest arXiv v.
Treat artifacts as experimental research, not homework answers.
Quickstart commands
Math proof chalkboard: node chain ending in a green check
Prerequisites: git 2.25+, curl, elan.
Example from README for arXiv:2407.14091 in formal-papers-2024:
git clone --filter=blob:none --sparse https://github.com/google-deepmind/formal-papers-2024git sparse-checkout set arxiv/2407.14091lake exe cache getlake build
Optional linters: lake exe runLinter, lake exe module-system.
For PaperLib search, clone formal-papers, run bash scripts/bootstrap.sh, then python3 scripts/search_paper_lib.py --topics Analysis.
Relation to OpenAI's December topology drop
OpenAI's exotic four-spheres preprint ships PDF plus LaTeX. DeepMind's release ships executable Lean with axiom reports. Teams building AI-for-science pipelines should plan for both modalities in review queues.
Relation to prior DeepMind formal posts
explainx.ai already covered AlphaProof code verification and Hadwiger Gemini Lean proof. formal-papers is the library layer those efforts can feed, similar in spirit to Anthropic lattice Lean papers.
Repository layout and year-split packages
The main repo holds PaperLib/ lemmas and annotations/ metadata using literature-links conventions. Per-year repos (formal-papers-2026, formal-papers-2025, down to historical buckets) host individual Lake packages so you sparse-checkout only what you need.
That split keeps git clone sizes manageable when Mathlib cache already consumes gigabytes. It mirrors how Left to Solve ships challenge lists separate from proof attempts.
Tooling beyond lake build
README documents:
lake exe runLinterfor style and sorry checks configured strictlake exe module-systemfor Lean 4 module graph hygienescripts/search_paper_lib.pyfor topic and carrier grep
For CI, you can wire lake exe axioms into GitHub Actions and fail when unexpected axioms appear in new PRs. That pattern helped Certik TensorLean cultures adapt to kernel verification; formal math benefits similarly.
AGENTS.md and contributor workflow
CONTRIBUTING.md plus .agents/skills/formalize hint DeepMind expects agent-assisted formalization with human review. If you contribute:
- Pick a permissively licensed paper.
- Open a discrepancy issue when informal statements do not match Lean.
- Prefer proving megatheorems over adding invisible axioms when Mathlib catches up.
Risk disclosure for downstream ML papers
Teams citing PaperLib lemmas in NeurIPS-style proofs should attach formalization.yaml axiom lists as supplementary material, the same way CLIP benchmarks attach eval scripts.
What to run before you cite a lemma
- Sparse-checkout only the arXiv ID you need.
- Run
lake exe axiomsand store the output beside your internal memo. - Read the paper README discrepancy section before you tweet theorem X formalized.
- File GitHub issues using the Report Discrepancy template if you find statement bugs.
Example workflow for one arXiv paper
Suppose you care about arXiv:2407.14091 (README quickstart example).
- Sparse clone
formal-papers-2024and checkout only that directory. - Run
lake exe cache getto pull Mathlib artifacts. lake buildthe package; capture warnings as errors because sorry is disallowed.lake exe axioms --moduleon the main theorem file; save output in your paper notes.- Read paper README discrepancies before citing lemma names in slides.
If axioms include megatheorem tags, link the formalization.yaml hash in your internal wiki so teammates know which literature results were assumed.
How PaperLib relates to Mathlib growth
Mathlib maintainers merge community lemmas on schedules DeepMind does not control. PaperLib is an incubator: faster AI formalization, higher mistake rate, eventually upstreamed or deleted.
That mirrors industry data lakes beside warehouses. Teach interns the difference so they do not treat PaperLib as Mathlib quality by default.
Comparison with Opus CPython formalization
Anthropic Opus CPython Lean project found hundreds of implementation bugs because code was messy but executable. PaperLib targets published math, where mistakes are logical misstatements, not off-by-one C bugs.
Both show formal methods returning value when automation scales review bandwidth.
Licensing and what is not redistributed
README repeats: only permissively licensed works are formalized; PDFs stay with publishers. Lawyers should confirm your institution can run Lean on derivative formalizations before shipping product features that embed theorem text.
Failure modes the README foreshadows
| Failure | Symptom | Mitigation |
|---|---|---|
| Misstated definition | Kernel proves wrong theorem | Read discrepancy notes |
| Megatheorem drift | Hidden axiom in corollary chain | lake exe axioms |
| Wrong paper version | Formalized v1 not v3 arXiv | Check README version note |
| Overclaimed correctness | Press says proved | Quote README Expect Mistakes |
Teaching junior engineers to read failure tables before tweet threads is part of formal methods literacy now that labs ship math like models.
Why DeepMind open-sourced now
Top labs compete on trust as much as benchmarks. After Gemini Cohen-Lenstra and cell biology models, PaperLib signals long-horizon investment in checkable science, not one-off demos.
Stars on day one are noise; watch issue tracker velocity and Mathlib PRs cherry-picking PaperLib lemmas.
Bootstrap and Python search script
The README scripts/bootstrap.sh prepares local tooling; search_paper_lib.py --carriers helps when you forgot Mathlib module paths. Require Python 3.10+ in CI images alongside elan.
If lake exe cache get fails behind corporate proxies, mirror cache tarballs per Lean community docs before blocking formal-papers pilots on IT tickets.
Formal-papers versus formal-papers-2026
The year repos will accumulate December uploads faster than this overview post updates. Subscribe to GitHub releases on formal-papers-2026 if you formalize current arXiv work; stay on formal-papers root if you extend PaperLib itself.
Annotating PaperLib with literature-links
The annotations/PaperLib/ tree uses literature-links metadata so formalized lemmas trace to DOI and arXiv records. When you browse a carrier (for example LeibnizAlgebra in the README search example), you are navigating both Lean names and bibliographic graph edges.
Product managers building citation widgets can mirror that separation: human-readable reference, machine-checked artifact, explicit axiom debt.
When to fork versus upstream
If your company formalizes trade-secret algorithms, do not open PaperLib PRs with proprietary lemmas. Fork privately, run the same tooling, and contribute only sanitized megatheorems after legal review.
Public formal-papers is for published science, not unreleased model architectures.
Deep dive on megatheorem_corollary tagging
Dependents marked megatheorem_corollary inherit visibility into which literature results were assumed. When Mathlib eventually proves the parent megatheorem, Lean rebuilds corollaries without manual grep across hundreds of files.
That is technical debt tracking mathematicians understand as conditional results, automated the way software teams track open work items linked to issues.
githooks and CI hints
The repo ships .githooks and .github workflow stubs so contributors run axiom audits before push. If you vendor PaperLib lemmas into a product, vendor the same hooks or reimplement them in your monorepo lint stage.
Lake warn.sorry = true with warningAsError means partial proofs fail CI, aligning formal-papers with production strictness rather than notebook culture.
Reading list for new formal engineers
- Lean 4 theorem proving basics on leanprover community pages.
- Mathlib style guide for naming.
- This README Expect Mistakes section.
- explainx Opus CPython bugs for scale reference.
- Left to Solve for agent loops.
Apache-2.0 licensing lets you experiment commercially with PaperLib code, but theorem text is not a patent grant on underlying math. Keep lawyers in the loop when shipping formal verification features to paying customers. Document axiom debt in SOC2 packets the same way you document third-party OSS licenses. Security reviewers increasingly ask what you proved versus what you assumed when AI writes proofs.
Issue templates on GitHub separate PaperLib bugs from paper-specific discrepancies so triage stays fast. When you file, paste lake exe axioms output and the formalization.yaml hash if present. Screenshots without axiom lists slow maintainers down. Good bug reports read like compiler output, not marketing blurbs. Attach Lean version from lean-toolchain too.
