Affine Algebras and Their Ideals

With regard to notation, we use affine algebra as a synonym for quotient of a multivariate polynomial ring by an ideal. More specifically, if RR is a multivariate polynomial ring with coefficient ring CC, and A=R/IA=R/I is the quotient of RR by an ideal II of RR, we refer to AA as an affine algebra over CC, or an affine CC-algebra. In this section, we discuss functionality for handling such algebras in OSCAR.

Note

We emphasize: In this section, we view R/IR/I together with its ring structure. Realizing R/IR/I as an RR-module means to implement it as the quotient of a free RR-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/IA = R/I are not necessarily represented by polynomials which are reduced with regard to II. That is, if fRf\in R is the internal polynomial representative of an element of AA, then ff may not be the normal form mod II with respect to the default ordering on RR (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.

Types

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.

Constructors

quoMethod
quo(R::MPolyRing, I::MPolyIdeal; ordering::MonomialOrdering = default_ordering(R)) -> MPolyQuoRing, Map

Create the quotient ring R/I and return the new ring as well as the projection map R \to R/I.

quo(R::MPolyRing, V::Vector{MPolyRingElem}; ordering::MonomialOrdering = default_ordering(R)) -> MPolyQuoRing, Map

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}}
source

Data Associated to Affine Algebras

Basic Data

If A=R/I is the quotient of a multivariate polynomial ring R modulo an ideal I of R, then

  • base_ring(A) refers to R,
  • modulus(A) to I,
  • gens(A) to the generators of A,
  • number_of_generators(A) / ngens(A) to the number of these generators,
  • gen(A, i) as well as A[i] to the i-th such generator, and
  • ordering(A) to the monomial ordering used in the construction of A.
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> 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])

In the graded case, we additionally have:

grading_groupMethod
grading_group(A::MPolyQuoRing{<:MPolyDecRingElem})

If A is, say, G-graded, return G.

Examples

julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [x^2*z-y^3, x-y]));

julia> grading_group(A)
Z
source
monomial_basisMethod
monomial_basis(A::MPolyQuoRing, g::FinGenAbGroupElem)

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.

monomial_basis(A::MPolyQuoRing, W::Vector{<:IntegerUnion})

Given a Zm\mathbb Z^m-graded affine algebra A over a field and a vector W of mm 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\mathbb 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
source
homogeneous_componentMethod
homogeneous_component(A::MPolyQuoRing{<:MPolyDecRingElem}, g::FinGenAbGroupElem)

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.

homogeneous_component(A::MPolyQuoRing{<:MPolyDecRingElem}, g::Vector{<:IntegerUnion})

Given a Zm\mathbb Z^m-graded quotient A of a multivariate polynomial ring over a field, and given a vector g of mm 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.

homogeneous_component(A::MPolyQuoRing{<:MPolyDecRingElem}, g::IntegerUnion)

Given a Z\mathbb 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 in 1:length(HC) println(EMB(HC[i])) end
z^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 in 1:length(HC) println(EMB(HC[i])) end
z^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 in 1:length(HC) println(EMB(HC[i])) end
x[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 in 1:length(HC) println(EMB(HC[i])) end
x[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]
source

Dimension

dimMethod
dim(A::MPolyQuoRing)

Return the Krull dimension of A.

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> dim(A)
1
source
is_finite_dimensional_vector_spaceMethod
is_finite_dimensional_vector_space(A::MPolyQuoRing)

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.

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> is_finite_dimensional_vector_space(A)
true

julia> A, _ = quo(R, ideal(R, [x]));

julia> is_finite_dimensional_vector_space(A)
false
source
vector_space_dimensionMethod
vector_space_dimension(A::MPolyQuoRing)

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])
source
monomial_basisMethod
monomial_basis(A::MPolyQuoRing)

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
source

Elements of Affine Algebras

Types

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.

Creating Elements of Affine Algebras

Elements of an affine algebra A=R/I are created as images of elements of R under the projection map or by directly coercing elements of R into A.

Examples
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);

