Skip to main content

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

Metadata

Release files for paper-badger 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paper-badger 0.1.3
File Size Uploaded Provenance Actions
paper_badger-0.1.3.tar.gz 30.0 kB With provenance Details for paper_badger-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paper-badger 0.1.3
File Interpreter ABI Platform Actions
paper_badger-0.1.3-py3-none-any.whl Python 3 none any Details for paper_badger-0.1.3-py3-none-any.whl

Total release size: 56.5 kB

Release files / paper_badger-0.1.3.tar.gz

Download URL paper_badger-0.1.3.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6fe5f72f5731d75793c1c3a286f5aad50028ff8346b94a311d2722a24582fe33
BLAKE2b-256 checksum
How to use checksums
bab7f1cf243996a46704db6baee4cdfde9c8037250b4b79070be21f3447754ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Release files / paper_badger-0.1.3-py3-none-any.whl

Download URL paper_badger-0.1.3-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c828ad091f2dba7c0a02af34ec4a8cd84bb60e8ab5b2edd957c6b8870c871359
BLAKE2b-256 checksum
How to use checksums
9d20bc832a877ae562509f0c9166d1f3decdaf839657895f7679883427f5f163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Security for paper-badger 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for paper_badger-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page