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:  sage8.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: 
Description (last modified by )
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
comment:3 Changed 6 years ago by
Branch:  → u/saraedum/zz___qq_is_not_onto 

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

Branch:  u/saraedum/zz___qq_is_not_onto 
Status:  new → needs_review 
comment:5 Changed 6 years ago by
Branch:  → u/saraedum/zz___qq_is_not_onto 

Commit:  → 79fd62a8c40632891cf32502a3d80709edc68cf8 
Description:  modified (diff) 
Reviewers:  → Travis Scrimshaw 
Status:  needs_review → positive_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:
79fd62a  ZZ is not onto QQ

comment:6 Changed 5 years ago by
Branch:  u/saraedum/zz___qq_is_not_onto → 79fd62a8c40632891cf32502a3d80709edc68cf8 

Resolution:  → fixed 
Status:  positive_review → closed 
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.