julia> A, p = quo(R, ideal(R, [x^3*y^2-y^3*x^2, x*y^4-x*y^2]));

julia> f = p(x^3*y^2-y^3*x^2+x*y)
x^3*y^2 - x^2*y^3 + x*y

julia> typeof(f)
MPolyQuoRingElem{QQMPolyRingElem}

julia> g = A(x^3*y^2-y^3*x^2+x*y)
x^3*y^2 - x^2*y^3 + x*y

julia> f == g
true

Reducing Polynomial Representatives

simplifyMethod
simplify(f::MPolyQuoRingElem)

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
source

Tests on Elements of Affine Algebras

==Method
==(f::MPolyQuoRingElem{T}, g::MPolyQuoRingElem{T}) where T

Return true if f is equal to g, false otherwise.

Examples

julia> R, (x,) = polynomial_ring(QQ, [:x]);

julia> A, p = quo(R, ideal(R, [x^4]));

julia> f = p(x-x^6)
-x^6 + x

julia> g = p(x)
x

julia> f == g
true
source
is_invertible_with_inverseMethod
is_invertible_with_inverse(f::MPolyQuoRingElem)

If f is invertible with inverse g, say, return (true, g). Otherwise, return (false, f).

Examples

julia> R, c = polynomial_ring(QQ, :c => (1:3));

julia> R, c = grade(R, [1, 2, 3]);

julia> I = ideal(R, [  -c[1]^3 + 2*c[1]*c[2] - c[3], c[1]^4 - 3*c[1]^2*c[2] + 2*c[1]*c[3] + c[2]^2,-c[1]^5 + 4*c[1]^3*c[2] - 3*c[1]^2*c[3] - 3*c[1]*c[2]^2 + 2*c[2]*c[3]]);

julia> A, _ = quo(R, I);

julia> f = A(c[1]^2 - c[1] - c[2] + 1)
c[1]^2 - c[1] - c[2] + 1

julia> tt, g = is_invertible_with_inverse(f)
(true, c[1] + c[2] + c[3] + 1)

julia> f*g
1
source

In the graded case, we additionally have:

is_homogeneousMethod
is_homogeneous(f::MPolyQuoRingElem{<:MPolyDecRingElem})

Given an element f of a graded affine algebra, return true if f is homogeneous, false otherwise.

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+z^4)
-x^2 + y^2 + z^4

julia> is_homogeneous(f)
true

julia> f
z^4
source

Data associated to Elements of Affine Algebras

Given an element f of an affine algebra A,

  • parent(f) refers to A.

In the graded case, we also have:

homogeneous_componentsMethod
homogeneous_components(f::MPolyQuoRingElem{<:MPolyDecRingElem})

Given an element f of a graded affine algebra, return the homogeneous components of f.

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_components(f)
Dict{FinGenAbGroupElem, MPolyQuoRingElem{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}} with 2 entries:
  [4] => z^4
  [3] => y^2*z
source
homogeneous_componentMethod
homogeneous_component(f::MPolyQuoRingElem{<:MPolyDecRingElem}, g::FinGenAbGroupElem)

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.

homogeneous_component(f::MPolyQuoRingElem{<:MPolyDecRingElem}, g::Vector{<:IntegerUnion})

Given an element f of a Zm\mathbb Z^m-graded affine algebra A, say, and given a vector g of mm integers, convert g into an element of the grading group of A, and return the homogeneous component of f whose degree is that element.

homogeneous_component(f::MPolyQuoRingElem{<:MPolyDecRingElem}, g::IntegerUnion)

Given an element f of a Z\mathbb 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
source
degreeMethod
degree(f::MPolyQuoRingElem{<:MPolyDecRingElem})

Given a homogeneous element f of a graded affine algebra, return the degree of f.

degree(::Type{Vector{Int}}, f::MPolyQuoRingElem{<:MPolyDecRingElem})

Given a homogeneous element f of a Zm\mathbb Z^m-graded affine algebra, return the degree of f, converted to a vector of integer numbers.

