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

[Merged by Bors] - feat(ring_theory/localization): order embedding of ideals, local ring instance #3287

Closed
wants to merge 5 commits into from

Conversation

101damnations
Copy link
Collaborator


@101damnations
Copy link
Collaborator Author

sorry for the long break in PRs. This is the order embedding of ideals in a localization & the local ring instance on the localization at the complement of a prime ideal.

@101damnations
Copy link
Collaborator Author

The linter says /- The `fails_quickly` linter reports: -/ /- TYPE CLASS SEARCHES TIMED OUT. For the following classes, there is an instance that causes a loop, or an excessively long search.: -/ -- ring_theory/ideals.lean #print local_ring /- maximum class-instance resolution depth has been reached (the limit can be increased by setting option 'class.instance_max_depth') (the class-instance resolution trace can be visualized by setting option 'trace.class_instances') -/

I am not sure what to do about this - the local ring instance added in this PR compiles - should I increase class.instance_max_depth just before the local ring instance or something? I don't understand how this PR can affect ring_theory/ideals.lean as the linter seems to imply

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Looks good to me! Maybe the instance is tripping up because codomain is reducible? I have no idea. @gebner could you please take a look?

namespace ideal

/-- The complement of a prime ideal `I ⊆ R` is a submonoid of `R`. -/
def prime_submonoid :
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def prime_submonoid :
def prime_complement :

Otherwise it sounds like you're turning the prime ideal itself into a submonoid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point... What about prime_compl, to be in keeping with set.compl etc?

Copy link
Member

Choose a reason for hiding this comment

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

yup, sounds good to me

@[nolint unused_arguments has_inhabited_instance]
def codomain (f : localization_map M S) := S

instance : comm_ring f.codomain := _inst_2
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
instance : comm_ring f.codomain := _inst_2
instance : comm_ring f.codomain := by apply_instance

_inst_2 doesn't seem like a very stable name. If someone adds a variable we might suddenly need _inst_3 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.

fair point! by apply_instance doesn't work but I've just found out you can use by assumption for instances... awesome

Also thank you for the irreducible codomain appeasing the linter :)

def codomain (f : localization_map M S) := S

instance : comm_ring f.codomain := _inst_2
instance {K : Type*} [field K] (f : localization_map M K) : field f.codomain := _inst_4
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
instance {K : Type*} [field K] (f : localization_map M K) : field f.codomain := _inst_4
instance {K : Type*} [field K] (f : localization_map M K) : field f.codomain := by apply_instance

@jcommelin
Copy link
Member

Thanks 🎉

bors merge

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Jul 4, 2020
bors bot pushed a commit that referenced this pull request Jul 4, 2020
@bors
Copy link

bors bot commented Jul 4, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(ring_theory/localization): order embedding of ideals, local ring instance [Merged by Bors] - feat(ring_theory/localization): order embedding of ideals, local ring instance Jul 4, 2020
@bors bors bot closed this Jul 4, 2020
@bors bors bot deleted the ring_loc_additions branch July 4, 2020 19:37
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants