Skip to content

[Merged by Bors] - chore: fix bug in rw? - #6088

Closed
kim-em wants to merge 118 commits into
masterfrom
rw_fixes
Closed

kim-em wants to merge 118 commits into
masterfrom
rw_fixes

Conversation

@kim-em

@kim-em kim-em commented Jul 24, 2023 •

Copy link
Copy Markdown
Contributor

This fixes a problem I encountered in another tactic, where the rewrites are not being tried with the original MetavarContext.


Open in Gitpod

@kim-em kim-em added awaiting-review t-meta Tactics, attributes or user commands awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Jul 24, 2023
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jul 24, 2023
@kim-em kim-em mentioned this pull request Jul 30, 2023
11 tasks done
Comment thread Mathlib/Tactic/TryThis.lean Resolved
Comment thread Mathlib/Tactic/Rewrites.lean Resolved
Comment thread Mathlib/Tactic/Rewrites.lean Resolved
Comment thread Mathlib/Tactic/TryThis.lean Resolved
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 8, 2023
@ghost ghost added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Aug 9, 2023
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 10, 2023
Comment thread Mathlib/Tactic/Rewrites.lean Resolved
@kim-em kim-em added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Aug 10, 2023
eric-wieser and others added 8 commits August 15, 2023 19:03
This is now [managed by the mathlib4_docs repository](https://github.com/leanprover-community/mathlib4_docs/actions), as this is required to use the new github pages deployment mechanism.

The downside of this approach is that we will have to restart doc builds manually every 90 days or so.
This adds Kyle Miller's elaborators for `Type*` and `Sort*` which provide implicit universe variables.

It also includes a few tests.

Co-authored-by: Kyle Miller <[email protected]>
Some of the tests for LibrarySearch functionality are nondetermininstic and were using `#guard_msgs` to check for specific output. This could [create spurious failures](https://github.com/leanprover-community/mathlib4/actions/runs/5810778556/job/15756601503). We switch to using `#guard_msgs (drop info)` for these tests, which still cleans up the stdout when running these tests without filtering out errors.
Add an option `lake exe graph --excludeMeta` which removes all nodes that start with `Mathlib.[Tactic|Lean|Util]`
…d_eq_of_le_of_le_of_mul_le` earlier (#6483)

This move was suggested in #6220.  In fact, the lemma is a general fact about an inequality involving multiplications and did not really belong in the file where it was.

Affected files:
```
Algebra.Group.UniqueProds
Algebra.Order.Monoid.Basic
```
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 23, 2023
@kim-em
kim-em requested review from alexjbest and thorimur August 24, 2023 06:49
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 24, 2023
Comment thread Mathlib/Tactic/Rewrites.lean Resolved
Comment thread Mathlib/Tactic/TryThis.lean Resolved
Comment thread Mathlib/Tactic/Rewrites.lean Resolved
@@ -231,12 +237,13 @@ elab_rules : tactic |
if results.isEmpty then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github doesn't let me comment or suggest on the appropriate line, but: should we check that (reducible) rfl doesn't close the goal by itself before looking at rewrite? (Note that even rw ... at h runs rfl on the goal and can close it, so checking it is indeed applicable in every case.) For example:

example : 0 = 0 by rw? -- Try this: rw [← @Nat.le_zero] -- "no goals"

(This is technically orthogonal to this PR, and maybe should be in a different one, but was born out of thinking about computeRfl.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I'm not sure here. I agree the behaviour of rw? is confusing when you present it with a goal solvable by rfl, but I don't think this makes it rw?'s job to try rfl.

How about we don't modify this behaviour for now, but I'm happy to consider it separately.

Comment thread Mathlib/Tactic/Rewrites.lean Resolved
@kim-em kim-em added awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. and removed awaiting-review labels Aug 27, 2023
@kim-em
kim-em requested review from kmill and thorimur August 27, 2023 06:30
@kim-em kim-em added awaiting-review and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Aug 28, 2023
@kmill

kmill commented Aug 28, 2023

Copy link
Copy Markdown
Contributor

The PR description doesn't seem to be accurate anymore (regarding addRewriteSuggestion). Could you fix that? Then it seems like these incremental improvements to rw? are ready to be merged.

bors d+

@bors

bors Bot commented Aug 28, 2023

Copy link
Copy Markdown

✌️ semorrison can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Aug 28, 2023
@kim-em

kim-em commented Aug 29, 2023

Copy link
Copy Markdown
Contributor Author

bors merge

@github-actions github-actions Bot added the ready-to-merge This PR has been sent to bors. label Aug 29, 2023
bors Bot pushed a commit that referenced this pull request Aug 29, 2023
This fixes a problem I encountered in another tactic, where the rewrites are not being tried with the original `MetavarContext`. 



Co-authored-by: Kevin Buzzard <[email protected]>
Co-authored-by: Joachim Breitner <[email protected]>
Co-authored-by: Chris Hughes <[email protected]>
Co-authored-by: Eric Wieser <[email protected]>
Co-authored-by: Anatole Dedecker <[email protected]>
Co-authored-by: Thomas Browning <[email protected]>
Co-authored-by: Oliver Nash <[email protected]>
Co-authored-by: sgouezel <[email protected]>
Co-authored-by: Alex J Best <[email protected]>
Co-authored-by: Xavier Roblot <[email protected]>
Co-authored-by: michaellee94 <[email protected]>
Co-authored-by: Yuma Mizuno <[email protected]>
Co-authored-by: Markus Himmel <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Peiran Wu <[email protected]>
Co-authored-by: Moritz Firsching <[email protected]>
Co-authored-by: Yury G. Kudryashov <[email protected]>
Co-authored-by: Ruben Van de Velde <[email protected]>
Co-authored-by: Anne Baanen <[email protected]>
Co-authored-by: Bolton Bailey <[email protected]>
Co-authored-by: Frédéric Dupuis <[email protected]>
Co-authored-by: Moritz Doll <[email protected]>
Co-authored-by: kkytola <[email protected]>
Co-authored-by: Joël Riou <[email protected]>
Co-authored-by: damiano <[email protected]>
Co-authored-by: Kyle Miller <[email protected]>
Co-authored-by: Rémy Degenne <[email protected]>
Co-authored-by: Jz Pan <[email protected]>
Co-authored-by: Eric Rodriguez <[email protected]>
@bors

bors Bot commented Aug 29, 2023

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors Bot changed the title chore: fix bug in rw? [Merged by Bors] - chore: fix bug in rw? Aug 29, 2023
@bors bors Bot closed this Aug 29, 2023
@bors
bors Bot deleted the rw_fixes branch August 29, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.