degree(::Type{Int}, f::MPolyQuoRingElem{<:MPolyDecRingElem})

Given a homogeneous element f of a Z\mathbb Z-graded affine algebra, return the degree of f, converted to an integer number.

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]))
(Quotient of multivariate polynomial ring by ideal (-x + y, -x^3 + z^3), Map: R -> A)

julia> f = p(y^2-x^2+z^4)
-x^2 + y^2 + z^4

julia> degree(f)
[4]

julia> typeof(degree(f))
FinGenAbGroupElem

julia> degree(Int, f)
4

julia> typeof(degree(Int, f))
Int64
source

Ideals in Affine Algebras

Constructors

idealMethod
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
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]));

julia> J = ideal(B, [x^2-y^2])
Ideal generated by
  x^2 - y^2
source

Reducing Polynomial Representatives of Generators

simplifyMethod
simplify(a::MPolyQuoIdeal)

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
source

Data Associated to Ideals in Affine Algebras

Basic Data

If a is an ideal of the affine algebra A, then

  • base_ring(a) refers to A,
  • gens(a) to the generators of a,
  • number_of_generators(a) / ngens(a) to the number of these generators, and
  • gen(a, i) as well as a[i] to the i-th such generator.
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> 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

Dimension of Ideals in Affine Algebras

dimMethod
dim(a::MPolyQuoIdeal)

Return the Krull dimension of a.

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> a = ideal(A, [x-y])
Ideal generated by
  x - y

julia> dim(a)
0
source

Minimal Sets of Generators

In the graded case, we have:

minimal_generating_setMethod
minimal_generating_set(I::MPolyQuoIdeal{<:MPolyDecRingElem})

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}}[]
source

Operations on Ideals in Affine Algebras

Simple Ideal Operations in Affine Algebras

Powers of Ideal
^Method
:^(a::MPolyQuoIdeal, m::Int)

Return the m-th power of a.

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> a^2
Ideal generated by
  x^2 + 2*x*y + y^2
source
Sum of Ideals
+Method
:+(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
source
Product of Ideals
*Method
:*(a::MPolyQuoIdeal{T}, b::MPolyQuoIdeal{T}) where T

Return the product 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^3 + x^2*y + x*y^2 + y^3
  x^2 + 2*x*y + y^2
source

Intersection of Ideals

intersectMethod
intersect(a::MPolyQuoIdeal{T}, bs::MPolyQuoIdeal{T}...) where T
intersect(V::Vector{MPolyQuoIdeal{T}}) where T

Return the intersection of two or more ideals.

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> intersect(a,b)
Ideal generated by
  x*y

julia> intersect([a,b])
Ideal generated by
  x*y
source

Ideal Quotients

quotientMethod
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
source

Tests on Ideals in Affine Algebras

Basic Tests

is_zeroMethod
is_zero(a::MPolyQuoIdeal)

Return true if a is the zero ideal, false otherwise.

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^2+y^2, x+y])
Ideal generated by
  x^2 + y^2
  x + y

julia> is_zero(a)
false

julia> b = ideal(A, [x^2-y])
Ideal generated by
  x^2 - y

julia> is_zero(b)
true
source

Containment of Ideals in Affine Algebras

is_subsetMethod
is_subset(a::MPolyQuoIdeal{T}, b::MPolyQuoIdeal{T}) where T

Return true if a is contained in 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> is_subset(a,b)
false

julia> is_subset(b,a)
true
source

Equality of Ideals in Affine Algebras

