Elements of finitely generated modules over a PID#
- AUTHOR:
William Stein, 2009
- class sage.modules.fg_pid.fgp_element.FGP_Element(parent, x, check=True)[source]#
Bases:
ModuleElement
An element of a finitely generated module over a PID.
INPUT:
parent
– parent module Mx
– element of M.V()
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 sage: x = Q(V.0-V.1); x #indirect doctest (0, 9) sage: isinstance(x, sage.modules.fg_pid.fgp_element.FGP_Element) True sage: type(x) <class 'sage.modules.fg_pid.fgp_module.FGP_Module_class_with_category.element_class'> sage: x is Q(x) True sage: x.parent() is Q 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 >>> x = Q(V.gen(0)-V.gen(1)); x #indirect doctest (0, 9) >>> isinstance(x, sage.modules.fg_pid.fgp_element.FGP_Element) True >>> type(x) <class 'sage.modules.fg_pid.fgp_module.FGP_Module_class_with_category.element_class'> >>> x is Q(x) True >>> x.parent() is Q True
- additive_order()[source]#
Return the additive order of this element.
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.0.additive_order() 4 sage: Q.1.additive_order() 12 sage: (Q.0+Q.1).additive_order() 12 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]) sage: Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (12, 0) sage: Q.0.additive_order() 12 sage: type(Q.0.additive_order()) <class 'sage.rings.integer.Integer'> sage: Q.1.additive_order() +Infinity
>>> 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.gen(0).additive_order() 4 >>> Q.gen(1).additive_order() 12 >>> (Q.gen(0)+Q.gen(1)).additive_order() 12 >>> 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)]) >>> Q = V/W; Q Finitely generated module V/W over Integer Ring with invariants (12, 0) >>> Q.gen(0).additive_order() 12 >>> type(Q.gen(0).additive_order()) <class 'sage.rings.integer.Integer'> >>> Q.gen(1).additive_order() +Infinity
- lift()[source]#
Lift self to an element of V, where the parent of self is the quotient module V/W.
EXAMPLES:
sage: V = span([[1/2,0,0],[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.0 (1, 0) sage: Q.1 (0, 1) sage: Q.0.lift() (0, 6, 1) sage: Q.1.lift() (0, -2, 0) sage: x = Q(V.0); x (0, 8) sage: x.lift() (1/2, 0, 0) sage: x == 8*Q.1 True sage: x.lift().parent() == V True
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(0),Integer(0)],[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.gen(0) (1, 0) >>> Q.gen(1) (0, 1) >>> Q.gen(0).lift() (0, 6, 1) >>> Q.gen(1).lift() (0, -2, 0) >>> x = Q(V.gen(0)); x (0, 8) >>> x.lift() (1/2, 0, 0) >>> x == Integer(8)*Q.gen(1) True >>> x.lift().parent() == V True
A silly version of the integers modulo 100:
sage: A = (ZZ^1)/span([[100]], ZZ); A Finitely generated module V/W over Integer Ring with invariants (100) sage: x = A([5]); x (5) sage: v = x.lift(); v (5) sage: v.parent() Ambient free module of rank 1 over the principal ideal domain Integer Ring
>>> from sage.all import * >>> A = (ZZ**Integer(1))/span([[Integer(100)]], ZZ); A Finitely generated module V/W over Integer Ring with invariants (100) >>> x = A([Integer(5)]); x (5) >>> v = x.lift(); v (5) >>> v.parent() Ambient free module of rank 1 over the principal ideal domain Integer Ring
- vector()[source]#
EXAMPLES:
sage: V = span([[1/2,0,0],[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: x = Q.0 + 3*Q.1; x (1, 3) sage: x.vector() (1, 3) sage: tuple(x) (1, 3) sage: list(x) [1, 3] sage: x.vector().parent() Ambient free module of rank 2 over the principal ideal domain Integer Ring
>>> from sage.all import * >>> V = span([[Integer(1)/Integer(2),Integer(0),Integer(0)],[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) >>> x = Q.gen(0) + Integer(3)*Q.gen(1); x (1, 3) >>> x.vector() (1, 3) >>> tuple(x) (1, 3) >>> list(x) [1, 3] >>> x.vector().parent() Ambient free module of rank 2 over the principal ideal domain Integer Ring