Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal associated primes #3705

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
18 changes: 18 additions & 0 deletions src/Rings/mpoly-ideals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,24 @@ function minimal_primes(I::MPolyIdeal; algorithm::Symbol = :GTZ, cache::Bool=tru
return V
end

@doc raw"""
function minimal_primes_zero_dim(I::MPolyIdeal{QQPolyRingElem})

Return a vector containing the minimal associated prime ideals of `I`.

Calls a modular variant of `minimal_primes` for zero dimensional ideals over a polynomial ring
with coefficient ring over the rationals.

No input checks. It is unclear if there exists input where this variant is
faster than just calling `minimal_primes` directly.
"""
function minimal_primes_zero_dim(I::MPolyIdeal{QQMPolyRingElem})
R = base_ring(I)
L = Singular.LibAssprimeszerodim.assPrimes(singular_generators(I))
result = typeof(I)[ideal(R, q) for q in L]
return result
end

# rerouting the procedure for minimal primes this way leads to
# much longer computations compared to the flattening of the coefficient
# field implemented above.
Expand Down
6 changes: 6 additions & 0 deletions test/Rings/mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ end
l = minimal_primes(i, algorithm=:charSets)
@test length(l) == 2
@test l[1] == i1 && l[2] == i2 || l[1] == i2 && l[2] == i1

I1 = ideal(R,[x-1,y-1,z-1])
I2 = ideal(R,[x^2+1,y^2+1,z])
J = intersect(I1,I2)
@test length(Oscar.minimal_primes_zero_dim(J))==3

R, (a, b, c, d) = polynomial_ring(ZZ, [:a, :b, :c, :d])
i = ideal(R, [R(9), (a+3)*(b+3)])
i1 = ideal(R, [R(3), a])
Expand Down
Loading