LeanWarp
v0.2.11Check and verify Lean 4 proofs on hosted, warm Lean and Mathlib workers.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
doctor
Show the project's toolchain and environment and whether it runs, and any connect in progress. Does not start compute.
files
List the Lean files that would upload, their sizes and any problems. .gitignore and .leanwarpignore in the project exclude files. With dependencies, also each path dependency connect sends: its dir and its files with sizes. Needs no key and uploads nothing.
| Parameter | Type | Description |
|---|---|---|
dependencies | boolean |
versions
List the Lean toolchains LeanWarp supports.
environments
List this account's environments: each project's build status and dependencies.
account
Show credit: balance, reserved and available, as microdollar strings ($1 = 1000000).
resources
Show the published worker's resources and pricing. Does not start compute.
connect
Connect this project. A new environment build uses prepaid credit. The project's toolchain, lakefile, lockfile and path dependencies define its environment; LeanWarp builds it once and this waits up to 40 seconds. Pass retry after fixing what made a build fail. Each dependency's default libraries are built; pass libraries (each package/Target, such as mathlib/Archive) to build others too, as a check refusing an import names. Plain files run with Mathlib; pass mathlib false for core Lean alone, which starts faster and builds nothing. Chan…
| Parameter | Type | Description |
|---|---|---|
libraries | ||
mathlib | ||
max_spend_microusd | ||
retry | ||
workspace_id |
workspaces
List the account's workspaces; this_project marks the one this project uses.
history
One page of stored operations and results, newest first; default this project's. Pass the previous page's next_cursor as cursor to read older ones. Finished history is kept for a window only.
| Parameter | Type | Description |
|---|---|---|
cursor | ||
detail | string | |
workspace_id |
status
Show the workspace and an operation's state: the latest, or operation_id. It never includes a result; call wait with the operation_id for that.
| Parameter | Type | Description |
|---|---|---|
operation_id |
check
Compile a file and report Lean errors and warnings. Uploads changed files first. draft defaults to false: a strict check that fails on errors, sorry and extra axioms. draft=true is faster while editing: Lean reuses its work on the unchanged part of the file, and `sorry` is only a warning, so finish with a strict check or verify_target. status is ok, error or rejected (failure.kind says why), or, with no verdict, timeout, infrastructure_failure or not_checked: then retry, when failure.retryable, rather than change the proof. retention="sh…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
draft | boolean | |
retention | string | |
wait_seconds | number |
inspect
Show goals at a tactic or proof hole. Lines and character columns start at 1. no_goals means a known empty tactic state. omitted counts hidden goals. Use detail="full" for a selection too large for the compact answer. retention="short" lets LeanWarp remove the finished result after about a minute. May start a worker, which uses credit.
| Parameter | Type | Description |
|---|---|---|
column * | integer | |
file * | string | |
line * | integer | |
detail | string | |
retention | string | |
wait_seconds | number |
try_tactics
Try tactics at a position without editing the file. Read each result's outcome. The default limit covers the sum of the tactic budgets plus overhead, up to the operation maximum. A shorter explicit limit scales tactic budgets down. Read each outcome to see whether the tactic closed its goal. retention="short" lets LeanWarp remove the finished result after about a minute. May use credit.
| Parameter | Type | Description |
|---|---|---|
column * | integer | |
file * | string | |
line * | integer | |
tactics * | array | |
detail | string | |
retention | string | |
wait_seconds | number |
verify_target
Check that a declaration proves exactly the user's statement. May use credit. target_context holds the imports and definitions the statement needs, such as `import Mathlib`; it may import only the environment's packages, never this project's modules. Never weaken the statement or context to make a proof pass. fresh runs on a separate worker that stops afterwards. success needs status ok and a receipt; rejected is a verdict (failure.kind: target_mismatch, axioms, ...), while timeout and infrastructure_failure decide nothing: retry.
| Parameter | Type | Description |
|---|---|---|
candidate_declaration * | string | |
file * | string | |
target_statement * | string | |
detail | string | |
fresh | boolean | |
target_context | string | |
wait_seconds | number |
suggest
Find a tactic that closes the hole at a position; call apply straight after. Without tactics, LeanWarp ranks its own portfolio for the goal; timeout_ms bounds each tactic. success means a tactic closed the hole, changing nothing else. verification says how far the recheck reached: strict, the whole file, by the independent checker; declaration, this declaration (others still have holes), an editing aid and not a verdict: run check on the finished file. A hole in a declaration that keeps other holes is not closed (declaration_has_other_ho…
| Parameter | Type | Description |
|---|---|---|
column * | integer | |
file * | string | |
line * | integer | |
detail | string | |
tactics | ||
timeout_ms | ||
wait_seconds | number |
holes
List sorry and ?_ positions with their observed state from one elaboration. Lines and columns are 1-based. States are resolved, sorry, unresolved, or unknown. unfinished_count counts only sorry/unresolved placeholders; unknown_count is separate and must not be treated as proof completion. The legacy unfinished flag stays true for unknowns; only resolved is false. hole_count includes resolved syntax placeholders. Goals are bounded to the first 16 unfinished/unknown entries; omitted contexts are explicit. success means the listing ran; sta…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
goals | boolean | |
wait_seconds | number |
proof_states
Every tactic Lean ran in the file, with its goals before and after, one page at a time. One call replaces an inspect per tactic. Rows are in command order, a tactic before those nested in it; each has source_range (1-based lines and columns), occurrence (a tactic run once per goal repeats its range) and before/after with status available (state: an id in the page's states), no_goals, omitted (too large) or unavailable. Call again with next_cursor as cursor until it is null. max_bytes bounds the page (4096 to 524288). status unsupported m…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
cursor | integer | |
detail | string | |
max_bytes | integer | |
wait_seconds | number |
extract_decls
List the declarations a file adds, with types and dependencies. May use credit.
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
wait_seconds | number |
sorry2lemma
Move each unfinished theorem's proof into a named lemma; call apply to write it. The original theorem then calls the new lemma, which keeps its sorry: prove each one next, for example with suggest. name_prefix names them. Section variables are preserved in the generated lemma application. A failed transformation leaves the source unchanged. The file is not changed until apply. May use credit.
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
max_extractions | integer | |
name_prefix | ||
strict_final_check | boolean | |
wait_seconds | number |
have2lemma
Move each named `have` in a theorem's proof into its own lemma; call apply to write it. The `have` then calls the new lemma, which takes the theorem's parameters. LeanWarp returns the new file only after checking that every statement is unchanged and nothing else was added; status rejected, with reason, means that audit refused it. The file is not changed until apply. May use credit.
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
max_extractions | integer | |
name_prefix | ||
wait_seconds | number |
simplify_proofs
Replace theorem proofs with shorter tactic proofs; call apply to write the file. Each candidate is kept only if the whole file still checks with it and it is at least min_reduction_bytes shorter; timeout_ms bounds each attempt (each tactic's own budget without it). Each theorem it edits must end complete with Lean's standard axioms only, and no statement may change; status rejected, with reason, means LeanWarp's audit refused the rewritten file. Tactics may not use sorry or admit. The file is not changed until apply. May use credit.…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
max_simplifications | integer | |
min_reduction_bytes | integer | |
tactics | ||
timeout_ms | ||
wait_seconds | number |
repair_proofs
Try to repair sorry holes. Call apply only when source_changed is true. Every attempt checks the whole patched file; timeout_ms bounds each one (each tactic's own budget without it), and sorrys that do not fit the operation's time come back skipped. Each theorem it edits must end complete with Lean's standard axioms only: a theorem that keeps another sorry is refused (declaration_has_other_holes). Solve its remaining holes together or manually separate them into lemmas. Tactics may not use sorry or admit. A rejected response gives the au…
| Parameter | Type | Description |
|---|---|---|
file * | string | |
detail | string | |
max_repairs | integer | |
tactics | ||
timeout_ms | ||
wait_seconds | number |
check_files
Check up to 64 files in one operation; success is true only if every file passed. Strict by default: sorry, errors and non-standard axioms fail a file. draft accepts files that compile; timeout bounds each file in seconds (default 60, at most 300, which needs the default operation deadline). Each file's status is ok, error or rejected (a verdict), or timeout, infrastructure_failure or not_checked (no verdict: retry those, do not change the proof). The batch is ok, failed (a file was refused) or incomplete. May use credit.
| Parameter | Type | Description |
|---|---|---|
files * | array | |
detail | string | |
draft | boolean | |
timeout | ||
wait_seconds | number |
verify_batch
Check up to 64 inline proofs in one operation; success is true only if all passed. Each code is {"custom_id": ..., "proof": ...} with a unique custom_id; no file is uploaded. Proofs may import the environment's packages, such as Mathlib, but not this project's modules (use check_files for those). Without a target, ok means the source compiles, its declarations pass the kernel and it uses no extra axioms, not that it proves what you meant: add "target": {"context": imports, "statement": the Prop, "declaration": the theorem's name} to bind…
| Parameter | Type | Description |
|---|---|---|
codes * | array | |
detail | string | |
draft | boolean | |
timeout | ||
wait_seconds | number |
apply
Write the latest successful suggest or file-rewrite result into its file, then upload it. Refuses if the file changed since the result was computed. If the upload response was lost, retry apply. For revision_conflict, inspect the local file, run reconcile, review the changes, then run any operation (it uploads first). Run check or verify_target afterwards to confirm the proof.
wait
Wait up to timeout seconds (at most 40) for an operation: the latest, or operation_id. If it is still running, success is null: call wait again with its operation_id. With operation_id, wait only reads that operation. Without it, wait first resends a saved request whose response was lost, which can upload source changes, including deletions, and start the operation it carried.
| Parameter | Type | Description |
|---|---|---|
detail | string | |
operation_id | ||
timeout | number |
recover
Resend the saved create, sync or submit request after a lost response. Any other tool that writes resends it first, so this is needed only to see the outcome on its own. An operation_id means the submission was recovered: wait instead of resubmitting. A workspace and revision only confirm create or sync: then run the intended operation.
| Parameter | Type | Description |
|---|---|---|
detail | string |
cancel
Cancel an operation, the latest or operation_id; wait until it finishes.
| Parameter | Type | Description |
|---|---|---|
detail | string | |
operation_id |
stop
Stop the worker so it stops using credit. Saved files are kept.
| Parameter | Type | Description |
|---|---|---|
generation |
feedback
Report a confirmed problem with LeanWarp itself to the LeanWarp team. For a bug you reproduced, a result that contradicts the guide, a confusing error, a capability you needed and lacked, or slowness that held up the work; never for Lean errors in the user's proof. One report per issue, at a pause between steps, then continue the task. Free; starts no compute. If recorded is false, carry on without retrying.
| Parameter | Type | Description |
|---|---|---|
details | string | What you did, expected and got, up to 4000 characters. Never the user's source, proofs or secrets. |
kind | string | Required. An unlisted kind is recorded as other. |
operation_id | string | The operation it is about; defaults to the latest one. |
severity | string | |
summary | string | Required. One line, 8 to 200 characters: what is wrong or missing. |
reconcile
Adopt the workspace's revision after another client changed its files. Use only after a revision_conflict you have resolved. The result lists the paths the next sync uploads or deletes, overwriting the other client's files, and under remote_only the files only the workspace has, which stay.
prune
Delete files that only the workspace has, such as beyond a partial checkout. Without confirm, lists them and deletes nothing. Show the user that list and ask. Pass the returned confirm token only after they agree: this cannot be undone and the files may be a teammate's.
| Parameter | Type | Description |
|---|---|---|
confirm |
disconnect
Forget this project's stopped workspace so it can connect to another environment.
delete
Permanently delete a workspace with its files and results; credit is kept. Only when the user asked to delete that workspace. Cannot be undone.
| Parameter | Type | Description |
|---|---|---|
workspace_id * | string |