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(data/equiv): define ring_equiv_class #11977

Closed
wants to merge 7 commits into from

Conversation

Vierkantor
Copy link
Collaborator

This PR applies the morphism class pattern to ring_equiv, producing a new ring_equiv_class extending mul_equiv_class and add_equiv_class. It also provides a ring_equiv_class instance for alg_equivs.


Open in Gitpod

@Vierkantor Vierkantor added awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. labels Feb 11, 2022
Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks!

src/algebra/algebra/basic.lean Show resolved Hide resolved
src/data/equiv/ring.lean Outdated Show resolved Hide resolved
src/data/equiv/ring.lean Outdated Show resolved Hide resolved
ext,
exact congr_fun w a,
end
fun_like.coe_injective

instance has_coe_to_ring_equiv : has_coe (A₁ ≃ₐ[R] A₂) (A₁ ≃+* A₂) := ⟨alg_equiv.to_ring_equiv⟩
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can get rid of this one by adding the has_coe_t F (A₁ ≃+* A₂) instance from ring_equiv_class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd prefer to do so in a separate PR, since reviewing/debugging coercions is quite a bit harder than reviewing the new class.

src/data/equiv/ring.lean Outdated Show resolved Hide resolved
src/data/equiv/ring.lean Outdated Show resolved Hide resolved
src/data/equiv/ring.lean Outdated Show resolved Hide resolved
@@ -382,7 +382,7 @@ begin
(mv_polynomial.map_surjective f.to_ring_hom hf_surj).comp (alg_equiv.surjective _),
ideal.fg_ker_comp _ _ _ _ (alg_equiv.surjective _)⟩,
{ convert submodule.fg_bot,
exact ring_hom.ker_coe_equiv _, },
exact ring_hom.ker_coe_equiv (mv_polynomial.sum_alg_equiv R ι ι').to_ring_equiv },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The unifier had issues here because the goal contained (coe : alg_hom → ring_hom) sum_alg_equiv.to_alg_hom which had to be unified with (coe : ring_equiv → ring_hom) sum_alg_equiv.to_ring_equiv. Apparently the new generic coercion to ring_hom deriving from ring_equiv.ring_hom_class makes this unification slightly too hard without this hint.

In any case, we should be able to fix the requirement for unification entirely by generalizing ker to a ring_hom_class.

@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Feb 16, 2022
@urkud
Copy link
Member

urkud commented Feb 18, 2022

Thanks!
bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Feb 18, 2022
bors bot pushed a commit that referenced this pull request Feb 18, 2022
This PR applies the morphism class pattern to `ring_equiv`, producing a new `ring_equiv_class` extending `mul_equiv_class` and `add_equiv_class`. It also provides a `ring_equiv_class` instance for `alg_equiv`s.



Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@bors
Copy link

bors bot commented Feb 18, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/equiv): define ring_equiv_class [Merged by Bors] - feat(data/equiv): define ring_equiv_class Feb 18, 2022
@bors bors bot closed this Feb 18, 2022
@bors bors bot deleted the ring_equiv_class branch February 18, 2022 16:48
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

3 participants