Submodules and subquotients of free modules#

Free modules and submodules of a free module (of finite rank) over a principal ideal domain have well-defined notion of rank, and they are implemented in sage.modules.free_module. Here submodules with no rank are implemented. For example, submodules of free modules over multivariate polynomial rings with more than one variables have no notion of rank.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
sage: N
Submodule of Ambient free module of rank 2 over the integral domain Multivariate Polynomial Ring in x, y, z over Rational Field
Generated by the rows of the matrix:
[x - y     z]
[  y*z   x*z]
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
>>> N
Submodule of Ambient free module of rank 2 over the integral domain Multivariate Polynomial Ring in x, y, z over Rational Field
Generated by the rows of the matrix:
[x - y     z]
[  y*z   x*z]

AUTHORS:

  • Kwankyu Lee (2022-05): initial version

class sage.modules.submodule.Submodule_free_ambient(ambient, gens, check=True, already_echelonized=False)[source]#

Bases: Module_free_ambient

Base class of submodules of ambient modules.

The ambient module is either a free module or a quotient of a free module by a submodule.

Note that if the ambient module is a quotient module, submodules of the quotient module are called subquotients.

INPUT:

  • ambient – an ambient module

  • gens – vectors of the ambient free module generating this submodule

  • check – boolean; if True, vectors in gens are checked whether they belong to the ambient free module

  • already_echelonized – ignored; for compatibility with other submodules

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
sage: N
Submodule of Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
Generated by the rows of the matrix:
[x - y     z]
[  y*z   x*z]
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
>>> N
Submodule of Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
Generated by the rows of the matrix:
[x - y     z]
[  y*z   x*z]
sage: M.coerce_map_from(N)
Coercion map:
  From: Submodule of Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
Generated by the rows of the matrix:
[x - y     z]
[  y*z   x*z]
  To:   Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
>>> from sage.all import *
>>> M.coerce_map_from(N)
Coercion map:
  From: Submodule of Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
Generated by the rows of the matrix:
[x - y     z]
[  y*z   x*z]
  To:   Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
ambient_module()[source]#

Return the ambient module of self.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
sage: N.ambient_module() is M
True
sage: N.zero_submodule().ambient_module() is M
True
sage: Q = M / N
sage: Q.zero_submodule().ambient_module() is Q
True
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
>>> N.ambient_module() is M
True
>>> N.zero_submodule().ambient_module() is M
True
>>> Q = M / N
>>> Q.zero_submodule().ambient_module() is Q
True
gen(i=0)[source]#

Return the \(i\)-th generator of this module.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y*z, x*z])])
sage: N.gen(0)
(x - y, z)
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y*z, x*z])])
>>> N.gen(Integer(0))
(x - y, z)
generators_matrix()[source]#

Return the matrix defining self.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y*z, x*z])])
sage: N.matrix()
[x - y     z]
[  y*z   x*z]
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y*z, x*z])])
>>> N.matrix()
[x - y     z]
[  y*z   x*z]
gens()[source]#

Return the generators of this submodule.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
sage: N.gens()
[
(x - y, z),
(y*z, x*z)
]
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
>>> N.gens()
[
(x - y, z),
(y*z, x*z)
]
matrix()[source]#

Return the matrix defining self.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y*z, x*z])])
sage: N.matrix()
[x - y     z]
[  y*z   x*z]
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y*z, x*z])])
>>> N.matrix()
[x - y     z]
[  y*z   x*z]
relations()[source]#

Return the relations module of the ambient module.

If the ambient module is free, then the relations module is trivial.

EXAMPLES:

sage: S.<x,y,z> = PolynomialRing(QQ)
sage: M = S**2
sage: N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
sage: N.relations() == M.zero_submodule()
True

sage: Q = M.quotient(N)
sage: Q.zero_submodule().relations() == N
True
>>> from sage.all import *
>>> S = PolynomialRing(QQ, names=('x', 'y', 'z',)); (x, y, z,) = S._first_ngens(3)
>>> M = S**Integer(2)
>>> N = M.submodule([vector([x - y, z]), vector([y * z, x * z])])
>>> N.relations() == M.zero_submodule()
True

>>> Q = M.quotient(N)
>>> Q.zero_submodule().relations() == N
True