∴LeanProofs
Guide

How do I repair a small Lean proof?

Read the expected type, compare it with the term you supplied, and make the smallest change. Keep incomplete goals distinct from invalid statements and unavailable infrastructure.

LeanProofs editorial · 24 November 2026 · native examples compiled 25 November 2026; mathematical review pending

Type mismatch: the term proves something else

If h : P, then exact h can close a goal P, but it cannot generally close a goal Q. Compare the hypothesis and goal rather than adding axioms. Our implication-composition example shows how the type of each supplied proof determines which goal it can close.

Unsolved goals: a step is missing

For P ∧ Q, constructor creates two obligations. You still need a proof of each side. Follow the conjunction example and use the hypotheses separately; inserting sorry only hides the missing work.

Reflexivity: the two sides must reduce to the same term

rfl works on n = n. It does not establish arbitrary arithmetic facts such as n = n + 1. Check the intended statement before changing tactics. A typo in the theorem statement is a different problem from a typo in the proof.

Missing import or unavailable checker

These examples target the built-in core library. Mathlib imports will require a separately pinned Mathlib environment. An unavailable checker or a timeout is infrastructure status, not evidence that your statement is false. The experimental checker reports actual compiler diagnostics and never issues a course pass.

Sources & next step