Weekly

News about Lean, the theorem prover and programming language.

Verification, page 3

Software, hardware, protocols, and cryptography verified with Lean. 148 items, newest first.

Verification

Bowen Zhu and Jian Wu certify plasma solver outputs with Lean proofs

The paper reuses a machine-generated lemma from OpenAI's Lean 4 relativistic Vlasov-Maxwell library: initial fields determine the field at an outside point until plasma signals reach it. Eleven new Lean modules build on it, and the certified references exposed boundary and initialization errors in WarpX and Smilei that global energy checks missed.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.23319paperswithlean.comtomzhu0225/vlasov-maxwell-pic-benchmark

Verification

Adam Reynolds publishes Noctium, a Lean 4 framework for proving Midnight contracts

The research preview compiles contracts written in a typed Lean DSL directly to native ZKIR circuits and Impact ledger plans, and executes them with Rust. It registers 40 active ZKIR 3.2.1 opcodes and has execution paths for C/C++, Kotlin (Android emulator tested), Swift (macOS and iOS simulator tested) and TypeScript (WASM, Chrome tested).

Checked against: awjreynolds/noctium

Verification

Smayan Agarwal and Aalok Thakkar's Kamot generates zippers, partly verified in Lean

Kamot converts datatype declarations in a restricted Haskell fragment into zippers, which pair a focused position in a data structure with the context needed to rebuild it. Lean 4 verifies simulation, bounds, and completeness of the generated code for finite single self-recursive datatypes, using only core Lean; the rest is proved on paper.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.22572paperswithlean.comdoi.org

Verification

Lean harness ForShor verifies Shor's algorithm, including its asymptotic gate cost

Anirudh Suresh, Joshua M. Courtney, Runzhou Tao, and Yudong Cao prove correctness and gate-count theorems once for all valid policies (Toom-Cook multiplication designs, possibly from AI agents) and publish an open challenge at forshor.ai. At 2048 bits, a varying-arity policy gives about 1.685 trillion T-gates, against 1.820 trillion for the best single arity.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.20342VerifiedQC/ForShorpaperswithlean.com

Verification

QECLean, a Lean framework, proves an IBM quantum code has distance 24

Stavan Jain, Nithin Raveendran and Aws Albarghouthi's framework, built on Mathlib, backs every claimed property of quantum error-correcting codes with a machine-checked proof. Its new code combinators prove distance compositionally for large codes beyond algorithmic techniques (24 was previously only an upper bound), and it formalizes entire code families such as the surface code.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.21236QECLean/QECLean

Verification

Rylan Malarchick presents qlin, a dynamic quantum circuit compiler with Lean proofs

Lean 4 proofs show that qlin moves operations out of measurement-dependent branches without delaying the program, and that its check of each compiled program against its source is sound. Modeled at the QICK controller's 42 ns per decision, 10 of 65 programs run at least 10% faster than the best baseline, up to 91.2%.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.19618rylanmalarchick/qlin

Verification

TrustBound proves in Lean how to account for payments outliving AI agents

Sandip Nandi, Aishwarya Bose, Apurba Bose and Soovadeep Bakshi prove that once a fence stops new admissions, discharging outstanding rights prevents further payments, and that truthful outcomes give exact accounting. Lean accepts six histories from a Python/SQLite service; concurrent tests exposed a conflict from reordered provider reads, fixed in all 84 tested cases.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.19551tokencraftdata/trustboundpaperswithlean.com

Verification

Harmonic's Aristotle now formally verifies Rust, joining C and Verilog

Harmonic says users can prove that Rust code has no undefined behavior and does exactly what its specification says, even if it uses unsafe, and that Rust code ported from C behaves the same as the original. The Lean account on X welcomed the use of Lean for Rust verification.

Image: x.com/HarmonicMath

Checked against: @HarmonicMath on X@leanprover on X

Verification

Nockchain releases a Nock zkVM with an end-to-end Lean soundness proof

The Open Proof Machine's verifier checks a short proof instead of re-running a program in Nock, a tiny combinator language; kernel-checked soundness and completeness theorems cover all twelve opcodes, unbounded natural-number atoms and jets (known formulas that an interpreter replaces with native code). The alpha research release has not been independently audited.

Checked against: nockchain.orgnockchain/nock-zkvm

Verification

Harmonic's Lean-powered Aristotle adds Rust verification alongside C and Verilog

Aristotle can prove that Rust code has no undefined behavior and does exactly what its spec says, even inside unsafe blocks (code the compiler does not check), and that C rewritten in Rust matches the original. On Manifest, an open-source Solana order book, Aristotle proved 28 results and found a rounding bug, since fixed.

The title “Aristotle Expands Into Rust” in blue with the picture of the article, the date and the Harmonic logo
Image: harmonic.fun

Checked against: harmonic.funleanprover.zulipchat.com

Verification

OKcontract Labs releases Zean for proving Zig functions in Lean

The open-source toolkit translates supported Zig functions into executable Lean models, working from Zig's analyzed intermediate representation (AIR); an included copy-loop example proves its model avoids invalid accesses and uninitialized reads. Lean checks the translated model under its stated assumptions, so the proofs do not establish correctness of the final native binary.

Introducing Zean: Write Zig and prove it in Lean
Image: okcontract.com

Checked against: okcontract.com

Verification

Aaron Elijah Mars verifies 15 Ethereum tokens' deployed bytecode in Lean 4

The proofs, 7,024 theorems in total, cover every input, caller and order of calls for tokens worth about $54 billion on Ethereum, including DAI, UNI, SHIB and PEPE. They show balances always add up to the total supply (or supply grows only as the rules say) and who can mint, freeze, blacklist or pause.

