-
Notifications
You must be signed in to change notification settings - Fork 470
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
fix: abstractNestedProofs
should see into the head of an application
#7353
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! Especially as I'm also experimenting with abstracting more proofs at the moment.
Can you fix the tests (again)? |
Hmm, this test is really annoying because it keeps changing the order of its messages (hence the merge conflict) |
Head branch was pushed to by a user without write access
Actually, given that this is a performance critical function, could you maybe make another measurement with the old code that looks at a full application as a whole (but of course fixed to also visit the function). Partial applications are never proofs, and it may make a difference to not look up the cache for every partial application in the term. (Or maybe the proposed code is better if partial applications are shared - who knows) |
This PR changes
abstractNestedProofs
so that it also visits the subterms in the head of an application.This oversight caused some definitions in mathlib to have unabstracted proofs, such as CategoryTheory.StructuredArrow.commaMapEquivalenceInverse
Mathlib bench:
build instructions -0,141 %
process pre-definitions 5,541 %
There is a small general slowdown from the extra work done by
abstractNestedProofs
. But this is outweighed by the speedup that we get in files related toCategoryTheory.Functor
.Zulip: https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/dsimp.20simplifies.20proofs.2C.20which.20is.20slow/near/503630173