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

Commit

Permalink
29723: ring homomorphism: inverse, is_invertible, is_surjective
Browse files Browse the repository at this point in the history
  • Loading branch information
mwageringel committed Jun 16, 2020
1 parent fd6dee6 commit 5bf9893
Show file tree
Hide file tree
Showing 4 changed files with 399 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sage/categories/rings.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ def is_injective(self):
if K is self.codomain():
return True

if self.domain().cardinality() > self.codomain().cardinality():
return False
try:
if self.domain().cardinality() > self.codomain().cardinality():
return False
except AttributeError:
pass

raise NotImplementedError

Expand Down
13 changes: 13 additions & 0 deletions src/sage/rings/finite_rings/hom_finite_field.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,19 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
"""
return self.__class__(self.domain(), self.power()*n)

@cached_method
def inverse(self):
"""
Return the inverse of this Frobenius endomorphism.
EXAMPLES::
sage: k.<a> = GF(7^11)
sage: f = k.frobenius_endomorphism(5)
sage: (f.inverse() * f).is_identity()
True
"""
return self.__class__(self.domain(), -self.power())

def _composition(self, right):
"""
Expand Down
Loading

0 comments on commit 5bf9893

Please sign in to comment.