Checked against: aaronjmars/proven-tokens

Verification

NyxFoundation publishes LeanAsm, a Lean 4 foundation for verified RV64 assembly

LeanAsm covers typed RV64IM (RISC-V) and scalar x86-64 assembly, executable machine semantics, encoding, and source emission; it is intended to be shared by ssz-asm, cl-asm, and p2p-asm. Its architecture follows the verified macro-assembly approach demonstrated by Verified-zkEVM's evm-asm while remaining independent of EVM, zkVM execution, and riscv-zkvm.

Checked against: NyxFoundation/LeanAsm

Verification

Nethermind's Foxglove formalizes a separation logic for probabilistic programs in Lean

Built on iris-lean, Foxglove adapts the Bluebell logic of Bao, D'Osualdo and Farzan to functional programs and is intended to support verifying cryptographic primitives formalized in ArkLib. Every rule of the logic is proved against a semantic model with no axioms beyond Lean's own, and the Ethereum Foundation funded the work.

Checked against: NethermindEth/Foxglovereservoir.lean-lang.org

Verification

Scidonia Limited ports libexpat's XML 1.0 parsing semantics to Lean 4

The port, lexpat, is aimed at untrusted input and has a resumable streaming core, machine-checked properties of its UTF-8 decoder, and a bounded differential fixture against libexpat. A C header and shared library for x86_64-linux provide a subset of libexpat's XML_* calls; namespace processing, DTDs and external entities are not implemented.

Checked against: scidonia/lexpatreservoir.lean-lang.org

Verification

emberian's qsag combines post-quantum threshold signing in Rust with Lean proofs

The research-preview stack implements NIST FIPS 205 SLH-DSA-SHAKE and FIPS 204 ML-DSA-44, and Lean certificate checks pass for its 19 x86-64 and 9 AArch64 certified assembly kernels. Its main-library axiom audit checks 59,257 declarations, including 28,744 kernel theorem declarations, across 57 modules, with no rejected axioms.

Checked against: emberian/qsag

Verification

okcontract publishes Solidity Spec, an executable formal model of Solidity in Lean

The Lean 4.29.0 package targets Solidity 0.8.36 and comes with a paper on its semantics and trust boundary. Conformance checks compare selected executions with the pinned compiler and a local Cancun EVM; okcontract calls the formalization incomplete and notes that compiler compatibility, scoped to viaIR: true, is not a proof of general compiler conformance.

Checked against: okcontract/solidity-spec

Verification

mathematics-inc runs Linux's WireGuard handshake code in Lean, finding undefined behaviour

The repository holds the Cerberus Core of a program running a complete two-peer WireGuard handshake, as readable Lean modules with one definition per WireGuard C function. Running it under a C semantics in Cerberus-Lean produced output identical to an independent reference implementation and also found limitations of Cerberus and Cerberus-Lean.

Checked against: mathematics-inc/wireguard-handshake-cerberus-lean

Verification

Bartosz Naskręcki publishes Lean Doom Lab, pairing Doom play with Lean proofs

Users can play a route, pause on a game tick and inspect its Lean proof; in a browser course of nine authored maps, all 27 supplied route witnesses have stock Lean kernel audits. The lab's first-safe-exit theorems state that the player remains alive, physics succeeds and the last input raises the exit flag.

Checked against: nasqret/leandoom-proofs

Verification

Kamil Braun's Kotlean runs proven Lean code inside Android apps

Developers write an app's state, behavior and UI in Lean, prove properties of that code, and compile it into the app, while a small Kotlin host renders native Android Views. Examples include SnackNet, an original maze-chase game written in Lean, and Counter, a smaller starter with buttons and an editable note.

Checked against: kbr-/kotlean

Verification

Veil 2.0 released for verifying distributed protocols in Lean 4

The release adds verified model checkers for safety (2 to 20 times faster than TLC) and liveness, an LTL proof mode, a TLA+-to-Veil LLM skill, and a PlusCal-style DSL. George Pîrlea says Veil now supports anything the TLA+ Toolbox is used for; Ilya Sergey credits @zqy1018 and external contributors.

Image: x.com/ilyasergey

Checked against: @ilyasergey on X@GeorgePirlea on X

Verification

AI-written Lean model of CPython 3.15.2 finds hundreds of bugs

David Andrews and Chao Zhang's model spans 613,318 lines of Lean with 18,898 theorems and lemmas; each modelled function must agree with the real interpreter on at least 50,000 cases. Of 26,004 functions in scope, 4,071 (15.7%) are judged faithful by independent review, and 418 bug records reproduce on 3.15.2, each with a reproducer.

Checked against: Broyojo/python-formalization

Verification

Yalu Cai, Tung-Che Chang, and Santosh Nagarakatte verify an eBPF proof checker

Keel, an in-kernel proof checker for the Linux eBPF verifier, is specified in Lean and proved sound against bit-vector semantics; its implementation in EmbC, a deeply embedded C fragment, is proved to refine that specification. Formalizing the eBPF Certificate Framework (BCF) checker uncovered 13 bugs, and Keel runs 1.3X faster than BCF's checker.

First page of the paper
Image: paperswithlean.com

Checked against: arXiv:2611.11117

Verification

Giulio rebuffo's usdt-verify formally verifies deployed USDT bytecode in Lean 4

Built on EthLib's EVM model and program logic, the proofs are about the 11,075 deployed bytes read from Ethereum mainnet; the Solidity source served only as a guide. The README says each of its claims is proved and has passed several independent reviews, and that this does not mean USDT is verified unconditionally.

Checked against: Giulio2002/usdt-verify

More news