AI will make formal verification go mainstream
TL;DR Highlight
LLMs make proofs cheap, so Kleppmann predicts formal verification will go mainstream.
Who Should Read
A backend developer tired of manually reviewing AI-generated code and wondering if proofs could replace review.
Core Mechanics
- Proofs were too expensive to use
- The seL4 microkernel had 8,700 lines of C, and as of 2009 its proof took 20 person-years and 200,000 lines of Isabelle.
- That is 23 proof lines and half a person-day per implementation line.
- The author guesses only a few hundred people worldwide can write such proofs (his own "wild guess").
- LLMs have started writing proof scripts
- Coding assistants are getting pretty good at proof scripts in several languages, not just implementation code.
- A specialist still has to guide the process today.
- The author expects full automation within a few years.
- The proof checker catches hallucinations
- An invalid proof is rejected by the proof checker, which forces the AI agent to retry.
- The checker is a small, itself-verified piece of code, so sneaking a bad proof past it is virtually impossible.
- AI code needs proofs instead of human review
- The author would rather have AI prove its generated code correct than have humans review it.
- Precise verification offsets the imprecise, probabilistic nature of LLMs.
- The bottleneck shifts from proofs to specs
- Checking that the proved properties are the ones you care about still takes expertise.
- Writing the spec is still much easier and faster than writing the proof by hand.
- AI might help translate between formal and natural language, but nuance could be lost.
- Lean is where the action is
- A September 2025 paper coins "vericoding" (vs. vibecoding) and presents benchmark results for several languages.
- The author has heard reports that Harmonic's Aristotle, Logical Intelligence, and DeepSeek-Prover-V2 are getting pretty good at Lean proofs.
Community Reactions
- Experience writing tens of thousands of lines of Lean 4
- One commenter said work that took 6 months in Coq during their PhD now takes hours to days since Opus 4.5 and GPT 5.2.
- Their role shifted from finding proofs to checking definitions and statements.
- Counterargument that specs are the real bottleneck
- Several commenters said requirements are incomplete, contradictory, and users often don't know what they want.
- One argued proofs faded because development moved from waterfall to agile.
- Opinion that mainstream means property checks in CI
- Commenters expect proof engines to hide behind property-based tests, contracts, and linters rather than direct Lean use.
- Calling it "verification" gets it filed as a research project, so it should look like a CI checkbox.
- Experience putting Quint specs between prompts and code
- One team tried this on a consensus engine change and said it worked out better than expected.
- Opinion that agents need ways to validate their work
- A commenter said good results from coding agents depend on execution and testing setups, and formal verification tools extend that spectrum.
How to Apply
- Have the agent write the success-check program first
- Pick one small function today and have the agent write a property test or verification script first.
- Then ask it to implement the function and iterate until the check passes.
- Finally, verify the result yourself.
- Write invariants for a critical module in plain sentences
- Pick a module where bugs are costly, such as payments or a state machine.
- Write 3 to 5 lines of properties it must always satisfy and ask the AI what you missed.
- Those sentences become your spec later.
- Ask for Lean proofs on a pure-logic function
- Have the AI port a side-effect-free function to Lean 4 and prove it.
- The proof checker passing is your acceptance criterion.
- Still read the definitions and statements to confirm they match your intent.
Try It
# Paste into Claude, ChatGPT, or Claude Code (simplified version of the idea: spec first, verify, then implement)
Work on the function below based on its requirements.
[Requirements]
{{function description}}
Follow these steps:
1. List up to 5 properties (invariants) this function must always satisfy, in plain language. Ask me if you think I missed any.
2. Translate those properties into Lean 4 theorems. Do not write proofs yet.
3. Write the implementation in Lean 4 and attempt a proof for each theorem. If you get stuck, say where.
4. Finally, translate each theorem statement back into plain English, one line each, so I can check they capture the properties from step 1.
Note: never claim an unprovable statement is proved. If there is a counterexample, show it.Terminology
Related Papers
Gemini 4 Neon is the new #1 on the Models Engineering Index
Gemini 4 Neon ranks first on the Models Engineering Index with 68.0, combining multiple benchmarks.
LLMs can read and write executables byte by byte from a hex dump
Given only a hex dump and no tools, an LLM analyzed, patched and wrote working executables.
Claude was trained on protein sequences at scale
Next-amino-acid tests on obscure proteins show only the latest Claude models predict them
Remembered as Brief: Stored Preferences SilentlyRemove Decision-Critical Information
A stored 'keep it short' preference silently drops warnings; listing must-know points first restores content.
All AI-generated code should be Open Source
A blog argues AI-generated code should be open source; most HN commenters disagreed.
What thousands of conversations look like inside a language model
Mapping Qwen3-1.7B states showed Chinese sitting apart from English, while German and Croatian overlapped it.
AI, activity, and outcomes in software engineering
AI sped up writing code, but shipping speed did not rise as much, says a talk
LLMs Play Zachtronics' TIS-100
16 LLMs played TIS-100 and set 133 new Pareto frontier points across 18 puzzles