[Merged by Bors] - feat(Tactic): automatically replace convert with convert!#39721
[Merged by Bors] - feat(Tactic): automatically replace convert with convert!#39721Vierkantor wants to merge 17 commits into
Conversation
This PR prepares for leanprover-community#39039 by adding the required syntax. Once this PR is in, we'll do a global find and replace for changing `convert` to `convert!` (without changing the behaviour), and finally we will enable the new behaviour for `convert`.
This PR sets up an option for `congr!` to close generated goals with configurable transparency, but does not enable this by default. Then it adds a check to `convert` where it will run the `congr!` algorithm at both reducible and default transparency. In the case the default transparency generates different goals, it pops up a "Try this:" suggestion to use `convert!`. Applying all the "Try this:" suggestions to Mathlib means we can then change the semantics of `convert` to close the goals reducibly. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards.
PR summary 5230f2468cImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
5340b1e to
ea3e0c6
Compare
|
The replacement logic LGTM! |
|
This PR/issue depends on: |
Since antiquotations inside the `congr()` elaborator can't be pretty-printed reliably, manually change `convert congr(...)` to `convert! congr(...)`.
Commit Verification SummaryWarning Some verifications failed. See details below. Commits to Review (15)
❌ Automated commits (2) — 0/2 verified❌
|
|
The current status is good: let's try merging this --- and if there's a conflict in the morning, we can re-do. |
This PR makes any use of `convert` pop up a "Try this:" message replacing it with `convert!`. This prepares for #39039 which will make `convert` change behaviour and `convert!` retain the old behaviour. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
|
Build failed: Fix if necessary, and then someone with permission can run |
|
Silly CI error (line length); it seems no merge conflicts yet. |
|
CI error is unrelated to this PR (I've just re-run): let's try if this can just be borsed. |
This PR makes any use of `convert` pop up a "Try this:" message replacing it with `convert!`. This prepares for #39039 which will make `convert` change behaviour and `convert!` retain the old behaviour. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
|
Build failed: Fix if necessary, and then someone with permission can run |
|
Once more, with feeling: |
This PR makes any use of `convert` pop up a "Try this:" message replacing it with `convert!`. This prepares for #39039 which will make `convert` change behaviour and `convert!` retain the old behaviour. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
|
Pull request successfully merged into master. Build succeeded: |
|
It worked 🎉 |
…-community#39721) This PR makes any use of `convert` pop up a "Try this:" message replacing it with `convert!`. This prepares for leanprover-community#39039 which will make `convert` change behaviour and `convert!` retain the old behaviour. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
…-one Conflict in Mathlib/NumberTheory/ModularForms/LevelOne/DimensionFormula.lean caused by leanprover-community#39721 (convert → convert! rename). Resolved by keeping HEAD — our refactored `dimension_level_one` proof replaced the `convert; norm_num` block with `simpa [Nat.ModEq] using ...`, so the upstream rename doesn't apply. `QExpansion.lean` auto-merged cleanly; `convert` calls there are now `convert!` as intended. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-community#39721) This PR makes any use of `convert` pop up a "Try this:" message replacing it with `convert!`. This prepares for leanprover-community#39039 which will make `convert` change behaviour and `convert!` retain the old behaviour. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
…-community#39721) This PR makes any use of `convert` pop up a "Try this:" message replacing it with `convert!`. This prepares for leanprover-community#39039 which will make `convert` change behaviour and `convert!` retain the old behaviour. Note that `convert` and `convert!` still do the same thing and result in the same goals after this PR is applied, except `convert!` does not pop up a "Try this:" afterwards. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
This PR makes any use of
convertpop up a "Try this:" message replacing it withconvert!. This prepares for #39039 which will makeconvertchange behaviour andconvert!retain the old behaviour.Note that
convertandconvert!still do the same thing and result in the same goals after this PR is applied, exceptconvert!does not pop up a "Try this:" afterwards.After the code in this PR passes an initial review, I will run Skimmer to apply all the "Try this:" messages.
convert!,convert_to!,ac_change!#39715