Morphisms between finitely generated modules over a PID#
AUTHOR:
William Stein, 2009
- sage.modules.fg_pid.fgp_morphism.FGP_Homset(X, Y)[source]#
EXAMPLES:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]); Q = V/W sage: Q.Hom(Q) # indirect doctest Set of Morphisms from Finitely generated module V/W over Integer Ring with invariants (4, 12) to Finitely generated module V/W over Integer Ring with invariants (4, 12) in Category of modules over Integer Ring sage: True # Q.Hom(Q) is Q.Hom(Q) True sage: type(Q.Hom(Q)) <class 'sage.modules.fg_pid.fgp_morphism.FGP_Homset_class_with_category'>
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]); Q = V/W >>> Q.Hom(Q) # indirect doctest Set of Morphisms from Finitely generated module V/W over Integer Ring with invariants (4, 12) to Finitely generated module V/W over Integer Ring with invariants (4, 12) in Category of modules over Integer Ring >>> True # Q.Hom(Q) is Q.Hom(Q) True >>> type(Q.Hom(Q)) <class 'sage.modules.fg_pid.fgp_morphism.FGP_Homset_class_with_category'>
- class sage.modules.fg_pid.fgp_morphism.FGP_Homset_class(X, Y, category=None)[source]#
Bases:
Homset
Homsets of
FGP_Module
- Element[source]#
alias of
FGP_Morphism
- class sage.modules.fg_pid.fgp_morphism.FGP_Morphism(parent, phi, check=True)[source]#
Bases:
Morphism
A morphism between finitely generated modules over a PID.
EXAMPLES:
An endomorphism:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]) sage: Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: phi = Q.hom([Q.0+3*Q.1, -Q.1]); phi Morphism from module over Integer Ring with invariants (4, 12) to module with invariants (4, 12) that sends the generators to [(1, 3), (0, 11)] sage: phi(Q.0) == Q.0 + 3*Q.1 True sage: phi(Q.1) == -Q.1 True
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]) >>> Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> phi = Q.hom([Q.gen(0)+Integer(3)*Q.gen(1), -Q.gen(1)]); phi Morphism from module over Integer Ring with invariants (4, 12) to module with invariants (4, 12) that sends the generators to [(1, 3), (0, 11)] >>> phi(Q.gen(0)) == Q.gen(0) + Integer(3)*Q.gen(1) True >>> phi(Q.gen(1)) == -Q.gen(1) True
A morphism between different modules V1/W1 —> V2/W2 in different ambient spaces:
sage: V1 = ZZ^2; W1 = V1.span([[1,2],[3,4]]); A1 = V1/W1 sage: V2 = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W2 = V2.span([2*V2.0+4*V2.1, 9*V2.0+12*V2.1, 4*V2.2]); A2=V2/W2 sage: A1 Finitely generated module V/W over Integer Ring with invariants (2) sage: A2 Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: phi = A1.hom([2*A2.0]) sage: phi(A1.0) (2, 0) sage: 2*A2.0 (2, 0) sage: phi(2*A1.0) (0, 0)
>>> from sage.all import * >>> V1 = ZZ**Integer(2); W1 = V1.span([[Integer(1),Integer(2)],[Integer(3),Integer(4)]]); A1 = V1/W1 >>> V2 = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W2 = V2.span([Integer(2)*V2.gen(0)+Integer(4)*V2.gen(1), Integer(9)*V2.gen(0)+Integer(12)*V2.gen(1), Integer(4)*V2.gen(2)]); A2=V2/W2 >>> A1 Finitely generated module V/W over Integer Ring with invariants (2) >>> A2 Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> phi = A1.hom([Integer(2)*A2.gen(0)]) >>> phi(A1.gen(0)) (2, 0) >>> Integer(2)*A2.gen(0) (2, 0) >>> phi(Integer(2)*A1.gen(0)) (0, 0)
- im_gens()[source]#
Return tuple of the images of the generators of the domain under this morphism.
EXAMPLES:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]); Q = V/W sage: phi = Q.hom([Q.0,Q.0 + 2*Q.1]) sage: phi.im_gens() ((1, 0), (1, 2)) sage: phi.im_gens() is phi.im_gens() True
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]); Q = V/W >>> phi = Q.hom([Q.gen(0),Q.gen(0) + Integer(2)*Q.gen(1)]) >>> phi.im_gens() ((1, 0), (1, 2)) >>> phi.im_gens() is phi.im_gens() True
- image()[source]#
Compute the image of this homomorphism.
EXAMPLES:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]) sage: Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: Q.hom([Q.0+3*Q.1, -Q.1]).image() Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: Q.hom([3*Q.1, Q.1]).image() Finitely generated module V/W over Integer Ring with invariants (12)
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]) >>> Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> Q.hom([Q.gen(0)+Integer(3)*Q.gen(1), -Q.gen(1)]).image() Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> Q.hom([Integer(3)*Q.gen(1), Q.gen(1)]).image() Finitely generated module V/W over Integer Ring with invariants (12)
- inverse_image(A)[source]#
Given a submodule A of the codomain of this morphism, return the inverse image of A under this morphism.
EXAMPLES:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]); Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: phi = Q.hom([0, Q.1]) sage: phi.inverse_image(Q.submodule([])) Finitely generated module V/W over Integer Ring with invariants (4) sage: phi.kernel() Finitely generated module V/W over Integer Ring with invariants (4) sage: phi.inverse_image(phi.codomain()) Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: phi.inverse_image(Q.submodule([Q.0])) Finitely generated module V/W over Integer Ring with invariants (4) sage: phi.inverse_image(Q.submodule([Q.1])) Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: phi.inverse_image(ZZ^3) Traceback (most recent call last): ... TypeError: A must be a finitely generated quotient module sage: phi.inverse_image(ZZ^3 / W.scale(2)) Traceback (most recent call last): ... ValueError: A must be a submodule of the codomain
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]); Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> phi = Q.hom([Integer(0), Q.gen(1)]) >>> phi.inverse_image(Q.submodule([])) Finitely generated module V/W over Integer Ring with invariants (4) >>> phi.kernel() Finitely generated module V/W over Integer Ring with invariants (4) >>> phi.inverse_image(phi.codomain()) Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> phi.inverse_image(Q.submodule([Q.gen(0)])) Finitely generated module V/W over Integer Ring with invariants (4) >>> phi.inverse_image(Q.submodule([Q.gen(1)])) Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> phi.inverse_image(ZZ**Integer(3)) Traceback (most recent call last): ... TypeError: A must be a finitely generated quotient module >>> phi.inverse_image(ZZ**Integer(3) / W.scale(Integer(2))) Traceback (most recent call last): ... ValueError: A must be a submodule of the codomain
- kernel()[source]#
Compute the kernel of this homomorphism.
EXAMPLES:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]) sage: Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) sage: Q.hom([0, Q.1]).kernel() Finitely generated module V/W over Integer Ring with invariants (4) sage: A = Q.hom([Q.0, 0]).kernel(); A Finitely generated module V/W over Integer Ring with invariants (12) sage: Q.1 in A True sage: phi = Q.hom([Q.0-3*Q.1, Q.0+Q.1]) sage: A = phi.kernel(); A Finitely generated module V/W over Integer Ring with invariants (4) sage: phi(A) Finitely generated module V/W over Integer Ring with invariants ()
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]) >>> Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (4, 12) >>> Q.hom([Integer(0), Q.gen(1)]).kernel() Finitely generated module V/W over Integer Ring with invariants (4) >>> A = Q.hom([Q.gen(0), Integer(0)]).kernel(); A Finitely generated module V/W over Integer Ring with invariants (12) >>> Q.gen(1) in A True >>> phi = Q.hom([Q.gen(0)-Integer(3)*Q.gen(1), Q.gen(0)+Q.gen(1)]) >>> A = phi.kernel(); A Finitely generated module V/W over Integer Ring with invariants (4) >>> phi(A) Finitely generated module V/W over Integer Ring with invariants ()
- lift(x)[source]#
Given an element x in the codomain of self, if possible find an element y in the domain such that self(y) == x. Raise a ValueError if no such y exists.
INPUT:
x
– element of the codomain of self.
EXAMPLES:
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2]) sage: Q=V/W; phi = Q.hom([2*Q.0, Q.1]) sage: phi.lift(Q.1) (0, 1) sage: phi.lift(Q.0) Traceback (most recent call last): ... ValueError: no lift of element to domain sage: phi.lift(2*Q.0) (1, 0) sage: phi.lift(2*Q.0+Q.1) (1, 1) sage: V = span([[5, -1/2]],ZZ); W = span([[20,-2]],ZZ); Q = V/W; phi=Q.hom([2*Q.0]) sage: x = phi.image().0; phi(phi.lift(x)) == x True
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(1),Integer(1)],[Integer(3)/Integer(2),Integer(2),Integer(1)],[Integer(0),Integer(0),Integer(1)]],ZZ); W = V.span([Integer(2)*V.gen(0)+Integer(4)*V.gen(1), Integer(9)*V.gen(0)+Integer(12)*V.gen(1), Integer(4)*V.gen(2)]) >>> Q=V/W; phi = Q.hom([Integer(2)*Q.gen(0), Q.gen(1)]) >>> phi.lift(Q.gen(1)) (0, 1) >>> phi.lift(Q.gen(0)) Traceback (most recent call last): ... ValueError: no lift of element to domain >>> phi.lift(Integer(2)*Q.gen(0)) (1, 0) >>> phi.lift(Integer(2)*Q.gen(0)+Q.gen(1)) (1, 1) >>> V = span([[Integer(5), -Integer(1)/Integer(2)]],ZZ); W = span([[Integer(20),-Integer(2)]],ZZ); Q = V/W; phi=Q.hom([Integer(2)*Q.gen(0)]) >>> x = phi.image().gen(0); phi(phi.lift(x)) == x True