-
Notifications
You must be signed in to change notification settings - Fork 441
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
simp usually reduces Fin n
literals, but not n
itself
#5630
Comments
Fin n
literals, but not n
Fin n
literals, but not n
itself
previously, it would not reduce `25 : Fin 25` to `0 : Fin 25`. fixes #5630
previously, it would not reduce `25 : Fin 25` to `0 : Fin 25`. fixes #5630
Out of curiosity, would a similar fix to this one be appropriate for https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/simproc.20for.20Fin as well? Or are the fixes there the correct way to proceed |
I'm not an expert on the API design here. I'd say that whenever a simp rule works it should be used over a simproc. I'm not sure about the conclusion of that thread - did someone find a simp lemma that works? |
I think this answers my question!
It is somewhat implicit in that thread, but the addition which works is
|
If the discrimnation tree behaviour is ok here (I assume it will be tried on every Fin-to-Nat coercion), then yes, looks plausible. |
Very conveniently,
simp
knows aboutFin n
literals, and reduces them modn
:It does not do that for
n
itself, though:I expect this to simplify to
P 0
.Note that it also doesn't change 0 to n:
It would be desirable if
simp
would consistently reduce allFin n
literals (with concreten
) modulon
.This came up in the equational_theories project.
Versions
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: