Opened 6 years ago

Closed 5 years ago

#23186 closed enhancement (fixed)

ZZ → QQ is not onto

Reported by: Julian Rüth Owned by:
Priority: minor Milestone: sage-8.0
Component: commutative algebra Keywords: sd86.5
Cc: Merged in:
Authors: Julian Rüth Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 79fd62a (Commits, GitHub, GitLab) Commit: 79fd62a8c40632891cf32502a3d80709edc68cf8
Dependencies: Stopgaps:

Status badges

Description (last modified by Travis Scrimshaw)

Currently, this fails

sage: QQ.coerce_map_from(ZZ).is_surjective()
NotImplementedError

To fix this, we make the coercion morphism know it is not surjective.

Change History (6)

comment:1 Changed 6 years ago by Travis Scrimshaw

You should never, ever give information about specific objects at the category level.

However, you can impart this information in the Z_to_Q morphism class.

comment:2 Changed 6 years ago by Julian Rüth

Why not do that at the category level?

comment:3 Changed 6 years ago by Julian Rüth

Branch: u/saraedum/zz___qq_is_not_onto

comment:4 Changed 6 years ago by Julian Rüth

Authors: Julian Rüth
Branch: u/saraedum/zz___qq_is_not_onto
Status: newneeds_review

comment:5 Changed 6 years ago by Travis Scrimshaw

Branch: u/saraedum/zz___qq_is_not_onto
Commit: 79fd62a8c40632891cf32502a3d80709edc68cf8
Description: modified (diff)
Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review

Because to do something at the category level, you should be doing something for all objects in that category, not for one specific object (in a specific implementation). Now, if you wanted to have something in Rings checking if a morphism to ZZ was surjective returning True, then that would be good because it is true for all rings (of characteristic 0). Although map has a concrete implementation of is_surjective, which is a technical detail that would need to be worked around (which that method probably should be lifted to the category of set morphisms).

The fix LGTM.


New commits:

79fd62aZZ is not onto QQ

comment:6 Changed 5 years ago by Volker Braun

Branch: u/saraedum/zz___qq_is_not_onto79fd62a8c40632891cf32502a3d80709edc68cf8
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.