Conversation
|
This is essentially impossible to review in the traditional way, so the question is whether we trust your script or not. I'd say yes (the fact that it builds is proof enough that it works at least to reduce some imports) so I think we should merge this as quickly as possible (running the tool again to fix the conflicts), but it would be better that at least two people agree on this, so |
|
🚀 Pull request has been placed on the maintainer queue by sgouezel. |
|
This PR was not actually written by my script, unfortunately. It was a few phases of looking at the output, moving some things to global The script is able to produce a passable approximation of this PR, but it works best when there are few changes needed and most of the noshakes are already in place; when you run it cold like this it makes a lot of mistakes (because it missed some dependency it wasn't aware of) and makes more mistakes trying to fix its other mistakes, and this requires manual cleanup. |
|
Let me correct myself, then. The question is whether we trust |
|
Going forward it might be worth teaching people (mainly maintainers) how to use In short:
|
| conv_rhs => rw [add_comm m, ← mod_add_mod, mod_eq_sub_mod hm', mod_eq_of_lt this] | ||
| rw [← add_right_inj l.length, ← add_tsub_assoc_of_le, add_tsub_tsub_cancel, | ||
| add_tsub_cancel_of_le, add_comm] | ||
| rw [← add_right_inj l.length, ← add_tsub_assoc_of_le (α := ℕ), add_tsub_tsub_cancel (α := ℕ), |
There was a problem hiding this comment.
Why do these now need an explicitly given implicit argument?
There was a problem hiding this comment.
I am not entirely sure; apparently you can do this proof without some imports and it still works when you pass the types explicitly but inferring them seems not to work, or you can add more imports and it will work as is. I felt like it would be better to err on the side of fewer imports since the fallout isn't too much.
a67311d to
bde1cd8
Compare
bde1cd8 to
c3e4dfc
Compare
Vierkantor
left a comment
There was a problem hiding this comment.
As a bit of penance for my own huge PRs I went through all the changes. Only two additions stood out to me as unusual and there were a couple of weird reorderings, otherwise looks good to me.
|
I've pushed fixes for the tests, which might warrant additional scrutiny since additional imports there imply some usability loss (to remember to import things otherwise the tactic has degraded behavior). |
Vierkantor
left a comment
There was a problem hiding this comment.
As far as I can tell, most of the added imports cover extra test cases, not the core functionality. Only rw_search and rw really do seem to need Init.Core to work at all. (And because they're meant to be self-replacing, it's extra important that we don't tweak the test cases too much: other tactics can rely on being tested by the bulk of Mathlib itself.)
I'm confident that this change is going to be an improvement, since things build with minimal modifications outside of the import lines. Let's get this merged!
bors d+
test/RewriteSearch/Basic.lean
Outdated
| @@ -1,3 +1,4 @@ | |||
| import Mathlib.Init.Core | |||
There was a problem hiding this comment.
This file seems to specifically need the following attributes to work:
attribute [refl] Eq.refl
attribute [trans] Eq.trans
attribute [symm] Eq.symmSo I think we should import them in Tactic.RewriteSearch itself.
test/rewrites.lean
Outdated
| import Mathlib.Init.Core | ||
| import Mathlib.Tactic.Rewrites |
There was a problem hiding this comment.
Idem: we should probably make Init.Core available in Tactic.Rewrites.
|
✌️ digama0 can now approve this pull request. To approve and merge a pull request, simply reply with |
|
Could you please merge import Std.Classes.SetNotation
import Mathlib.Init.Set
import Mathlib.Tactic.Attr.Core
import Mathlib.Tactic.Simps.Basic
import Mathlib.Order.Notation
import Mathlib.Util.CompileInductive
import Mathlib.Data.SProd
import Mathlib.Data.Subtype(I removed |
|
(I hadn't actually done the re-shaking from the last merge yet. I can't shake it until it compiles successfully. Seems I have to merge again and restart the process...) |
7d09797 to
d664d41
Compare
d664d41 to
ae67f3c
Compare
|
AAH it conflicted again, I literally can't get this out the door fast enough |
|
bors merge p=10 |
|
Pull request successfully merged into master. Build succeeded: |
- [ ] depends on: #9830 This is the `noshake.json` file corresponding to the edits in leanprover-community/batteries#533. There was a small bug in `shake` making it much more conservative than it needed to be, so there is a big mathlib PR #9830, on which this PR depends because CI will not pass without it. Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
This uses the improved
shakescript from #9772 to reduce imports across mathlib. The correspondingnoshake.jsonfile has been added to #9772.