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

chore(RingTheory/Ideal): add new file Ideal.IsPrincipal #13175

Closed
wants to merge 6 commits into from

Conversation

xroblot
Copy link
Collaborator

@xroblot xroblot commented May 24, 2024

This PR adds a new file RingTheory.Ideal.IsPrincipal and moves most of the (basic) results about Ideal.IsPrincipal and Ideal.span_singleton from Ideal.Basic and Ideal.Operations to this file. (Some very basic results or results related to Submodule.span_singleton are left in place.)

The need for this PR comes from a discussion in #12780 about where to put the proof that the equivalence between principal ideals and associates is actually a MulEquiv (#13177).

Some remarks:

  • no_lost_declarations.sh says
* 25  added declarations
* 25  removed declarations
* 5  paired declarations

this is due to some renames in the variables and also namespace changes. I have checked that the added declarations correspond exactly to the removed declarations

  • Some results that could not stay in Ideal.Basic but are not really related to principal ideals have been moved (for the moment?) to the end of Ideal.IsPrincipal (see the misc section). I thought about putting them in Ideal.Operations but the file is already quite large (about 1400 lines). Note that Ideal.Operations imports Ideal.IsPrincipal and these additional results do not add any extra import to Ideal.IsPrincipal. Still, they should probably go somewhere else...

Open in Gitpod

@xroblot xroblot changed the title chore(RingTheory/Ideal): add Ideal.IsPrincipal chore(RingTheory/Ideal): add new file Ideal.IsPrincipal May 24, 2024
@xroblot xroblot added awaiting-review awaiting-CI t-algebra Algebra (groups, rings, fields, etc) labels May 24, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 24, 2024
@@ -0,0 +1,299 @@
/-
Copyright (c) 2018 Kenny Lau. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this copyright correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, that's what I did in my previous splits: just copy the copyright of the original file. I am not sure it is the best way to proceed but, well, that's the only one I know...


/-!
# Principal Ideals
-/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want a small list of the principal results? Also, perhaps, a couple of words about what is what (i.e. in the whole file R is a semiring, sometimes supposed to be a ring...)

variable [Semiring R]

@[simp]
theorem zero_eq_bot : (0 : Ideal R) = ⊥ :=
Copy link
Collaborator

@faenuccio faenuccio May 24, 2024

Choose a reason for hiding this comment

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

This could stay in Basic no? EDIT It was actually in Operation but Basic seems more appropriate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it was in Operations. I moved it here because I need it here and, after all, zero is a principal ideal. It cannot be in Basic because of imports and I don't want to change Basic imports.

Copy link
Member

Choose a reason for hiding this comment

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

I think this can go under Submodule.zero_eq_bot?

Copy link
Member

Choose a reason for hiding this comment

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

Okay after reading the remaining of the file, maybe add a new file RingTheory/Ideal/Lattice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think I'm going to put this PR on hold. There is first a need to split Operations into several smaller files first for this to work.

open Submodule Set

@[simp]
theorem one_eq_top : (1 : Ideal R) = ⊤ := by erw [Submodule.one_eq_range, LinearMap.range_id]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could remain in Basic, I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the same as above

(mul_dvd_mul_iff_left h₁).1 <| by rwa [mul_one, ← Ideal.span_singleton_le_span_singleton]
#align ideal.factors_decreasing Ideal.factors_decreasing

lemma Ideal.isPrime_of_maximally_disjoint [CommSemiring R] (I : Ideal R) (S : Submonoid R)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why has this been moved here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As I mentioned in the description, a certain number of results could not stay in Basic since they depend on results that have been moved to IsPrincipal. For the moment, I moved those results to IsPrincipal as a temporary solution (in the misc section). I could put these results in Operations but the file is already quite big so I am not sure it's the best way to proceed. I welcome any suggestions on what to do with those...

rw [← hr₁, ← hr₂]
ring

theorem Ring.not_isField_iff_exists_ideal_bot_lt_and_lt_top [CommSemiring R] [Nontrivial R] :
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(Same as above)

exact lt_top (I.mul_mem_right _ mem)
#align ring.not_is_field_iff_exists_ideal_bot_lt_and_lt_top Ring.not_isField_iff_exists_ideal_bot_lt_and_lt_top

theorem Ring.not_isField_iff_exists_prime [CommSemiring R] [Nontrivial R] :
Copy link
Collaborator

Choose a reason for hiding this comment

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

Once more... why here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(Same as above)

Copy link
Collaborator

@faenuccio faenuccio left a comment

Choose a reason for hiding this comment

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

I was all in favour of creating this new file, and so of course this PR looks very good to me. I wonder why many lemmas about prime/maximal ideals ended up in the IsPrincipal one although they do not have anything to do with principality, AFAICT.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 25, 2024
@xroblot
Copy link
Collaborator Author

xroblot commented May 25, 2024

Well, I think I am going to close this PR. I do not think into possible to put everything about IsPrincipal in a single file before a major refactor of Operations has been done.

@xroblot xroblot added WIP Work in progress and removed awaiting-review labels May 25, 2024
@xroblot xroblot closed this May 25, 2024
@xroblot xroblot deleted the xfr-split_ideal_isprincipal_step1 branch June 3, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-algebra Algebra (groups, rings, fields, etc) WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants