Live
Black Hat USADark ReadingBlack Hat AsiaAI BusinessAI startup Rocket offers vibe McKinsey-style reports at a fraction of the costTechCrunch AIChatGPT Now Crawls 3.6x More Than Googlebot: What 24M Requests Reveal - Search Engine JournalGoogle News: ChatGPTYour Claude Code is Starving, the Food’s Scattered All Over Your Org, and Some of it is StaleTowards AIMistral Introduces "Voxtral TTS": An Open-Weight Text-to-Voice Model Capable Of Cloning Any Voice From 3 Seconds Of Audio, Runs In 9 Languages, & Beats Elevenlabs Flash V2.5 With A 68.4% Human Preference Win Rate.Reddit r/LocalLLaMAAI chatbots programmed to validate users relying on mental health advice, experts warn - FOX 10 PhoenixGNews AI mental healthThe Agentic AI: How Autonomous AI Systems Are Rewriting the Rules of Work, Business, and TechnologyTowards AI[R] Agentic AI and Occupational Displacement: A Multi-Regional Task Exposure Analysis (236 occupations, 5 US metros)Reddit r/MachineLearningBefore Word2Vec: The Strange, Fascinating Road from Counting Words to Learning MeaningTowards AIAI Agents Are Calling Restaurants. Restaurants Can’t Talk Back.Towards AIThe Claude Code Leak Didn’t Hurt Cursor. It Forced a More Honest Competition.Towards AI30 ChatGPT Commands That Actually Save You Hours (Tested in Real Workflows)Towards AISeedream 5.0 vs Seedream 4.5 vs Nano Banana 2: Who Actually Wins in 2026?Towards AIBlack Hat USADark ReadingBlack Hat AsiaAI BusinessAI startup Rocket offers vibe McKinsey-style reports at a fraction of the costTechCrunch AIChatGPT Now Crawls 3.6x More Than Googlebot: What 24M Requests Reveal - Search Engine JournalGoogle News: ChatGPTYour Claude Code is Starving, the Food’s Scattered All Over Your Org, and Some of it is StaleTowards AIMistral Introduces "Voxtral TTS": An Open-Weight Text-to-Voice Model Capable Of Cloning Any Voice From 3 Seconds Of Audio, Runs In 9 Languages, & Beats Elevenlabs Flash V2.5 With A 68.4% Human Preference Win Rate.Reddit r/LocalLLaMAAI chatbots programmed to validate users relying on mental health advice, experts warn - FOX 10 PhoenixGNews AI mental healthThe Agentic AI: How Autonomous AI Systems Are Rewriting the Rules of Work, Business, and TechnologyTowards AI[R] Agentic AI and Occupational Displacement: A Multi-Regional Task Exposure Analysis (236 occupations, 5 US metros)Reddit r/MachineLearningBefore Word2Vec: The Strange, Fascinating Road from Counting Words to Learning MeaningTowards AIAI Agents Are Calling Restaurants. Restaurants Can’t Talk Back.Towards AIThe Claude Code Leak Didn’t Hurt Cursor. It Forced a More Honest Competition.Towards AI30 ChatGPT Commands That Actually Save You Hours (Tested in Real Workflows)Towards AISeedream 5.0 vs Seedream 4.5 vs Nano Banana 2: Who Actually Wins in 2026?Towards AI
AI NEWS HUBbyEIGENVECTOREigenvector

Automatic Textbook Formalization

Hacker News Topby facebookresearchApril 3, 20264 min read1 views
Source Quiz

Article URL: https://github.com/facebookresearch/repoprover Comments URL: https://news.ycombinator.com/item?id=47631648 Points: 21 # Comments: 7

Code for Automatic Textbook Formalization (Gloeckle, Rammal, Arnal, Munos, Cabannes, Synnaeve, Hayat, 2026).

RepoProver is a multi-agent scaffold for large-scale formalization of mathematics textbooks in Lean. It orchestrates multiple LLM agents that collaborate on a shared git repository with the Lean project: sketcher agents translate definitions and theorem statements, prover agents fill in proofs, and reviewer agents enforce quality via pull request reviews. Coordination happens through a lightweight file-system-based issue tracker and a merge queue that ensures the main branch always builds.

This code produced an automatic formalization of the graduate textbook Algebraic Combinatorics by Darij Grinberg.

Setup

Requires Python 3.10+. Install in editable mode:

pip install -e .

Preparing a formalization project

RepoProver operates on a Lean project repository. Before running, you need to set up:

  • Create a Lean project with Mathlib and build it:

lake init MyProject math lake update lake build

  • Add LaTeX source files under a tex/ directory inside the project, organized by topic:

MyProject/ ├── lakefile.lean ├── lean-toolchain ├── lake-manifest.json ├── MyProject.lean # root import file ├── MyProject/ │ └── tex/ # LaTeX source chapters │ ├── all.tex # full textbook source (optional) │ ├── Topic1/ │ │ ├── Chapter1.tex │ │ └── Chapter2.tex │ └── Topic2/ │ └── ... ├── manifest.json # chapter manifest (see below) ├── CONTENTS.md # structure documentation (see below) └── issues/ # issue tracker (see below)

The tex files should be split by chapter/section so each can be assigned to a sketcher agent independently. An all.tex with the full source can be included for reference. Note that tex files are read-only — agents can read them but never modify source material.

  • Create a CONTENTS.md at the project root documenting the structure of tex sources and corresponding Lean files. The coordinator generates an initial version from the manifest, and agents update it as the Lean codebase evolves. It serves as the central reference for project structure, proof status and architecture notes.

  • Create a manifest.json at the project root listing the chapters to formalize and their target theorems/definitions. Each chapter entry has:

id: unique identifier for the chapter title: human-readable chapter title source_path: path to the LaTeX source file (relative to project root) target_theorems: list of theorem/definition IDs to formalize from this chapter

See configs/example_manifest.json for a full example from the algebraic combinatorics case study.

  • Create an empty issues/ directory at the project root. Agents use this as a lightweight file-system-based issue tracker — they create short YAML files here to flag blockers, request refactorings, or coordinate work across chapters.

  • Initialize git (with branch name main) in the project if not already done — RepoProver uses git for version control, branching and merging.

Usage

Running the coordinator

python -m repoprover run /path/to/lean/project --pool-size 10

This starts the main coordinator loop which launches sketcher, prover, maintainer and reviewer agents, manages the merge queue and tracks progress. The project state is saved in .repoprover/ inside the Lean project directory.

Use --clean to start from scratch, --verbose for debug logging.

Multi-node (SLURM)

For distributed runs across multiple machines, use the stool launcher:

python -m repoprover.stool --name myrun --project /path/to/lean/project

The stool launcher snapshots the repoprover code to a dump directory, symlinks the Lean project (avoiding slow copies of .lake/ and .git/) and submits a SLURM job. Rank 0 runs the coordinator in a background thread; all ranks (including rank 0) run as workers that pull tasks from the coordinator.

Options:

  • --launcher bash — run directly if already inside an salloc session

  • --pool-size N — number of Lean REPL instances per node (default: 10)

  • --nodes N — number of SLURM nodes (default: 1)

  • --agents-per-target N — max parallel agents per theorem/issue (default: 1)

  • --prs-to-issues — convert pending PRs to issues when resuming a run

  • --clean — wipe state and restart from scratch

  • --dirs-exists-ok — reuse an existing dump directory

See configs/example.yaml for an example configuration.

Analysis scripts

# Token usage breakdown by agent type and outcome python scripts/count_tokens.py /path/to/lean/project

Agent efficiency plots over time

python scripts/plot_agent_efficiency.py /path/to/lean/project --out ./plots`

Smoke test

A toy project is included under examples/toy_project/ for quick testing. The setup script copies the files to a working directory, initializes git, fetches Mathlib and builds the project:

bash examples/toy_project/setup.sh /tmp/repoprover-toy-test

Then run repoprover on it:

source .venv/bin/activate python -m repoprover run /tmp/repoprover-toy-test --pool-size 2 --verbose

The toy project has one chapter with 4 trivial targets (a definition and 3 theorems about doubling natural numbers).

Trajectory viewer

To inspect agent trajectories from a run:

python -m repoprover.viewer --dir /path/to/lean/project/runs --port 8080

License

This project is licensed under the terms in LICENSE.

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by Eigenvector · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

More about

researchgithub

Knowledge Map

Knowledge Map
TopicsEntitiesSource
Automatic T…researchgithubHacker News…

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 287 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Research Papers