-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - chore(Analysis/Normed/Lp/WithLp): generalize action-related instances on WithLp
#22706
Conversation
WithLp
PR summary b1b0fa9f09Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
!bench |
Here are the benchmark results for commit a685563. |
3 files, Instructions -2.0⬝10⁹
|
@@ -58,26 +58,35 @@ instance instNontrivial [Nontrivial V] : Nontrivial (WithLp p V) := ‹Nontrivia | |||
instance instUnique [Unique V] : Unique (WithLp p V) := ‹Unique V› | |||
instance instDecidableEq [DecidableEq V] : DecidableEq (WithLp p V) := ‹DecidableEq V› | |||
|
|||
variable [Semiring K] [Semiring K'] [AddCommGroup V] | |||
instance instAddMonoid [AddMonoid V] : AddMonoid (WithLp p V) := ‹AddMonoid V› | |||
instance instAddCommMonoid [AddCommMonoid V] : AddCommMonoid (WithLp p V) := ‹AddCommMonoid V› |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest dropping these two instances from this PR, since they're not action-related. You can ungeneralize below at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion applied, but why? Is it because WithLp
are only used along with the commutative property?
!bench |
Here are the benchmark results for commit 4ab1227. |
|
!bench |
‹Module.Finite K V› | ||
|
||
variable {K V} | ||
variable [Module K V] | ||
-- variable [SMul K V] [AddCommGroup V] [Semiring K] [Module K V] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to remove this line, can you also remove the one below? As written, your change puts the variables in a weird order. Usually we want the typeclasses before everything else.
Here are the benchmark results for commit 76278bf. |
2 files, Instructions -2.0⬝10⁹
|
WithLp
WithLp
instance instDistribMulAction [Monoid K] [AddCommGroup V] [DistribMulAction K V] : | ||
DistribMulAction K (WithLp p V) := ‹DistribMulAction K V› | ||
instance instModule [Semiring K] [AddCommGroup V] [Module K V] : Module K (WithLp p V) := | ||
‹Module K V› | ||
|
||
/-! `WithLp p V` inherits various module-adjacent structures from `V`. -/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this belongs up on line 60, above the instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors d+
Thanks!
✌️ qawbecrdtey can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
… on `WithLp` (#22706) This generalizes `Module` to weaker classes of action. As the assumptions now vary by lemma, a `variable` line has been inlined into the following lemmas. Co-authored-by: qawbecrdtey <[email protected]> Co-authored-by: qawbecrdtey <[email protected]>
Pull request successfully merged into master. Build succeeded: |
WithLp
WithLp
This generalizes
Module
to weaker classes of action.As the assumptions now vary by lemma, a
variable
line has been inlined into the following lemmas.For additional benchmarking (related: #22434)