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
- Downloads and extracts an arXiv source bundle (or copies a local directory).
- Detects definitions, lemmas, propositions, corollaries, and theorems.
- Initializes a Lean 4 + Mathlib workspace.
- Loops: prover agent proposes a formalization,
lake buildcompiles it, verifier agent checks correctness. - Accepted statements get a
\leanproof{}or\leanformalized{}badge inserted into the LaTeX source. - Progress is saved to
state.jsonafter 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fe5f72f5731d75793c1c3a286f5aad50028ff8346b94a311d2722a24582fe33
|
|
| MD5 |
253d86c6461cef60e0b24fec78ec7e9e
|
|
| BLAKE2b-256 |
bab7f1cf243996a46704db6baee4cdfde9c8037250b4b79070be21f3447754ff
|
Provenance
The following attestation bundles were made for paper_badger-0.1.3.tar.gz:
Publisher:
publish-pypi.yml on BioDisCo/paper-badger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paper_badger-0.1.3.tar.gz -
Subject digest:
6fe5f72f5731d75793c1c3a286f5aad50028ff8346b94a311d2722a24582fe33 - Sigstore transparency entry: 1188027722
- Sigstore integration time:
-
Permalink:
BioDisCo/paper-badger@02b919f37c3c3fede94ca18eeb1fe322c704332d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/BioDisCo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@02b919f37c3c3fede94ca18eeb1fe322c704332d -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c828ad091f2dba7c0a02af34ec4a8cd84bb60e8ab5b2edd957c6b8870c871359
|
|
| MD5 |
f80e3bdd59bb172d426f85bb668d4120
|
|
| BLAKE2b-256 |
9d20bc832a877ae562509f0c9166d1f3decdaf839657895f7679883427f5f163
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paper_badger-0.1.3-py3-none-any.whl -
Subject digest:
c828ad091f2dba7c0a02af34ec4a8cd84bb60e8ab5b2edd957c6b8870c871359 - Sigstore transparency entry: 1188027728
- Sigstore integration time:
-
Permalink:
BioDisCo/paper-badger@02b919f37c3c3fede94ca18eeb1fe322c704332d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/BioDisCo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@02b919f37c3c3fede94ca18eeb1fe322c704332d -
Trigger Event:
push
-
Statement type: