Skip to content

[Merged by Bors] - feat(Algebra/Group): add theorems about Submonoid.pi - #28665

Closed
staroperator wants to merge 9 commits into
leanprover-community:masterfrom
staroperator:refactor_submonoid_pi
Closed

staroperator wants to merge 9 commits into
leanprover-community:masterfrom
staroperator:refactor_submonoid_pi

Conversation

@staroperator

@staroperator staroperator commented Aug 19, 2025 •

Copy link
Copy Markdown
Collaborator

This PR adds theorems on Submonoid.pi, which are the same theorems on Subgroup.pi.

Also chore:

  1. moved Submonoid.pi from Subgroup/Basic.lean to Submonoid/Operations.lean, which is a more suitable place.
  2. changed the type of Subgroup.le_pi_iff, to align with its simp normal form in Set (see Set.image_subset_iff).

Open in Gitpod

@github-actions

github-actions Bot commented Aug 19, 2025 •

Copy link
Copy Markdown

PR summary fd9fa0be7f

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Algebra.Group.Submonoid.Operations 331 335 +4 (+1.21%)
Import changes for all files
Files Import difference
10 files Mathlib.CategoryTheory.Galois.Decomposition Mathlib.CategoryTheory.Galois.GaloisObjects Mathlib.CategoryTheory.Galois.Prorepresentability Mathlib.Combinatorics.Additive.VerySmallDoubling Mathlib.GroupTheory.CoprodI Mathlib.GroupTheory.GroupAction.SubMulAction.OfFixingSubgroup Mathlib.GroupTheory.GroupAction.SubMulAction.OfStabilizer Mathlib.GroupTheory.MonoidLocalization.Cardinality Mathlib.MeasureTheory.Constructions.SubmoduleQuotient Mathlib.RingTheory.OreLocalization.Cardinality
1
32 files Mathlib.Algebra.Algebra.Field Mathlib.Algebra.Category.Grp.Limits Mathlib.Algebra.CharZero.Quotient Mathlib.Algebra.ModEq Mathlib.Algebra.Order.Archimedean.Class Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder Mathlib.Algebra.Order.Ring.Star Mathlib.Algebra.Order.Star.Basic Mathlib.Algebra.Order.Star.Prod Mathlib.Algebra.Pointwise.Stabilizer Mathlib.Algebra.Ring.NonZeroDivisors Mathlib.Algebra.Ring.Submonoid.Pointwise Mathlib.Algebra.Star.NonUnitalSubsemiring Mathlib.CategoryTheory.Monoidal.Cartesian.CommGrp_ Mathlib.CategoryTheory.Monoidal.Cartesian.Grp_ Mathlib.Data.Int.Star Mathlib.Data.Rat.Star Mathlib.LinearAlgebra.Quotient.Defs Mathlib.NumberTheory.FrobeniusNumber Mathlib.RingTheory.Congruence.Basic Mathlib.RingTheory.Congruence.Opposite Mathlib.RingTheory.Ideal.Quotient.Defs Mathlib.RingTheory.Localization.Defs Mathlib.RingTheory.NonUnitalSubsemiring.Basic Mathlib.RingTheory.OreLocalization.Ring Mathlib.RingTheory.SimpleRing.Basic Mathlib.RingTheory.SimpleRing.Defs Mathlib.RingTheory.TwoSidedIdeal.Basic Mathlib.RingTheory.TwoSidedIdeal.BigOperators Mathlib.RingTheory.TwoSidedIdeal.Instances Mathlib.RingTheory.TwoSidedIdeal.Kernel Mathlib.RingTheory.TwoSidedIdeal.Lattice
2
11 files Mathlib.Algebra.Group.Submonoid.Pointwise Mathlib.Algebra.Group.Submonoid.Units Mathlib.Algebra.GroupWithZero.Submonoid.Pointwise Mathlib.Geometry.Group.Growth.QuotientInter Mathlib.GroupTheory.FreeGroup.Basic Mathlib.GroupTheory.FreeGroup.IsFreeGroup Mathlib.GroupTheory.FreeGroup.Reduce Mathlib.GroupTheory.GroupAction.Basic Mathlib.GroupTheory.GroupAction.FixingSubgroup Mathlib.GroupTheory.QuotientGroup.Defs Mathlib.GroupTheory.Submonoid.Inverses
3
24 files Mathlib.Algebra.Group.Graph Mathlib.Algebra.Group.Subgroup.Ker Mathlib.Algebra.Group.Subgroup.Lattice Mathlib.Algebra.Group.Subgroup.Map Mathlib.Algebra.Group.Subgroup.ZPowers.Basic Mathlib.Algebra.Group.Submonoid.Membership Mathlib.Algebra.Group.Submonoid.Operations Mathlib.Algebra.GroupWithZero.NonZeroDivisors Mathlib.Algebra.Order.Hom.Submonoid Mathlib.Algebra.PresentedMonoid.Basic Mathlib.Algebra.Ring.Subring.Units Mathlib.GroupTheory.Congruence.Basic Mathlib.GroupTheory.Coprod.Basic Mathlib.GroupTheory.MonoidLocalization.Away Mathlib.GroupTheory.MonoidLocalization.Basic Mathlib.GroupTheory.MonoidLocalization.DivPairs Mathlib.GroupTheory.MonoidLocalization.GrothendieckGroup Mathlib.GroupTheory.MonoidLocalization.MonoidWithZero Mathlib.GroupTheory.MonoidLocalization.Order Mathlib.GroupTheory.NoncommCoprod Mathlib.GroupTheory.Subgroup.Saturated Mathlib.GroupTheory.Submonoid.Center Mathlib.GroupTheory.Submonoid.Centralizer Mathlib.RingTheory.OreLocalization.NonZeroDivisors
4

