#29723 closed enhancement (fixed)

inverses of ring homomorphisms

Reported by: gh-mwageringel Owned by:
Priority: major Milestone: sage-9.2
Component: commutative algebra Keywords:
Cc: rburing, nbruin, dimpase, yzh Merged in:
Authors: Markus Wageringel Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: ab60c40 (Commits, GitHub, GitLab) Commit: ab60c40550b9aacc101d1bbb39b4f22d5e9dfee7
Dependencies: #9792 Stopgaps:

Status badges

Description (last modified by gh-mwageringel)

Ticket #9792 implements inverse_image and is_injective for polynomial ring homomorphisms. Based on that, this ticket implements the methods

  • inverse
  • is_invertible
  • is_surjective

This works for morphisms of polynomial rings, quotient rings, number fields and Galois fields. Several classes of ring homomorphisms are covered.

Example:

sage: R.<x,y,z> = QQ[]
sage: sigma = R.hom([x - 2*y*(z*x+y^2) - z*(z*x+y^2)^2, y + z*(z*x+y^2), z], R)
sage: tau = sigma.inverse(); tau
Ring endomorphism of Multivariate Polynomial Ring in x, y, z over Rational Field
  Defn: x |--> -y^4*z - 2*x*y^2*z^2 - x^2*z^3 + 2*y^3 + 2*x*y*z + x
        y |--> -y^2*z - x*z^2 + y
        z |--> z
sage: (tau * sigma).is_identity()
True

See #9792 for more details.

Change History (15)

comment:1 Changed 11 months ago by gh-mwageringel

  • Authors set to Markus Wageringel
  • Branch set to u/gh-mwageringel/29723
  • Commit set to 13e89803a6fc071d70c3aabe718f28bad74928f4
  • Dependencies set to #9792
  • Description modified (diff)
  • Status changed from new to needs_review

It turns out to be more convenient to implement inverse_image first, so this branch is now based on #9792 (kernel and inverse_image of (polynomial) ring homomorphisms).

I would appreciate if someone could give these tickets a review.


New commits:

ad0dc039792: ring homomorphism: inverse_image, kernel, is_injective
13e898029723: ring homomorphism: inverse, is_invertible, is_surjective

comment:2 Changed 11 months ago by tscrim

Is there a particular reason why you raise a ZeroDivisionError if the inverse doesn't exist? I feel like it would be better as a ValueError (or maybe a TypeError).

comment:3 follow-up: Changed 11 months ago by gh-mwageringel

Mainly for consistency with morphisms between vector spaces:

sage: f = (QQ^2).hom([[1,1], [1,1]], QQ^2)
sage: f.inverse()
...
ZeroDivisionError: matrix morphism not invertible

Morphisms can be composed using the multiplication operator, so with respect to that operation, a ZeroDivisionError sort of makes sense. Another option would be to raise an ArithmeticError. I do not have a strong opinion about this matter, though.

This reminds me that we should probably add an alias __invert__ for ring homomorphisms as well, so that the syntax ~f can be used.

comment:4 in reply to: ↑ 3 Changed 11 months ago by tscrim

Replying to gh-mwageringel:

Mainly for consistency with morphisms between vector spaces:

sage: f = (QQ^2).hom([[1,1], [1,1]], QQ^2)
sage: f.inverse()
...
ZeroDivisionError: matrix morphism not invertible

Morphisms can be composed using the multiplication operator, so with respect to that operation, a ZeroDivisionError sort of makes sense. Another option would be to raise an ArithmeticError. I do not have a strong opinion about this matter, though.

I see, and I agree that it sort of makes sense. Then let us keep it as a ZeroDivisionError.

This reminds me that we should probably add an alias __invert__ for ring homomorphisms as well, so that the syntax ~f can be used.

Please do so. Once that is done, this will be a positive review.

comment:5 Changed 11 months ago by git

  • Commit changed from 13e89803a6fc071d70c3aabe718f28bad74928f4 to 85d94d28f8dd7f082cec9a749c47fc8d5a7151aa

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

fd6dee69792: fix some details
5bf989329723: ring homomorphism: inverse, is_invertible, is_surjective
85d94d229723: add __invert__ for ring homomorphisms

comment:6 Changed 11 months ago by gh-mwageringel

Thank you. I have rebased the branch and implemented __invert__ -- not as an alias though, as it would not work well with inheritance.

comment:7 Changed 11 months ago by tscrim

Thanks. Looks good overall, but the patchbot reports some failures:

sage -t --long src/sage/rings/polynomial/skew_polynomial_ring.py  # 1 doctest failed
sage -t --long src/sage/rings/polynomial/skew_polynomial_element.pyx  # 3 doctests failed

Once fixed, you can set a positive review.

comment:8 Changed 11 months ago by git

  • Commit changed from 85d94d28f8dd7f082cec9a749c47fc8d5a7151aa to 081f79da91d52366e29d580a75a2cb451f62757c

Branch pushed to git repo; I updated commit sha1. New commits:

081f79d29723: fix doctests of skew polynomials

comment:9 Changed 11 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM.

comment:10 Changed 11 months ago by vbraun

  • Status changed from positive_review to needs_work

Merge conflict

comment:11 Changed 11 months ago by git

  • Commit changed from 081f79da91d52366e29d580a75a2cb451f62757c to ab60c40550b9aacc101d1bbb39b4f22d5e9dfee7

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7216bac29723: Merge tag '9.2.beta2' into #29723
ab60c4029723: fix doctests of skew polynomials

comment:12 Changed 11 months ago by gh-mwageringel

  • Status changed from needs_work to needs_review

I have resolved the conflict. Let us see what the bot says.

comment:13 Changed 11 months ago by mkoeppe

  • Cc yzh added

comment:14 Changed 11 months ago by tscrim

  • Status changed from needs_review to positive_review

LGTM.

comment:15 Changed 10 months ago by vbraun

  • Branch changed from u/gh-mwageringel/29723 to ab60c40550b9aacc101d1bbb39b4f22d5e9dfee7
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.