LeanTutor: Towards a Verified AI Mathematical Proof Tutor

This paper introduces LeanTutor, a proof-of-concept system that combines Large Language Models with theorem provers to create an AI mathematical proof tutor, and evaluates its effectiveness using the newly introduced PeanoBench dataset.

Manooshree Patel, Rayna Bhattacharyya, Thomas Lu, Arnav Mehta, Niels Voss, Narges Norouzi, Gireeja Ranade

Published 2026-03-05
📖 5 min read🧠 Deep dive

Imagine you are learning to play a complex instrument, like the violin. You have two potential teachers:

  1. The "Genius" AI (LLM): This teacher is incredibly chatty, speaks your language perfectly, and can write beautiful music. But, they are prone to making up facts. They might tell you, "Just press this string here," and when you do, it sounds terrible. They are confident, but often wrong.
  2. The "Robot" Musician (Theorem Prover): This teacher is a machine that never makes a mistake. If you play a wrong note, it immediately beeps and says, "Error." But, it speaks in a secret code (mathematical symbols) that is incredibly hard for a human to understand. It can't explain why you're wrong in a way that helps you learn; it just stops you.

LeanTutor is the dream collaboration between these two. It combines the friendly, conversational nature of the "Genius" AI with the unshakeable accuracy of the "Robot" Musician.

Here is how the paper breaks down this idea in simple terms:

The Problem: The "Helpful" Trap

Right now, students use AI chatbots (like ChatGPT) to help with math proofs. The problem is that these chatbots are designed to be helpful, which often means they just give you the answer. Worse, they sometimes "hallucinate"—they confidently explain a math concept that is completely made up. In a math class, getting a wrong answer with a confident explanation is dangerous because it stops you from learning how to think.

The Solution: LeanTutor

The researchers built a system called LeanTutor. Think of it as a three-person team working together to help a student:

  1. The Translator (Autoformalizer):

    • What it does: The student types their proof in plain English (e.g., "I will start by assuming x is zero"). The Translator instantly converts this into the strict, secret code that the Robot Musician understands.
    • The Analogy: Imagine you are speaking English, and a translator instantly turns your words into a computer program. If you make a grammar mistake in English, the translator might get confused, but LeanTutor tries to be very careful to keep your meaning exactly the same.
  2. The Referee (Next-Step Generator):

    • What it does: Once the Translator converts the student's idea into code, the Robot Musician checks it. If the student is stuck or made a mistake, the Referee looks at the "Game Board" (the current state of the proof) and suggests the next valid move.
    • The Analogy: Think of a chess coach. You make a move, and the coach says, "That's a legal move, but it doesn't get you closer to winning. Try moving your knight here instead." The coach knows the rules perfectly but doesn't just play the game for you.
  3. The Coach (Feedback Generator):

    • What it does: The Referee knows the next move, but it speaks in code. The Coach takes that code and translates it back into friendly, natural English advice.
    • The Analogy: Instead of saying "Error: Syntax mismatch," the Coach says, "You're trying to skip a step! Remember, you need to prove the base case before you move to the next one. Try simplifying that first part."

The Training Ground: PeanoBench

To teach this system, the researchers couldn't just use random math problems. They needed a specific set of practice problems where they knew the answer perfectly. They created PeanoBench, a dataset of 371 math proofs about basic numbers (Peano Arithmetic).

  • They took existing proofs from a game called "Natural Numbers Game."
  • They created "Correct" versions (written by experts).
  • They created "Incorrect" versions by intentionally removing steps or making logical jumps, mimicking the mistakes real students make.
  • They wrote these in different "personalities" (some very short and algebraic, some very wordy and explanatory) to make the system robust.

How They Tested It

They didn't just hope it worked; they tested it rigorously.

  • They gave the system incorrect proofs (the kind a student would write).
  • They compared LeanTutor against a standard AI chatbot.
  • The Result: LeanTutor was much better at spotting exactly where the student went wrong and giving a hint that guided them to the solution without just handing over the answer. The standard AI often gave vague advice or accidentally revealed the whole answer.

The Catch (Limitations)

The paper admits this is a "Proof of Concept" (a working prototype), not a finished product yet.

  • The Translation Gap: If the student's English is too messy or vague, the Translator might get it wrong, and the whole system breaks.
  • The "Perfect Answer" Requirement: Currently, the system needs a "Staff Solution" (a perfect proof written by a human) to work. It can't invent a new proof from scratch; it just guides you toward a known solution.
  • Scope: Right now, it only works on basic number theory. It hasn't been tested on complex calculus or advanced physics yet.

The Big Picture

The ultimate goal of LeanTutor is to create a math tutor that is safe. It uses the AI to talk to you like a human, but it uses a "truth machine" (the theorem prover) in the background to ensure that every piece of advice is mathematically 100% correct. It's the best of both worlds: the patience of a human tutor with the precision of a supercomputer.