[Merged by Bors] - feat: extensible push and pull tactics#21965
[Merged by Bors] - feat: extensible push and pull tactics#21965
push and pull tactics#21965Conversation
PR summary ea6c1124c8
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Tactic.Push | 88 | 76 | -12 (-13.64%) |
Import changes for all files
| Files | Import difference |
|---|---|
| There are 6451 files with changed transitive imports taking up over 278132 characters: this is too many to display! | |
You can run scripts/import_trans_difference.sh all locally to see the whole output. |
Declarations diff
+ Head
+ Head.ofExpr?
+ Head.toString
+ PullTheorem
+ elabDischarger
+ elabHead
+ elabPushTree
+ instance : ToString Head := ⟨Head.toString⟩
+ isPullThm
+ log_abs
+ log_mul
+ nonempty_iff_empty_ne
+ not_exists
+ not_imp
+ not_le
+ not_not
+ pullCore
+ pullStep
+ pushCore
+ pushSimpConfig
+ pushStep
+ resolvePushId?
+-+ not_iff
- elabPushNegConv
- empty_ne_eq_nonempty
- ne_empty_eq_nonempty
- not_exists_eq
- not_ge_eq
- not_gt_eq
- not_implies_eq
- not_le_eq
- not_lt_eq
- not_ne_eq
- not_nonempty_eq
- not_not_eq
- not_or_eq
- pushNegCore
- transformNegationStep
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for script/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
What should I do with the copyright docstring at the top of these files? I added myself as the main author, set the year to 2025, and left the names which were there in the original file. |
Adding yourself as an author and leaving the original authors sounds good. Please leave the year as it was. |
|
!bench |
|
Here are the benchmark results for commit 13affdb. |
|
This PR renames the file `PushNeg.lean` to `Push.lean`, to help reviewing #21965. It also removes an import of PushNeg where it is already transitively imported
Co-authored-by: grunweg <[email protected]>
|
Thanks for the reviews! For the |
|
I agree that |
|
Ok, I think that this is probably the last extension that I will ask about |
|
I didn't put the command |
|
For a tactic that computes |
adomani
left a comment
There was a problem hiding this comment.
I like the new tests, thanks! I also have a couple more that I just noticed...
I do not have a feeling for how much the #push_discr_tree test will cause issues. If it turns out to be quite fussy, there is always the option of commenting it out, while we think of an alternative.
Thank you for your patience through the various reviews!
bors d+
|
✌️ JovanGerb can now approve this pull request. To approve and merge a pull request, simply reply with |
|
I forgot about the fact that I removed the For the |
|
Ok, let's remove the Thanks! |
|
bors r+ |
This PR defines the `push` and `pull` tactics, and makes `push_neg` a macro for `push Not`. The tactics are also available in `conv` mode. For tagging, there is only the `@[push]` attribute, which adds the reverse rewrite for the `pull` tactic when relevant. In the future, we may also need a separate `@[pull X]` attribute for pulling `X`. Thanks to this change, we will be able to make `push_neg` into a more powerful tactic by tagging more lemmas. It also means that about 60 files now don't need to import `LinearOrder`/`PartialOrder`. This will be especially useful when we get the `@[to_dual]` attribute. This work originally started in #21769. There is now the follow up PR #29000 which adds `push` tags and tests for them. The `@[push]` attribute is defined in `Mathlib.Tactic.Push.Attr` and the main implementation of `push` and `pull` is in `Mathlib.Tactic.Push`. Some proofs need to be fixed because the new simp-based `push_neg` can see through more reducible definitions. Zulip conversation: [#mathlib4 > I made an extensible `push` tactic generalizing `push_neg`](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/I.20made.20an.20extensible.20.60push.60.20tactic.20generalizing.20.60push_neg.60) closes #21841
|
Build failed: |
|
I think this only failed due to a runner having a bad setup (which should be fixed now). |
This PR defines the `push` and `pull` tactics, and makes `push_neg` a macro for `push Not`. The tactics are also available in `conv` mode. For tagging, there is only the `@[push]` attribute, which adds the reverse rewrite for the `pull` tactic when relevant. In the future, we may also need a separate `@[pull X]` attribute for pulling `X`. Thanks to this change, we will be able to make `push_neg` into a more powerful tactic by tagging more lemmas. It also means that about 60 files now don't need to import `LinearOrder`/`PartialOrder`. This will be especially useful when we get the `@[to_dual]` attribute. This work originally started in #21769. There is now the follow up PR #29000 which adds `push` tags and tests for them. The `@[push]` attribute is defined in `Mathlib.Tactic.Push.Attr` and the main implementation of `push` and `pull` is in `Mathlib.Tactic.Push`. Some proofs need to be fixed because the new simp-based `push_neg` can see through more reducible definitions. Zulip conversation: [#mathlib4 > I made an extensible `push` tactic generalizing `push_neg`](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/I.20made.20an.20extensible.20.60push.60.20tactic.20generalizing.20.60push_neg.60) closes #21841
|
Pull request successfully merged into master. Build succeeded: |
push and pull tacticspush and pull tactics
This PR defines the `push` and `pull` tactics, and makes `push_neg` a macro for `push Not`. The tactics are also available in `conv` mode. For tagging, there is only the `@[push]` attribute, which adds the reverse rewrite for the `pull` tactic when relevant. In the future, we may also need a separate `@[pull X]` attribute for pulling `X`. Thanks to this change, we will be able to make `push_neg` into a more powerful tactic by tagging more lemmas. It also means that about 60 files now don't need to import `LinearOrder`/`PartialOrder`. This will be especially useful when we get the `@[to_dual]` attribute. This work originally started in leanprover-community#21769. There is now the follow up PR leanprover-community#29000 which adds `push` tags and tests for them. The `@[push]` attribute is defined in `Mathlib.Tactic.Push.Attr` and the main implementation of `push` and `pull` is in `Mathlib.Tactic.Push`. Some proofs need to be fixed because the new simp-based `push_neg` can see through more reducible definitions. Zulip conversation: [#mathlib4 > I made an extensible &leanprover-community#96;push&leanprover-community#96; tactic generalizing &leanprover-community#96;push_neg&leanprover-community#96;](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/I.20made.20an.20extensible.20.60push.60.20tactic.20generalizing.20.60push_neg.60) closes leanprover-community#21841
This PR defines the `push` and `pull` tactics, and makes `push_neg` a macro for `push Not`. The tactics are also available in `conv` mode. For tagging, there is only the `@[push]` attribute, which adds the reverse rewrite for the `pull` tactic when relevant. In the future, we may also need a separate `@[pull X]` attribute for pulling `X`. Thanks to this change, we will be able to make `push_neg` into a more powerful tactic by tagging more lemmas. It also means that about 60 files now don't need to import `LinearOrder`/`PartialOrder`. This will be especially useful when we get the `@[to_dual]` attribute. This work originally started in leanprover-community#21769. There is now the follow up PR leanprover-community#29000 which adds `push` tags and tests for them. The `@[push]` attribute is defined in `Mathlib.Tactic.Push.Attr` and the main implementation of `push` and `pull` is in `Mathlib.Tactic.Push`. Some proofs need to be fixed because the new simp-based `push_neg` can see through more reducible definitions. Zulip conversation: [#mathlib4 > I made an extensible &leanprover-community#96;push&leanprover-community#96; tactic generalizing &leanprover-community#96;push_neg&leanprover-community#96;](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/I.20made.20an.20extensible.20.60push.60.20tactic.20generalizing.20.60push_neg.60) closes leanprover-community#21841
This PR defines the `push` and `pull` tactics, and makes `push_neg` a macro for `push Not`. The tactics are also available in `conv` mode. For tagging, there is only the `@[push]` attribute, which adds the reverse rewrite for the `pull` tactic when relevant. In the future, we may also need a separate `@[pull X]` attribute for pulling `X`. Thanks to this change, we will be able to make `push_neg` into a more powerful tactic by tagging more lemmas. It also means that about 60 files now don't need to import `LinearOrder`/`PartialOrder`. This will be especially useful when we get the `@[to_dual]` attribute. This work originally started in leanprover-community#21769. There is now the follow up PR leanprover-community#29000 which adds `push` tags and tests for them. The `@[push]` attribute is defined in `Mathlib.Tactic.Push.Attr` and the main implementation of `push` and `pull` is in `Mathlib.Tactic.Push`. Some proofs need to be fixed because the new simp-based `push_neg` can see through more reducible definitions. Zulip conversation: [#mathlib4 > I made an extensible &leanprover-community#96;push&leanprover-community#96; tactic generalizing &leanprover-community#96;push_neg&leanprover-community#96;](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/I.20made.20an.20extensible.20.60push.60.20tactic.20generalizing.20.60push_neg.60) closes leanprover-community#21841
This PR defines the
pushandpulltactics, and makespush_nega macro forpush Not. The tactics are also available inconvmode.For tagging, there is only the
@[push]attribute, which adds the reverse rewrite for thepulltactic when relevant. In the future, we may also need a separate@[pull X]attribute for pullingX.Thanks to this change, we will be able to make
push_neginto a more powerful tactic by tagging more lemmas. It also means that about 60 files now don't need to importLinearOrder/PartialOrder. This will be especially useful when we get the@[to_dual]attribute.This work originally started in #21769. There is now the follow up PR #29000 which adds
pushtags and tests for them.The
@[push]attribute is defined inMathlib.Tactic.Push.Attrand the main implementation ofpushandpullis inMathlib.Tactic.Push.Some proofs need to be fixed because the new simp-based
push_negcan see through more reducible definitions.Zulip conversation: #mathlib4 > I made an extensible `push` tactic generalizing `push_neg`
closes #21841