Declarations diff

+ coe_pi
+ le_pi_iff
+ mem_pi
+ mulSingle_mem_pi
+ pi
+ pi_bot
+ pi_empty
+ pi_eq_bot_iff
+ pi_top
+ subset_pi_iff
+ univ_pi_eq_singleton_iff
+ update_mem_pi_iff
+ update_mem_pi_iff_of_mem
- _root_.Submonoid.pi

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 relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label Aug 19, 2025
simpa using h hj
· simpa [heq] using ha j hj

theorem univ_pi_eq_singleton_iff {a} : pi univ t = {a} ↔ ∀ i, t i = {a i} := by

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
theorem univ_pi_eq_singleton_iff {a} : pi univ t = {a} ↔ ∀ i, t i = {a i} := by
theorem pi_univ_eq_singleton_iff {a} : pi univ t = {a} ↔ ∀ i, t i = {a i} := by

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following Set.empty_pi and Set.univ_pi_eq_empty, the first argument of Set.pi should be placed before pi in theorem name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are misnamed, unfortunately. Since Set.pi does not have infix notation, we preserve the order of appearance when naming declarations.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let me add a note in the module doc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we often allow definitions to be named with infix convention even if they have no notation allocated.

Comment thread Mathlib/Data/Set/Prod.lean Resolved
Comment thread Mathlib/Data/Set/Prod.lean Resolved
Comment thread Mathlib/Data/Set/Prod.lean Resolved
Comment thread Mathlib/Data/Set/Prod.lean Resolved
@chrisflav chrisflav added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Aug 27, 2025
@staroperator staroperator added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Aug 27, 2025
@staroperator
staroperator force-pushed the refactor_submonoid_pi branch from 13fcc8e to 6c013a7 Compare August 27, 2025 14:40
@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 Aug 27, 2025
Comment thread Mathlib/Data/Set/Prod.lean Resolved
Comment thread Mathlib/Data/Set/Prod.lean Resolved
Comment thread Mathlib/Data/Set/Prod.lean Resolved
Set.subset_pi_iff

@[to_additive (attr := simp)]
theorem mulSingle_mem_pi [DecidableEq ι] {I : Set ι} {S : ∀ i, Submonoid (M i)} (i : ι) (x : M i) :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
theorem mulSingle_mem_pi [DecidableEq ι] {I : Set ι} {S : ∀ i, Submonoid (M i)} (i : ι) (x : M i) :
theorem mulSingle_mem_pi [DecidableEq ι] {I : Set ι} {S : ∀ i, Submonoid (M i)} {i : ι} {x : M i} :

to match the set one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nevermind, this doesn't match Subgroup

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, does Mathlib have a style guide on when to make arguments explicit and when implicit?

@eric-wieser

Copy link
Copy Markdown
Member

bors d+

Things are still slightly messy here, but it's no longer the fault of your PR. We're no longer repeating any interesting proofs, so I think this is already an overall improvement.

Thanks!

@mathlib-bors

mathlib-bors Bot commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

✌️ staroperator can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Aug 27, 2025
@staroperator

Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request Aug 28, 2025
This PR adds theorems on `Submonoid.pi`, which are the same theorems on `Subgroup.pi`.

Also chore:
1. moved `Submonoid.pi` from Subgroup/Basic.lean to Submonoid/Operations.lean, which is a more suitable place.
2. changed the type of `Subgroup.le_pi_iff`, to align with its simp normal form in `Set` (see [`Set.image_subset_iff`](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Image.html#Set.image_subset_iff)).

Co-authored-by: staroperator <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Algebra/Group): add theorems about Submonoid.pi [Merged by Bors] - feat(Algebra/Group): add theorems about Submonoid.pi Aug 28, 2025
@mathlib-bors mathlib-bors Bot closed this Aug 28, 2025
FormulaRabbit81 pushed a commit to YaelDillies/mathlib4 that referenced this pull request Aug 30, 2025
…mmunity#28665)

This PR adds theorems on `Submonoid.pi`, which are the same theorems on `Subgroup.pi`.

Also chore:
1. moved `Submonoid.pi` from Subgroup/Basic.lean to Submonoid/Operations.lean, which is a more suitable place.
2. changed the type of `Subgroup.le_pi_iff`, to align with its simp normal form in `Set` (see [`Set.image_subset_iff`](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Set/Image.html#Set.image_subset_iff)).

Co-authored-by: staroperator <[email protected]>
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). t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants