Skip to content

BioDisCo/paper-badger

Repository files navigation

paper-badger

Automated Lean 4 formalization and verification badges for research papers.

paper-badger fetches an arXiv paper (or uses a local LaTeX directory), extracts theorem-like statements, runs LLM-backed prover and verifier agents to formalize them in Lean 4 + Mathlib, and inserts verified-badges links back into the paper source.

How it works

arXiv paper ──> extract statements ──> LLM prover ──> Lean compilation
      │                                                       │
      │                                              LLM verifier
      │                                                       │
      └──────────────── insert badges <────────────── accept / retry
  1. Downloads and extracts an arXiv source bundle (or copies a local directory).
  2. Detects definitions, lemmas, propositions, corollaries, and theorems.
  3. Initializes a Lean 4 + Mathlib workspace.
  4. Loops: prover agent proposes a formalization, lake build compiles it, verifier agent checks correctness.
  5. Accepted statements get a \leanproof{} or \leanformalized{} badge inserted into the LaTeX source.
  6. Progress is saved to state.json after every task, so runs are fully resumable.

Requirements

Install

pip install paper-badger

Or run directly without installing:

uvx paper-badger 2002.10752

Usage

Formalize an arXiv paper

paper-badger 2002.10752

The run subcommand is implied, so paper-badger run 2002.10752 is equivalent.

Formalize a local paper

paper-badger run my-paper --paper-dir path/to/latex/

Choose backends

By default the prover is codex and the verifier is claude. To use Claude for both:

paper-badger run 2002.10752 --prover-backend claude --verifier-backend claude

Monitor a run

paper-badger monitor 2002.10752          # live dashboard
paper-badger monitor 2002.10752 --once   # single snapshot

Badge link modes

Mode Behavior
local file:// links relative to the paper directory (default)
github GitHub blob links using --repo-url and --branch
auto GitHub links when repo info is provided, local otherwise
paper-badger run 2002.10752 \
  --badge-link-mode github \
  --repo-url https://github.com/you/repo \
  --branch main

Run directory layout

runs/<paper-id>/
  paper/                              # LaTeX sources (badges inserted here)
  <RootModule>/Formalizations/        # Generated Lean files
  state.json                          # Resumable run state
  TODO.md                             # Task checklist
  PROVER.md                           # Current prover status
  ISSUES.md                           # Paper issues found during the run

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages