[Merged by Bors] - feat: if a monoid M acts, then so does (s : S) with [SubmonoidClass S M]#21123
[Merged by Bors] - feat: if a monoid M acts, then so does (s : S) with [SubmonoidClass S M]#21123
Conversation
PR summary 4e84203d6a
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Algebra.Group.Submonoid.DistribMulAction | 278 | 261 | -17 (-6.12%) |
| Mathlib.RingTheory.OreLocalization.Basic | 381 | 366 | -15 (-3.94%) |
| Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero | 432 | 429 | -3 (-0.69%) |
| Mathlib.Algebra.Ring.Action.Subobjects | 386 | 387 | +1 (+0.26%) |
| Mathlib.Algebra.Ring.Subsemiring.Basic | 619 | 618 | -1 (-0.16%) |
Import changes for all files
| Files | Import difference |
|---|---|
Mathlib.Algebra.Group.Submonoid.DistribMulAction |
-17 |
Mathlib.RingTheory.OreLocalization.Basic |
-15 |
Mathlib.Algebra.Group.Subgroup.Actions Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero |
-3 |
11 filesMathlib.Algebra.Ring.Semireal.Defs Mathlib.Algebra.Ring.Subring.Basic Mathlib.Algebra.Ring.Subring.MulOpposite Mathlib.Algebra.Ring.Subring.Pointwise Mathlib.Algebra.Ring.Subsemiring.Basic Mathlib.Algebra.Ring.Subsemiring.MulOpposite Mathlib.Algebra.Ring.Subsemiring.Pointwise Mathlib.Algebra.Ring.SumsOfSquares Mathlib.Algebra.Star.Subsemiring Mathlib.RingTheory.LocalRing.Subring Mathlib.RingTheory.SimpleRing.Field |
-1 |
Mathlib.Algebra.Ring.Action.Subobjects |
1 |
Declarations diff
+ instance (priority := low) [AddMonoid α] [DistribMulAction M α] : DistribMulAction s α
+ instance (priority := low) [Monoid α] [MulDistribMulAction M α] : MulDistribMulAction s α
+ instance (priority := low) [MulAction M' α] : MulAction s α
+ instance (priority := low) [MulSemiringAction M R] {S : Type*} [SetLike S M] (s : S)
+ instance (priority := low) [SMul M' α] : SMul s α
+ instance (priority := low) [SMul M' β] [SMul α β] [SMulCommClass M' α β] : SMulCommClass s α β
+ instance (priority := low) [SMul α β] [SMul M' α] [SMul M' β] [IsScalarTower M' α β] :
+ instance (priority := low) [SMul α β] [SMul M' β] [SMulCommClass α M' β] : SMulCommClass α s β
+ instance (priority := low) {M' α : Type*} [SMul M' α] {S' : Type*}
++ instance (priority := low) [AddCommMonoid α] [Module R' α] {S' : Type*} [SetLike S' R']
++ instance (priority := low) {S' : Type*} [SetLike S' R'] [SubsemiringClass S' R'] (s : S')
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).
|
Can you change the PR title to something descriptive, please? Thanks! |
|
Yeah apologies for this. I am wondering whether the two machines I use for Lean have different behaviour when it comes to opening a PR. As you can see the commit message for the first commit was supposed to be the title of the PR and I am pretty darn sure that sometimes when I publish, this actually happens. But apparently not always -- it seems that here the title was the name of the branch rather than the commit message of the first commit. |
|
!bench |
|
Here are the benchmark results for commit d012251. Benchmark Metric Change
============================================================================
- ~Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Proper instructions 36.9%
- ~Mathlib.Analysis.Normed.Lp.lpSpace instructions 6.4% |
3 files, Instructions +2.0⬝10⁹
5 files, Instructions +1.0⬝10⁹
|
|
Youch, this deserves further investigation. |
|
OK so the further investigation shows me that basically this idea derails certain instance searches e.g. in the theory of graded rings, where the grade 0 piece |
|
Actually maybe I'll try once more with low prio for the instances? |
|
!bench |
|
Here are the benchmark results for commit da778f9. |
2 files, Instructions +2.0⬝10⁹
3 files, Instructions +1.0⬝10⁹
|
|
Ok this looks much more reasonable. |
|
It looks reasonable to me, and the bench is good. Any reason to not merge this? |
No reason IMHO! bors merge |
… M] (#21123) If a monoid or semiring M acts on A then a submonoid or subsemiring of M also acts on A. But we can kill two birds with one stone by letting a SubmonoidClass of M act on A.
|
Pull request successfully merged into master. Build succeeded: |
* origin/master: (823 commits) chore(Computability): fix naming of lemmas about Sum.inl, Sum.inr, Sum.casesOn (#22156) feat: `Fintype Ordering` (#22154) chore: more renamings to fit the naming convention (#22148) feat(CategoryTheory): any monomorphism in a Grothendieck abelian category is a transfinite composition of pushouts of monomorphisms in a small family (#22157) chore: rename `{Continuous., continuous_}sum_map` to `sumMap` (#22155) chore: remove initial space followed by `-/` (#22158) chore: make arg in HeightOneSpectrum.valuation explicit (#22139) feat(Data/List): `List.maximum` is monotone (#22091) chore(Combinatorics/SimpleGraph): extract WalkDecomp from Walk (#21981) feat: if a monoid M acts, then so does (s : S) with [SubmonoidClass S M] (#21123) chore: backport changes to `getElem` lemmas (#22146) feat(CategoryTheory): generating monomorphisms in Grothendieck abelian categories (#22150) feat: rename variables to fit doc (#22143) feat(CategoryTheory): IsDetecting.isIso_iff_of_mono (#22135) feat(CategoryTheory): truncations of transfinite compositions (#22149) chore: simplify a proof (#22134) feat(CategoryTheory): monomorphisms are stable under coproducts in Grothendieck abelian categories (#22133) feat(Order): Set.Ici.isSuccLimit_coe (#22103) chore(Analysis/Convex/Normed): split into smaller files (#22015) feat(Algebra/Algebra/Lie): max nilpotent ideal <= radical (#22140) refactor(LinearIndependent): refactor to use LinearIndepOn (#21886) chore: rename some more `Foo.sum_elim` -> `sumElim` (#22130) chore: rename Injective.sum_elim and friends (#22129) chore: fix naming oversight from #22070 (#22128) chore: fix spelling mistakes (#22136) feat(RingTheory/Ideal/Quotient): define transtition map between ring or module quotient by powers of ideal (#21900) fix: initialize_simps_projections print warning when projection data already exists (#20339) chore: rename ContMDiff.sum_{elim,map} (#22131) feat(CategoryTheory): characterization of injective objects in terms of lifting properties (#22104) chore(Lean,Tactic): un-indent some doc-strings (#22118) feat(Algebra/MvPolynomial): add `comp` versions of rename lemmas (#21259) chose: add deprecation (#22124) feat(CategoryTheory/Abelian/GrothendieckCategory): computing colimits in Subobject (#22123) feat(CategoryTheory/Subobject): hasCardinalLT_of_mono (#22122) feat: add `DenseRange.piMap` (#22114) feat(Algebra/Algebra/Lie): define the maximal nilpotent ideal of Lie algebras (#22061) chore(Data/Finset): don't import algebra when defining `Finset.card` (#21866) feat: a function on a discrete space is smooth (#22113) feat: commutative group objects in additive categories (#21521) style(Geometry/Manifold): remove superfluous indentation in doc-strings (#22117) chore: rename PushNeg.lean to Push.lean (#22108) feat: add Is{Open,Closed}Embedding.sum_elim (#22070) feat(RingTheory/Perfectoid): define the untilt map and generalize pretilt (#21563) feature(Topology/Algebra/Module/WeakBilin): Linear map from F into the topological dual of E with the weak topology (#21078) feat(CategoryTheory/Abelian): the exact sequence attached to a pushout square (#22110) chore(ChartedSpace.lean): group constructions together (#22107) feat(CategoryTheory/MorphismProperty): more basic API (#22099) chore(Data/Fintype): split `Fintype/Card.lean` (#21840) chore(SetTheory/Cardinal/Cofinality): make `IsStrongLimit` into a structure (#21971) feat(Combinatorics/SimpleGraph): Add a theorem about cliques in induced subgraphs (#20705) ...
* polynomial-sequences: (558 commits) Correct the TODO to mention IsCancelAdd which does exist. Talk about strict monotonicity instead, thanks @pechersky. Mention the TODO on li generalization to semirings. One more dedent. Same injectivity twiddling for basis. nontiviality to simplify this proof, and some dedenting. Hopefully more correct injectivity lemmas matching the naming convention. Fix the empty docstring. Update Mathlib/Algebra/Polynomial/Sequence.lean Fix the variable naming. Apply suggestions from code review chore(Computability): fix naming of lemmas about Sum.inl, Sum.inr, Sum.casesOn (#22156) feat: `Fintype Ordering` (#22154) chore: more renamings to fit the naming convention (#22148) feat(CategoryTheory): any monomorphism in a Grothendieck abelian category is a transfinite composition of pushouts of monomorphisms in a small family (#22157) chore: rename `{Continuous., continuous_}sum_map` to `sumMap` (#22155) chore: remove initial space followed by `-/` (#22158) chore: make arg in HeightOneSpectrum.valuation explicit (#22139) feat(Data/List): `List.maximum` is monotone (#22091) chore(Combinatorics/SimpleGraph): extract WalkDecomp from Walk (#21981) feat: if a monoid M acts, then so does (s : S) with [SubmonoidClass S M] (#21123) chore: backport changes to `getElem` lemmas (#22146) feat(CategoryTheory): generating monomorphisms in Grothendieck abelian categories (#22150) feat: rename variables to fit doc (#22143) feat(CategoryTheory): IsDetecting.isIso_iff_of_mono (#22135) feat(CategoryTheory): truncations of transfinite compositions (#22149) chore: simplify a proof (#22134) feat(CategoryTheory): monomorphisms are stable under coproducts in Grothendieck abelian categories (#22133) feat(Order): Set.Ici.isSuccLimit_coe (#22103) chore(Analysis/Convex/Normed): split into smaller files (#22015) feat(Algebra/Algebra/Lie): max nilpotent ideal <= radical (#22140) refactor(LinearIndependent): refactor to use LinearIndepOn (#21886) chore: rename some more `Foo.sum_elim` -> `sumElim` (#22130) chore: rename Injective.sum_elim and friends (#22129) chore: fix naming oversight from #22070 (#22128) chore: fix spelling mistakes (#22136) feat(RingTheory/Ideal/Quotient): define transtition map between ring or module quotient by powers of ideal (#21900) fix: initialize_simps_projections print warning when projection data already exists (#20339) chore: rename ContMDiff.sum_{elim,map} (#22131) feat(CategoryTheory): characterization of injective objects in terms of lifting properties (#22104) chore(Lean,Tactic): un-indent some doc-strings (#22118) feat(Algebra/MvPolynomial): add `comp` versions of rename lemmas (#21259) chose: add deprecation (#22124) feat(CategoryTheory/Abelian/GrothendieckCategory): computing colimits in Subobject (#22123) feat(CategoryTheory/Subobject): hasCardinalLT_of_mono (#22122) feat: add `DenseRange.piMap` (#22114) feat(Algebra/Algebra/Lie): define the maximal nilpotent ideal of Lie algebras (#22061) chore(Data/Finset): don't import algebra when defining `Finset.card` (#21866) feat: a function on a discrete space is smooth (#22113) feat: commutative group objects in additive categories (#21521) ...
If a monoid or semiring M acts on A then a submonoid or subsemiring of M also acts on A. But we can kill two birds with one stone by letting a SubmonoidClass of M act on A.
This is a variant of #20983 which only does one thing at once, namely generalizing many submonoid instances to submonoidclass.
A basic example of the change I'm making here is that the instance
is now generalized to the instance
The full list:
SetLike,SMulfor the object givesSMulfor the subobject,FaithfulSMultransfers to the subobject andSMulCommClasstransfers (in both variables).SubmonoidClass, the instances which transfer areMulAction,DistribMulAction,MulDistribMulActionandMulSemiringAction.SubsemiringClass, the transferring instances areSMulWithZero,MulActionWithZeroandModule.It turns out that many of the instances I was generalizing were explicitly named because they are explicitly used in mathlib, so I have kept all the original instances and proved them with
inferInstance. Note that #11304 tried to take things further and delete all the now-redundant instances, and this caused slowdowns in mathlib, so I've decided just to leave everything there. It might be an interesting experiment to runTryAtEachStepon mathlib with the tacticinfer_instancebefore and after this PR.The refactor meant that
shakecould minimise some imports and then has to put some more back later; the original version of this PR imported the short new file Mathlib/Algebra/Group/Submonoid/MulAction.lean (which I made in #21067) into Mathlib/Algebra/Group/Submonoid/DistribMulAction.lean; shake then did all the other import changes, which are reducing imports overall.