[Merged by Bors] - feat(Convert): less aggressive congruence#38071
[Merged by Bors] - feat(Convert): less aggressive congruence#38071JovanGerb wants to merge 9 commits into
Conversation
PR summary c631f6e5f1Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
This pull request has conflicts, please merge |
|
This change makes sense to me! If it were possible, I'd like to get it in before the very drastic changes of #39039. Could you fix the merge conflict and the build? Or do you want to have the |
This reverts commit 42dc41b.
joneugster
left a comment
There was a problem hiding this comment.
Thanks!
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by joneugster. |
|
oh I missed that CI is failing |
This PR implements the main behaviour change from #39039: `convert` now discharges side goals at reducible transparency. `convert!`, which we previously switched all calls inside Mathlib to, keeps the old behaviour of working at default transparency. (Everything discussed in this PR holds analogously for the other tactics in the family: `convert_to` and `ac_change`). The main trick in this PR is in allowing `convert!` to have different configuration options than `convert`, but still allow the user to override those options too. So `convert! (postTransparency := .instances)` will have transparency set to `.instances`, not `.default`. We achieve this by having two new structures that copy `Congr!.Config` but set different default values, and choosing between the corresponding elaborators for those configs based on the presence of an `!`. I got this trick from Jovan's #38071 which also changes settings in `Convert.Config`. This PR should be mostly compatible with #38071 and I'd like to get both this one and #38071 in before wrapping up #39039 by replacing unnecessary calls to `convert!` with `convert`.
This PR implements the main behaviour change from #39039: `convert` now discharges side goals at reducible transparency. `convert!`, which we previously switched all calls inside Mathlib to, keeps the old behaviour of working at default transparency. (Everything discussed in this PR holds analogously for the other tactics in the family: `convert_to` and `ac_change`). The main trick in this PR is in allowing `convert!` to have different configuration options than `convert`, but still allow the user to override those options too. So `convert! (postTransparency := .instances)` will have transparency set to `.instances`, not `.default`. We achieve this by having two new structures that copy `Congr!.Config` but set different default values, and choosing between the corresponding elaborators for those configs based on the presence of an `!`. I got this trick from Jovan's #38071 which also changes settings in `Convert.Config`. This PR should be mostly compatible with #38071 and I'd like to get both this one and #38071 in before wrapping up #39039 by replacing unnecessary calls to `convert!` with `convert`. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com>
|
The trouble with the new |
|
@kmill, as the original author, do you have some opinions on this PR? |
| Examples: | ||
|
|
||
| ```lean | ||
| -- `convert using` controls the depth of congruence. |
There was a problem hiding this comment.
I'm okay with removing the emphasis on using, since it seems that there are indeed many cases where we no longer need to use using.
|
Thanks! bors r+ |
This PR tries to make `convert` behave more predictably, disabling some of the aggressive congruence steps that `congr!` does. In particular, when the two sides have a different head constants, then we should not use congruence on these applications. Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
|
Pull request successfully merged into master. Build succeeded: |
This PR tries to make `convert` behave more predictably, disabling some of the aggressive congruence steps that `congr!` does. In particular, when the two sides have a different head constants, then we should not use congruence on these applications. Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
…ommunity#39928) This PR implements the main behaviour change from leanprover-community#39039: `convert` now discharges side goals at reducible transparency. `convert!`, which we previously switched all calls inside Mathlib to, keeps the old behaviour of working at default transparency. (Everything discussed in this PR holds analogously for the other tactics in the family: `convert_to` and `ac_change`). The main trick in this PR is in allowing `convert!` to have different configuration options than `convert`, but still allow the user to override those options too. So `convert! (postTransparency := .instances)` will have transparency set to `.instances`, not `.default`. We achieve this by having two new structures that copy `Congr!.Config` but set different default values, and choosing between the corresponding elaborators for those configs based on the presence of an `!`. I got this trick from Jovan's leanprover-community#38071 which also changes settings in `Convert.Config`. This PR should be mostly compatible with leanprover-community#38071 and I'd like to get both this one and leanprover-community#38071 in before wrapping up leanprover-community#39039 by replacing unnecessary calls to `convert!` with `convert`. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com>
This PR tries to make `convert` behave more predictably, disabling some of the aggressive congruence steps that `congr!` does. In particular, when the two sides have a different head constants, then we should not use congruence on these applications. Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
This PR tries to make `convert` behave more predictably, disabling some of the aggressive congruence steps that `congr!` does. In particular, when the two sides have a different head constants, then we should not use congruence on these applications. Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
This PR fixes a regression introduced in #38071, which had caused the congruence algorithm of `convert` to not support over-applications. I added a test to show this now works again.
…unity#40740) This PR fixes a regression introduced in leanprover-community#38071, which had caused the congruence algorithm of `convert` to not support over-applications. I added a test to show this now works again.
…unity#40740) This PR fixes a regression introduced in leanprover-community#38071, which had caused the congruence algorithm of `convert` to not support over-applications. I added a test to show this now works again.
This PR tries to make
convertbehave more predictably, disabling some of the aggressive congruence steps thatcongr!does. In particular, when the two sides have a different head constants, then we should not use congruence on these applications.