==Method
==(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
source

Ideal Membership

ideal_membershipMethod
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
source

Homomorphisms From Affine Algebras

If A=R/IA=R/I is an affine CC-algebra, and SS is any ring, then defining a ring homomorphism ϕ:AS\overline{\phi}: A \to S means to define a ring homomorphism ϕ:RS\phi: R \to S such that Iker(ϕ)I\subset \ker(\phi). Thus, ϕ\overline{\phi} is determined by specifying its restriction to CC, and by assigning an image to each generator of AA. In OSCAR, such homomorphisms are created as follows:

homMethod
hom(A::MPolyQuoRing, S::NCRing, coeff_map, images::Vector; check::Bool = true)

hom(A::MPolyQuoRing, S::NCRing, images::Vector; check::Bool = true)

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 \to 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 \to S iff the given data defines a homomorphism base_ring(A) \to 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
source

Given a ring homomorphism F : A \to S as above, domain(F) and codomain(F) refer to A and S, respectively. Given ring homomorphisms F : A \to B and G : B \to T as above, compose(F, G) refers to their composition.

Homomorphisms of Affine Algebras

The OSCAR homomorphism type AffAlgHom models ring homomorphisms R \to 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.

Data Associated to Homomorphisms of Affine Algebras

preimageMethod
preimage(F::MPolyAnyMap, I::Ideal)

Return the preimage of the ideal I under F.

source
kernelMethod
kernel(F::AffAlgHom)

Return the kernel of F.

source
Examples
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

Tests on Homomorphisms of Affine Algebras

is_injectiveMethod
is_injective(F::AffAlgHom)

Return true if F is injective, false otherwise.

source
is_surjectiveMethod
is_surjective(F::AffAlgHom)

Return true if F is surjective, false otherwise.

source
is_bijectiveMethod
is_bijective(F::AffAlgHom)

Return true if F is bijective, false otherwise.

source
is_finiteMethod
is_finite(F::AffAlgHom)

Return true if F is finite, false otherwise.

source
Examples
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

Inverting Homomorphisms of Affine Algebras

inverseMethod
inverse(F::AffAlgHom)

If F is bijective, return its inverse.

Examples

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
source

Presenting Finite Extension Rings

present_finite_extension_ringMethod
  present_finite_extension_ring(F::Oscar.AffAlgHom)

Given a finite homomorphism F :: A \rightarrow B of algebras of type <: Union{MPolyRing, MPolyQuoRing} over a field, return a presentation

ArAsB0A^r \rightarrow A^s\rightarrow B \rightarrow 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 ×\times s-matrix of polynomials defining the map ArAsA^r \rightarrow A^s, and
  • sect is a function which gives rise to a section of the augmentation map AsB A^s\rightarrow 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
source

Algebraic Independence

is_algebraically_independentMethod
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
source
is_algebraically_independent_with_relationsMethod
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))
source

Subalgebras

Subalgebra Membership

subalgebra_membershipMethod
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)
source

Minimal Subalgebra Generators

minimal_subalgebra_generatorsMethod
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
source

Noether Normalization

noether_normalizationMethod
noether_normalization(A::MPolyQuoRing)

Given an affine algebra A=R/IA=R/I over a field KK, return a triple (V,F,G)(V,F,G) such that:

  • VV is a vector of d=dimAd=\dim A elements of AA, represented by linear forms liRl_i\in R, and such that K[V]AK[V]\hookrightarrow A is a Noether normalization for AA;
  • F:A=R/IB=R/ϕ(I)F: A=R/I \to B = R/\phi(I) is an isomorphism, induced by a linear change ϕ\phi of coordinates of RR which maps the lil_i to the the last dd variables of RR;
  • G=F1.G = F^{-1}.
Warning

The algorithm may not terminate over a small finite field. If it terminates, the result is correct.

source
Examples
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

Normalization

normalizationMethod
normalization(A::MPolyQuoRing; algorithm = :equidimDec)

