Ideals in Multivariate Rings
Types
The OSCAR type for ideals in multivariate polynomial rings is of parametrized form MPolyIdeal{T}
, where T
is the element type of the polynomial ring.
Constructors
ideal
— Methodideal(g::Vector{T}) where {T <: MPolyElem}
ideal(g::Vector{T}) where {T <: MPolyElem_dec}
Given a vector g
of polynomials in a polynomial ring R
, say, return the ideal of R
generated by these polynomials.
In the graded case, assure that the entries of g
are homogeneous.
ideal(R::MPolyRing, g::Vector)
Given a vector g
of polynomials in R
, return the ideal of R
generated by these polynomials.
In the graded case, assure that the entries of g
are homogeneous.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x*y-3*x,y^3-2*x^2*y])
ideal(x*y - 3*x, -2*x^2*y + y^3)
julia> typeof(I)
MPolyIdeal{fmpq_mpoly}
julia> S, (x, y) = GradedPolynomialRing(QQ, ["x", "y"], [1, 2])
(Multivariate Polynomial Ring in x, y over Rational Field graded by
x -> [1]
y -> [2], MPolyElem_dec{fmpq, fmpq_mpoly}[x, y])
julia> J = ideal(S, [(x^2+y)^2])
ideal(x^4 + 2*x^2*y + y^2)
julia> typeof(J)
MPolyIdeal{MPolyElem_dec{fmpq, fmpq_mpoly}}
Data Associated to Ideals
Basic Data
If I
is an ideal of a multivariate polynomial ring R
, then
base_ring(I)
refers toR
,gens(I)
to the generators ofI
,ngens(I)
to the number of these generators, andgen(I, k)
as well asI[k]
to thek
-th such generator.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x, y])^2
ideal(x^2, x*y, y^2)
julia> base_ring(I)
Multivariate Polynomial Ring in x, y over Rational Field
julia> gens(I)
3-element Vector{fmpq_mpoly}:
x^2
x*y
y^2
julia> ngens(I)
3
julia> gen(I, 2)
x*y
Dimension
dim
— Methoddim(I::MPolyIdeal)
Return the Krull dimension of I
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [y-x^2, x-z^3])
ideal(-x^2 + y, x - z^3)
julia> dim(I)
1
Codimension
codim
— Methodcodim(I::MPolyIdeal)
Return the codimension of I
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [y-x^2, x-z^3])
ideal(-x^2 + y, x - z^3)
julia> codim(I)
2
Minimal Sets of Generators
In the graded case, we have:
minimal_generating_set
— Methodminimal_generating_set(I::MPolyIdeal{<:MPolyElem_dec})
Given a homogeneous ideal I
in a graded multivariate polynomial ring over a field, return an array containing a minimal set of generators of I
.
Examples
julia> R, (x, y, z) = GradedPolynomialRing(QQ, ["x", "y", "z"]);
julia> V = [x, z^2, x^3+y^3, y^4, y*z^5];
julia> I = ideal(R, V)
ideal(x, z^2, x^3 + y^3, y^4, y*z^5)
julia> minimal_generating_set(I)
3-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
x
z^2
x^3 + y^3
Operations on Ideals
Simple Ideal Operations
Powers of Ideal
^
— Method^(I::MPolyIdeal, m::Int)
Return the m
-th power of I
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [x, y])
ideal(x, y)
julia> I^3
ideal(x^3, x^2*y, x*y^2, y^3)
Sum of Ideals
+
— Method+(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return the sum of I
and J
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [x, y])
ideal(x, y)
julia> J = ideal(R, [z^2])
ideal(z^2)
julia> I+J
ideal(x, y, z^2)
Product of Ideals
*
— Method*(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return the product of I
and J
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [x, y])
ideal(x, y)
julia> J = ideal(R, [z^2])
ideal(z^2)
julia> I*J
ideal(x*z^2, y*z^2)
Intersection of Ideals
intersect
— Methodintersect(I::MPolyIdeal{T}, Js::MPolyIdeal{T}...) where T
Return the intersection of two or more ideals.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
Ideal Quotients
Given two ideals $I, J$ of a ring $R$, the ideal quotient of $I$ by $J$ is the ideal
\[I:J= \bigl\{f \in R\:\big|\: f J \subset I\bigr\}\subset R.\]
quotient
— Methodquotient(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return the ideal quotient of I
by J
. Alternatively, use I:J
.
quotient(I::MPolyIdeal{T}, f::MPolyElem{T}) where T
Return the ideal quotient of I
by the ideal generated by f
. Alternatively, use I:f
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [x^4+x^2*y*z+y^3*z, y^4+x^3*z+x*y^2*z, x^3*y+x*y^3])
ideal(x^4 + x^2*y*z + y^3*z, x^3*z + x*y^2*z + y^4, x^3*y + x*y^3)
julia> J = ideal(R, [x, y, z])^2
ideal(x^2, x*y, x*z, y^2, y*z, z^2)
julia> L = quotient(I, J)
ideal(x^3*z + x*y^2*z + y^4, x^3*y + x*y^3, x^4 + x^2*y*z + y^3*z, x^3*z^2 - x^2*y*z^2 + x*y^2*z^2 - y^3*z^2, x^2*y^2*z - x^2*y*z^2 - y^3*z^2, x^3*z^2 + x^2*y^3 - x^2*y^2*z + x*y^2*z^2)
julia> I:J
ideal(x^3*z + x*y^2*z + y^4, x^3*y + x*y^3, x^4 + x^2*y*z + y^3*z, x^3*z^2 - x^2*y*z^2 + x*y^2*z^2 - y^3*z^2, x^2*y^2*z - x^2*y*z^2 - y^3*z^2, x^3*z^2 + x^2*y^3 - x^2*y^2*z + x*y^2*z^2)
julia> I:x
ideal(x^2*y + y^3, x^3*z + x*y^2*z + y^4, x^2*z^2 + x*y^3 - x*y^2*z + y^2*z^2, x^4, x^3*z^2 - x^2*z^3 + 2*x*y^2*z^2 - y^2*z^3, -x^2*z^4 + x*y^2*z^3 - y^2*z^4)
Saturation
Given two ideals $I, J$ of a ring $R$, the saturation of $I$ with respect to $J$ is the ideal
\[I:J^{\infty} = \bigl\{ f \in R \:\big|\: f J^k \!\subset I {\text{ for some }}k\geq 1 \bigr\} = \textstyle{\bigcup\limits_{k=1}^{\infty} (I:J^k)}.\]
saturation
— Methodsaturation(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return the saturation of I
with respect to J
.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [z^3, y*z^2, x*z^2, y^2*z, x*y*z, x^2*z, x*y^2, x^2*y])
ideal(z^3, y*z^2, x*z^2, y^2*z, x*y*z, x^2*z, x*y^2, x^2*y)
julia> J = ideal(R, [x, y, z])
ideal(x, y, z)
julia> K = saturation(I, J)
ideal(z, x*y)
saturation_with_index
— Methodsaturation_with_index(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return $I:J^{\infty}$ together with the smallest integer $m$ such that $I:J^m = I:J^{\infty}$.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> I = ideal(R, [z^3, y*z^2, x*z^2, y^2*z, x*y*z, x^2*z, x*y^2, x^2*y])
ideal(z^3, y*z^2, x*z^2, y^2*z, x*y*z, x^2*z, x*y^2, x^2*y)
julia> J = ideal(R, [x, y, z])
ideal(x, y, z)
julia> K, m = saturation_with_index(I, J)
(ideal(z, x*y), 2)
Elimination
eliminate
— Methodeliminate(I::MPolyIdeal{T}, V::Vector{T}) where T <: MPolyElem
Given a vector V
of polynomials which are variables, these variables are eliminated from I
. That is, return the ideal generated by all polynomials in I
which only involve the remaining variables.
eliminate(I::MPolyIdeal, V::AbstractVector{Int})
Given a vector V
of indices which specify variables, these variables are eliminated from I
. That is, return the ideal generated by all polynomials in I
which only involve the remaining variables.
The return value is an ideal of the original ring.
Examples
julia> R, (t, x, y, z) = PolynomialRing(QQ, ["t", "x", "y", "z"])
(Multivariate Polynomial Ring in t, x, y, z over Rational Field, fmpq_mpoly[t, x, y, z])
julia> I = ideal(R, [t-x, t^2-y, t^3-z])
ideal(t - x, t^2 - y, t^3 - z)
julia> A = [t]
1-element Vector{fmpq_mpoly}:
t
julia> TC = eliminate(I, A)
ideal(-x*z + y^2, x*y - z, x^2 - y)
julia> A = [1]
1-element Vector{Int64}:
1
julia> TC = eliminate(I, A)
ideal(-x*z + y^2, x*y - z, x^2 - y)
julia> base_ring(TC)
Multivariate Polynomial Ring in t, x, y, z over Rational Field
Tests on Ideals
Basic Tests
is_zero
— Methodis_zero(I::MPolyIdeal)
Return true
if I
is the zero ideal, false
otherwise.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, y-x^2)
ideal(-x^2 + y)
julia> is_zero(I)
false
is_one
— Methodis_one(I::MPolyIdeal)
Return true
if I
is generated by 1
, false
otherwise.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x, x + y, y - 1])
ideal(x, x + y, y - 1)
julia> is_one(I)
true
is_monomial
— Methodis_monomial(f::MPolyElem)
Return true
if f
is a monomial, false
otherwise.
is_monomial(I::MPolyIdeal)
Return true
if I
can be generated by monomials, false
otherwise.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> f = 2*x+y
2*x + y
julia> g = y
y
julia> is_monomial(f)
false
julia> is_monomial(g)
true
julia> is_monomial(ideal(R, [f, g]))
true
Containment of Ideals
is_subset
— Methodis_subset(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return true
if I
is contained in J
, false
otherwise.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x^2])
ideal(x^2)
julia> J = ideal(R, [x, y])^2
ideal(x^2, x*y, y^2)
julia> is_subset(I, J)
true
Equality of Ideals
==
— Method==(I::MPolyIdeal{T}, J::MPolyIdeal{T}) where T
Return true
if I
is equal to J
, false
otherwise.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x^2])
ideal(x^2)
julia> J = ideal(R, [x, y])^2
ideal(x^2, x*y, y^2)
julia> I == J
false
Ideal Membership
ideal_membership
— Methodideal_membership(f::T, I::MPolyIdeal{T}) where T
Return true
if f
is contained in I
, false
otherwise. Alternatively, use f in I
.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> f = x^2
x^2
julia> I = ideal(R, [x, y])^2
ideal(x^2, x*y, y^2)
julia> ideal_membership(f, I)
true
julia> g = x
x
julia> g in I
false
Radical Membership
radical_membership
— Methodradical_membership(f::T, I::MPolyIdeal{T}) where T
Return true
if f
is contained in the radical of I
, false
otherwise. Alternatively, use inradical(f, I)
.
Examples
julia> R, (x,) = PolynomialRing(QQ, ["x"])
(Multivariate Polynomial Ring in x over Rational Field, fmpq_mpoly[x])
julia> f = x
x
julia> I = ideal(R, [x^2])
ideal(x^2)
julia> radical_membership(f, I)
true
julia> g = x+1
x + 1
julia> inradical(g, I)
false
Primality Test
is_prime
— Methodis_prime(I::MPolyIdeal)
Return true
if I
is prime, false
otherwise.
The function computes the minimal associated primes of I
. This may take some time.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x, y])^2
ideal(x^2, x*y, y^2)
julia> is_prime(I)
false
Primary Test
is_primary
— Methodis_primary(I::MPolyIdeal)
Return true
if I
is primary, false
otherwise.
The function computes a primary decomposition of I
. This may take some time.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = ideal(R, [x, y])^2
ideal(x^2, x*y, y^2)
julia> is_primary(I)
true
Decomposition of Ideals
We discuss various decomposition techniques. They are implemented for polynomial rings over fields and, if explicitly mentioned, also for polynomial rings over the integers. See Wolfram Decker, Gert-Martin Greuel, Gerhard Pfister (1999) for a survey.
Radical
radical
— Methodradical(I::MPolyIdeal)
Return the radical of I
.
Implemented Algorithms
If the base ring of I
is a polynomial ring over a field, a combination of the algorithms of Krick and Logar (with modifications by Laplagne) and Kemper is used. For polynomial rings over the integers, the algorithm proceeds as suggested by Pfister, Sadiq, and Steidel. See Teresa Krick, Alessandro Logar (1991), Gregor Kemper (2002), and Gerhard Pfister, Afshan Sadiq, Stefan Steidel (2011).
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> RI = radical(I)
ideal(x^4 - x^3*y - x^3 - x^2 - x*y^2 + x*y + x + y^3 + y^2)
julia> R, (a, b, c, d) = PolynomialRing(ZZ, ["a", "b", "c", "d"])
(Multivariate Polynomial Ring in a, b, c, d over Integer Ring, fmpz_mpoly[a, b, c, d])
julia> I = intersect(ideal(R, [9,a,b]), ideal(R, [3,c]))
ideal(9, 3*b, 3*a, b*c, a*c)
julia> I = intersect(I, ideal(R, [11,2a,7b]))
ideal(99, 3*b, 3*a, b*c, a*c)
julia> I = intersect(I, ideal(R, [13a^2,17b^4]))
ideal(39*a^2, 13*a^2*c, 51*b^4, 17*b^4*c, 3*a^2*b^4, a^2*b^4*c)
julia> I = intersect(I, ideal(R, [9c^5,6d^5]))
ideal(78*a^2*d^5, 117*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5, 6*a^2*b^4*d^5, 9*a^2*b^4*c^5, 39*a^2*c^5*d^5, 51*b^4*c^5*d^5, 3*a^2*b^4*c^5*d^5)
julia> I = intersect(I, ideal(R, [17,a^15,b^15,c^15,d^15]))
ideal(1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5, 663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15, 78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15, 39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5, 6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15, 3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5)
julia> RI = radical(I)
ideal(102*b*d, 78*a*d, 51*b*c, 39*a*c, 6*a*b*d, 3*a*b*c)
Primary Decomposition
primary_decomposition
— Methodprimary_decomposition(I::MPolyIdeal; alg = :GTZ)
Return a minimal primary decomposition of I
. If I
is the unit ideal, return [ideal(1)]
.
The decomposition is returned as a vector of tuples $(Q_1, P_1), \dots, (Q_t, P_t)$, say, where each $Q_i$ is a primary ideal with associated prime $P_i$, and where the intersection of the $Q_i$ is I
.
Implemented Algorithms
If the base ring of I
is a polynomial ring over a field, the algorithm of Gianni, Trager, and Zacharias is used by default (alg = :GTZ
). Alternatively, the algorithm by Shimoyama and Yokoyama can be used by specifying alg = :SY
. For polynomial rings over the integers, the algorithm proceeds as suggested by Pfister, Sadiq, and Steidel. See Patrizia Gianni, Barry Trager, Gail Zacharias (1988), Takeshi Shimoyama, Kazuhiro Yokoyama (1996), and Gerhard Pfister, Afshan Sadiq, Stefan Steidel (2011).
The algorithm of Gianni, Trager, and Zacharias may not terminate over a small finite field. If it terminates, the result is correct.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> L = primary_decomposition(I)
3-element Vector{Tuple{MPolyIdeal{fmpq_mpoly}, MPolyIdeal{fmpq_mpoly}}}:
(ideal(x^3 - x - y^2), ideal(x^3 - x - y^2))
(ideal(x^2 - 2*x*y - 2*x + y^2 + 2*y + 1), ideal(x - y - 1))
(ideal(y, x^2), ideal(x, y))
julia> L = primary_decomposition(I, alg = :SY)
3-element Vector{Tuple{MPolyIdeal{fmpq_mpoly}, MPolyIdeal{fmpq_mpoly}}}:
(ideal(x^3 - x - y^2), ideal(x^3 - x - y^2))
(ideal(x^2 - 2*x*y - 2*x + y^2 + 2*y + 1), ideal(x - y - 1))
(ideal(y, x^2), ideal(y, x))
julia> R, (a, b, c, d) = PolynomialRing(ZZ, ["a", "b", "c", "d"])
(Multivariate Polynomial Ring in a, b, c, d over Integer Ring, fmpz_mpoly[a, b, c, d])
julia> I = ideal(R, [1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5,
663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15,
78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15,
39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5,
6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15,
3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5])
ideal(1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5, 663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15, 78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15, 39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5, 6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15, 3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5)
julia> L = primary_decomposition(I)
8-element Vector{Tuple{MPolyIdeal{fmpz_mpoly}, MPolyIdeal{fmpz_mpoly}}}:
(ideal(d^5, c^5), ideal(d, c))
(ideal(a^2, b^4), ideal(b, a))
(ideal(2, c^5), ideal(2, c))
(ideal(3), ideal(3))
(ideal(13, b^4), ideal(13, b))
(ideal(17, a^2), ideal(17, a))
(ideal(17, d^15, c^15, b^15, a^15), ideal(17, d, c, b, a))
(ideal(9, 3*d^5, d^10), ideal(3, d))
Absolute Primary Decomposition
absolute_primary_decomposition
— Methodabsolute_primary_decomposition(I::MPolyIdeal{<:MPolyElem{fmpq}})
If I
is an ideal in a multivariate polynomial ring over the rationals, return an absolute minimal primary decomposition of I
.
Return the decomposition as a vector of tuples $(Q_i, P_i, P_{ij}, d_{ij})$, say, where $(Q_i, P_i)$ is a (primary, prime) tuple as returned by primary_decomposition(I)
, and $P_{ij}$ represents a corresponding class of conjugated absolute associated primes defined over a number field of degree $d_{ij}$ whose generator prints as _a
.
Implemented Algorithms
The implementation combines the algorithm of Gianni, Trager, and Zacharias for primary decomposition with absolute polynomial factorization.
Examples
julia> R, (y, z) = PolynomialRing(QQ, ["y", "z"])
(Multivariate Polynomial Ring in y, z over Rational Field, fmpq_mpoly[y, z])
julia> p = z^2+1
z^2 + 1
julia> q = z^3+2
z^3 + 2
julia> I = ideal(R, [p*q^2, y-z^2])
ideal(z^8 + z^6 + 4*z^5 + 4*z^3 + 4*z^2 + 4, y - z^2)
julia> L = primary_decomposition(I)
2-element Vector{Tuple{MPolyIdeal{fmpq_mpoly}, MPolyIdeal{fmpq_mpoly}}}:
(ideal(z^2 + 1, y - z^2), ideal(z^2 + 1, y - z^2))
(ideal(z^6 + 4*z^3 + 4, y - z^2), ideal(z^3 + 2, y - z^2))
julia> AL = absolute_primary_decomposition(I)
2-element Vector{Tuple{MPolyIdeal{fmpq_mpoly}, MPolyIdeal{fmpq_mpoly}, MPolyIdeal{AbstractAlgebra.Generic.MPoly{nf_elem}}, Int64}}:
(ideal(z^2 + 1, y + 1), ideal(z^2 + 1, y + 1), ideal(z - _a, y + 1), 2)
(ideal(z^6 + 4*z^3 + 4, y - z^2), ideal(z^3 + 2, y - z^2), ideal(z - _a, y - _a*z), 3)
julia> AP = AL[1][3]
ideal(z - _a, y + 1)
julia> RAP = base_ring(AP)
Multivariate Polynomial Ring in y, z over Number field over Rational Field with defining polynomial x^2 + 1
julia> NF = coefficient_ring(RAP)
Number field over Rational Field with defining polynomial x^2 + 1
julia> a = gen(NF)
_a
julia> minpoly(a)
x^2 + 1
Minimal Associated Primes
minimal_primes
— Methodminimal_primes(I::MPolyIdeal; alg = :GTZ)
Return a vector containing the minimal associated prime ideals of I
. If I
is the unit ideal, return [ideal(1)]
.
Implemented Algorithms
If the base ring of I
is a polynomial ring over a field, the algorithm of Gianni, Trager, and Zacharias is used by default (alg = :GTZ
). Alternatively, characteristic sets can be used by specifying alg = :charSets
. For polynomial rings over the integers, the algorithm proceeds as suggested by Pfister, Sadiq, and Steidel. See Patrizia Gianni, Barry Trager, Gail Zacharias (1988) and Gerhard Pfister, Afshan Sadiq, Stefan Steidel (2011).
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> L = minimal_primes(I)
2-element Vector{MPolyIdeal{fmpq_mpoly}}:
ideal(x - y - 1)
ideal(x^3 - x - y^2)
julia> L = minimal_primes(I, alg = :charSets)
2-element Vector{MPolyIdeal{fmpq_mpoly}}:
ideal(x - y - 1)
ideal(x^3 - x - y^2)
julia> R, (a, b, c, d) = PolynomialRing(ZZ, ["a", "b", "c", "d"])
(Multivariate Polynomial Ring in a, b, c, d over Integer Ring, fmpz_mpoly[a, b, c, d])
julia> I = ideal(R, [1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5,
663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15,
78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15,
39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5,
6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15,
3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5])
ideal(1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5, 663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15, 78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15, 39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5, 6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15, 3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5)
julia> L = minimal_primes(I)
6-element Vector{MPolyIdeal{fmpz_mpoly}}:
ideal(d, c)
ideal(b, a)
ideal(2, c)
ideal(3)
ideal(13, b)
ideal(17, a)
Weak Equidimensional Decomposition
equidimensional_decomposition_weak
— Methodequidimensional_decomposition_weak(I::MPolyIdeal)
Return a vector of equidimensional ideals where the last entry is the equidimensional hull of I
, that is, the intersection of the primary components of I
of maximal dimension. Each of the previous entries is an ideal of lower dimension whose associated primes are exactly the associated primes of I
of that dimension. If I
is the unit ideal, return [ideal(1)]
.
Implemented Algorithms
The implementation relies on ideas of Eisenbud, Huneke, and Vasconcelos. See David Eisenbud, Craig Huneke, Wolmer Vasconcelos (1992).
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> L = equidimensional_decomposition_weak(I)
2-element Vector{MPolyIdeal{fmpq_mpoly}}:
ideal(y, x)
ideal(x^5 - 2*x^4*y - 2*x^4 + x^3*y^2 + 2*x^3*y - x^2*y^2 + 2*x^2*y + 2*x^2 + 2*x*y^3 + x*y^2 - 2*x*y - x - y^4 - 2*y^3 - y^2)
Equidimensional Decomposition of radical
equidimensional_decomposition_radical
— Methodequidimensional_decomposition_radical(I::MPolyIdeal)
Return a vector of equidimensional radical ideals increasingly ordered by dimension. For each dimension, the returned radical ideal is the intersection of the associated primes of I
of that dimension. If I
is the unit ideal, return [ideal(1)]
.
Implemented Algorithms
The implementation combines the algorithms of Krick and Logar (with modifications by Laplagne) and Kemper. See Teresa Krick, Alessandro Logar (1991) and Gregor Kemper (2002).
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> L = equidimensional_decomposition_radical(I)
2-element Vector{MPolyIdeal{fmpq_mpoly}}:
ideal(y, x)
ideal(x^4 - x^3*y - x^3 - x^2 - x*y^2 + x*y + x + y^3 + y^2)
Equidimensional Hull
equidimensional_hull
— Methodequidimensional_hull(I::MPolyIdeal)
If the base ring of I
is a polynomial ring over a field, return the intersection of the primary components of I
of maximal dimension. In the case of polynomials over the integers, return the intersection of the primary components of I of minimal height. If I
is the unit ideal, return [ideal(1)]
.
Implemented Algorithms
For polynomial rings over a field, the implementation relies on ideas as used by Gianni, Trager, and Zacharias or Krick and Logar. For polynomial rings over the integers, the algorithm proceeds as suggested by Pfister, Sadiq, and Steidel. See Patrizia Gianni, Barry Trager, Gail Zacharias (1988), Teresa Krick, Alessandro Logar (1991), and Gerhard Pfister, Afshan Sadiq, Stefan Steidel (2011).
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> L = equidimensional_hull(I)
ideal(x^5 - 2*x^4*y - 2*x^4 + x^3*y^2 + 2*x^3*y - x^2*y^2 + 2*x^2*y + 2*x^2 + 2*x*y^3 + x*y^2 - 2*x*y - x - y^4 - 2*y^3 - y^2)
julia> R, (a, b, c, d) = PolynomialRing(ZZ, ["a", "b", "c", "d"])
(Multivariate Polynomial Ring in a, b, c, d over Integer Ring, fmpz_mpoly[a, b, c, d])
julia> I = ideal(R, [1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5,
663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15,
78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15,
39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5,
6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15,
3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5])
ideal(1326*a^2*d^5, 1989*a^2*c^5, 102*b^4*d^5, 153*b^4*c^5, 663*a^2*c^5*d^5, 51*b^4*c^5*d^5, 78*a^2*d^15, 117*a^2*c^15, 78*a^15*d^5, 117*a^15*c^5, 6*a^2*b^4*d^15, 9*a^2*b^4*c^15, 39*a^2*c^5*d^15, 39*a^2*c^15*d^5, 6*a^2*b^15*d^5, 9*a^2*b^15*c^5, 6*a^15*b^4*d^5, 9*a^15*b^4*c^5, 39*a^15*c^5*d^5, 3*a^2*b^4*c^5*d^15, 3*a^2*b^4*c^15*d^5, 3*a^2*b^15*c^5*d^5, 3*a^15*b^4*c^5*d^5)
julia> L = equidimensional_hull(I)
ideal(3)
Radical of the Equidimensional Hull
equidimensional_hull_radical
— Methodequidimensional_hull_radical(I::MPolyIdeal)
Return the intersection of the associated primes of I
of maximal dimension. If I
is the unit ideal, return [ideal(1)]
.
Implemented Algorithms
The implementation relies on a combination of the algorithms of Krick and Logar (with modifications by Laplagne) and Kemper. See Teresa Krick, Alessandro Logar (1991) and Gregor Kemper (2002).
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> I = intersect(ideal(R, [x, y])^2, ideal(R, [y^2-x^3+x]))
ideal(x^3*y - x*y - y^3, x^4 - x^2 - x*y^2)
julia> I = intersect(I, ideal(R, [x-y-1])^2)
ideal(x^5*y - 2*x^4*y^2 - 2*x^4*y + x^3*y^3 + 2*x^3*y^2 - x^2*y^3 + 2*x^2*y^2 + 2*x^2*y + 2*x*y^4 + x*y^3 - 2*x*y^2 - x*y - y^5 - 2*y^4 - y^3, x^6 - 2*x^5 - 3*x^4*y^2 - 2*x^4*y + 2*x^3*y^3 + 3*x^3*y^2 + 2*x^3*y + 2*x^3 + 5*x^2*y^2 + 2*x^2*y - x^2 + 3*x*y^4 - 5*x*y^2 - 2*x*y - 2*y^5 - 4*y^4 - 2*y^3)
julia> L = equidimensional_hull_radical(I)
ideal(x^4 - x^3*y - x^3 - x^2 - x*y^2 + x*y + x + y^3 + y^2)
Homogenization and Dehomogenization
Referring to Martin Kreuzer, Lorenzo Robbiano (2005) for definitions and technical details, we discuss homogenization and dehomogenization in the context of $\mathbb Z^m$-gradings.
homogenization
— Functionhomogenization(f::MPolyElem, W::Union{fmpz_mat, Matrix{<:IntegerUnion}}, var::String, pos::Int = 1)
If $m$ is the number of rows of W
, extend the parent polynomial ring of f
by inserting $m$ extra variables, starting at position pos
. Correspondingly, extend the integer matrix W
by inserting the standard unit vectors of size $m$ as new columns, starting at column pos
. Grade the extended ring by converting the columns of the extended matrix to elements of the group $\mathbb Z^m$ and assigning these as weights to the variables. Homogenize f
with respect to the induced $\mathbb Z^m$-grading on the original ring, using the extra variables as homogenizing variables. Return the result as an element of the extended ring with its $\mathbb Z^m$-grading. If $m=1$, the extra variable prints as var
. Otherwise, the extra variables print as var[
$i$]
, for $i = 1 \dots m$.
homogenization(V::Vector{T}, W::Union{fmpz_mat, Matrix{<:IntegerUnion}}, var::String, pos::Int = 1) where {T <: MPolyElem}
Given a vector V
of elements in a common polynomial ring, create an extended ring with $\mathbb Z^m$-grading as above. Homogenize the elements of V
correspondingly, and return the vector of homogenized elements.
homogenization(I::MPolyIdeal{T}, W::Union{fmpz_mat, Matrix{<:IntegerUnion}}, var::String, pos::Int = 1; ordering::Symbol = :degrevlex) where {T <: MPolyElem}
Return the homogenization of I
in an extended ring with $\mathbb Z^m$-grading as above.
Applied to an ideal I
, the function first homogenizes the generators of I
in the extended ring. It then creates the ideal generated by these homogenizations, and saturates this ideal with respect to the ideal which is generated by the homogenizing variables.
Examples
julia> R, (x, y) = PolynomialRing(QQ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Rational Field, fmpq_mpoly[x, y])
julia> f = x^3+x^2*y+x*y^2+y^3
x^3 + x^2*y + x*y^2 + y^3
julia> W = [1 2; 3 4]
2×2 Matrix{Int64}:
1 2
3 4
julia> F = homogenization(f, W, "z", 3)
x^3*z[1]^3*z[2]^3 + x^2*y*z[1]^2*z[2]^2 + x*y^2*z[1]*z[2] + y^3
julia> parent(F)
Multivariate Polynomial Ring in x, y, z[1], z[2] over Rational Field graded by
x -> [1 3]
y -> [2 4]
z[1] -> [1 0]
z[2] -> [0 1]
homogenization
— Functionhomogenization(f::MPolyElem, var::String, pos::Int = 1)
homogenization(V::Vector{T}, var::String, pos::Int = 1) where {T <: MPolyElem}
homogenization(I::MPolyIdeal{T}, var::String, pos::Int = 1; ordering::Symbol = :degrevlex) where {T <: MPolyElem}
Homogenize f
, V
, or I
with respect to the standard $\mathbb Z$-grading using a homogenizing variable printing as var
. Return the result as an element of a graded polynomial ring with the homogenizing variable at position pos
.
Applied to an ideal I
, the function proceeds by homogenizing the elements of a Gröbner basis of I
with respect to a degree compatible monomial ordering such as degrevlex
(default). If a Gröbner basis with respect to the specified ordering has not yet been computed and, thus, not yet been cached, executing the homogenization
function with argument I
may take some time. The degree compatibility of the specified ordering is not checked by the function.
Examples
julia> R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> f = x^3-y^2-z
x^3 - y^2 - z
julia> F = homogenization(f, "w", 4)
x^3 - y^2*w - z*w^2
julia> parent(F)
Multivariate Polynomial Ring in x, y, z, w over Rational Field graded by
x -> [1]
y -> [1]
z -> [1]
w -> [1]
julia> V = [y-x^2, z-x^3]
2-element Vector{fmpq_mpoly}:
-x^2 + y
-x^3 + z
julia> homogenization(V, "w")
2-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
w*y - x^2
w^2*z - x^3
julia> I = ideal(R, V)
ideal(-x^2 + y, -x^3 + z)
julia> PTC = homogenization(I, "w")
ideal(-x*z + y^2, -w*z + x*y, -w*y + x^2)
julia> parent(PTC[1])
Multivariate Polynomial Ring in w, x, y, z over Rational Field graded by
w -> [1]
x -> [1]
y -> [1]
z -> [1]
julia> homogenization(I, "w", ordering = deglex(gens(base_ring(I))))
ideal(x*z - y^2, -w*z + x*y, -w*y + x^2, -w*z^2 + y^3)
dehomogenization
— Methoddehomogenization(F::MPolyElem_dec, pos::Int)
Given an element F
of a $\mathbb Z^m$-graded ring, where the generators of $\mathbb Z^m$ are the assigned weights to the variables at positions pos
, $\dots$, pos
$-1+m$, dehomogenize F
using the variables at these positions. Return the result as an element of a polynomial ring not depending on the variables at these positions.
dehomogenization(V::Vector{T}, pos::Int) where {T <: MPolyElem_dec}
Given a vector V
of elements in a common graded polynomial ring, create a polynomial ring not depending on the variables at positions pos
, $\dots$, pos
$-1+m$. Dehomogenize the elements of V
correspondingly, and return the vector of dehomogenized elements.
dehomogenization(I::MPolyIdeal{T}, pos::Int) where {T <: MPolyElem_dec}
Return the dehomogenization of I
in a polynomial ring as above.
Examples
julia> S, (x, y, z) = GradedPolynomialRing(QQ, ["x", "y", "z"])
(Multivariate Polynomial Ring in x, y, z over Rational Field graded by
x -> [1]
y -> [1]
z -> [1], MPolyElem_dec{fmpq, fmpq_mpoly}[x, y, z])
julia> F = x^3-x^2*y-x*z^2
x^3 - x^2*y - x*z^2
julia> f = dehomogenization(F, 1)
-y - z^2 + 1
julia> parent(f)
Multivariate Polynomial Ring in y, z over Rational Field
julia> V = [x*y-z^2, x^2*z-x^3]
2-element Vector{MPolyElem_dec{fmpq, fmpq_mpoly}}:
x*y - z^2
-x^3 + x^2*z
julia> dehomogenization(V, 3)
2-element Vector{fmpq_mpoly}:
x*y - 1
-x^3 + x^2
julia> I = ideal(S, V)
ideal(x*y - z^2, -x^3 + x^2*z)
julia> dehomogenization(I, 3)
ideal(x*y - 1, -x^3 + x^2)
julia> W = [1 2 1 0; 3 4 0 1]
2×4 Matrix{Int64}:
1 2 1 0
3 4 0 1
julia> S, (w, x, y, z) = GradedPolynomialRing(QQ, ["w", "x", "y", "z"], W)
(Multivariate Polynomial Ring in w, x, y, z over Rational Field graded by
w -> [1 3]
x -> [2 4]
y -> [1 0]
z -> [0 1], MPolyElem_dec{fmpq, fmpq_mpoly}[w, x, y, z])
julia> F = w^3*y^3*z^3 + w^2*x*y^2*z^2 + w*x^2*y*z + x^3
w^3*y^3*z^3 + w^2*x*y^2*z^2 + w*x^2*y*z + x^3
julia> dehomogenization(F, 3)
w^3 + w^2*x + w*x^2 + x^3
Generating Special Ideals
katsura
— Methodkatsura(n::Int)
Given a natural number n
returns the Katsura ideal generated by $u_m - \sum_{l=n}^n u_{l-m} u_l$, $1 - \sum_{l = -n}^n u_l$ where $u_{-i} = u_i$, and $u_i = 0$ for $i > n$ and $m \in \{-n, \ldots, n\}$. Also note that indices have been shifted to start from 1.
Examples
julia> katsura(2)
ideal(x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2)
katsura
— Methodkatsura(R::MPolyRing)
Returns the Katsura ideal in the given polynomial ring R
.
Examples
julia> R, _ = QQ["x", "y", "z"]
(Multivariate Polynomial Ring in x, y, z over Rational Field, fmpq_mpoly[x, y, z])
julia> katsura(R)
ideal(x + 2*y + 2*z - 1, x^2 - x + 2*y^2 + 2*z^2, 2*x*y + 2*y*z - y)