With regard to notation, we use affine algebra as a synonym for quotient of a multivariate polynomial ring by an ideal. More specifically, if R is a multivariate polynomial ring with coefficient ring C, and A=R/I is the quotient of R by an ideal I of R, we refer to A as an affine algebra over C, or an affine C-algebra. In this section, we discuss functionality for handling such algebras in OSCAR.
Note
We emphasize: In this section, we view R/I together with its ring structure. Realizing R/I as an R-module means to implement it as the quotient of a free R-module of rank 1. See the section on modules.
Note
Most functions discussed here rely on Gröbner basis techniques. In particular, they typically make use of a Gröbner basis for the modulus of the quotient. Nevertheless, the construction of quotients is lazy in the sense that the computation of such a Gröbner basis is delayed until the user performs an operation that indeed requires it. The Gröbner basis is then computed with respect to the monomial ordering entered by the user when creating the quotient; if no ordering is entered, OSCAR will use the default_ordering on the underlying polynomial ring. See the section on Gröbner/Standard Bases for default orderings in OSCAR. Once computed, the Gröbner basis is cached for later reuse.
Note
Recall that Gröbner basis methods are implemented for multivariate polynomial rings over fields (exact fields supported by OSCAR) and, where not indicated otherwise, for multivariate polynomial rings over the integers.
Note
In OSCAR, elements of a quotient A=R/I are not necessarily represented by polynomials which are reduced with regard to I. That is, if f∈R is the internal polynomial representative of an element of A, then f may not be the normal form mod I with respect to the default ordering on R (see the section on Gröbner/Standard Bases for normal forms). Operations involving Gröbner basis computations may lead to (partial) reductions. The function simplify discussed in this section computes fully reduced representatives.
Note
Each grading on a multivariate polynomial ring R in OSCAR descends to a grading on the affine algebra A = R/I (recall that OSCAR ideals of graded polynomial rings are required to be homogeneous). Functionality for dealing with such gradings and our notation for describing this functionality descend accordingly. This applies, in particular, to the functions is_graded, is_standard_graded, is_z_graded, is_zm_graded, and is_positively_graded which will not be discussed again here.
The OSCAR type for quotients of multivariate polynomial rings is of parametrized form MPolyQuoRing{T}, with elements of type MPolyQuoRingElem{T}. Here, T is the element type of the polynomial ring.
As above, where I is the ideal of R generated by the polynomials in V.
Note
Once R/I is created, all computations within R/I relying on division with remainder and/or Gröbner bases are done with respect to ordering.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, p = quo(R, ideal(R, [x^2-y^3, x-y]));
julia> A
Quotient
of multivariate polynomial ring in 2 variables x, y
over rational field
by ideal (x^2 - y^3, x - y)
julia> typeof(A)
MPolyQuoRing{QQMPolyRingElem}
julia> typeof(x)
QQMPolyRingElem
julia> p
Map defined by a julia-function with inverse
from multivariate polynomial ring in 2 variables over QQ
to quotient of multivariate polynomial ring by ideal (x^2 - y^3, x - y)
julia> p(x)
x
julia> typeof(p(x))
MPolyQuoRingElem{QQMPolyRingElem}
julia> S, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z]);
julia> B, _ = quo(S, ideal(S, [x^2*z-y^3, x-y]))
(Quotient of multivariate polynomial ring by ideal (x^2*z - y^3, x - y), Map: S -> B)
julia> typeof(B)
MPolyQuoRing{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3]));
julia> base_ring(A)
Multivariate polynomial ring in 3 variables x, y, z
over rational field
julia> modulus(A)
Ideal generated by
-x^2 + y
-x^3 + z
julia> gens(A)
3-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
x
y
z
julia> number_of_generators(A)
3
julia> gen(A, 2)
y
julia> ordering(A)
degrevlex([x, y, z])
Given an affine algebra A over a field which is graded by a free group of type FinGenAbGroup, and given an element g of that group, return a vector of monomials of R such that the residue classes of these monomials form a K-basis of the graded part of A of degree g.
Given a Zm-graded affine algebra A over a field and a vector W of m integers, convert W into an element g of the grading group of A and proceed as above.
monomial_basis(A::MPolyQuoRing, d::IntegerUnion)
Given a Z-graded affine algebra A over a field and an integer d, convert d into an element g of the grading group of A and proceed as above.
Note
If the component of the given degree is not finite dimensional, an error message will be thrown.
Examples
julia> R, (x, y) = graded_polynomial_ring(QQ, [:x, :y]);
julia> I = ideal(R, [x^2])
Ideal generated by
x^2
julia> A, _ = quo(R, I)
(Quotient of multivariate polynomial ring by ideal (x^2), Map: R -> A)
julia> L = monomial_basis(A, 3)
2-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}:
y^3
x*y^2
Given a graded quotient A of a multivariate polynomial ring over a field, where the grading group is free of type FinGenAbGroup, and given an element g of that group, return the homogeneous component of A of degree g. Additionally, return the embedding of the component into A.
Given a Zm-graded quotient A of a multivariate polynomial ring over a field, and given a vector g of m integers, convert g into an element of the grading group of A, and return the homogeneous component of A whose degree is that element. Additionally, return the embedding of the component into A.
Given a Z-graded quotient A of a multivariate polynomial ring over a field, and given an integer g, convert g into an element of the grading group of A, and return the homogeneous component of A whose degree is that element. Additionally, return the embedding of the component into A.
Note
If the component is not finite dimensional, an error message will be thrown.
Examples
julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z])
(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z])
julia> L = homogeneous_component(R, 2);
julia> HC = gens(L[1]);
julia> EMB = L[2]
Map defined by a julia-function with inverse
from R_[2] of dim 10
to graded multivariate polynomial ring in 4 variables over QQ
julia>for i in1:length(HC) println(EMB(HC[i])) endz^2
y*z
y^2
x*z
x*y
x^2
w*z
w*y
w*x
w^2
julia> PTC = ideal(R, [-x*z + y^2, -w*z + x*y, -w*y + x^2]);
julia> A, _ = quo(R, PTC);
julia> L = homogeneous_component(A, 2);
julia> HC = gens(L[1]);
julia> EMB = L[2]
Map defined by a julia-function with inverse
from quotient space over QQ with 7 generators and no relations
to quotient of multivariate polynomial ring by ideal (-x*z + y^2, -w*z + x*y, -w*y + x^2)
julia>for i in1:length(HC) println(EMB(HC[i])) endz^2
y*z
x*z
w*z
w*y
w*x
w^2
julia> G = abelian_group([0, 0])
Z^2
julia> W = [G[1], G[1], G[2], G[2], G[2]];
julia> S, x, y = graded_polynomial_ring(QQ, :x => 1:2, :y => 1:3; weights = W);
julia> L = homogeneous_component(S, [2,1]);
julia> HC = gens(L[1]);
julia> EMB = L[2]
Map defined by a julia-function with inverse
from S_[2 1] of dim 9
to graded multivariate polynomial ring in 5 variables over QQ
julia>for i in1:length(HC) println(EMB(HC[i])) endx[2]^2*y[3]
x[2]^2*y[2]
x[2]^2*y[1]
x[1]*x[2]*y[3]
x[1]*x[2]*y[2]
x[1]*x[2]*y[1]
x[1]^2*y[3]
x[1]^2*y[2]
x[1]^2*y[1]
julia> I = ideal(S, [x[1]*y[1]-x[2]*y[2]]);
julia> A, = quo(S, I);
julia> L = homogeneous_component(A, [2,1]);
julia> HC = gens(L[1]);
julia> EMB = L[2]
Map defined by a julia-function with inverse
from quotient space over QQ with 7 generators and no relations
to quotient of multivariate polynomial ring by ideal (x[1]*y[1] - x[2]*y[2])
julia>for i in1:length(HC) println(EMB(HC[i])) endx[2]^2*y[3]
x[2]^2*y[2]
x[2]^2*y[1]
x[1]*x[2]*y[3]
x[1]*x[2]*y[2]
x[1]^2*y[3]
x[1]^2*y[2]
If, say, A = R/I, where R is a multivariate polynomial ring over a field K, and I is an ideal of R, return true if A is finite-dimensional as a K-vector space, false otherwise.
Note
A is finite-dimensional as a K-vector space iff it has Krull dimension zero. This condition is checked by the function.
If, say, A = R/I, where R is a multivariate polynomial ring over a field K, and I is an ideal of R, return the dimension of A as a K-vector space.
Note
If A is not finite-dimensional as a K-vector space, an error is thrown.
Examples
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [x^3+y^3+z^3-1, x^2+y^2+z^2-1, x+y+z-1]));
julia> vector_space_dimension(A)
6
julia> I = modulus(A)
Ideal generated by
x^3 + y^3 + z^3 - 1
x^2 + y^2 + z^2 - 1
x + y + z - 1
julia> groebner_basis(I, ordering = lex(base_ring(I)))
Gröbner basis with elements
1: z^3 - z^2
2: y^2 + y*z - y + z^2 - z
3: x + y + z - 1
with respect to the ordering
lex([x, y, z])
If, say, A = R/I, where R is a multivariate polynomial ring over a field K, and I is an ideal of R, return a vector of monomials of R such that the residue classes of these monomials form a basis of A as a K-vector space.
Note
If A is not finite-dimensional as a K-vector space, an error is thrown.
Examples
julia> R, (x, y) = graded_polynomial_ring(QQ, [:x, :y]);
julia> I = ideal(R, [x^2, y^3])
Ideal generated by
x^2
y^3
julia> A, _ = quo(R, I)
(Quotient of multivariate polynomial ring by ideal (x^2, y^3), Map: R -> A)
julia> L = monomial_basis(A)
6-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}:
x*y^2
y^2
x*y
y
x
1
The OSCAR type for elements of quotients of multivariate polynomial rings is of parametrized form MPolyQuoRing{T}, where T is the element type of the polynomial ring.
If f is an element of the affine algebra A = R/I, say, replace the internal polynomial representative of f by its normal form mod I with respect to ordering(A).
Examples
julia> R, (x,) = polynomial_ring(QQ, [:x]);
julia> A, p = quo(R, ideal(R, [x^4]));
julia> f = p(2*x^6 + x^3 + x)
2*x^6 + x^3 + x
julia> simplify(f)
x^3 + x
julia> f
x^3 + x
Given an element f of a graded affine algebra, and given an element g of the grading group of that algebra, return the homogeneous component of f of degree g.
Given an element f of a Zm-graded affine algebra A, say, and given a vector g of m integers, convert g into an element of the grading group of A, and return the homogeneous component of f whose degree is that element.
Given an element f of a Z-graded affine algebra A, say, and given an integer g, convert g into an element of the grading group of A, and return the homogeneous component of f whose degree is that element.
Examples
julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z]);
julia> A, p = quo(R, ideal(R, [y-x, z^3-x^3]));
julia> f = p(y^2-x^2+x*y*z+z^4)
-x^2 + x*y*z + y^2 + z^4
julia> homogeneous_component(f, 4)
z^4
ideal(A::MPolyQuoRing{T}, V::Vector{T}) where T <: MPolyRingElem
Given a (graded) quotient ring A=R/I and a vector V of (homogeneous) polynomials in R, create the ideal of A which is generated by the images of the entries of V.
ideal(A::MPolyQuoRing{T}, V::Vector{MPolyQuoRingElem{T}}) where T <: MPolyRingElem
Given a (graded) quotient ring A and a vector V of (homogeneous) elements of A, create the ideal of A which is generated by the entries of V.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, ideal(R, [x^2-y^3, x-y]));
julia> I = ideal(A, [x^2-y])
Ideal generated by
x^2 - y
If a is an ideal of the affine algebra A = R/I, say, replace the internal polynomial representative of each generator of a by its normal form mod I with respect to ordering(A).
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, ideal(R, [x^3*y^2-y^3*x^2, x*y^4-x*y^2]));
julia> a = ideal(A, [x^3*y^4-x+y, x*y+y^2*x])
Ideal generated by
x^3*y^4 - x + y
x*y^2 + x*y
julia> gens(a)
2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
x^3*y^4 - x + y
x*y^2 + x*y
julia> simplify(a)
Ideal generated by
x^2*y^3 - x + y
x*y^2 + x*y
julia> gens(a)
2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
x^2*y^3 - x + y
x*y^2 + x*y
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3]));
julia> a = ideal(A, [x-y, z^4])
Ideal generated by
x - y
z^4
julia> base_ring(a)
Quotient
of multivariate polynomial ring in 3 variables x, y, z
over rational field
by ideal (-x^2 + y, -x^3 + z)
julia> gens(a)
2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
x - y
z^4
julia> number_of_generators(a)
2
julia> gen(a, 2)
z^4
Given a homogeneous ideal I of a graded affine algebra over a field, return an array containing a minimal set of generators of I. If I is the zero ideal, an empty list is returned.
Examples
julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z]);
julia> A, p = quo(R, ideal(R, [x-y]));
julia> V = [x, z^2, x^3+y^3, y^4, y*z^5];
julia> a = ideal(A, V);
julia> minimal_generating_set(a)
2-element Vector{MPolyQuoRingElem{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}}:
y
z^2
julia> a = ideal(A, [x-y])
Ideal generated by
x - y
julia> minimal_generating_set(a)
MPolyQuoRingElem{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}[]
:+(a::MPolyQuoIdeal{T}, b::MPolyQuoIdeal{T}) where T
Return the sum of a and b.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, [x^2-y, y^2-x+y]);
julia> a = ideal(A, [x+y])
Ideal generated by
x + y
julia> b = ideal(A, [x^2+y^2, x+y])
Ideal generated by
x^2 + y^2
x + y
julia> a+b
Ideal generated by
x + y
x^2 + y^2
quotient(a::MPolyQuoIdeal{T}, b::MPolyQuoIdeal{T}) where T
Return the ideal quotient of a by b. Alternatively, use a:b.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, ideal(R, [x^2-y^3, x-y]));
julia> a = ideal(A, [y^2])
Ideal generated by
y^2
julia> b = ideal(A, [x])
Ideal generated by
x
julia> a:b
Ideal generated by
y
==(a::MPolyQuoIdeal{T}, b::MPolyQuoIdeal{T}) where T
Return true if a is equal to b, false otherwise.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, ideal(R, [x^3*y^2-y^3*x^2, x*y^4-x*y^2]));
julia> a = ideal(A, [x^3*y^4-x+y, x*y+y^2*x])
Ideal generated by
x^3*y^4 - x + y
x*y^2 + x*y
julia> b = ideal(A, [x^3*y^3-x+y, x^2*y+y^2*x])
Ideal generated by
x^3*y^3 - x + y
x^2*y + x*y^2
julia> a == b
false
ideal_membership(f::MPolyQuoRingElem{T}, a::MPolyQuoIdeal{T}) where T
Return true if f is contained in a, false otherwise. Alternatively, use f in a.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, ideal(R, [x^3*y^2-y^3*x^2, x*y^4-x*y^2]));
julia> a = ideal(A, [x^3*y^4-x+y, x*y+y^2*x])
Ideal generated by
x^3*y^4 - x + y
x*y^2 + x*y
julia> f = A(x^2*y^3-x+y)
x^2*y^3 - x + y
julia> f in a
true
If A=R/I is an affine C-algebra, and S is any ring, then defining a ring homomorphism ϕ:A→S means to define a ring homomorphism ϕ:R→S such that I⊂ker(ϕ). Thus, ϕ is determined by specifying its restriction to C, and by assigning an image to each generator of A. In OSCAR, such homomorphisms are created as follows:
Given a homomorphism coeff_map from C to S, where C is the coefficient ring of the base ring of A, and given a vector images of ngens(A) elements of S, return the homomorphism A→S whose restriction to C is coeff_map, and which sends the i-th generator of A to the i-th entry of images.
If no coefficient map is entered, invoke a canonical homomorphism of C to S, if such a homomorphism exists, and throw an error, otherwise.
Note
The function returns a well-defined homomorphism A→S iff the given data defines a homomorphism base_ring(A)→S whose kernel contains the modulus of A. This condition is checked by the function in case check = true (default).
Note
In case check = true (default), the function also checks the conditions below:
If S is graded, the assigned images must be homogeneous with respect to the given grading.
If S is noncommutative, the assigned images must pairwise commute.
Examples
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3]));
julia> S, (s, t) = polynomial_ring(QQ, [:s, :t]);
julia> F = hom(A, S, [s, s^2, s^3])
Ring homomorphism
from quotient of multivariate polynomial ring by ideal (-x^2 + y, -x^3 + z)
to multivariate polynomial ring in 2 variables over QQ
defined by
x -> s
y -> s^2
z -> s^3
Given a ring homomorphism F : A→S as above, domain(F) and codomain(F) refer to A and S, respectively. Given ring homomorphisms F : A→B and G : B→T as above, compose(F, G) refers to their composition.
The OSCAR homomorphism type AffAlgHom models ring homomorphisms R→S such that the types of R and S are subtypes of Union{MPolyRing{T}, MPolyQuoRing{U1}} and Union{MPolyRing{T}, MPolyQuoRing{U2}}, respectively. Here, T <: FieldElem and U1 <: MPolyRingElem{T}, U2 <: MPolyRingElem{T}. Functionality for these homomorphism is discussed in what follows.
julia> D1, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);
julia> C1, (s,t) = graded_polynomial_ring(QQ, [:s, :t]);
julia> V1 = [s^3, s^2*t, s*t^2, t^3];
julia> para = hom(D1, C1, V1)
Ring homomorphism
from graded multivariate polynomial ring in 4 variables over QQ
to graded multivariate polynomial ring in 2 variables over QQ
defined by
w -> s^3
x -> s^2*t
y -> s*t^2
z -> t^3
julia> twistedCubic = kernel(para)
Ideal generated by
-x*z + y^2
-w*z + x*y
-w*y + x^2
julia> C2, p2 = quo(D1, twistedCubic);
julia> D2, (a, b, c) = graded_polynomial_ring(QQ, [:a, :b, :c]);
julia> V2 = [p2(w-y), p2(x), p2(z)];
julia> proj = hom(D2, C2, V2)
Ring homomorphism
from graded multivariate polynomial ring in 3 variables over QQ
to quotient of multivariate polynomial ring by ideal (-x*z + y^2, -w*z + x*y, -w*y + x^2)
defined by
a -> w - y
b -> x
c -> z
julia> nodalCubic = kernel(proj)
Ideal generated by
-a^2*c + b^3 - 2*b^2*c + b*c^2
julia> D3,y = polynomial_ring(QQ, :y => 1:3);
julia> C3, x = polynomial_ring(QQ, :x => 1:3);
julia> V3 = [x[1]*x[2], x[1]*x[3], x[2]*x[3]];
julia> F3 = hom(D3, C3, V3)
Ring homomorphism
from multivariate polynomial ring in 3 variables over QQ
to multivariate polynomial ring in 3 variables over QQ
defined by
y[1] -> x[1]*x[2]
y[2] -> x[1]*x[3]
y[3] -> x[2]*x[3]
julia> sphere = ideal(C3, [x[1]^3 + x[2]^3 + x[3]^3 - 1])
Ideal generated by
x[1]^3 + x[2]^3 + x[3]^3 - 1
julia> steinerRomanSurface = preimage(F3, sphere)
Ideal generated by
y[1]^6*y[2]^6 + 2*y[1]^6*y[2]^3*y[3]^3 + y[1]^6*y[3]^6 + 2*y[1]^3*y[2]^6*y[3]^3 + 2*y[1]^3*y[2]^3*y[3]^6 - y[1]^3*y[2]^3*y[3]^3 + y[2]^6*y[3]^6
julia> D, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> S, (a, b, c) = polynomial_ring(QQ, [:a, :b, :c]);
julia> C, p = quo(S, ideal(S, [c-b^3]));
julia> V = [p(2*a + b^6), p(7*b - a^2), p(c^2)];
julia> F = hom(D, C, V)
Ring homomorphism
from multivariate polynomial ring in 3 variables over QQ
to quotient of multivariate polynomial ring by ideal (-b^3 + c)
defined by
x -> 2*a + c^2
y -> -a^2 + 7*b
z -> c^2
julia> is_surjective(F)
true
julia> D1, _ = quo(D, kernel(F));
julia> F1 = hom(D1, C, V);
julia> is_bijective(F1)
true
julia> R, (x, y, z) = polynomial_ring(QQ, [ :x, :y, :z]);
julia> C, (s, t) = polynomial_ring(QQ, [:s, :t]);
julia> V = [s*t, t, s^2];
julia> paraWhitneyUmbrella = hom(R, C, V)
Ring homomorphism
from multivariate polynomial ring in 3 variables over QQ
to multivariate polynomial ring in 2 variables over QQ
defined by
x -> s*t
y -> t
z -> s^2
julia> D, _ = quo(R, kernel(paraWhitneyUmbrella));
julia> is_finite(hom(D, C, V))
true
julia> D1, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> D, _ = quo(D1, [y-x^2, z-x^3]);
julia> C, (t,) = polynomial_ring(QQ, [:t]);
julia> F = hom(D, C, [t, t^2, t^3]);
julia> is_bijective(F)
true
julia> G = inverse(F)
Ring homomorphism
from multivariate polynomial ring in 1 variable over QQ
to quotient of multivariate polynomial ring by ideal (-x^2 + y, -x^3 + z)
defined by
t -> x
julia> G(t)
x
Given a finite homomorphism F:A→B of algebras of type <: Union{MPolyRing, MPolyQuoRing} over a field, return a presentation
Ar→As→B→0
of B as an A-module.
More precisely, return a tuple (gs, PM, sect), say, where
gs is a vector of polynomials representing generators for B as an A-module,
PM is an r×s-matrix of polynomials defining the map Ar→As, and
sect is a function which gives rise to a section of the augmentation map As→B.
Note
The finiteness condition on F is checked by the function.
Note
The function is implemented so that the last element of gs is one(B).
Examples
julia> RA, (h,) = polynomial_ring(QQ, [:h]);
julia> A, _ = quo(RA, ideal(RA, [h^9]));
julia> RB, (k, l) = polynomial_ring(QQ, [:k, :l]);
julia> B, _ = quo(RB, ideal(RB, [k^3, l^3]));
julia> F = hom(A, B, [k+l])
Ring homomorphism
from quotient of multivariate polynomial ring by ideal (h^9)
to quotient of multivariate polynomial ring by ideal (k^3, l^3)
defined by
h -> k + l
julia> gs, PM, sect = present_finite_extension_ring(F);
julia> gs
3-element Vector{QQMPolyRingElem}:
l^2
l
1
julia> PM
3×3 Matrix{QQMPolyRingElem}:
h^3 0 0
-3*h^2 h^3 0
3*h -3*h^2 h^3
julia> sect(k*l)
3-element Vector{QQMPolyRingElem}:
-1
h
0
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> I = ideal(R, [z^2-y^2*(y+1)]);
julia> A, _ = quo(R, I);
julia> B, (s,t) = polynomial_ring(QQ, [:s, :t]);
julia> F = hom(A,B, [s, t^2-1, t*(t^2-1)])
Ring homomorphism
from quotient of multivariate polynomial ring by ideal (-y^3 - y^2 + z^2)
to multivariate polynomial ring in 2 variables over QQ
defined by
x -> s
y -> t^2 - 1
z -> t^3 - t
julia> gs, PM, sect = present_finite_extension_ring(F);
julia> gs
2-element Vector{QQMPolyRingElem}:
t
1
julia> PM
2×2 Matrix{QQMPolyRingElem}:
y -z
-z y^2 + y
julia> sect(t)
2-element Vector{QQMPolyRingElem}:
1
0
julia> sect(one(B))
2-element Vector{QQMPolyRingElem}:
0
1
julia> sect(s)
2-element Vector{QQMPolyRingElem}:
0
x
julia> A, (a, b, c) = polynomial_ring(QQ, [:a, :b, :c]);
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> I = ideal(R, [x*y]);
julia> B, _ = quo(R, I);
julia> (x, y, z) = gens(B);
julia> F = hom(A, B, [x^2+z, y^2-1, z^3])
Ring homomorphism
from multivariate polynomial ring in 3 variables over QQ
to quotient of multivariate polynomial ring by ideal (x*y)
defined by
a -> x^2 + z
b -> y^2 - 1
c -> z^3
julia> gs, PM, sect = present_finite_extension_ring(F);
julia> gs
2-element Vector{QQMPolyRingElem}:
y
1
julia> PM
2×2 Matrix{QQMPolyRingElem}:
a^3 - c 0
0 a^3*b + a^3 - b*c - c
julia> sect(y)
2-element Vector{QQMPolyRingElem}:
1
0
julia> sect(one(B))
2-element Vector{QQMPolyRingElem}:
0
1
is_algebraically_independent(V::Vector{T}) where T <: Union{MPolyRingElem, MPolyQuoRingElem}
Given a vector V of elements of a multivariate polynomial ring over a field K, say, or of a quotient of such a ring, return true if the elements of V are algebraically independent over K, and false otherwise.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> V = [x, y, x^2+y^3]
3-element Vector{QQMPolyRingElem}:
x
y
x^2 + y^3
julia> is_algebraically_independent(V)
false
julia> A, p = quo(R, [x*y]);
julia> is_algebraically_independent([p(x), p(y)])
false
is_algebraically_independent_with_relations(V::Vector{T}) where T <: Union{MPolyRingElem, MPolyQuoRingElem}
Given a vector V of elements of a multivariate polynomial ring over a field K, say, or of a quotient of such a ring, return (true, Ideal (0)) if the elements of V are algebraically independent over K. Otherwise, return false together with the ideal of K-algebra relations.
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> V = [x, y, x^2+y^3]
3-element Vector{QQMPolyRingElem}:
x
y
x^2 + y^3
julia> is_algebraically_independent_with_relations(V)
(false, Ideal (t1^2 + t2^3 - t3))
julia> A, p = quo(R, [x*y]);
julia> is_algebraically_independent_with_relations([p(x), p(y)])
(false, Ideal (t1*t2))
subalgebra_membership(f::T, V::Vector{T}) where T <: Union{MPolyRingElem, MPolyQuoRingElem}
Given an element f of a multivariate polynomial ring over a field, or of a quotient of such a ring, and given a vector V of further elements of that ring, consider the subalgebra generated by the entries of V in the given ring. If f is contained in the subalgebra, return (true, h), where h is giving the polynomial relation. Return, (false, 0), otherwise.
Examples
julia> R, x = polynomial_ring(QQ, :x => 1:3);
julia> f = x[1]^6*x[2]^6-x[1]^6*x[3]^6;
julia> V = [x[1]^3*x[2]^3-x[1]^3*x[3]^3, x[1]^3*x[2]^3+x[1]^3*x[3]^3]
2-element Vector{QQMPolyRingElem}:
x[1]^3*x[2]^3 - x[1]^3*x[3]^3
x[1]^3*x[2]^3 + x[1]^3*x[3]^3
julia> subalgebra_membership(f, V)
(true, t1*t2)
minimal_subalgebra_generators(V::Vector{T}; check::Bool = true) where T <: Union{MPolyRingElem, MPolyQuoRingElem}
Given a vector V of homogeneous elements of a positively graded multivariate polynomial ring, or of a quotient of such a ring, return a subset of the elements in V of minimal cardinality which, in the given ring, generate the same subalgebra as all elements in V.
If check is true (default), the conditions on V and the given ring are checked.
Examples
julia> R, (x, y) = graded_polynomial_ring(QQ, [:x, :y]);
julia> V = [x, y, x^2+y^2]
3-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}:
x
y
x^2 + y^2
julia> minimal_subalgebra_generators(V)
2-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}:
x
y
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [x*y, x*z]));
julia> L = noether_normalization(A);
julia> L[1]
2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}:
-2*x + y
-5*y + z
julia> L[2]
Ring homomorphism
from quotient of multivariate polynomial ring by ideal (x*y, x*z)
to quotient of multivariate polynomial ring by ideal (2*x^2 + x*y, 10*x^2 + 5*x*y + x*z)
defined by
x -> x
y -> 2*x + y
z -> 10*x + 5*y + z
julia> L[3]
Ring homomorphism
from quotient of multivariate polynomial ring by ideal (2*x^2 + x*y, 10*x^2 + 5*x*y + x*z)
to quotient of multivariate polynomial ring by ideal (x*y, x*z)
defined by
x -> x
y -> -2*x + y
z -> -5*y + z
Find the normalization of a reduced affine algebra over a perfect field K. That is, given the quotient A=R/I of a multivariate polynomial ring R over K modulo a radical ideal I, compute the integral closure A of A in its total ring of fractions Q(A), together with the embedding f:A→A.
Implemented Algorithms and how to Read the Output
The function relies on the algorithm of Greuel, Laplagne, and Seelisch which proceeds by finding a suitable decomposition I=I1∩⋯∩Ir into radical ideals Ik, together with maps A=R/I→Ak=R/Ik which give rise to the normalization map of A:
A↪A1×⋯×Ar=A
For each k, the function specifies two representations of Ak: It returns an array of triples (Ak,fk,ak), where Ak is represented as an affine K-algebra, and fk as a map of affine K-algebras. The third entry ak is a tuple (dk,Jk), consisting of an element dk∈A and an ideal Jk⊂A, such that dk1Jk=Ak as A-submodules of the total ring of fractions of A.
By default (algorithm = :equidimDec), as a first step on its way to find the decomposition I=I1∩⋯∩Ir, the algorithm computes an equidimensional decomposition of the radical ideal I. Alternatively, if specified by algorithm = :primeDec, the algorithm computes I=I1∩⋯∩Ir as the prime decomposition of the radical ideal I. If specified by algorithm = :isPrime, assume that I is prime.
The function does not check whether A is reduced. Use is_reduced(A) in case you are unsure (this may take some time).
Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, _ = quo(R, ideal(R, [(x^2-y^3)*(x^2+y^2)*x]));
julia> L = normalization(A);
julia> size(L)
(2,)
julia> LL = normalization(A, algorithm = :primeDec);
julia> size(LL)
(3,)
julia> LL[1][1]
Quotient
of multivariate polynomial ring in 3 variables T(1), x, y
over rational field
by ideal (-T(1)*y + x, -T(1)*x + y^2, T(1)^2 - y, -x^2 + y^3)
julia> LL[1][2]
Ring homomorphism
from quotient of multivariate polynomial ring by ideal (x^5 - x^3*y^3 + x^3*y^2 - x*y^5)
to quotient of multivariate polynomial ring by ideal (-T(1)*y + x, -T(1)*x + y^2, T(1)^2 - y, -x^2 + y^3)
defined by
x -> x
y -> y
julia> LL[1][3]
(y, Ideal (x, y))
of A as does normalize(A), but return additionally the delta invariant of A, that is, the dimension
dimK(A/A).
How to Read the Output
The return value is a tuple whose first element is normalize(A), whose second element is an array containing the delta invariants of the Ak, and whose third element is the (total) delta invariant of A. The return value -1 in the third element indicates that the delta invariant is infinite.
Given a polynomial f in two variables with coefficients in a perfect field K, and given an integer i∈{1,2} specifying one of the variables, f must be irreducible and monic in the specified variable: Say, f∈K[x,y] is monic in y. Then the normalization of A=K[x,y]/⟨f⟩, that is, the integral closure A of A in its quotient field, is a free module over K[x] of finite rank, and any set of free generators for A over K[x] is called an integral basis for A over K[x]. The function returns a pair (d,V), where d is an element of A, and V is a vector of elements in A, such that the fractions v/d,v∈V, form an integral basis for A over K[x].
By default (algorithm = :normal_local), the function relies on the local-to-global approach to normalization presented in [BDLPSS13]. Alternatively, if specified by algorithm = :normal_global, the global normalization algorithm in [GLS10] is used. If K=Q, it is recommended to apply the algorithm in [BDLP19], which makes use of Puiseux expansions and Hensel lifting (algorithm = :hensel).
Given an affine algebra A over a perfect field, return true if A is normal, and false otherwise.
Note
This function performs the first step of the normalization algorithm of Greuel, Laplagne, and Seelisch [GLS10] and may, thus, be more efficient than computing the full normalization of A.
Warning
If check is true, the function checks whether A is indeed reduced. This may take some time.
Examples
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [z^2-x*y]));
julia> is_normal(A)
true
Given a Z-graded affine algebra A = R/I over a field, say, K, where the grading is inherited from the standard Z-grading on the polynomial ring R, return true if A is a Cohen-Macaulay ring, false otherwise.
Examples
julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);
julia> I = ideal(R, [x*z-y^2, w*z-x*y, w*y-x^2]);
julia> A, _ = quo(R, I);
julia> is_cohen_macaulay(A)
true
julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z]);
julia> I = ideal(R, [x*z, y*z]);
julia> A, _ = quo(R, I);
julia> is_cohen_macaulay(A)
false
Given a multivariate polynomial ring R over a field K together with a (multi)grading on R by a finitely generated abelian group G, let I be an ideal of R which is homogeneous with respect to this grading. Then the affine K−algebra A=R/I inherits the grading: A=⨁g∈GAg. Suppose now that R is positively graded by G. That is, G is free and each graded piece Rg has finite dimension. Then also Ag is a finite dimensional K-vector space for each g, and we have the well-defined Hilbert function of A,
H(A,d):G→N,g↦dimK(Ag).
The Hilbert series of A is the generating function
HA(t)=g∈G∑H(A,g)tg
(see Section 8.2 in [MS05] for a formal discussion extending the classical case of Z-gradings with positive weights to the more general case of multigradings). As in the classical case, the infinitely many values of the Hilbert function can be expressed in finite terms by representing the Hilbert series as a rational function (see Theorem 8.20 in [MS05] for a precise statement).
By a result of Macaulay, if A=R/I is an affine algebra, and L>(I) is the leading ideal of I with respect to a global monomial ordering >, then the Hilbert function of A equals that of R/L>(I) (see Theorem 15.26 in [Eis95]). Thus, using Gröbner bases, the computation of Hilbert series can be reduced to the case where the modulus of the affine algebra is a monomial ideal. In the latter case, we face a problem of combinatorial nature, and there are various strategies of how to proceed (see [KR05]). The functions hilbert_series, hilbert_series_reduced, hilbert_series_expanded, hilbert_function, hilbert_polynomial, and degree address the case of Z-gradings with positive weights, relying on corresponding Singular functionality. The functions multi_hilbert_series, multi_hilbert_series_reduced, and multi_hilbert_function offer a variety of different strategies and allow one to handle positive gradings in general.
Let R=K[x1,…xn] be a polynomial ring in n variables over a field K. Assign positive integer weights wi to the variables xi, and grade R=⨁d∈ZRd=⨁d≥0Rd according to the corresponding weighted degree. Let I be an ideal of R which is homogeneous with respect to this grading. Then the affine K-algebra A=R/I inherits the grading: A=⨁d≥0Ad, where each graded piece Ad is a finite dimensional K-vector space. In this situation, the Hilbert function of A is of type
H(A,d):N→N,d↦dimK(d),
and the Hilbert series of A is the formal power series
HA(t)=d≥0∑H(A,d)td∈Z[[t]].
The Hilbert series can be written as a rational function p(t)/q(t), with denominator
q(t)=(1−tw1)⋯(1−twn).
In the standard Z-graded case, where the weights on the variables are all 1, the Hilbert function is of polynomial nature: There exists a unique polynomial PA(t)∈Q[t], the Hilbert polynomial, which satisfies H(M,d)=PM(d) for all d≫0. Furthermore, the degree of A is defined as the dimension of A over K if this dimension is finite, and as the integer d such that the leading term of the Hilbert polynomial has the form dte/e!, otherwise.
Given a Z-graded affine algebra A=R/I over a field K, where the grading is inherited from a Z-grading on the polynomial ring R defined by assigning positive integer weights to the variables, return a pair (p,q), say, of univariate polynomials p,q∈Z[t] such that p/q represents the Hilbert series of A as a rational function with denominator
q=(1−tw1)⋯(1−twn),
where n is the number of variables of R, and w1,…,wn are the assigned weights.
See also hilbert_series_reduced.
Note
The advanced user can select different backends for the computation (:Singular and :Abbott for the moment), as well as different algorithms. The latter might be ignored for certain backends.
Given a Z-graded affine algebra A=R/I over a field K, where the grading is inherited from a Z-grading on the polynomial ring R defined by assigning positive integer weights to the variables, return a pair (p,q), say, of univariate polynomials p,q∈Z[t] such that p/q represents the Hilbert series of A as a rational function written in lowest terms.
Given a Z-graded affine algebra A=R/I over a field K, where the grading is inherited from a Z-grading on the polynomial ring R defined by assigning positive integer weights to the variables, return the Hilbert series of A to precision d.
Given a Z-graded affine algebra A=R/I over a field K, where the grading is inherited from a Z-grading on the polynomial ring R defined by assigning positive integer weights to the variables, return the value H(A,d), where
Given a Z-graded affine algebra A=R/I over a field K, where the grading is inherited from the standard Z-grading on the polynomial ring R, return the Hilbert polynomial of A.
Given a Z-graded affine algebra A=R/I over a field K, where the grading is inherited from the standard Z-grading on the polynomial ring R, return the degree of A.
Given a positively graded affine algebra A over a field K with grading group G, say, and given an element g of G, return the value H(A,g) of the Hilbert function
Given a positively Zm-graded affine algebra A over a field K, and given a vector g of m integers, convert g into an element of the grading group of A, and return the value H(A,g) as above.
Given a positively Z-graded affine algebra A over a field K, and given an integer g, convert g into an element of the grading group of A, and return the value H(A,g) as above.
Examples
julia> W = [111; 00 -1];
julia> R, x = graded_polynomial_ring(QQ, :x => 1:3, W)
(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]])
julia> I = ideal(R, [x[1]^3*x[2], x[2]*x[3]^2, x[2]^2*x[3], x[3]^4]);
julia> A, _ = quo(R, I);
julia> multi_hilbert_function(A::MPolyQuoRing, [1, 0])
2