-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structural recursion: wrong motive generated #6015
Comments
Ok, in general there is code there for this kind of reshuffling of arguments, but it seems to be not tested enough. Maybe the tests only had one level of indices or so. I can have a look next week. |
nomeata
added a commit
that referenced
this issue
Nov 18, 2024
This PR fixes a bug where structural recursion did not work when indices of the recursive argument appeared as function parameters in a different order than in the argument's type's definition. Fixes #6015.
Mostly a straight-forward fix, it seems: #6116 |
github-merge-queue bot
pushed a commit
that referenced
this issue
Nov 18, 2024
This PR fixes a bug where structural recursion did not work when indices of the recursive argument appeared as function parameters in a different order than in the argument's type's definition. Fixes #6015.
JovanGerb
pushed a commit
to JovanGerb/lean4
that referenced
this issue
Jan 21, 2025
This PR fixes a bug where structural recursion did not work when indices of the recursive argument appeared as function parameters in a different order than in the argument's type's definition. Fixes leanprover#6015.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Structural recursion may fail due to a badly formed motive in a
brecOn
callContext
I encountered this issue when trying to formalise a theory of signatures for inductive types.
Steps to Reproduce
MWE:
Expected behavior: The function gets accepted.
Actual behavior: The following error pops up:
Versions
Lean 4.15.0-nightly-2024-11-08 Target: x86_64-unknown-linux-gnu
Additional Information
The issue seems to be that the motive generated for the recursive call puts arguments in the wrong order. Changing the order of arguments in the signature of
Tmₛ
fixes things: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: