out of scope let-variable can appear in fun
binder type of metavariable assignment
#5939
Open
2 of 3 tasks
fun
binder type of metavariable assignment
#5939
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
The following declaration raises an error.
The unification that results from
have : x a = () := rfl
asigns the metavariable inx
tofun (a : N) => ()
. However,N
is not in the context ofx
, so the free variable remains in the definition ofx
.Context
I ran into an error caused by this
isDefEq
bug while programming. I reported the problem on Zulip.Steps to Reproduce
Use the above problematic declaration.
Expected behavior: [Clear and concise description of what you expect to happen]
The elaboration succeeds, and results in either
or the reduced form
Actual behavior: [Clear and concise description of what actually happens]
We get the error
(kernel) declaration has free variables '_example'
Versions
4.13.0
Additional Information
The minimized original example that I ran into is this:
The same underlying problem is responsible for #4375 and #5387. One problematic case was fixed by #4410.
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: