cd /news/artificial-intelligence/google-deepmind-formal-papers-lean-4… · home › topics › artificial-intelligence › article
[ARTICLE · art-182236] src=explainx.ai ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Google DeepMind formal-papers: Lean 4 PaperLib and Megatheorems

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 layered atop Mathlib, TauCeti, cslib, and cslib-frontier. The README states the content was AI generated and warns readers to expect mistakes, and it documents megatheorems — unproved but statement-visible axioms declared when missing theory would otherwise block formalization, checkable via commands such as `lake exe axioms --root Papers`. Finished papers are split into formal-papers-YYYY repositories (2026 back through historical buckets plus pre-1500), and DeepMind plans to delete PaperLib modules once Mathlib absorbs them.

key takeaway

DeepMind's formal-papers ships executable Lean 4 with megatheorems declared as private axioms visible to Lean's kernel, and `lake exe axioms --root Papers` reports them so downstream theorems automatically drop the axiom once the megatheorem is proved.

by read8 min views1 publishedDec 5, 2026
Google DeepMind formal-papers: Lean 4 PaperLib and Megatheorems
Image: Explainx (auto-discovered)

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 Papers

  • lake exe axioms --module Papers.arxiv_2407_14091.MainTheorem

  • #print axioms vialake 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:

  1. Kernel-checked proofs do not stopwrong statements .
  2. Megatheorem misformulations slip past proof checking.
  3. Per-paper README notes documenttranslation discrepancies ; they are not accusations against original authors.
  4. Formalized version may not be thelatest 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-2024`
  • git sparse-checkout set arxiv/2407.14091
  • lake exe cache get
  • lake 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 runLinter forstyle and sorry checks configured strict
  • lake exe module-system forLean 4 module graph hygiene
  • scripts/search_paper_lib.py fortopic 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:

  1. Pick a permissively licensed paper.
  2. Open a discrepancy issue wheninformal statements do not matchLean .
  3. Prefer proving megatheorems overadding invisible axioms whenMathlib 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 #

  1. Sparse-checkout only thearXiv ID you need.
  2. Run lake exe axioms and store the output beside yourinternal memo .
  3. Read the paper README discrepancy section before you tweettheorem X formalized .
  4. File GitHub issues using theReport Discrepancy template if you findstatement bugs .

Example workflow for one arXiv paper #

Suppose you care about arXiv:2407.14091 (README quickstart example).

  1. Sparse cloneformal-papers-2024 and** checkout** only that directory.
  2. Run lake exe cache get to pullMathlib artifacts.
  3. lake build the package; capturewarnings aserrors becausesorry is disallowed.
  4. lake exe axioms --module on themain theorem file; save output in yourpaper notes .
  5. Read paper README discrepancies before citinglemma names inslides .

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.

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 #

  1. Lean 4 theorem proving basics onleanprover community pages.
  2. Mathlib style guide fornaming .
  3. This README****Expect Mistakes section.
4. explainx **[Opus CPython bugs](https://explainx.ai/blog/opus-5-5-cpython-lean-formalization-418-bugs-2026)** for**scale reference** .
5. **[Left to Solve](https://explainx.ai/blog/left-to-solve-ai-agents-open-math-lean-erdos-november-2026)** 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.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @google deepmind 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/google-deepmind-form…] indexed:0 read:8min 2026-12-05 · —