You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, (α := α) is equivalent to (α := .(α)) and does not bind a new variable. However, switching to the dot ident notation does not have this behavior, causing the example to fail.
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
When elaborating a constructor pattern, the parameters are treated as inaccessible.
example : List α → Bool | List.nil (α := α) => false | List.cons (α := α) .. => true
In this example,
(α := α)
is equivalent to(α := .(α))
and does not bind a new variable. However, switching to the dot ident notation does not have this behavior, causing the example to fail.example : List α → Bool | .nil (α := α) => false | .cons (α := α) .. => true
Context
This difference in behavior is relied upon in a mathlib test:
https://github.com/leanprover-community/mathlib4/blob/a7fc949f1b05c2a01e01c027fd9f480496a1253e/MathlibTest/congr.lean#L176-L181
Changing the pattern
.nil n
towalk.nil n
causes it to no longer succeed.Steps to Reproduce
Run the code above with the dot ident notation.
Expected behavior: No errors, same as the code which uses the full constructor name.
Actual behavior: The following error:
Versions
Lean 4.16.0-nightly-2025-01-07
This bug has been present since the introduction of the dot ident feature in e1fa9c1
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: