Claude Generates Massive Mathematical Proofs to Verify Open Source Code
Anthropic and Theorem used an AI model to mathematically validate 123 libraries, uncovering hidden bugs that traditional testing missed.
By Madison Morris ·

Anthropic and its partner Theorem have demonstrated that Claude can automatically generate mathematical proofs to verify the correctness of existing software. This development marks a significant shift in how developers might trust AI generated code in the future. The system produced roughly 180 million lines of proof code for 123 open source libraries in a matter of weeks. This volume of work previously required teams of human specialists spending years on a single project.
The initiative addresses a long standing limitation in software engineering. Formal verification has historically been too expensive for general use. A team of experts took 20 person years to verify the seL4 operating system kernel. Because of this high cost, the method was largely reserved for critical systems like Airbus avionics. The new approach lowers the barrier by letting Claude handle the intensive proof generation work.
The process does not involve writing new application code. Instead, Claude translates crash tests into mathematical problems and analyzes compiled machine code. It then produces extensive proofs that an independent program called Rocq checks automatically. Anthropic describes the process as fully autonomous, though human experts at Theorem built the underlying tools and formal foundations. The model required almost no human reviewers during the verification phase.
The effort uncovered hundreds of bugs that conventional testing had failed to detect. Many of these issues only appear under very specific conditions, such as unusually large input files or specific access sequences. Claude was allowed to fix these bugs itself during the proof generation process. In one notable instance, the team found as many security bugs in a widely used PDF reader in one week as are typically reported in an entire year.
The discovery highlights the potential of this method for deep code auditing. In another application, Claude caught a logical error that had remained undetected for over a decade. Anthropic notes that even when a complete proof fails, the attempt often surfaces real bugs. This suggests that the verification process adds value even if it does not reach a final conclusion. The ability to find obscure errors improves overall software reliability.
However, the company emphasizes that formal verification does not mean the software is error free. The proofs hold only under strict conditions, including a specific processor architecture and single threaded programs. Inputs must also stay under 64 MB. In practice, these libraries often run on different hardware and configurations. Developers must understand these limits when applying the verified code to real world scenarios.
The compute cost for this process is significant. Individual proofs can run into the hundreds of millions of tokens. Anthropic did not report the total project costs, but the efficiency of newer models offers some relief. A smaller test run showed that Opus 5.5 solves half the proofs with about 40 percent fewer tokens than Opus 5. This efficiency gain makes the method more viable for broader adoption over time.
The project strengthens the case for greater software automation. If AI can write code and guarantee its correctness under defined conditions, the focus shifts to proving safety. Anthropic expects formal verification with AI to become as routine as standard testing soon. Theorem's roadmap already targets critical infrastructure libraries like glibc, OpenSSL, and cURL. This expansion could have consequences well beyond today's coding tools.
Source: The Decoder · original report published





