Skip to content

[Merged by Bors] - feat(Algebra/Group): semigroup ideals - #31497

Closed
staroperator wants to merge 17 commits into
leanprover-community:masterfrom
staroperator:semigroup_ideal
Closed

staroperator wants to merge 17 commits into
leanprover-community:masterfrom
staroperator:semigroup_ideal

Conversation

@staroperator

@staroperator staroperator commented Nov 11, 2025 •

Copy link
Copy Markdown
Collaborator

This PR defines semigroup ideals; they are different from (in fact, a weaker form of) ring ideals. We prove that in a monoid whose algebraic order is well-quasi-order, all semigroup ideals are finitely generated, and the semigroup ideals satisfy the ascending chain condition. These definitions and results are useful in #27414.

Note: Following Ideal with Submodule, SemigroupIdeal M is an abbrev of SubMulAction M M. Also, Ideal.closure is a re-definition of SubMulAction.closure and Ideal.FG is defeq to SubMulAction.FG but unfolds more nicely.


Open in Gitpod

@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label Nov 11, 2025
@github-actions

github-actions Bot commented Nov 11, 2025 •

Copy link
Copy Markdown

PR summary ede1a9b152

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Algebra.Group.Ideal (new file) 579
Mathlib.Algebra.Order.Group.Ideal (new file) 688

Declarations diff

+ FG
+ SemigroupIdeal
+ closure
+ closure_le
+ closure_mono
+ coe_closure
+ coe_closure'
+ fg_iff
+ fg_of_wellQuasiOrderedLE
+ instance : WellFoundedGT (SemigroupIdeal M) := by
+ mem_closure
+ mem_closure'
+ mem_closure''
+ mem_closure_of_mem
+ mul_mem
+ subset_closure

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).

Comment thread Mathlib/Algebra/Group/Ideal.lean Resolved
Comment thread Mathlib/Algebra/Group/Ideal.lean Resolved

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you split off the new SubMulAction material to a preliminary PR?

Comment thread Mathlib/Algebra/Group/Ideal.lean Resolved
Comment thread Mathlib/Algebra/Group/Ideal.lean Resolved
Comment thread Mathlib/Algebra/Group/Ideal.lean Resolved
Comment thread Mathlib/Algebra/Group/Ideal.lean Outdated
generated. -/
@[to_additive /-- In a canonically ordered and well-quasi-ordered additive monoid, any semigroup
ideal is finitely generated. -/]
theorem fg_of_wellQuasiOrderedLE (I : SemigroupIdeal M) : I.FG := by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
theorem fg_of_wellQuasiOrderedLE (I : SemigroupIdeal M) : I.FG := by
theorem FG.of_wellQuasiOrderedLE (I : SemigroupIdeal M) : I.FG := 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.

Is this an actual improvement? There are 58 fg_of_ but only 5 FG.of_ in Mathlib.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's not surprising to me. Anonymous dot notation wasn't a thing in Lean 3

Comment thread Mathlib/Algebra/Group/Ideal.lean Outdated
Comment on lines +159 to +160
have hs : ∀ x ∈ s, ∃ i, x ∈ f i := by
intro x hx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
have hs : ∀ x ∈ s, ∃ i, x ∈ f i := by
intro x hx
have hs x (hx : x ∈ s) : ∃ i, x ∈ f 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.

This looks less readable than the quantifiers.

@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 11, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Nov 11, 2025
@staroperator staroperator removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 11, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Nov 12, 2025
@mathlib4-dependent-issues-bot

Copy link
Copy Markdown

Comment thread Mathlib/Algebra/Group/Ideal.lean Outdated
Comment on lines +51 to +52
def closure (s : Set M) : SemigroupIdeal M :=
SubMulAction.closure M s

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
def closure (s : Set M) : SemigroupIdeal M :=
SubMulAction.closure M s
abbrev closure (s : Set M) : SemigroupIdeal M :=
SubMulAction.closure M s

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.

I'm following Ideal.span which is a def, not an abbrev. I should add a simp lemma subMulActionClosure_eq.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we are just being inconsistent, but in comparison PointedCone.span is an abbrev. It certainly make more sense to me as an abbrev since there's no functional difference between both 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.

That makes sense. My concern is that making it abbrev allows simp to rewrite a SemigroupIdeal into a SubMulAction, which makes lemmas on SemigroupIdeal less discoverable.

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.

@YaelDillies Do you still think abbrev is better than def?

@YaelDillies YaelDillies Nov 16, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I think so. This can always be changed later either way, but I believe abbrev is the right design here

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 I will use abbrev here. Though we can still change it if we find the best design

Comment thread Mathlib/Algebra/Group/Ideal.lean Resolved

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

maintainer delegate

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 12, 2025

@jcommelin jcommelin left a comment

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.

bors d+

@mathlib-bors

mathlib-bors Bot commented Nov 14, 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 delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Nov 14, 2025
@staroperator

Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request Nov 16, 2025
This PR defines semigroup ideals; they are different from (in fact, a weaker form of) ring ideals. We prove that in a monoid whose algebraic order is well-quasi-order, all semigroup ideals are finitely generated, and the semigroup ideals satisfy the ascending chain condition. These definitions and results are useful in #27414.

Note: Following `Ideal` with `Submodule`, `SemigroupIdeal M` is an `abbrev` of `SubMulAction M M`. Also, `Ideal.closure` is a re-definition of `SubMulAction.closure` and `Ideal.FG` is defeq to `SubMulAction.FG` but unfolds more nicely.
@mathlib-bors

mathlib-bors Bot commented Nov 16, 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): semigroup ideals [Merged by Bors] - feat(Algebra/Group): semigroup ideals Nov 16, 2025
@mathlib-bors mathlib-bors Bot closed this Nov 16, 2025
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.

4 participants