Operations on Modules
Subquotients Related to Homomorphisms
Kernel
kernel
— Methodkernel(a::ModuleFPHom)
Return the kernel of a
as an object of type SubQuo
.
Additionally, if K
denotes this object, return the inclusion map K
$\rightarrow$ domain(a)
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> F = free_module(R, 3)
Free module of rank 3 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> G = free_module(R, 2)
Free module of rank 2 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> W = matrix(R, [y 0; x y; 0 z])
[y 0]
[x y]
[0 z]
julia> a = hom(F, G, W);
julia> kernel(a)
(Submodule with 1 generator
1 -> x*z*e[1] - y*z*e[2] + y^2*e[3]
represented as subquotient with no relations., Map with following data
Domain:
=======
Submodule with 1 generator
1 -> x*z*e[1] - y*z*e[2] + y^2*e[3]
represented as subquotient with no relations.
Codomain:
=========
Free module of rank 3 over Multivariate Polynomial Ring in x, y, z over Rational Field)
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> F1 = free_module(R, 1)
Free module of rank 1 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> A = R[x; y]
[x]
[y]
julia> B = R[x^2; y^3; z^4]
[x^2]
[y^3]
[z^4]
julia> M = SubQuo(F1, A, B)
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1]
julia> N = M;
julia> V = [y^2*N[1], x*N[2]]
2-element Vector{SubQuoElem{fmpq_mpoly}}:
x*y^2*e[1]
x*y*e[1]
julia> b = hom(M, N, V);
julia> K, iota = kernel(b)
(Subquotient of Submodule with 3 generators
1 -> (-x + y^2)*e[1]
2 -> x*y*e[1]
3 -> -x*y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1], Map with following data
Domain:
=======
Subquotient of Submodule with 3 generators
1 -> (-x + y^2)*e[1]
2 -> x*y*e[1]
3 -> -x*y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1]
Codomain:
=========
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1])
Image
image
— Methodimage(a::ModuleFPHom)
Return the image of a
as an object of type SubQuo
.
Additionally, if I
denotes this object, return the inclusion map I
$\rightarrow$ codomain(a)
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> F = free_module(R, 3)
Free module of rank 3 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> G = free_module(R, 2)
Free module of rank 2 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> W = matrix(R, [y 0; x y; 0 z])
[y 0]
[x y]
[0 z]
julia> a = hom(F, G, W);
julia> I, iota = image(a)
(Submodule with 3 generators
1 -> y*e[1]
2 -> x*e[1] + y*e[2]
3 -> z*e[2]
represented as subquotient with no relations., Map with following data
Domain:
=======
Submodule with 3 generators
1 -> y*e[1]
2 -> x*e[1] + y*e[2]
3 -> z*e[2]
represented as subquotient with no relations.
Codomain:
=========
Free module of rank 2 over Multivariate Polynomial Ring in x, y, z over Rational Field)
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> F1 = free_module(R, 1)
Free module of rank 1 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> A = R[x; y]
[x]
[y]
julia> B = R[x^2; y^3; z^4]
[x^2]
[y^3]
[z^4]
julia> M = SubQuo(F1, A, B)
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1]
julia> N = M;
julia> V = [y^2*N[1], x*N[2]]
2-element Vector{SubQuoElem{fmpq_mpoly}}:
x*y^2*e[1]
x*y*e[1]
julia> b = hom(M, N, V);
julia> image(b)
(Subquotient of Submodule with 2 generators
1 -> x*y^2*e[1]
2 -> x*y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1], Map with following data
Domain:
=======
Subquotient of Submodule with 2 generators
1 -> x*y^2*e[1]
2 -> x*y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1]
Codomain:
=========
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1])
Cokernel
cokernel
— Methodcokernel(a::ModuleFPHom)
Return the cokernel of a
as an object of type SubQuo
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> F = free_module(R, 3)
Free module of rank 3 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> G = free_module(R, 2)
Free module of rank 2 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> W = matrix(R, [y 0; x y; 0 z])
[y 0]
[x y]
[0 z]
julia> a = hom(F, G, W);
julia> cokernel(a)
Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 3 generators
1 -> y*e[1]
2 -> x*e[1] + y*e[2]
3 -> z*e[2]
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> F1 = free_module(R, 1)
Free module of rank 1 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> A = R[x; y]
[x]
[y]
julia> B = R[x^2; y^3; z^4]
[x^2]
[y^3]
[z^4]
julia> M = SubQuo(F1, A, B)
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 3 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1]
julia> N = M;
julia> V = [y^2*N[1], x*N[2]]
2-element Vector{SubQuoElem{fmpq_mpoly}}:
x*y^2*e[1]
x*y*e[1]
julia> b = hom(M, N, V);
julia> cokernel(b)
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 5 generators
1 -> x^2*e[1]
2 -> y^3*e[1]
3 -> z^4*e[1]
4 -> x*y^2*e[1]
5 -> x*y*e[1]
Direct Sums and Products
direct_sum
— Methoddirect_sum(M::ModuleFP{T}...; task::Symbol = :sum) where T
Given modules $M_1\dots M_n$, say, return the direct sum $\bigoplus_{i=1}^n M_i$.
Additionally, return
- a vector containing the canonical injections $M_i\rightarrow\bigoplus_{i=1}^n M_i$ if
task = :sum
(default), - a vector containing the canonical projections $\bigoplus_{i=1}^n M_i\rightarrow M_i$ if
task = :prod
, - two vectors containing the canonical injections and projections, respectively, if
task = :both
, - none of the above maps if
task = :none
.
direct_product
— Methoddirect_product(M::ModuleFP{T}...; task::Symbol = :prod) where T
Given modules $M_1\dots M_n$, say, return the direct product $\prod_{i=1}^n M_i$.
Additionally, return
- a vector containing the canonical projections $\prod_{i=1}^n M_i\rightarrow M_i$ if
task = :prod
(default), - a vector containing the canonical injections $M_i\rightarrow\prod_{i=1}^n M_i$ if
task = :sum
, - two vectors containing the canonical projections and injections, respectively, if
task = :both
, - none of the above maps if
task = :none
.
Presentations
presentation
— Methodpresentation(M::ModuleFP)
Return a free presentation of $M$.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> A = R[x; y];
julia> B = R[x^2; y^3; z^4];
julia> M = SubQuo(A, B);
julia> P = presentation(M);
julia> rank(P[1])
5
julia> rank(P[0])
2
Syzygies and Free Resolutions
free_resolution
— Methodfree_resolution(M::SubQuo; ordering::ModuleOrdering = default_ordering(M),
length::Int=0, algorithm::Symbol=:fres)
Return a free resolution of M
.
If length != 0
, the free resolution is only computed up to the length
-th free module. algorithm
can be set to :sres
or :fres
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> A = R[x; y]
[x]
[y]
julia> B = R[x^2; x*y; y^2; z^4]
[x^2]
[x*y]
[y^2]
[z^4]
julia> M = SubQuo(A, B)
Subquotient of Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
by Submodule with 4 generators
1 -> x^2*e[1]
2 -> x*y*e[1]
3 -> y^2*e[1]
4 -> z^4*e[1]
julia> fr = free_resolution(M, length=1)
rank | 6 2
-------|------
degree | 1 0
julia> is_complete(fr)
false
julia> fr[4]
Free module of rank 0 over Multivariate Polynomial Ring in x, y, z over Rational Field
julia> fr
rank | 0 2 6 6 2
-------|---------------
degree | 4 3 2 1 0
julia> is_complete(fr)
true
julia> fr = free_resolution(M, algorithm=:sres)
rank | 0 2 6 6 2
-------|---------------
degree | 4 3 2 1 0
Homology
homology
— Methodhomology(C::ChainComplex{<:ModuleFP})
Return the homology of C
.
Examples
julia> R, (x,) = PolynomialRing(QQ, ["x"]);
julia> F = free_module(R, 1);
julia> A, _ = quo(F, [x^4*F[1]]);
julia> B, _ = quo(F, [x^3*F[1]]);
julia> a = hom(A, B, [x^2*B[1]]);
julia> b = hom(B, B, [x^2*B[1]]);
julia> C = ChainComplex(ModuleFP, [a, b]);
julia> H = homology(C)
3-element Vector{SubQuo{fmpq_mpoly}}:
Subquotient of Submodule with 1 generator
1 -> x*e[1]
by Submodule with 1 generator
1 -> x^4*e[1]
Subquotient of Submodule with 1 generator
1 -> x*e[1]
by Submodule with 2 generators
1 -> x^3*e[1]
2 -> x^2*e[1]
Subquotient of Submodule with 1 generator
1 -> e[1]
by Submodule with 2 generators
1 -> x^3*e[1]
2 -> x^2*e[1]
homology
— Methodhomology(C::ChainComplex{<:ModuleFP}, i::Int)
Return the i
-th homology module of C
.
Examples
julia> R, (x,) = PolynomialRing(QQ, ["x"]);
julia> F = free_module(R, 1);
julia> A, _ = quo(F, [x^4*F[1]]);
julia> B, _ = quo(F, [x^3*F[1]]);
julia> a = hom(A, B, [x^2*B[1]]);
julia> b = hom(B, B, [x^2*B[1]]);
julia> C = ChainComplex(ModuleFP, [a, b]);
julia> H = homology(C, 1)
Subquotient of Submodule with 1 generator
1 -> x*e[1]
by Submodule with 2 generators
1 -> x^3*e[1]
2 -> x^2*e[1]
Hom and Ext
hom
— Functionhom(M::ModuleFP, N::ModuleFP)
Return the module Hom(M,N)
as an object of type SubQuo
.
Additionally, if H
is that object, return the map which sends an element of H
to the corresponding homomorphism M
$\to$ N
.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"]);
julia> F = FreeMod(R, 2);
julia> V = [x*F[1], y^2*F[2]];
julia> M = quo(F, V)[1]
Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2]
julia> H = hom(M, M)[1]
hom of (Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2], Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2])
julia> gens(H)
2-element Vector{SubQuoElem{fmpq_mpoly}}:
(e[1] -> e[1])
(e[2] -> e[2])
julia> relations(H)
4-element Vector{FreeModElem{fmpq_mpoly}}:
x*(e[1] -> e[1])
y^2*(e[1] -> e[2])
x*(e[2] -> e[1])
y^2*(e[2] -> e[2])
element_to_homomorphism
— Methodelement_to_homomorphism(f::ModuleFPElem)
If f
is an element of a module created via hom(M,N)
, for some modules M
and N
, return the homomorphism M
$\to$ N
corresponding to f
.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"]);
julia> F = FreeMod(R, 2);
julia> V = [x*F[1], y^2*F[2]];
julia> M = quo(F, V)[1]
Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2]
julia> H = hom(M, M)[1];
julia> gens(H)
2-element Vector{SubQuoElem{fmpq_mpoly}}:
(e[1] -> e[1])
(e[2] -> e[2])
julia> relations(H)
4-element Vector{FreeModElem{fmpq_mpoly}}:
x*(e[1] -> e[1])
y^2*(e[1] -> e[2])
x*(e[2] -> e[1])
y^2*(e[2] -> e[2])
julia> a = element_to_homomorphism(H[1]+y*H[2])
Map with following data
Domain:
=======
Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2]
Codomain:
=========
Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2]
julia> matrix(a)
[1 0]
[0 y]
homomorphism_to_element
— Methodhomomorphism_to_element(H::ModuleFP, a::ModuleFPHom)
If the module H
is created via hom(M,N)
, for some modules M
and N
, and a
: M
$\to$ N
is a homomorphism, then return the element of H
corresponding to a
.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"]);
julia> F = FreeMod(R, 2);
julia> V = [x*F[1], y^2*F[2]];
julia> M = quo(F, V)[1]
Subquotient of Submodule with 2 generators
1 -> e[1]
2 -> e[2]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y^2*e[2]
julia> H = hom(M, M)[1];
julia> gens(H)
2-element Vector{SubQuoElem{fmpq_mpoly}}:
(e[1] -> e[1])
(e[2] -> e[2])
julia> relations(H)
4-element Vector{FreeModElem{fmpq_mpoly}}:
x*(e[1] -> e[1])
y^2*(e[1] -> e[2])
x*(e[2] -> e[1])
y^2*(e[2] -> e[2])
julia> W = [M[1], y*M[2]];
julia> a = hom(M, M, W);
julia> iswelldefined(a)
true
julia> matrix(a)
[1 0]
[0 y]
julia> m = homomorphism_to_element(H, a)
(e[1] -> e[1]) + y*(e[2] -> e[2])
ext
— Methodext(M::ModuleFP, N::ModuleFP, i::Int)
Return $\text{Ext}^i(M,N)$.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"]);
julia> F = FreeMod(R, 1);
julia> V = [x*F[1], y*F[1]];
julia> M = quo(F, V)[1]
Subquotient of Submodule with 1 generator
1 -> e[1]
by Submodule with 2 generators
1 -> x*e[1]
2 -> y*e[1]
julia> ext(M, M, 0)
Subquotient of Submodule with 1 generator
1 -> (e[1] -> e[1])
by Submodule with 2 generators
1 -> x*(e[1] -> e[1])
2 -> y*(e[1] -> e[1])
julia> ext(M, M, 1)
Subquotient of Submodule with 2 generators
1 -> (e[2] -> e[1])
2 -> (e[1] -> e[1])
by Submodule with 4 generators
1 -> x*(e[1] -> e[1])
2 -> y*(e[1] -> e[1])
3 -> x*(e[2] -> e[1])
4 -> y*(e[2] -> e[1])
julia> ext(M, M, 2)
Subquotient of Submodule with 1 generator
1 -> (e[1] -> e[1])
by Submodule with 3 generators
1 -> x*(e[1] -> e[1])
2 -> y*(e[1] -> e[1])
3 -> -y*(e[1] -> e[1])
julia> ext(M, M, 3)
Submodule with 0 generators
represented as subquotient with no relations.
Tensorproduct and Tor
tensor_product
— Methodtensor_product(M::ModuleFP...; task::Symbol = :none)
Given a collection of modules, say, $M_1, \dots, M_n$ over a ring $R$, return $M_1\otimes_R \cdots \otimes_R M_n$.
If task = :map
, additionally return the map which sends a tuple $(m_1,\dots, m_n)$ of elements $m_i\in M_i$ to the pure tensor $m_1\otimes\dots\otimes m_n$.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> F = free_module(R, 1);
julia> A = R[x; y];
julia> B = R[x^2; y^3; z^4];
julia> M = SubQuo(F, A, B);
julia> gens(M)
2-element Vector{SubQuoElem{fmpq_mpoly}}:
x*e[1]
y*e[1]
julia> T, t = tensor_product(M, M; task = :map);
julia> gens(T)
4-element Vector{SubQuoElem{fmpq_mpoly}}:
x^2*e[1] \otimes e[1]
x*y*e[1] \otimes e[1]
x*y*e[1] \otimes e[1]
y^2*e[1] \otimes e[1]
julia> domain(t)
parent of tuples of type Tuple{SubQuoElem{fmpq_mpoly}, SubQuoElem{fmpq_mpoly}}
julia> t((M[1], M[2]))
x*y*e[1] \otimes e[1]
tor
— Methodtor(M::ModuleFP, N::ModuleFP, i::Int)
Return $\text{Tor}_i(M,N)$.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]);
julia> A = R[x; y];
julia> B = R[x^2; y^3; z^4];
julia> M = SubQuo(A, B);
julia> F = free_module(R, 1);
julia> Q, _ = quo(F, [x*F[1]]);
julia> T0 = tor(Q, M, 0)
Subquotient of Submodule with 2 generators
1 -> x*e[1] \otimes e[1]
2 -> y*e[1] \otimes e[1]
by Submodule with 4 generators
1 -> x^2*e[1] \otimes e[1]
2 -> y^3*e[1] \otimes e[1]
3 -> z^4*e[1] \otimes e[1]
4 -> x*y*e[1] \otimes e[1]
julia> T1 = tor(Q, M, 1)
Subquotient of Submodule with 1 generator
1 -> -x*e[1] \otimes e[1]
by Submodule with 3 generators
1 -> x^2*e[1] \otimes e[1]
2 -> y^3*e[1] \otimes e[1]
3 -> z^4*e[1] \otimes e[1]
julia> T2 = tor(Q, M, 2)
Submodule with 0 generators
represented as subquotient with no relations.