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

is_prime buggy for multivariate polynomial rings #2427

Closed
simonbrandhorst opened this issue May 28, 2023 · 4 comments
Closed

is_prime buggy for multivariate polynomial rings #2427

simonbrandhorst opened this issue May 28, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@simonbrandhorst
Copy link
Collaborator

By definition the (1) ideal is never prime.
Yet:

julia> R,x = polynomial_ring(QQ,2);

julia> I = ideal(R,[1])
ideal(1)

julia> is_prime(I)
true

The reason is that

julia> minimal_primes(I)
1-element Vector{MPolyIdeal{QQMPolyRingElem}}:
 ideal(1)

Refuses to return an empty list but instead returns a non-prime ideal.
(Matching its documentation, so it is not a bug.)
In any case I would suggest to rather return only prime ideals,
even if it means that you cannot do
intersect(minimal_primes(I)) (if the return value is the empty array). One can still do something like
intersect(minimal_primes(I), init=R) instead.
We have the same situation when we sum the elements of an array.
@wdecker

@simonbrandhorst simonbrandhorst added the bug Something isn't working label May 28, 2023
@fingolfin fingolfin changed the title is_prime buggy for multivarite polynomial rings is_prime buggy for multivariate polynomial rings Jun 14, 2023
@fingolfin
Copy link
Member

We discussed this today and agreed that minimal_primes should return an empty vector in this case. Moreover, there are other functions that may suffer from similar problems, so we should check those as well. E.g. this is also questionable:

julia> primary_decomposition(I)
1-element Vector{Tuple{MPolyIdeal{QQMPolyRingElem}, MPolyIdeal{QQMPolyRingElem}}}:
 (ideal(1), ideal(1))

There are further considerations (e.g. maybe primary_decomposition should return a special type; or should always include a "unit factor" etc.) but that goes beyond the point here.

@fingolfin
Copy link
Member

@wdecker agreed to work on this. Meaning: just changing minimal_primes as discussed, verifying is_prime now works, perhaps adding a test. And depending on his time also look for other problematic commands that need similar fixes.

wdecker added a commit that referenced this issue Jun 15, 2023
simonbrandhorst pushed a commit that referenced this issue Jun 18, 2023
* addresseing Issue #2427

---------

Co-authored-by: Matthias Zach <85350711+HechtiDerLachs@users.noreply.github.com>
Co-authored-by: anne <anne@krueger-berg.de>
@wdecker
Copy link
Collaborator

wdecker commented Jun 18, 2023

Solved with PR #2473

@wdecker wdecker closed this as completed Jun 18, 2023
@simonbrandhorst
Copy link
Collaborator Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants