-
Notifications
You must be signed in to change notification settings - Fork 733
Description
Prerequisites
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
Consider the following example:
@[grind =]
def f : Nat → Nat
| 0 => 0
| n + 1 => f n
theorem foo (n : Nat) : f n = 0 := by
match n with
| 0 => grind
| n + 1 => grind [foo n]On 4.27.0-rc1 the proof fails (correctly according to Kim), but has an uninformative unknown free variable ... error. Especially because a user might expect this to work following #11268, it would be nice to give an informative error message, maybe indicating to try using have with the provided term.
On 4.28.0-nightly-2026-01-07 however, this example and another provided on Zulip both seem to pass. Given that Kim mentioned this should fail, I decided to still open this issue.
Context
Reported at #lean4>grind in recursive proofs
Steps to Reproduce
- Run the above example
Expected behavior: fail with a more informative error
Actual behavior: fails with a unknown free variable error
Versions
Version: 4.27.0-rc1, 4.28.0-nightly-2026-01-07
Target: x86_64-unknown-linux-gnu
Additional Information
[Additional information, configuration or data that might be necessary to reproduce the issue]
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.