← Latest papers
🤖 AI

Just Type It in Isabelle! AI Agents Drafting, Mechanizing, and Generalizing from Human Hints

This paper presents a formal metatheoretical account and Isabelle/HOL mechanization of complete and minimal type annotations for rank-one polymorphic λ\lambda-calculus terms, developed through a collaborative workflow where human and AI agents independently produce proofs that are subsequently autoformalized and generalized with human-guided AI interventions.

Original authors: Kevin Kappelmann, Maximilian Schäffeler, Lukas Stevens, Mohammad Abdulaziz, Andrei Popescu, Dmitriy Traytel

Published 2026-04-20
📖 6 min read🧠 Deep dive

Original authors: Kevin Kappelmann, Maximilian Schäffeler, Lukas Stevens, Mohammad Abdulaziz, Andrei Popescu, Dmitriy Traytel

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 Big Picture: The "Perfect Translator" Problem

Imagine you have a very complex, high-tech recipe written in a secret code. This recipe includes not just the ingredients (like "flour" or "eggs") but also specific instructions on what kind of flour (e.g., "gluten-free") and what kind of eggs (e.g., "organic").

Now, imagine you want to send this recipe to a friend. You want to write it out in plain English so it's easy to read. However, you have a strict rule: When your friend reads your plain English version and tries to cook it, they must end up with the exact same dish as the original secret code.

If you leave out too many details (like just saying "flour" instead of "gluten-free flour"), your friend might accidentally use regular flour, and the cake will collapse. But if you write every single detail (e.g., "organic, free-range, large, brown-shelled, gluten-free flour"), the recipe becomes a nightmare to read.

The Goal: Find the "Goldilocks" version of the recipe. It needs to have just enough details to ensure the friend cooks the right dish, but no more than necessary so it remains easy to read.

The Real-World Context: Isabelle and Type Annotations

In the world of computer science, specifically with a tool called Isabelle (a proof assistant used to verify math and code), this is exactly the problem the authors tackled.

  • The "Recipe": A computer program or a mathematical proof.
  • The "Secret Code": The fully typed version where every variable has a specific type assigned (e.g., this number is an integer, that one is a string).
  • The "Plain English": The printed version shown to the human user.
  • The "Details": Type annotations. These are little labels attached to variables telling the computer what they are.

The problem is: If you print a proof without enough labels, the computer's "guessing game" (called type inference) might guess the wrong type, breaking the proof. If you print it with too many labels, it's ugly and hard to read.

The Human vs. The AI Robot

The authors of this paper didn't just solve the problem; they ran a fascinating experiment to see how Humans and AI (specifically a Large Language Model called Claude) handle the job of solving it.

Think of it like a cooking competition between a Master Chef (the Human) and a Super-Intelligent Robot Chef (the AI).

1. The Human Chef (The Experts)

The human experts sat down with pen and paper. They:

  • Wrote down the rules of the game.
  • Created a mathematical proof showing exactly how to remove unnecessary labels without breaking the recipe.
  • Result: They produced a perfect, rigorous proof. But it took them about 5 days of hard work.

2. The Robot Chef (The AI Agent)

The authors gave the AI a messy, informal description of the problem (like a recipe written in a hurry) and asked it to do the same job.

  • Round 1: The AI tried to write the proof. It got the main ideas right but made some silly mistakes (like saying "flour" when it meant "sugar," or forgetting to define what "flour" even is).
  • The Review: A human looked at the AI's work and said, "Hey, you missed this step," and "You defined this wrong."
  • Round 2-4: The AI fixed its mistakes, learned from the feedback, and eventually wrote a proof that was almost as good as the human's.
  • Result: The AI did it in about 2 hours of computer time and cost only $70 in computing fees.

The "Auto-Translation" Phase

Once both the Human and the AI had their "pen-and-paper" proofs, the authors asked the AI to do one more thing: Translate these proofs into the actual computer code (Isabelle/HOL) that the proof assistant can read and verify.

  • The Human Proof Translation: The AI successfully translated the human's clean, logical proof into code.
  • The AI Proof Translation: The AI also successfully translated its own messy-but-improved proof into code.

The Surprise: The AI managed to do all the heavy lifting of writing the formal code for both versions. The humans didn't write a single line of the final code! They just acted as the "editors" and "managers."

The "Generalization" Twist (The Magic Hint)

In the final experiment, the authors gave the AI a "hint." They said, "Hey, this problem you're solving? It's actually just a special case of a famous, generic math problem called an 'Independence System'."

The AI immediately understood. It realized, "Oh! I don't need to reinvent the wheel. I can just use the existing rules for this generic problem to solve my specific problem instantly."

The AI then wrote a new, shorter proof based on this generic rule. It showed that AI can act like a super-smart research assistant that connects dots humans might miss, making the work much faster.

Key Takeaways (The "So What?")

  1. AI is a Great Draftsman: The AI can write complex mathematical proofs and computer code very quickly, but it needs a human to check its work for logic errors. It's like a brilliant intern who writes fast but needs a manager to sign off.
  2. Cost vs. Time: The human took 5 days. The AI took 2 hours and cost $70. For the price of a nice dinner, you can get a draft of a complex mathematical proof.
  3. The Future of Math: This suggests a new way of doing math and computer science. Instead of humans doing everything from scratch, humans can act as "conductors," guiding AI agents to do the heavy lifting of writing proofs, while humans focus on the big ideas and checking the results.
  4. The "Round-Trip" Success: They proved that you can print a computer proof, strip away the clutter, and have the computer perfectly reconstruct the original. It's like shredding a document and having a machine perfectly reassemble it, provided you leave a few specific "glue spots" (annotations) intact.

In short: The paper shows that AI is ready to be a partner in solving hard math and computer science problems, provided humans are there to guide it, review its work, and give it the right hints. It's a "Human + AI" team that is faster and cheaper than humans working alone.

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 →