Find the normalization of a reduced affine algebra over a perfect field KK. That is, given the quotient A=R/IA=R/I of a multivariate polynomial ring RR over KK modulo a radical ideal II, compute the integral closure A\overline{A} of AA in its total ring of fractions Q(A)Q(A), together with the embedding f:AAf: A \to \overline{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=I1IrI=I_1\cap\dots\cap I_r into radical ideals IkI_k, together with maps A=R/IAk=R/IkA = R/I \to A_k=\overline{R/I_k} which give rise to the normalization map of AA:

AA1××Ar=AA\hookrightarrow A_1\times \dots\times A_r=\overline{A}

For each kk, the function specifies two representations of AkA_k: It returns an array of triples (Ak,fk,ak)(A_k, f_k, \mathfrak a_k), where AkA_k is represented as an affine KK-algebra, and fkf_k as a map of affine KK-algebras. The third entry ak\mathfrak a_k is a tuple (dk,Jk)(d_k, J_k), consisting of an element dkAd_k\in A and an ideal JkAJ_k\subset A, such that 1dkJk=Ak\frac{1}{d_k}J_k = A_k as AA-submodules of the total ring of fractions of AA.

By default (algorithm = :equidimDec), as a first step on its way to find the decomposition I=I1IrI=I_1\cap\dots\cap I_r, the algorithm computes an equidimensional decomposition of the radical ideal II. Alternatively, if specified by algorithm = :primeDec, the algorithm computes I=I1IrI=I_1\cap\dots\cap I_r as the prime decomposition of the radical ideal II. If specified by algorithm = :isPrime, assume that II is prime.

See [GLS10].

Warning

The function does not check whether AA 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))
source
normalization_with_deltaMethod
normalization_with_delta(A::MPolyQuoRing; algorithm::Symbol = :equidimDec)

Compute the normalization

AA1××Ar=AA\hookrightarrow A_1\times \dots\times A_r=\overline{A}

of AA as does normalize(A), but return additionally the delta invariant of AA, that is, the dimension

dimK(A/A).\dim_K(\overline{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 AkA_k, and whose third element is the (total) delta invariant of AA. The return value -1 in the third element indicates that the delta invariant is infinite.

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_with_delta(A);

julia> L[2]
3-element Vector{Int64}:
 1
 1
 0

julia> L[3]
13
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [z^3-x*y^4]));

julia> L = normalization_with_delta(A);

julia> L[3]
-1
source

Integral Bases

integral_basisMethod
integral_basis(f::MPolyRingElem, i::Int; algorithm::Symbol = :normal_local)

Given a polynomial ff in two variables with coefficients in a perfect field KK, and given an integer i{1,2}i\in\{1,2\} specifying one of the variables, ff must be irreducible and monic in the specified variable: Say, fK[x,y]f\in\mathbb K[x,y] is monic in yy. Then the normalization of A=K[x,y]/fA = K[x,y]/\langle f \rangle, that is, the integral closure A\overline{A} of AA in its quotient field, is a free module over K[x]K[x] of finite rank, and any set of free generators for A\overline{A} over K[x]K[x] is called an integral basis for A\overline{A} over K[x]K[x]. The function returns a pair (d,V)(d, V), where dd is an element of AA, and VV is a vector of elements in AA, such that the fractions v/d,vVv/d, v\in V, form an integral basis for A\overline{A} over K[x]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=QK = \mathbb Q, it is recommended to apply the algorithm in [BDLP19], which makes use of Puiseux expansions and Hensel lifting (algorithm = :hensel).

Note

The conditions on ff are automatically checked.

Examples

julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);

julia> f = (y^2-2)^2 + x^5
x^5 + y^4 - 4*y^2 + 4

julia> integral_basis(f, 2)
(x^2, MPolyQuoRingElem{QQMPolyRingElem}[x^2, x^2*y, y^2 - 2, y^3 - 2*y])
source

Tests on Affine Algebras

Reducedness Test

is_reducedMethod
is_reduced(A::MPolyQuoRing)

Given an affine algebra A, return true if A is reduced, false otherwise.

Warning

The function computes the radical of the modulus of A. This may take some time.

Examples

julia> R, (x,) = polynomial_ring(QQ, [:x]);

julia> A, _ = quo(R, ideal(R, [x^4]));

julia> is_reduced(A)
false
source

Normality Test

is_normalMethod
is_normal(A::MPolyQuoRing; check::Bool=true) -> Bool

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
source

Cohen-Macaulayness Test

is_cohen_macaulayMethod
is_cohen_macaulay(A::MPolyQuoRing)

