gitwtfhub

wtf is leanstralsafeverify?

mistralai/leanstralsafeverify — explained in plain English

Analysis updated 2026-05-18

30LeanAudience · researcherComplexity · 5/5Setup · hard

TL;DR

A verification tool that checks whether submitted Lean proof code honestly solves a given problem, guarding against exploits and shortcuts.

Mindmap

mindmap
  root((repo))
    What it does
      Verifies Lean proofs
      Blocks exploits
      Checks allowed axioms
    Tech stack
      Lean
      Lake
    Use cases
      AI proof checking
      Benchmark verification
      Proof marketplaces
    Audience
      Researchers
      AI proving systems

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Verify that an AI-generated Lean proof actually satisfies the theorem it claims to prove, without exploits.

REASON 2

Check solutions to Lean coding-with-proofs benchmarks like MiniF2F or PutnamBench.

REASON 3

Build a proof verification backend for a coding platform or bounty marketplace built around formal proofs.

What's in the stack?

LeanLake

How it stacks up

mistralai/leanstralsafeverifygaearon/analysis-solutionsjzshischolar/pyleaner
Stars304214
LanguageLeanLeanLean
Last pushed2025-09-23
MaintenanceQuiet
Setup difficultyhardmoderatehard
Complexity5/54/54/5
Audienceresearcherresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires the Lean 4 toolchain and compiling files to olean format before checking.

Wtf does this do

This tool checks whether a piece of submitted Lean code actually proves what it claims to prove, without letting the submitter cheat. Lean is a programming language built around mathematical proofs, where code is written not just to run but to be formally verified as correct. That makes it useful for AI systems that write code and try to prove the code is correct, but it also opens the door to sneaky tricks: an AI or a person could satisfy the letter of a proof by manipulating the underlying environment, adding extra assumptions that should not be allowed, or exploiting bugs in the proof checker itself rather than actually solving the problem. SafeVerify guards against that. Given two compiled Lean files, a target file containing the problem to solve and a submission file meant to solve it, the tool checks that the submission genuinely fills in what the target asks for, using only a small set of standard, trusted mathematical axioms, and without tricks like partial or unsafe functions that could quietly cheat the type system. It replays each file's declarations independently through Lean's own kernel checker first, so the comparison happens on environments it has verified are honest, rather than trusting whatever the submitted files claim about themselves. This fork, maintained by Mistral, is used internally for training and evaluating AI coding agents that write and prove Lean code. The underlying project is also the verification backend behind several public efforts: a vibe coding web app for Lean, a coding problems with proofs website, and a theorem bounty marketplace built on smart contracts. Different branches of the repository are tuned to check solutions from specific AI proving systems and benchmarks, including DeepSeek Prover, Kimina Prover, and Seed Prover, and the tool has also been used by an official leaderboard for a well known theorem proving benchmark. To use it, you compile Lean files into olean files with the Lean build tool, then run the checker against a target and a submission file, or build it into a standalone executable. The README notes some things it deliberately does not check, such as certain keywords that are hard to catch at this level, leaving those to be handled separately.

Yoink these prompts

Prompt 1
Explain how this SafeVerify script checks that a submitted Lean proof matches a target specification.
Prompt 2
Help me compile my Lean files into olean format and run this checker against a target file.
Prompt 3
Walk me through building the safe_verify executable from this repo with lake build.
Prompt 4
What axioms does this tool allow in submitted Lean proofs, and how do I change the AllowedAxioms list?

Frequently asked questions

wtf is leanstralsafeverify?

A verification tool that checks whether submitted Lean proof code honestly solves a given problem, guarding against exploits and shortcuts.

What language is leanstralsafeverify written in?

Mainly Lean. The stack also includes Lean, Lake.

How hard is leanstralsafeverify to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is leanstralsafeverify for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.