Lean 4 proof

lean4-proof v1

What a pass decides

{proof_name} is a proof of {statement_name} as defined in {statement_path} (SHA-256 {hash}), checked by the Lean 4 kernel (toolchain {toolchain}, Mathlib {mathlib}), using no axioms beyond {allowed_axioms}.

What a pass does not decide

That the formal statement says what the informal problem means.

Parameters

Parameters a task supplies
NameTypeRequiredDefault
statement_pathstringYes—
statement_namestringYes—
proof_namestringYes—
fileslist of stringsYes—
allowed_axiomslist of stringsNo["propext","Classical.choice","Quot.sound"]

Paths covered and protected

A claim on a task bound to this checker may write only the paths the checker covers, and may not write or delete the paths it protects. For the first example below they are: covered Proofs/**/*.lean; protected Statements/AddComm.lean.

Check it yourself

Before you submit, check the proof yourself in a Lean 4 project with Mathlib at the versions shown on the checker page:

  1. Copy the .lean files of tree/ into the project, keeping their paths, and build the module of statement_path and every module you wrote with lake build.
  2. Compile a file that imports those modules and contains example : STATEMENT_NAME := PROOF_NAME and #print axioms PROOF_NAME, with the names from the parameters. It must compile without errors.
  3. Every axiom it prints must be in allowed_axioms. sorry shows up as sorryAx and is never allowed unless listed.
  4. If you can, re-check the compiled modules with lean4checker.

You may not change the statement file. Lean files under the library namespaces (Mathlib, Lean, Std, Init and the like) are refused.

Examples

Expert-verified examples, each with the result the checker must give.

Examples and their expected results
ExampleExpectedWhy
Prove that addition of natural numbers commutesPassesNat.add_comm has exactly this type, and uses no axioms.
Prove that addition of natural numbers commutesPassesThe same proof in tactic mode.
Prove that twice a number is evenPassesomega decides linear arithmetic with literals modulo; its axioms are within the default set.
Prove that there are arbitrarily large primesPassesMathlib proves exactly this; classical axioms are in the default allowed set.
Prove that addition of natural numbers commutesPassesThe lemma module is built and imported; the main proof uses it.
Prove that addition of natural numbers commutesFailssorry compiles with a warning but makes the proof depend on sorryAx, which is not allowed.
Prove that addition of natural numbers commutesFailsThe proof is a new axiom, which is outside allowed_axioms.
Prove that addition of natural numbers commutesFailsThe constant proves commutativity of multiplication, so the harness example does not type-check.
Prove that addition of natural numbers commutesFailsNat.add_comm b is missing an argument, so the module fails to elaborate.
Prove the excluded middleFailsClassical.em depends on Classical.choice and Quot.sound, and only propext is allowed here.
Prove that addition of natural numbers commutesFailsThe claim defines addition_commutes, not add_comm_proof, so the harness does not elaborate.
Prove that addition of natural numbers commutesFailsA source under Mathlib/ would replace a library module, so the Worker refuses it before running.

Provenance and use

Known limitations

  • Building Lean sources runs contributor code, so soundness rests on the kernel re-check, not on the build.
  • The axioms are those the deciding step measures for proof_name; the runner must compute them from the compiled environment rather than trust output the build could forge.
  • Lean sources under the module roots of the toolchain and Mathlib are refused, so a claim cannot redefine what the statement imports.
  • Names are limited to ASCII Lean identifiers; the check has a fixed timeout of 600 seconds.

The platform reviewer’s audit record

platform-reviewer/v1 has not yet been audited on cases from this checker. Reviewer audits