Opened 5 years ago

Closed 5 years ago

#23186 closed enhancement (fixed)

ZZ → QQ is not onto

Reported by: saraedum 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 tscrim)

Currently, this fails

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

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

Change History (6)

comment:1 Changed 5 years ago by tscrim

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 5 years ago by saraedum

Why not do that at the category level?

comment:3 Changed 5 years ago by saraedum

  • Branch set to u/saraedum/zz___qq_is_not_onto

comment:4 Changed 5 years ago by saraedum

  • Authors set to Julian Rüth
  • Branch u/saraedum/zz___qq_is_not_onto deleted
  • Status changed from new to needs_review

comment:5 Changed 5 years ago by tscrim

  • Branch set to u/saraedum/zz___qq_is_not_onto
  • Commit set to 79fd62a8c40632891cf32502a3d80709edc68cf8
  • Description modified (diff)
  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to 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:

79fd62aZZ is not onto QQ

comment:6 Changed 5 years ago by vbraun

  • Branch changed from u/saraedum/zz___qq_is_not_onto to 79fd62a8c40632891cf32502a3d80709edc68cf8
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.