Homsets

AUTHORS:

  • David Kohel and William Stein
  • David Joyner (2005-12-17): added examples
  • William Stein (2006-01-14): Changed from Homspace to Homset.
  • Nicolas M. Thiery (2008-12-): Updated for the new category framework
sage.categories.homset.End(X, category=None)

Create the set of endomorphisms of X in the category category.

INPUT:

  • X - anything
  • category - (optional) category in which to coerce X

OUTPUT: a set of endomorphisms in category

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 = AlternatingGroup(3)
sage: S = End(G); S
Set of Morphisms from AlternatingGroup(3) to AlternatingGroup(3) in Category of finite permutation groups
sage: from sage.categories.homset import is_Endset
sage: is_Endset(S)
True
sage: S.domain()
Alternating group of order 3!/2 as a permutation group

To avoid creating superfluous categories, homsets are in the homset category of the lowest category which currently says something specific about its homsets. For example, S is not in the category of hom sets of the category of groups:

sage: S.category()
Category of hom sets in Category of sets
sage: End(QQ).category()
Category of hom sets in Category of rings
sage.categories.homset.Hom(X, Y, category=None)

Create the space of homomorphisms from X to Y in the category category.

INPUT:

  • X - anything
  • Y - anything
  • category - (optional) category in which the morphisms must be

OUTPUT: a homset in category

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 = AlternatingGroup(3)
sage: Hom(G, G)
Set of Morphisms from AlternatingGroup(3) to AlternatingGroup(3) in Category of finite permutation groups
sage: Hom(ZZ, QQ, Sets())
Set of Morphisms from Integer Ring to Rational Field in Category of sets

sage: Hom(FreeModule(ZZ,1), FreeModule(QQ,1))
Set of Morphisms from Ambient free module of rank 1 over the principal ideal domain Integer Ring to Vector space of dimension 1 over Rational Field in Category of modules with basis over Integer Ring
sage: Hom(FreeModule(QQ,1), FreeModule(ZZ,1))
Set of Morphisms from Vector space of dimension 1 over Rational Field to Ambient free module of rank 1 over the principal ideal domain Integer Ring in Category of vector spaces over Rational Field

TODO: design decision: how much of the homset comes from the category of X and Y, and how much from the specific X and Y. In particular, do we need several parent classes depending on X and Y, or does the difference only lie in the elements (i.e. the morphism), and of course how the parent calls their constructors.

class sage.categories.homset.Homset(X, Y, category=None, base=None, check=True)

Bases: sage.structure.parent.Set_generic

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
codomain()
coerce_map_from_c(R)
domain()
element_class_set_morphism()

A base class for elements of this homset which are also SetMorphism, i.e. implemented by mean of a Python function.

This is currently plain SetMorphism, without inheritance from categories.

Todo: refactor during the upcoming homset cleanup.

EXAMPLES:

sage: H = Hom(ZZ, ZZ)
sage: H.element_class_set_morphism
<type 'sage.categories.morphism.SetMorphism'>
get_action_c(R, op, self_on_left)
homset_category()

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(AlternatingGroup(4), AlternatingGroup(7))
sage: H.homset_category()
Category of finite permutation groups
identity()
is_endomorphism_set()
Return True if the domain and codomain of self are the same object.
natural_map()
reversed()

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 modules with basis over Integer Ring
sage: type(H)
<class 'sage.modules.free_module_homspace.FreeModuleHomspace_with_category'>
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 hom sets in Category of modules with basis over Integer Ring
sage: type(H.reversed())
<class 'sage.modules.free_module_homspace.FreeModuleHomspace_with_category'>
class sage.categories.homset.HomsetWithBase(X, Y, category=None, check=True, base=None)
Bases: sage.categories.homset.Homset
sage.categories.homset.end(X, f)

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
sage.categories.homset.hom(X, Y, f)

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
sage.categories.homset.is_Endset(x)
Return True if x is a set of endomorphisms in a category.
sage.categories.homset.is_Homset(x)
Return True if x is a set of homomorphisms in a category.

Previous topic

Specific category classes.

Next topic

Morphisms

This Page