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] - fix(ring_theory/localization): remove coe_submodule instance #3832

Closed
wants to merge 5 commits into from

Conversation

digama0
Copy link
Member

@digama0 digama0 commented Aug 16, 2020

variables {f}
/-- Map from ideals of `R` to submodules of `S` induced by `f`.
(This was previously a `has_coe` instance, but if `f.codomain = R` then this will loop.) -/
def coe_submodule (I : ideal R) : submodule R f.codomain := submodule.map f.lin_coe I
Copy link
Member

Choose a reason for hiding this comment

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

This is also dangerous as a has_coe_t instance? How does this relate to the note [use has_coe_t]?

What do you exactly mean with this?

if f.codomain = R then this will loop

Copy link
Member Author

Choose a reason for hiding this comment

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

If f.codomain = R then both sides are defeq, i.e. it is an identity coercion. has_coe_t would help somewhat here, but that's not the only problem with this instance; f is not determined by the lhs so instance search goes down a rabbit hole.

Copy link
Member

Choose a reason for hiding this comment

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

localization_map.codomain is not reducible, so I thought that for the purposes of type-class inference f.codomain and R are never considered definitionally equal?

If it were a has_coe_t instance, I'm sure if the fact that f is not determined by the lhs is important...?

Copy link
Member

Choose a reason for hiding this comment

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

Changing it to a has_coe_t instance is enough to avoid the loop that exposed this, yes.

Copy link
Member

Choose a reason for hiding this comment

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

I'm happy to keep it a def though, I'm not sure whether this is a good coercion. Maybe a note saying that it doesn't loop as a has_coe_t is nice?

@Vierkantor Vierkantor added the awaiting-author A reviewer has asked the author a question or requested changes label Aug 17, 2020
@robertylewis robertylewis removed the awaiting-author A reviewer has asked the author a question or requested changes label Aug 17, 2020
@robertylewis
Copy link
Member

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 Aug 17, 2020
@bors
Copy link

bors bot commented Aug 17, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(ring_theory/localization): remove coe_submodule instance [Merged by Bors] - fix(ring_theory/localization): remove coe_submodule instance Aug 17, 2020
@bors bors bot closed this Aug 17, 2020
@bors bors bot deleted the no_coe_submodule branch August 17, 2020 18:07
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

4 participants