Skip to main content

Automate theorem extraction, Lean formalization runs, and verified badge insertion for research papers.

Project description

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

Usage

Formalize an arXiv paper

paper-badger 2401.01234

The run subcommand is implied, so paper-badger run 2401.01234 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 2401.01234 --prover-backend claude --verifier-backend claude

Monitor a run

paper-badger monitor 2401.01234          # live dashboard
paper-badger monitor 2401.01234 --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 2401.01234 \
  --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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paper_badger-0.1.3.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paper_badger-0.1.3-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file paper_badger-0.1.3.tar.gz.

File metadata

  • Download URL: paper_badger-0.1.3.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for paper_badger-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6fe5f72f5731d75793c1c3a286f5aad50028ff8346b94a311d2722a24582fe33
MD5 253d86c6461cef60e0b24fec78ec7e9e
BLAKE2b-256 bab7f1cf243996a46704db6baee4cdfde9c8037250b4b79070be21f3447754ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_badger-0.1.3.tar.gz:

Publisher: publish-pypi.yml on BioDisCo/paper-badger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paper_badger-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: paper_badger-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for paper_badger-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c828ad091f2dba7c0a02af34ec4a8cd84bb60e8ab5b2edd957c6b8870c871359
MD5 f80e3bdd59bb172d426f85bb668d4120
BLAKE2b-256 9d20bc832a877ae562509f0c9166d1f3decdaf839657895f7679883427f5f163

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_badger-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on BioDisCo/paper-badger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page