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.2.tar.gz (30.4 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.2-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paper_badger-0.1.2.tar.gz
  • Upload date:
  • Size: 30.4 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.2.tar.gz
Algorithm Hash digest
SHA256 d6e0a27be86a2709c78beb8976c9e2d6db8c188b4830d2f28b3630e3f9fdf50e
MD5 e2edebdfd674a68a0d5533fa29eceb63
BLAKE2b-256 38ddef1ab956a05c5a7a43826a9d68826644989afacc90d3e8551ac911569986

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_badger-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: paper_badger-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15b945c8ca0c3204a6968f79880664b79faeee417345944bb4521513d6a2aecc
MD5 0dd757e77858598a56e8d2c937fdade4
BLAKE2b-256 06c1121a382fe8513fd5151ccacee35238fbb2a57dd49fffe30febc7e4efc7d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_badger-0.1.2-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