Pant argues that tests cover only selected inputs, human review cannot keep pace with coding agents, and LLM judgments are probabilistic. In spec-driven development, people define and validate what correct means, while agents implement the specification and verification tools check the result.
Your Code Has Bugs. Lean4 Has Proofs: Formal Verification for Engineers
Speaker
Varun Pant, who leads formal verification teams while building AI products at AWS, explains how engineers can use Lean and related tools to prove software properties across all inputs.
Lean uses one language for definitions and proofs, with a small trusted kernel that checks proof results. Pant demonstrates a list-reversal theorem and compares trying proof tactics to exploring moves in chess, including backtracking when a tactic does not work.
Pant describes an open-source Andreo AI project that converted the C compression library zlib to Lean. AI generated a formal specification from the claim that decompressing compressed data returns the original, then produced Lean code, helper lemmas, and proofs. The result included 32,000 lines of proof checked by a small independent kernel.
Cedar's policy language is specified in Lean while its production implementation runs in Rust; Pant says about 100 million differential random tests run nightly, and versions ship only after they pass. He also describes Verus, which uses Z3 with preconditions and postconditions, and Enus, which translates Rust's intermediate representation into Lean.
Strata is an open-source work in progress at AWS for translating programs from different languages into a shared intermediate form called Strata Core, written in Lean. That representation can be checked with Lean proofs, SMT solvers, or model checkers. Pant suggests starting with critical code, writing and validating its specification, and using an agent to implement it.
Takeaways
- Treat the specification as a critical artifact: review it or test it before using it to generate code.
- Use formal proofs when you need a property to hold across all inputs, rather than relying only on tests.
- Consider a Lean model plus differential testing when production code runs in another language, as Cedar does with Rust.
- For Rust code, Verus supports preconditions and postconditions that are checked statically and erased at runtime.
- Start with a small, critical piece of code and define what correct means before asking an agent to implement it.
Mentioned in this talk
Search inside this talk
What was claimed 12
- works atVarun Pant works at
AWS
“I build AI products at AWS”
YouTube Unverified1 source· Talk
- feature
Kiro: Named as an example of spec-driven development.
“One way is spec-driven development, for example, with Kiro.”
YouTube Unverified1 source· Talk
- featureLean: Programming language and proof assistant using the same language for definitions and proofs, with a small trusted kernel.
“Lean is a programming language and a proof assistant.”
YouTube Unverified1 source· Talk
- usesLean conversion
“Andreo AI, which converted zlib, a C compression library, to Lean.”
YouTube Unverified1 source· Talk
- usesProduction code runs in Rust.
“the production code runs in Rust.”
YouTube Unverified1 source· Talk
- usesIts specification is written in Lean.
“The specification of Cedar is written in Lean”
YouTube Unverified1 source· Talk
- metricDifferential random testing: About 100 million tests run nightly for Cedar.
“About 100 million differential random tests run nightly.”
YouTube Unverified1 source· Talk
- uses
“It uses the very powerful solver Z3.”
YouTube Unverified1 source· Talk















