AUTHORS:
Create the set of endomorphisms of X in the category cat.
INPUT:
OUTPUT: a set of endomorphisms in cat
EXAMPLES:
sage: V = VectorSpace(QQ, 3)
sage: End(V)
Set of Morphisms from Vector space of dimension 3 over Rational
Field to Vector space of dimension 3 over Rational Field in
Category of vector spaces over Rational Field
sage: G = SymmetricGroup(3)
sage: S = End(G); S
Set of Morphisms from SymmetricGroup(3) to SymmetricGroup(3) in Category of groups
sage: from sage.categories.homset import is_Endset
sage: is_Endset(S)
True
sage: S.domain()
Symmetric group of order 3! as a permutation group
Homsets are not objects in their category. They are currently sets.
sage: S.category()
Category of sets
sage: S.domain().category()
Category of groups
Create the space of homomorphisms from X to Y in the category cat.
INPUT:
OUTPUT: a homset in cat
EXAMPLES:
sage: V = VectorSpace(QQ,3)
sage: Hom(V, V)
Set of Morphisms from Vector space of dimension 3 over Rational
Field to Vector space of dimension 3 over Rational Field in
Category of vector spaces over Rational Field
sage: G = SymmetricGroup(3)
sage: Hom(G, G)
Set of Morphisms from SymmetricGroup(3) to SymmetricGroup(3) in Category of groups
sage: Hom(ZZ, QQ, Sets())
Set of Morphisms from Integer Ring to Rational Field in Category of sets
The class for collections of morphisms in a category.
EXAMPLES:
sage: H = Hom(QQ^2, QQ^3)
sage: loads(H.dumps()) == H
True
sage: E = End(AffineSpace(2, names='x,y'))
sage: loads(E.dumps()) == E
True
Construct a morphism in this homset from x if possible.
EXAMPLES:
sage: H = Hom(SymmetricGroup(4), SymmetricGroup(7))
sage: phi = Hom(SymmetricGroup(5), SymmetricGroup(6)).natural_map()
sage: phi
Coercion morphism:
From: SymmetricGroup(5)
To: SymmetricGroup(6)
sage: H(phi)
Composite map:
From: SymmetricGroup(4)
To: SymmetricGroup(7)
Defn: Composite map:
From: SymmetricGroup(4)
To: SymmetricGroup(6)
Defn: Call morphism:
From: SymmetricGroup(4)
To: SymmetricGroup(5)
then
Coercion morphism:
From: SymmetricGroup(5)
To: SymmetricGroup(6)
then
Call morphism:
From: SymmetricGroup(6)
To: SymmetricGroup(7)
AUTHORS:
Return the category that this is a Hom in, i.e., this is typically the category of the domain or codomain object.
EXAMPLES:
sage: H = Hom(SymmetricGroup(4), SymmetricGroup(7))
sage: H.homset_category()
Category of groups
Return the corresponding homset, but with the domain and codomain reversed.
EXAMPLES:
sage: H = Hom(ZZ^2, ZZ^3); H
Set of Morphisms from Ambient free module of rank 2 over the principal ideal domain Integer Ring to Ambient free module of rank 3 over the principal ideal domain Integer Ring in Category of free modules over Integer Ring
sage: type(H)
<class 'sage.modules.free_module_homspace.FreeModuleHomspace'>
sage: H.reversed()
Set of Morphisms from Ambient free module of rank 3 over the principal ideal domain Integer Ring to Ambient free module of rank 2 over the principal ideal domain Integer Ring in Category of free modules over Integer Ring
sage: type(H.reversed())
<class 'sage.modules.free_module_homspace.FreeModuleHomspace'>
Return End(X)(f), where f is data that defines an element of End(X).
EXAMPLES:
sage: R, x = PolynomialRing(QQ,'x').objgen()
sage: phi = end(R, [x + 1])
sage: phi
Ring endomorphism of Univariate Polynomial Ring in x over Rational Field
Defn: x |--> x + 1
sage: phi(x^2 + 5)
x^2 + 2*x + 6
Return Hom(X,Y)(f), where f is data that defines an element of Hom(X,Y).
EXAMPLES:
sage: R, x = PolynomialRing(QQ,'x').objgen()
sage: phi = hom(R, QQ, [2])
sage: phi(x^2 + 3)
7