Google DeepMind has open-sourced the Lean 4 framework used to verify quantum algorithms developed by its Gemini 4 agents, including one that reduced estimated computational costs by 290 times.
The GitHub repository contains the mathematical definitions, specifications, and verified solutions, but Google has kept the system that coordinated the agents’ work internal.
Monday’s release follows “Discovering Formally Verified Quantum Programs with AI,” a paper Google posted to arXiv on November 6 that describes how it combined multi-agent algorithm discovery with machine-checked proofs.
The agents used a theorem prover to check whether their quantum programs met predefined requirements for correctness and computational cost.
The agents used a theorem prover to check whether their quantum programs met predefined requirements for correctness and computational cost. Google recently took a similar approach when it used Gemini 4 Carbon to prove properties of Signal’s encryption in Lean.
Inside the Lean 4 framework
Google built the framework on Lean 4, extending the Mathlib and Physlib libraries to support quantum programming and verify its computational costs; the same theorem prover underpins code-focused projects such as Mistral’s Leanstral.
QuantumComputation contains the core quantum programming tools and mathematical definitions, while QuantumComputationSpecs defines the problems the agents were tasked with solving and the requirements their solutions had to meet.
The framework supports both classical control flow and quantum operations, using quantum Hoare logic to prove that programs behave as expected. It also calculates the resources each algorithm requires, with Google measuring computational cost by multiplying the number of logical qubits by the number of T gates.
Developers can build the repository using Lean’s Lake build system.
lake exe cache getlake build
The company keeps the verified algorithms in a separate discoveries branch and has released the software under Apache 2.0. Google also plans to expand its cost models to account for classical computation and control flow.
How the agent teams coordinated
Independent teams of Gemini 4 Carbon agents worked on optimization problems with fixed mathematical specifications. The agents refined their algorithms in response to Lean’s verification results.
The most collaborative effort involved a non-Born-Oppenheimer photochemistry simulation, with as many as seven teams working in parallel.
The most collaborative effort involved a non-Born-Oppenheimer photochemistry simulation, with as many as seven teams working in parallel.
The teams maintained a shared wiki of verified results and met virtually every four hours to compare their progress and build on one another’s discoveries.
Stopping agents from gaming proofs
Because the agents could modify files in their own environments, there was a risk they might weaken specifications or introduce assumptions simply to make their proofs pass. Submissions were therefore checked in clean sandboxes against fixed specifications, with Lean Comparator flagging changes to definitions and theorems and rejecting proofs containing placeholders or unauthorized axioms.
The separation resembles the approach Anthropic’s Claude Code team uses, relying on automated checks rather than human review to evaluate AI-written code. Google has published the formal verification libraries and solutions, but not the infrastructure that coordinates the Gemini agents.
What the algorithms save
The largest gain came from a fixed-point arcsin algorithm, where estimated resource costs fell by a factor of 290. The revised circuit requires 100 logical qubits and 3,698 T gates, compared with 245 qubits and at least 440,576 T gates in the original implementation. Classical testing produced the initial improvements, with formal verification enabling more complex circuit designs that cut costs by another 11%.
Photochemical simulation costs fell roughly eightfold, while a simulation involving cytochrome P450 saw a 2.5-fold improvement.
For an inertial confinement fusion simulation, the agents reduced estimated costs by a factor of 11.8 and lowered the logical qubit requirement from 5,650 to 4,338. Photochemical simulation costs fell roughly eightfold, while a simulation involving cytochrome P450 saw a 2.5-fold improvement.
These are formally verified resource estimates, not performance measurements from quantum hardware; scientific simulations remain beyond the capabilities of current quantum computers.
Developers can independently check the published proofs using the repository’s pinned Lean, Mathlib and Physlib dependencies, with the verified algorithms available in a separate branch. Reproducing the discovery process is another matter, since Google’s agent orchestration system remains proprietary.
The framework’s resource model also has limitations. As noted in Google’s research announcement, it does not yet fully account for classical computation and control flow, which the team plans to address in future updates.
The post Google’s AI agents cut quantum computing costs 290-fold — now you can check their work appeared first on The New Stack.