Given a Z\mathbb Z-graded affine algebra A = R/I over a field, say, K, where the grading is inherited from the standard Z\mathbb 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
source

Hilbert Series and Hilbert Polynomial

Given a multivariate polynomial ring RR over a field KK together with a (multi)grading on RR by a finitely generated abelian group GG, let II be an ideal of RR which is homogeneous with respect to this grading. Then the affine KK-algebra A=R/IA=R/I inherits the grading: A=gGAgA = \bigoplus_{g\in G} A_g. Suppose now that RR is positively graded by GG. That is, GG is free and each graded piece RgR_g has finite dimension. Then also AgA_g is a finite dimensional KK-vector space for each gg, and we have the well-defined Hilbert function of AA,

H(A,d):GN,  gdimK(Ag).H(A, \underline{\phantom{d}}): G \to \mathbb{N}, \; g\mapsto \dim_K(A_g).

The Hilbert series of AA is the generating function

HA(t)=gGH(A,g)tgH_A(\mathbb t)=\sum_{g\in G} H(A, g) \mathbb t^g

(see Section 8.2 in [MS05] for a formal discussion extending the classical case of Z\mathbb 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/IA = R/I is an affine algebra, and L>(I)L_{>}(I) is the leading ideal of II with respect to a global monomial ordering >>, then the Hilbert function of AA equals that of R/L>(I)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\mathbb 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.

Z\mathbb Z-Gradings With Positive Weights

Let R=K[x1,xn]R=K[x_1, \dots x_n] be a polynomial ring in nn variables over a field KK. Assign positive integer weights wiw_i to the variables xix_i, and grade R=dZRd=d0RdR=\bigoplus_{d\in \mathbb Z} R_d=\bigoplus_{d\geq 0} R_d according to the corresponding weighted degree. Let II be an ideal of RR which is homogeneous with respect to this grading. Then the affine KK-algebra A=R/IA=R/I inherits the grading: A=d0AdA = \bigoplus_{d\geq 0} A_d, where each graded piece AdA_d is a finite dimensional KK-vector space. In this situation, the Hilbert function of AA is of type

H(A,d):NN,  ddimK(d),H(A, \underline{\phantom{d}}): \mathbb{N} \to \mathbb{N}, \;d \mapsto \dim_K(d),

and the Hilbert series of AA is the formal power series

HA(t)=d0H(A,d)tdZ[[t]].H_A(t)=\sum_{d\geq 0} H(A, d) t^d\in\mathbb Z[[t]].

The Hilbert series can be written as a rational function p(t)/q(t)p(t)/q(t), with denominator

q(t)=(1tw1)(1twn).q(t) = (1-t^{w_1})\cdots (1-t^{w_n}).

In the standard Z\mathbb 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]P_A(t)\in\mathbb{Q}[t], the Hilbert polynomial, which satisfies H(M,d)=PM(d)H(M,d)=P_M(d) for all d0d \gg 0. Furthermore, the degree of AA is defined as the dimension of AA over KK if this dimension is finite, and as the integer dd such that the leading term of the Hilbert polynomial has the form dte/e!d t^e/e!, otherwise.

hilbert_seriesMethod
hilbert_series(A::MPolyQuoRing; backend::Symbol=:Singular, algorithm::Symbol=:BayerStillmanA)

Given a Z\mathbb Z-graded affine algebra A=R/IA = R/I over a field KK, where the grading is inherited from a Z\mathbb Z-grading on the polynomial ring RR defined by assigning positive integer weights to the variables, return a pair (p,q)(p,q), say, of univariate polynomials p,qZ[t]p, q\in\mathbb Z[t] such that p/qp/q represents the Hilbert series of AA as a rational function with denominator

q=(1tw1)(1twn),q = (1-t^{w_1})\cdots (1-t^{w_n}),

where nn is the number of variables of RR, and w1,,wnw_1, \dots, w_n 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.

Examples

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> hilbert_series(A)
(2*t^3 - 3*t^2 + 1, (-t + 1)^4)

julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z], [1, 2, 3]);

julia> A, _ = quo(R, ideal(R, [x*y*z]));

julia> hilbert_series(A)
(-t^6 + 1, (-t^2 + 1)^1*(-t + 1)^1*(-t^3 + 1)^1)
source
hilbert_series_reducedMethod
hilbert_series_reduced(A::MPolyQuoRing)

Given a Z\mathbb Z-graded affine algebra A=R/IA = R/I over a field KK, where the grading is inherited from a Z\mathbb Z-grading on the polynomial ring RR defined by assigning positive integer weights to the variables, return a pair (p,q)(p,q), say, of univariate polynomials p,qZ[t]p, q\in\mathbb Z[t] such that p/qp/q represents the Hilbert series of AA as a rational function written in lowest terms.

See also hilbert_series.

Examples

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> hilbert_series_reduced(A)
(2*t + 1, t^2 - 2*t + 1)

julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z], [1, 2, 3]);

julia> A, _ = quo(R, ideal(R, [x*y*z]));

julia> hilbert_series(A)
(-t^6 + 1, (-t^2 + 1)^1*(-t + 1)^1*(-t^3 + 1)^1)

julia> hilbert_series_reduced(A)
(t^2 - t + 1, t^2 - 2*t + 1)
source
hilbert_series_expandedMethod
hilbert_series_expanded(A::MPolyQuoRing, d::Int)

Given a Z\mathbb Z-graded affine algebra A=R/IA = R/I over a field KK, where the grading is inherited from a Z\mathbb Z-grading on the polynomial ring RR defined by assigning positive integer weights to the variables, return the Hilbert series of AA to precision dd.

Examples

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> hilbert_series_expanded(A, 7)
1 + 4*t + 7*t^2 + 10*t^3 + 13*t^4 + 16*t^5 + 19*t^6 + 22*t^7 + O(t^8)

julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z], [1, 2, 3]);

julia> A, _ = quo(R, ideal(R, [x*y*z]));

julia> hilbert_series_expanded(A, 5)
1 + t + 2*t^2 + 3*t^3 + 4*t^4 + 5*t^5 + O(t^6)
source
hilbert_functionMethod
hilbert_function(A::MPolyQuoRing, d::Int)

Given a Z\mathbb Z-graded affine algebra A=R/IA = R/I over a field KK, where the grading is inherited from a Z\mathbb Z-grading on the polynomial ring RR defined by assigning positive integer weights to the variables, return the value H(A,d),H(A, d), where

H(A,d):NN,  ddimKAd,H(A, \underline{\phantom{d}}): \mathbb{N} \to \mathbb{N}, \; d \mapsto \dim_K A_d,

is the Hilbert function of AA.

Examples

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> hilbert_function(A,7)
22

julia> R, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z], [1, 2, 3]);

julia> A, _ = quo(R, ideal(R, [x*y*z]));

julia> hilbert_function(A, 5)
5
source
hilbert_polynomialMethod
hilbert_polynomial(A::MPolyQuoRing)

Given a Z\mathbb Z-graded affine algebra A=R/IA = R/I over a field KK, where the grading is inherited from the standard Z\mathbb Z-grading on the polynomial ring RR, return the Hilbert polynomial of AA.

Examples

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> hilbert_polynomial(A)
3*t + 1
source
degreeMethod
degree(A::MPolyQuoRing)

Given a Z\mathbb Z-graded affine algebra A=R/IA = R/I over a field KK, where the grading is inherited from the standard Z\mathbb Z-grading on the polynomial ring RR, return the degree of AA.

Examples

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> degree(A)
3
source

Positive Gradings in General

multi_hilbert_seriesMethod
multi_hilbert_series(A::MPolyQuoRing; algorithm::Symbol=:BayerStillmanA, parent::Union{Nothing,Ring}=nothing)

Return the Hilbert series of the graded affine algebra A.

Note

The advanced user can select an algorithm for the computation; see the code for details.

