Skip to content

[Merged by Bors] - feat: introduce IsRelPrime and DecompositionMonoid and refactor#10327

Closed
alreadydone wants to merge 39 commits intomasterfrom
DecompositionMonoid
Closed

[Merged by Bors] - feat: introduce IsRelPrime and DecompositionMonoid and refactor#10327
alreadydone wants to merge 39 commits intomasterfrom
DecompositionMonoid

Conversation

@alreadydone
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone commented Feb 7, 2024

  • Introduce typeclass DecompositionMonoid, which says every element in the monoid is primal, i.e., whenever an element divides a product b * c, it can be factored into a product such that the factors divides b and c respectively. A domain is called pre-Schreier if its multiplicative monoid is a decomposition monoid, and these are more general than GCD domains.

  • Show that any GCDMonoid is a DecompositionMonoid. In order for lemmas about DecompositionMonoids to automatically apply to UniqueFactorizationMonoids, we add instances from UniqueFactorizationMonoid α to Nonempty (NormalizedGCDMonoid α) to Nonempty (GCDMonoid α) to DecompositionMonoid α. (Zulip) See the bottom of message for an updated diagram of classes and instances.

  • Introduce binary predicate IsRelPrime which says that the only common divisors of the two elements are units. Replace previous occurrences in mathlib by this predicate.

  • Duplicate all lemmas about IsCoprime in Coprime/Basic (except three lemmas about smul) to IsRelPrime. Due to import constraints, they are spread into three files Algebra/Divisibility/Units (including key lemmas assuming DecompositionMonoid), GroupWithZero/Divisibility, and Coprime/Basic.

  • Show IsCoprime always imply IsRelPrime and is equivalent to it in Bezout rings. To reduce duplication, the definition of Bezout rings and the GCDMonoid instance are moved from RingTheory/Bezout to RingTheory/PrincipalIdealDomain, and some results in PrincipalIdealDomain are generalized to Bezout rings.

  • Remove the recently added file Squarefree/UniqueFactorizationMonoid and place the results appropriately within Squarefree/Basic. All results are generalized to DecompositionMonoid or weaker except the last one.

Zulip

With this PR, all the following instances (indicated by arrows) now work; this PR fills the central part.

																		  EuclideanDomain (bundled)
                                                                              ↙          ↖
                                                                 IsPrincipalIdealRing ← Field (bundled)
                                                                            ↓             ↓
         NormalizationMonoid ←          NormalizedGCDMonoid → GCDMonoid  IsBezout ← ValuationRing ← IsDiscreteValuationRing
                   ↓                             ↓                 ↘       ↙
Nonempty NormalizationMonoid ← Nonempty NormalizedGCDMonoid →  Nonempty GCDMonoid → IsIntegrallyClosed
                                                 ↑                    ↓
                    WfDvdMonoid ← UniqueFactorizationMonoid → DecompositionMonoid (pre-Schreier)
                                                 ↑
                                       IsPrincipalIdealRing

Open in Gitpod

@alreadydone alreadydone added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-algebra Algebra (groups, rings, fields, etc) labels Feb 7, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 7, 2024
@alreadydone alreadydone removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 7, 2024
@alreadydone alreadydone added WIP Work in progress and removed awaiting-review labels Feb 7, 2024
@alreadydone alreadydone removed the auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. label Feb 12, 2024
@alreadydone
Copy link
Copy Markdown
Contributor Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Feb 12, 2024
…10327)

+ Introduce typeclass `DecompositionMonoid`, which says every element in the monoid is primal, i.e., whenever an element divides a product `b * c`, it can be factored into a product such that the factors divides `b` and `c` respectively. A domain is called pre-Schreier if its multiplicative monoid is a decomposition monoid, and these are more general than GCD domains.

+ Show that any `GCDMonoid` is a `DecompositionMonoid`. In order for lemmas about `DecompositionMonoid`s to automatically apply to `UniqueFactorizationMonoid`s, we add instances from `UniqueFactorizationMonoid α` to `Nonempty (NormalizedGCDMonoid α)` to `Nonempty (GCDMonoid α)` to `DecompositionMonoid α`. ([Zulip](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/non-normalizable.20gcd_monoid/near/316895209)) See the bottom of message for an updated diagram of classes and instances.

+ Introduce binary predicate `IsRelPrime` which says that the only common divisors of the two elements are units. Replace previous occurrences in mathlib by this predicate.

+ Duplicate all lemmas about `IsCoprime` in Coprime/Basic (except three lemmas about smul) to `IsRelPrime`. Due to import constraints, they are spread into three files Algebra/Divisibility/Units (including key lemmas assuming DecompositionMonoid), GroupWithZero/Divisibility, and Coprime/Basic.

+ Show `IsCoprime` always imply `IsRelPrime` and is equivalent to it in Bezout rings. To reduce duplication, the definition of Bezout rings and the GCDMonoid instance are moved from RingTheory/Bezout to RingTheory/PrincipalIdealDomain, and some results in PrincipalIdealDomain are generalized to Bezout rings.

+ Remove the recently added file Squarefree/UniqueFactorizationMonoid and place the results appropriately within Squarefree/Basic. All results are generalized to DecompositionMonoid or weaker except the last one.

[Zulip](https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/Coprime.20if.20product.20is.20squarefree/near/419334520)

With this PR, all the following instances (indicated by arrows) now work; this PR fills the central part.
```
                                                                          EuclideanDomain (bundled)
                                                                              ↙          ↖
                                                                 IsPrincipalIdealRing ← Field (bundled)
                                                                            ↓             ↓
         NormalizationMonoid ←          NormalizedGCDMonoid → GCDMonoid  IsBezout ← ValuationRing ← DiscreteValuationRing
                   ↓                             ↓                 ↘       ↙
Nonempty NormalizationMonoid ← Nonempty NormalizedGCDMonoid →  Nonempty GCDMonoid → IsIntegrallyClosed
                                                 ↑                    ↓
                    WfDvdMonoid ← UniqueFactorizationMonoid → DecompositionMonoid
                                                 ↑
                                       IsPrincipalIdealRing
```



Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
Co-authored-by: Oliver Nash <github@olivernash.org>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 12, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: introduce IsRelPrime and DecompositionMonoid and refactor [Merged by Bors] - feat: introduce IsRelPrime and DecompositionMonoid and refactor Feb 12, 2024
@mathlib-bors mathlib-bors bot closed this Feb 12, 2024
@mathlib-bors mathlib-bors bot deleted the DecompositionMonoid branch February 12, 2024 22:06
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
…10327)

+ Introduce typeclass `DecompositionMonoid`, which says every element in the monoid is primal, i.e., whenever an element divides a product `b * c`, it can be factored into a product such that the factors divides `b` and `c` respectively. A domain is called pre-Schreier if its multiplicative monoid is a decomposition monoid, and these are more general than GCD domains.

+ Show that any `GCDMonoid` is a `DecompositionMonoid`. In order for lemmas about `DecompositionMonoid`s to automatically apply to `UniqueFactorizationMonoid`s, we add instances from `UniqueFactorizationMonoid α` to `Nonempty (NormalizedGCDMonoid α)` to `Nonempty (GCDMonoid α)` to `DecompositionMonoid α`. ([Zulip](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/non-normalizable.20gcd_monoid/near/316895209)) See the bottom of message for an updated diagram of classes and instances.

+ Introduce binary predicate `IsRelPrime` which says that the only common divisors of the two elements are units. Replace previous occurrences in mathlib by this predicate.

+ Duplicate all lemmas about `IsCoprime` in Coprime/Basic (except three lemmas about smul) to `IsRelPrime`. Due to import constraints, they are spread into three files Algebra/Divisibility/Units (including key lemmas assuming DecompositionMonoid), GroupWithZero/Divisibility, and Coprime/Basic.

+ Show `IsCoprime` always imply `IsRelPrime` and is equivalent to it in Bezout rings. To reduce duplication, the definition of Bezout rings and the GCDMonoid instance are moved from RingTheory/Bezout to RingTheory/PrincipalIdealDomain, and some results in PrincipalIdealDomain are generalized to Bezout rings.

+ Remove the recently added file Squarefree/UniqueFactorizationMonoid and place the results appropriately within Squarefree/Basic. All results are generalized to DecompositionMonoid or weaker except the last one.

[Zulip](https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/Coprime.20if.20product.20is.20squarefree/near/419334520)

With this PR, all the following instances (indicated by arrows) now work; this PR fills the central part.
```
                                                                          EuclideanDomain (bundled)
                                                                              ↙          ↖
                                                                 IsPrincipalIdealRing ← Field (bundled)
                                                                            ↓             ↓
         NormalizationMonoid ←          NormalizedGCDMonoid → GCDMonoid  IsBezout ← ValuationRing ← DiscreteValuationRing
                   ↓                             ↓                 ↘       ↙
Nonempty NormalizationMonoid ← Nonempty NormalizedGCDMonoid →  Nonempty GCDMonoid → IsIntegrallyClosed
                                                 ↑                    ↓
                    WfDvdMonoid ← UniqueFactorizationMonoid → DecompositionMonoid
                                                 ↑
                                       IsPrincipalIdealRing
```



Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
Co-authored-by: Oliver Nash <github@olivernash.org>
YaelDillies added a commit that referenced this pull request Jan 14, 2025
YaelDillies added a commit that referenced this pull request Jan 14, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 15, 2025
YaelDillies added a commit that referenced this pull request Jan 17, 2025
YaelDillies added a commit that referenced this pull request Jan 19, 2025
YaelDillies added a commit that referenced this pull request Jan 20, 2025
YaelDillies added a commit that referenced this pull request Jan 21, 2025
YaelDillies added a commit that referenced this pull request Jan 22, 2025
YaelDillies added a commit that referenced this pull request Jan 25, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jan 31, 2025
jt496 pushed a commit that referenced this pull request Feb 3, 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.

5 participants