Skip to content

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

Closed
kim-em wants to merge 118 commits intomasterfrom
rw_fixes
Closed

[Merged by Bors] - chore: fix bug in rw?#6088
kim-em wants to merge 118 commits intomasterfrom
rw_fixes

Conversation

@kim-em
Copy link
Copy Markdown
Contributor

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

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
@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
@kim-em kim-em added the awaiting-author A reviewer has asked the author a question or requested changes. 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 <kmill31415@gmail.com>
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]`
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
…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
@@ -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.

@kim-em kim-em added awaiting-author A reviewer has asked the author a question or requested changes. 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 A reviewer has asked the author a question or requested changes. labels Aug 28, 2023
@kmill
Copy link
Copy Markdown
Contributor

kmill commented Aug 28, 2023

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
Copy link
Copy Markdown

bors bot commented Aug 28, 2023

✌️ 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
Copy link
Copy Markdown
Contributor Author

kim-em commented Aug 29, 2023

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 <k.buzzard@imperial.ac.uk>
Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com>
Co-authored-by: Thomas Browning <tb65536@uw.edu>
Co-authored-by: Oliver Nash <github@olivernash.org>
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: Alex J Best <alex.j.best@gmail.com>
Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com>
Co-authored-by: michaellee94 <michael_lee1@brown.edu>
Co-authored-by: Yuma Mizuno <mizuno.y.aj@gmail.com>
Co-authored-by: Markus Himmel <markus@himmel-villmar.de>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Peiran Wu <15968905+wupr@users.noreply.github.com>
Co-authored-by: Moritz Firsching <moritz.firsching@gmail.com>
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Anne Baanen <vierkantor@vierkantor.com>
Co-authored-by: Bolton Bailey <bolton.bailey@gmail.com>
Co-authored-by: Frédéric Dupuis <dupuisf@iro.umontreal.ca>
Co-authored-by: Moritz Doll <moritz.doll@googlemail.com>
Co-authored-by: kkytola <kalle.kytola@aalto.fi>
Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr>
Co-authored-by: damiano <adomani@gmail.com>
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
Co-authored-by: Jz Pan <acme_pjz@hotmail.com>
Co-authored-by: Eric Rodriguez <ericrboidi@gmail.com>
@bors
Copy link
Copy Markdown

bors bot commented Aug 29, 2023

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.