Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Coercions to the fraction field are injective
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Oct 5, 2017
1 parent cc613b1 commit 55b33e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sage/categories/rings.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ def is_injective(self):
sage: f.is_injective()
True
A coercion to the fraction field is injective::
sage: R = ZpFM(3)
sage: R.fraction_field().coerce_map_from(R).is_injective()
True
"""
if self.domain().is_zero():
return True
Expand Down Expand Up @@ -155,6 +161,10 @@ def is_injective(self):
if self.domain().fraction_field() in NumberFields():
return True

if self._is_coercion:
if self.domain().fraction_field() is self.codomain():
return True

if self.domain().cardinality() > self.codomain().cardinality():
return False

Expand Down

0 comments on commit 55b33e4

Please sign in to comment.