← Latest papers
💻 computer science

CircuitProver: Agentic Lean 4 Theorem Proving with Reusable Circuit Proof Library for Hardware Verification

CircuitProver is an agentic Lean 4 framework that automates hardware verification by translating parameterized designs and specifications into executable models, iteratively constructing machine-checked proofs, and distilling these results into a reusable library that significantly improves proof efficiency and success rates compared to vanilla agents.

Original authors: Ziyi Yang, Wenji Fang, Chen Chen, Zhiyao Xie, Hongce Zhang

Published 2026-07-31
📖 7 min read🧠 Deep dive

Original authors: Ziyi Yang, Wenji Fang, Chen Chen, Zhiyao Xie, Hongce Zhang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Detective's Dilemma: Why We Need Smarter Hardware

Imagine you are building a massive, incredibly complex Lego city. Every brick is a tiny electronic switch, and together they form a computer chip that powers everything from your phone to the self-driving cars of the future. The problem? These cities are getting so huge and complicated that even the best human architects can't check every single brick to make sure it won't fall apart. If one tiny switch is in the wrong place, the whole city could crash.

For years, the standard way to check these cities has been like a "black box" test. You build a specific version of the city (say, with 8 floors), run a super-fast robot to see if it works, and it gives you a simple "Pass" or "Fail" stamp. If it fails, the robot might show you a picture of the broken brick. But here's the catch: the robot doesn't tell you why it broke, and it doesn't remember the lesson for the next city. If you build a slightly bigger city with 16 floors, the robot has to start from scratch, re-figuring out all the same rules, even though the logic is almost identical. It's like solving a math problem, getting the answer, and then throwing away your work so you have to re-solve the exact same problem for the next question.

This is where a new field called "formal verification" comes in. Instead of just testing, it tries to write a mathematical proof that the city is perfect. But writing these proofs is usually a super-hard job that requires a human genius to guide a computer step-by-step. Now, a new team of researchers has built a tool that acts like a super-smart detective who not only solves the puzzle but also writes a "cheat sheet" for future detectives, making the job faster and easier every time.

CircuitProver: The Detective Who Learns from Every Case

The paper introduces CircuitProver, a new system designed to check hardware designs (the "cities") using a programming language called Lean 4. Think of Lean 4 as a super-strict math teacher who never accepts a wrong answer. CircuitProver is an "agent," which is just a fancy word for an AI robot that can talk to this teacher, try to solve the problem, listen to the teacher's corrections, and try again until it gets it right.

But the real magic isn't just that it can solve the problems; it's what it does after it solves them.

The Old Way vs. The New Way

In the past, verifying hardware was like checking a single lock on a single door. If you had a door that could be 8 inches wide, 16 inches wide, or 100 inches wide, you had to check the 8-inch version, throw away the notes, check the 16-inch version, throw away the notes, and so on. The paper argues that this is wasteful. The logic for how the lock works is the same, regardless of the size.

CircuitProver changes the game by treating the door as a "parameterized" design. It asks, "Can we prove this lock works for any size?" Instead of checking one specific door, it proves a general rule that covers all possible sizes at once.

The "Cheat Sheet" Library

Here is the most exciting part: CircuitProver keeps a Reusable Proof Library. Imagine you are a detective solving a series of burglaries.

  1. The First Case: You solve a tricky burglary. It takes you 13 rounds of investigation. You figure out that the thief always leaves a specific type of mud on the windowsill.
  2. The Old Way: The next time a similar burglary happens, you ignore your notes. You spend 13 rounds of investigation again, rediscovering the mud clue.
  3. The CircuitProver Way: After solving the first case, you write down a "Proof Strategy" note: "If you see mud on the windowsill, check the attic immediately." You also save the "Machine-Checked Fact" (the proof that the mud means the thief was there).
  4. The Next Case: When a new burglary happens, your robot detective looks at the library. It sees the mud clue, grabs the "check the attic" strategy, and solves the case in just 6 rounds.

The paper shows that by using this library, the system didn't just get faster; it got smarter. It could solve problems that a standard robot (without the library) couldn't solve at all.

What the Numbers Say

The researchers tested CircuitProver on 63 different hardware tasks, ranging from simple math circuits to complex memory systems.

  • Success Rate: A standard robot (called a "vanilla agent") managed to solve 92.1% of the tasks. CircuitProver, with its library and smart strategies, solved 100% (all 63 tasks).
  • Speed: The standard robot took an average of 9.2 rounds of trying and failing to get a proof. CircuitProver only needed 4.6 rounds—it was twice as fast.
  • Time: The total time to verify the designs dropped by 23.2%.
  • Complexity: The proofs themselves were 16.3% shorter, meaning the logic was cleaner and easier to read.

The paper also tested this on huge, processor-level designs (like the brains of real computers). Here, the benefits were even bigger. CircuitProver reduced the time and effort by more than 50% compared to the standard robot. This suggests that as hardware gets more complex, the "cheat sheet" library becomes even more valuable, saving researchers from having to reinvent the wheel every time.

How It Works (The Magic Trick)

CircuitProver works in three main steps:

  1. Translation: It takes the hardware design (written in a language called Chisel) and translates it into the strict math language of Lean 4. It also translates the human description of what the hardware should do into a math problem.
  2. The Detective Work: The AI agent tries to prove the math problem. If it gets stuck, it asks the Lean 4 teacher for help. The teacher says, "No, that step is wrong," and the agent tries a different path.
  3. The Library Update: Once the proof is done, the system doesn't just file it away. It analyzes how it solved the problem. It extracts the "aha!" moments (like "use this specific math trick for carry-overs") and adds them to the library. Next time, the agent can just grab that trick instead of figuring it out from scratch.

Why This Matters

The paper suggests that this approach is a major step forward for hardware verification. By accumulating knowledge, we stop treating every new chip design as a brand-new mystery. Instead, we build a growing library of solved puzzles that makes verifying future, more complex chips faster and more reliable.

The researchers admit that their system currently works best with specific types of hardware designs and that it relies on powerful AI models (they tested it with different versions of an AI called Claude, finding that the smarter the AI, the better the results). However, the core idea—that we can teach computers to learn from their own proofs and share that knowledge—is a powerful new direction. It turns hardware verification from a repetitive, manual grind into a smart, self-improving process.

In short, CircuitProver is like giving a detective a memory and a notebook. It doesn't just solve the case; it remembers how it did it, so the next time a similar crime happens, the city is safe much faster.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →