All products

Debug a Lean proof with AI

Inspect the exact goal at a failing line, test a small change and leave a proof another mathematician can follow.

Debug a Lean proof with AI by starting at a particular line where your argument stops working. Perhaps you know that two expressions are equal, but the lemma you chose requires an inequality as a separate hypothesis. The lean-proof-assistant skill asks the agent to inspect the local context before it suggests another tactic.

For a substantial theorem, supply a short mathematical argument as well as the code. A good next step explains what the new goal should be. You can then check whether Lean agrees before investing time in the rest of the proof.

What it does

  • Read the hypotheses and notation that are actually in scope.
  • Trace a failed tactic back to the goal it received.
  • Find a library result that can replace a handwritten helper.
  • Check one proof step at a time in the project's environment.
  • Remove temporary inspection commands before the final check.

Install and use

  1. Give the agent the authorised Lean 4 project and a working toolchain, including its Mathlib dependency when used.
  2. Ask, “Show me the goal before this line. Which assumption does the lemma need that my argument hasn't supplied?”
  3. Apply the smallest proposed repair, inspect the remaining goals and check the complete file once the proof closes.

FAQ

Source

Made by Texra (texra-ai). Original skill: lean-proof-assistant, published on GitHub under the MIT licence.

View on GitHub