Examples

julia> W = [1 1 1; 0 0 -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> H = multi_hilbert_series(A);

julia> H[1][1]
-t[1]^7*t[2]^-2 + t[1]^6*t[2]^-1 + t[1]^6*t[2]^-2 + t[1]^5*t[2]^-4 - t[1]^4 + t[1]^4*t[2]^-2 - t[1]^4*t[2]^-4 - t[1]^3*t[2]^-1 - t[1]^3*t[2]^-2 + 1

julia> H[1][2]
(-t[1] + 1)^2*(-t[1]*t[2]^-1 + 1)^1

julia> H[2][1]
Z^2

julia> H[2][2]
Identity map
  of Z^2

julia> G = abelian_group(ZZMatrix([1 -1]));

julia> g = gen(G, 1)
Abelian group element [0, 1]

julia> W = [g, g, g, g];

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z], W);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> (num, den), (H, iso) = multi_hilbert_series(A);

julia> num
2*t^3 - 3*t^2 + 1

julia> den
(-t + 1)^4

julia> H
Z

julia> iso
Map
  from Z
  to finitely generated abelian group with 2 generators and 1 relation
source
multi_hilbert_series_reducedMethod
multi_hilbert_series_reduced(A::MPolyQuoRing; algorithm::Symbol=:BayerStillmanA)

Return the reduced Hilbert series of the positively graded affine algebra A.

Note

The advanced user can select a algorithm for the computation; see the code for details.

Examples

julia> W = [1 1 1; 0 0 -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> H = multi_hilbert_series_reduced(A);


julia> H[1][1]
-t[1]^5*t[2]^-1 + t[1]^3 + t[1]^3*t[2]^-3 + t[1]^2 + t[1]^2*t[2]^-1 + t[1]^2*t[2]^-2 + t[1] + t[1]*t[2]^-1 + 1

julia> H[1][2]
-t[1] + 1

julia> H[2][1]
Z^2

julia> H[2][2]
Identity map
  of Z^2

julia> G = abelian_group(ZZMatrix([1 -1]));

julia> g = gen(G, 1)
Abelian group element [0, 1]

julia> W = [g, g, g, g];

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z], W);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> H = multi_hilbert_series_reduced(A);

julia> H[1][1]
2*t + 1

julia> H[1][2]
t^2 - 2*t + 1

julia> H[2][1]
Z

julia> H[2][2]
Map
  from Z
  to finitely generated abelian group with 2 generators and 1 relation
source
multi_hilbert_functionMethod
multi_hilbert_function(A::MPolyQuoRing, g::FinGenAbGroupElem)

Given a positively graded affine algebra AA over a field KK with grading group GG, say, and given an element gg of GG, return the value H(A,g)H(A, g) of the Hilbert function

H(A,d):GN,  gdimK(Ag).H(A, \underline{\phantom{d}}): G \to \mathbb{N}, \; g\mapsto \dim_K(A_g).

multi_hilbert_function(A::MPolyQuoRing, g::Vector{<:IntegerUnion})

Given a positively Zm\mathbb Z^m-graded affine algebra AA over a field KK, and given a vector gg of mm integers, convert gg into an element of the grading group of AA, and return the value H(A,g)H(A, g) as above.

multi_hilbert_function(A::MPolyQuoRing, g::IntegerUnion)

Given a positively Z\mathbb Z-graded affine algebra AA over a field KK, and given an integer gg, convert gg into an element of the grading group of AA, and return the value H(A,g)H(A, g) as above.

Examples

julia> W = [1 1 1; 0 0 -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
julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z], [-1, -1, -1, -1]);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> multi_hilbert_function(A, -7)
22
julia> G = abelian_group(ZZMatrix([1 -1]));

julia> g = gen(G, 1);

julia> W = [g, g, g, g];

julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z], W);

julia> A, _ = quo(R, ideal(R, [w*y-x^2, w*z-x*y, x*z-y^2]));

julia> multi_hilbert_function(A, 7*g)
22
source