← Latest papers
🤖 AI

Case study: proving sqrt(2) irrational with LPTP and an LLM

This paper presents a case study demonstrating how an LLM, guided by basic logic programming definitions and verified by the LPTP theorem prover, can successfully generate a complete, human-readable formal proof of the irrationality of the square root of 2.

Original authors: Fred Mesnard, Étienne Payet, Wim Vanhoof

Published 2026-07-24
📖 6 min read🧠 Deep dive

Original authors: Fred Mesnard, Étienne Payet, Wim Vanhoof

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

Imagine you are a detective trying to solve a mystery that has baffled humans for over two thousand years: Is the square root of 2 a "rational" number? In the world of math, a rational number is like a perfect fraction, a clean slice of a pie (like 3/4 or 5/2). An irrational number is a messy, never-ending decimal that can never be written as a simple fraction. The square root of 2 is the length of the diagonal of a square with sides of length 1, and ancient mathematicians proved it is messy—it cannot be a fraction.

Now, imagine you have two very different tools to help you solve this. The first is a super-strict, robotic referee called LPTP. It speaks a very precise, logical language (based on Prolog) and will only accept a proof if every single step is mathematically perfect. If you make even a tiny mistake, it slams the gavel and says, "Nope, invalid." The second tool is a Large Language Model (LLM), which is like a super-smart, creative student who has read almost everything ever written. This student is great at guessing the next step in a story or a math problem, but sometimes it "hallucinates," making up facts that sound good but are actually wrong.

The big question for scientists today is: Can we team up these two? Can we let the creative student do the heavy lifting of writing the proof, while the strict referee checks every single sentence to make sure the student isn't lying? This paper explores exactly that partnership, using the ancient mystery of the square root of 2 as the test case.


The Great Proof-Checking Team-Up

In this paper, the authors set out to see if they could use a modern AI (specifically, a model called Claude) to help prove that the square root of 2 is irrational, but with a twist: the proof had to be written in a very specific, strict format that the robotic referee (LPTP) could understand and verify. They didn't just want the AI to say "it's true"; they wanted the AI to write the actual step-by-step logic, which the referee would then grade.

The story starts with a simple idea. To prove the square root of 2 is irrational, you usually assume the opposite: that it is a fraction made of two whole numbers, pp and qq, that don't share any common factors (they are "coprime"). If you do the math, you eventually run into a contradiction where both numbers must be even, which means they do share a factor (2). This breaks the rule that they were coprime, proving the original assumption was wrong.

The authors tried to get the AI to write this proof in the strict language of LPTP. At first, the AI was like a student who knows the story but can't write the essay in the required format. It would try to jump steps or make logical leaps that the referee wouldn't accept.

Here is where the teamwork happened. The authors set up a feedback loop:

  1. The AI tries to write a proof step.
  2. The referee (LPTP) checks it.
  3. If the referee finds a mistake, it points out the exact line where the logic broke.
  4. The authors show that error to the AI.
  5. The AI tries again, fixing the specific error.

This process was like a game of "hot and cold." The referee didn't just say "wrong"; it said, "You made a mistake in step 4," allowing the AI to correct its course.

The Results: A Partial Victory

The experiment was a success, but with some caveats. The AI was able to prove many of the smaller, easier parts of the puzzle on its own. For example, it successfully proved that "if a number is even, its square is even" or that "2 times a number is even." The authors call these "lemmas" (small helper proofs). The AI got these right, sometimes even coming up with new helper ideas that the humans hadn't thought of.

However, for the trickiest part of the proof—the specific logic showing why the square root of 2 cannot be a fraction—the AI got stuck. It couldn't quite find the right path on its own. So, the human authors had to step in and give the AI a "hint" or even write the main structure of the proof themselves, asking the AI to fill in the smaller gaps.

In the end, they produced a complete, formal proof that the square root of 2 is irrational. This proof was partially written by the AI and fully checked by the robot referee. The referee gave it a passing grade, confirming that the logic was sound.

What This Means

The paper doesn't claim that AI can now solve all math problems on its own. In fact, the authors explicitly show that the AI cannot do it alone; without the human guidance and the strict checking of the referee, the AI would likely have produced a fake or broken proof.

Instead, the paper suggests a new way of working: AI as a draft writer, humans as editors, and formal tools as the fact-checkers. The AI is fast and creative, generating ideas and filling in details, while the formal tool (LPTP) acts as an unblinking eye that catches hallucinations and errors.

The authors also tested other automated math tools (called ATPs) to see if they could do the job faster. These tools were fast and free, but they produced proofs that were hard for humans to read and couldn't be easily added to the library of verified math. The AI approach, while slower and requiring human help, produced proofs that were readable and could be safely stored for future use.

In short, this paper shows that we don't need to choose between human intuition and machine precision. By letting the AI do the heavy lifting of drafting and the strict tools do the grading, we can build a system where AI helps us prove complex mathematical truths, as long as we keep a human in the loop to steer the ship and a strict referee to check the map. The square root of 2 remains irrational, but now we have a new, collaborative way to prove it.

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 →