Vaccari's Code

AI outperforms mathematicians in counterexamples

7/21/2026

In recent times, the world of mathematical formalization has given us some surprises and, in particular, raised many questions about the role of artificial intelligence in theorem discovery and verification. As a senior engineer following the intersection of software and business, I have observed with great interest how AI tools are beginning to "counterexample" even human mathematicians.

AI Challenging Ancient Conjectures and Accelerating Formalization

The journey began a few months ago when ChatGPT refuted the Erdős Unit Distance Conjecture in discrete geometry. This, in itself, was a remarkable feat. The proof, based on a profound theorem by Golod and Shafarevich from the 1960s, was initially verified by human mathematicians. My first question, naturally, was: "Was this formalized in Lean?" For those unfamiliar, Lean is an interactive theorem prover — a program that allows writing mathematical proofs rigorously, verifying each step logically. It's like a compiler for mathematics. The initial answer was no.

However, the speed at which things moved was impressive. Less than a week later, Mike Freedman, a Fields medalist and Chief Science Officer at Logical Intelligence (a company co-founded by the "godfather of AI" Yan LeCun), announced that his system had auto-formalized the entire article generated by ChatGPT in Lean. This means that AI not only generated the idea of the proof, but another AI translated it into a formal, computer-verifiable language. A fascinating data point showing the capability of auto-formalization in real-time.

But the real game-changer came a month later. Boris Alexeev, from OpenAI, used the new Sol model to guide ChatGPT to a complete formalization of the Erdős counterexample, starting from basic mathematical axioms. What did this imply? That Sol had, in the process, generated proofs for extremely complex theorems from global class field theory — a branch of number theory that is notoriously difficult and took over 100 pages for humans to prove, with concepts developed in the early 20th century. What shocked me was the scale: Sol generated 1.2 million lines of Lean code in just three weeks. For context, mathlib, Lean's fantastic mathematical library, has 2.3 million lines and took nine years for a global community to write. It was at this point that it really clicked for me: major mathematical developments generated by AI are inevitable. And, of course, as an engineer, the first concern was security: AI-generated code cannot be blindly trusted, so execution in an isolated environment (sandbox) is crucial, as Lean, being a programming language, can execute arbitrary commands.

AI as an Error Detector and the Future of Verification

AI's capability is not limited to generating complex proofs. It has also proved effective in error detection. At a formalization workshop, I was using auto-formalization tools from companies like Logos Research. To set the stage, I fed Claude Fable and ChatGPT classic articles from the theory of finite flat group schemes (finite and flat group schemes, an advanced concept in algebraic geometry) to generate an exposition in natural language.

I handed this PDF document to Logos. On the first day of the workshop, they informed me that one of the statements in the PDF was incorrect and that their tool had found an explicit counterexample! Another counterexample, this time pointing out an error in the description of a standard construction generated by an LLM (Large Language Model). I myself had missed the error when reviewing the document. It's remarkable how AI not only indicated a flaw but presented a proof that the statement was false. This shows a qualitative leap: AI not only creates but also validates and corrects, acting as a tireless auditor.

Why This Matters to You, Builder and Decision-Maker

We are witnessing a fundamental shift in how mathematical knowledge, and by extension, logical and structured knowledge, can be generated and verified.

  1. Acceleration of Discovery and Verification: The ability to generate millions of lines of formalized code in weeks, or find counterexamples in complex texts, means that AI can drastically accelerate research and development in fields that depend on logical rigor. This has implications for software engineering, cryptography, hardware design, and any domain where correctness is critical.
  2. Increased Software Reliability: AI-driven formalization tools can help us build more reliable systems. Think of smart contracts, operating systems, or security algorithms. If AI can formalize complex mathematical proofs, it can, in theory, help formalize and verify the correctness of large codebases, reducing bugs and vulnerabilities.
  3. The Need to "Trust and Verify": Experience with AI-generated code (and even text) reminds us of the importance of human verification and proof tools. AI is a powerful tool, but not infallible. The combination of AI generating and formalizing, with humans and theorem provers verifying, creates a robust feedback loop.
  4. The Future of Problem Solving: AI is becoming a partner in solving complex problems, not only suggesting solutions but also validating them. For tech leaders and founders, this means that problems that once seemed insurmountable due to their formal complexity can become approachable with the help of AI systems.

The era in which human mathematicians are "counterexampled" by machines is not a sign that we are being replaced, but rather that we have new and powerful tools to expand the limits of what is possible, build more robust systems, and accelerate the pursuit of knowledge and truth. The question is not if AI will transform our work, but how we will intelligently and securely integrate it into our processes.


Sources


📬 Enjoyed this? Subscribe to the Vaccari's Code newsletter for the next wave of software & AI trends, straight to your inbox: Subscribe here

← all posts · listen to the episode →