Skip to content
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

refactor: generalize IsIntegrallyClosed away from fraction fields #7116

Closed
wants to merge 6 commits into from

Conversation

Vierkantor
Copy link
Contributor

@Vierkantor Vierkantor commented Sep 12, 2023

Instead of saying IsIntegrallyClosed R means the ring R contains all integral elements of the ring of fractions, we follow, as suggested by @alreadydone in the review for #6126, the convention by the Stacks project and paramerize over an arbitrary algebra A: IsIntegrallyClosed R A means R contains all integral elements of A.

Most results generalize straightforwardly. The general algorithm: if the fraction field is already there, use that. Otherwise use FractionRing R.

TODO: generalize away from IsFractionRing if they are not needed.


Open in Gitpod

@Vierkantor Vierkantor added RFC Request for comment t-algebra Algebra (groups, rings, fields etc) labels Sep 12, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Sep 12, 2023

variable {R : Type*} [CommRing R]
-- TODO: this section can be generalized from `IsFractionRing` to any `Algebra` that is injective,
-- but there is no way to hook that assumption up to the typeclass system.
Copy link
Collaborator

Choose a reason for hiding this comment

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

iirc, it's NoZeroSmulDivisors

Copy link
Contributor

Choose a reason for hiding this comment

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

The identity homomorphism from R to itself is injective but wouldn't satisfy NoZeroSmulDivisors if R has zero divisors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, indeed, I just remember using it in flt-reg for that purpose but that's just because we were dealing with domains at all times

Mathlib/Algebra/GCDMonoid/IntegrallyClosed.lean Outdated Show resolved Hide resolved
Mathlib/RingTheory/IntegrallyClosed.lean Outdated Show resolved Hide resolved
Mathlib/RingTheory/IntegrallyClosed.lean Outdated Show resolved Hide resolved

variable {R : Type*} [CommRing R]
-- TODO: this section can be generalized from `IsFractionRing` to any `Algebra` that is injective,
-- but there is no way to hook that assumption up to the typeclass system.
Copy link
Contributor

Choose a reason for hiding this comment

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

The identity homomorphism from R to itself is injective but wouldn't satisfy NoZeroSmulDivisors if R has zero divisors.

Mathlib/RingTheory/IntegrallyClosed.lean Outdated Show resolved Hide resolved
@jcommelin jcommelin added the awaiting-author A reviewer has asked the author a question or requested changes label Sep 14, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Sep 14, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

This PR/issue depends on:

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Sep 14, 2023
Vierkantor and others added 4 commits September 14, 2023 13:25
Instead of saying `IsIntegrallyClosed R` means the ring `R` contains all integral elements of the ring of fractions, we follow the convention by the Stacks project and paramerize over an arbitrary algebra `A`: `IsIntegrallyClosed R A` means `R` contains all integral elements of `A`.

Most results generalize straightforwardly.
The general algorithm: if the fraction field is already there, use that. Otherwise use `FractionRing R`.

TODO: generalize away from `IsFractionRing` if they are not needed.
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
@Vierkantor Vierkantor added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes RFC Request for comment merge-conflict The PR has a merge conflict with master, and needs manual merging. labels Sep 14, 2023
@@ -71,7 +71,7 @@ end

variable [IsDomain S] [NoZeroSMulDivisors R S]

variable [IsIntegrallyClosed R]
variable [IsIntegrallyClosed R (FractionRing R)]
Copy link
Member

@jcommelin jcommelin Sep 14, 2023

Choose a reason for hiding this comment

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

Shouldn't we introduce a name for this? Can we call these rings "normal"?
@alreadydone do you have opinions on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Normal implies not only IsIntegrallyClosed R (FractionRing R) but also IsReduced according to Stacks' definition.
Maybe we could call this generalized version IsIntegrallyClosedIn and let IsIntegrallyClosed R := IsIntegrallyClosedIn R (FractionRing R), so the definition of IsIntegrallyClosed remains unchanged. To be honest I don't see much use of IsIntegrallyClosedIn yet ...

@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Sep 14, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Sep 19, 2023
@Vierkantor
Copy link
Contributor Author

Coming back to this, I indeed don't see a direct application for the changes. However, the integral closure machinery in Mathlib still feels somewhat messy at the moment so I'd like to spend some time figuring out how to make it better.

Continuing along Junyan's suggestion, can't we define IsIntegrallyClosedIn R A := IsIntegralClosure R R A and then IsIntegrallyClosed R := IsIntegrallyClosedIn R (FractionRing R)? I expect that would integrate the different classes in a neater way. I don't know if aliases or defs would be the best mechanisms.

@alreadydone
Copy link
Contributor

Continuing along Junyan's suggestion, can't we define IsIntegrallyClosedIn R A := IsIntegralClosure R R A and then IsIntegrallyClosed R := IsIntegrallyClosedIn R (FractionRing R)? I expect that would integrate the different classes in a neater way. I don't know if aliases or defs would be the best mechanisms.

Indeed, there's IsIntegralClosure too. Sounds like a good idea!

Vierkantor added a commit that referenced this pull request Oct 23, 2023
…sedIn`

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
@Vierkantor
Copy link
Contributor Author

Closing in favour of #7857.

@Vierkantor Vierkantor closed this Oct 23, 2023
Vierkantor added a commit that referenced this pull request Jan 16, 2024
…sedIn`

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
Vierkantor added a commit that referenced this pull request Apr 5, 2024
…sedIn`

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
mathlib-bors bot pushed a commit that referenced this pull request Apr 11, 2024
…sedIn` (#7857)

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
Louddy pushed a commit that referenced this pull request Apr 15, 2024
…sedIn` (#7857)

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
…sedIn` (#7857)

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
…sedIn` (#7857)

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
callesonne pushed a commit that referenced this pull request Apr 22, 2024
…sedIn` (#7857)

This refactor adds a new definition `IsIntegrallyClosedIn R A` equal to `IsIntegralClosure R A A`, and redefines `IsIntegrallyClosed R` to equal `IsIntegrallyClosed R (FractionRing A)`. This should make it possible and convenient to generalize away from the fraction fields.

This also more closely approximates the conventions of the Stacks project.

This is a second attempt at the refactor, after #7116 which was much more messy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes merge-conflict The PR has a merge conflict with master, and needs manual merging. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants