Copied


Mistral AI Launches Leanstral Open-Source Proof Agent for Lean 4

Zach Anderson   Mar 16, 2026 19:13 0 Min Read


Mistral AI released Leanstral on March 16, 2026—the first open-source AI agent built specifically for Lean 4 formal verification. The 120B parameter model runs on just 6B active parameters and ships under Apache 2.0 licensing, making production-grade theorem proving accessible without enterprise budgets.

Why does this matter for crypto? Formal verification—mathematical proof that code does exactly what it claims—has become the gold standard for securing smart contracts and blockchain protocols. Bugs in DeFi code have cost billions. Leanstral could dramatically lower the barrier for projects seeking verified security.

Performance vs. Cost Trade-offs

Mistral benchmarked Leanstral against both proprietary and open-source competitors using FLTEval, a new evaluation suite testing real proof engineering tasks from the Fermat's Last Theorem formalization project.

The numbers are striking. Leanstral at pass@2 scored 26.3 points for $36 in compute costs. Claude Sonnet 4.6 managed 23.7 points but ran up a $549 bill—over 15x the cost for worse performance. Even at pass@16, where Leanstral hits 31.9 points for $290, it still costs less than one-fifth of Claude Opus 4.6's $1,650 price tag (though Opus leads quality at 39.6).

Against open-source alternatives, the efficiency gap widens further. GLM5-744B-A40B and Kimi-K2.5-1T-A32B plateau around 16-20 points despite having 6-8x more active parameters. Qwen3.5-397B-A17B needs four passes to reach 25.4 points—Leanstral beats that with two.

Technical Architecture

Leanstral uses a sparse mixture-of-experts architecture optimized for proof engineering workflows. The model integrates with Lean's language server protocol through MCP (Model Context Protocol), specifically trained for maximal performance with lean-lsp-mcp tooling.

Lean 4 itself launched stable in September 2023 and has seen rapid adoption for formalizing mathematics. The Mathlib library—a massive collection of mathematical proofs—successfully ported to Lean 4 that same year. Projects like the formal proof of Fermat's Last Theorem demonstrate the platform's capability for serious mathematical work.

Real-World Applications

Mistral showcased Leanstral handling a genuine Stack Exchange debugging question about breaking changes in Lean 4.29.0-rc6. The agent diagnosed a definitional equality issue with type aliases and correctly identified that swapping def for abbrev would restore tactic matching.

The model also demonstrated cross-language translation, converting Rocq (formerly Coq) definitions to Lean 4 while preserving proof semantics and implementing custom notation.

Access Options

Three deployment paths exist: direct integration in Mistral Vibe (use /leanstall to start), a free API endpoint at labs-leanstral-2603 for limited-time feedback gathering, or self-hosted deployment with the Apache 2.0 weights.

For blockchain projects, the calculus is straightforward. Formal verification has traditionally required either expensive auditing firms or deep in-house expertise. An open-source agent that can prove code correctness at $36-290 per task could reshape how protocols approach security—assuming the proofs hold up under production conditions.


Read More