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

Support basic Ideal properties #2038

Closed
wardjm opened this issue Mar 16, 2025 · 2 comments
Closed

Support basic Ideal properties #2038

wardjm opened this issue Mar 16, 2025 · 2 comments

Comments

@wardjm
Copy link

wardjm commented Mar 16, 2025

Suggestion: copy what Sage does to answer questions about basic Ideal properties.

R.<z> = PolynomialRing(FiniteField(7))
P = Ideal(R, z^4-1,z^3-3*z^2+3*z-1)
P.is_principle()
True

Sage has

  • is_principle
  • is_prime
  • is_primary
  • is_maximal
  • is_idempotent
  • is_reducible? -- I don't see this one in tab-completion, but it could be nice to have

Knowing these properties can likely speed up other algorithms as well.

@fingolfin
Copy link
Member

Hi, thanks for your interest!

This package is mostly focus on providing some general interfaces for algebraic structures, plus some toy implementations of them primarily for testing purposes.

There isn't even a general ideal type in this package (just one for euclidean domains, so necessarily all of those would be principal ideals). To implement functions like is_prime would require adding a lot of functionality that doesn't fit into this interface package. The best this can therefore could do is add stubs for these functions (although I am not sure what is_reducible

Instead, perhaps have a look at Oscar.jl which has

  • is_prime and is_primary for ideals in multivariate rings
  • is_irreducible (the more common negation of your proposed is_reducible) for polynomials
    • but not for ideals there, I am not sure how hard it would be to implement; do you have a concrete use case?
  • no is_principle but probably mostly because nobody needed it, should be easy to add
  • no is_maximal -- IIRC this can be tricky in general but perhaps could be added, do you have a concrete use case?
  • I don't know what an idempotent ideal is: perhaps one where I^2=I holds? Then of course that can be tested like that; I don't know if there are better algorithms for that. Someone could investigate if there is (you guessed it) a concrete use case ;-)

Some examples:

julia> R, (z,) = polynomial_ring(QQ,[:z])
(Multivariate polynomial ring in 1 variable over QQ, QQMPolyRingElem[z])

julia> I = ideal(R, [z^4-1,z^3-3*z^2+3*z-1])
Ideal generated by
  z^4 - 1
  z^3 - 3*z^2 + 3*z - 1

julia> is_prime(I)
true

julia> is_primary(I)
true

julia> is_irreducible(z^2)
false

julia> is_irreducible(z^2+1)
true

julia> I^2 == I
false

This is all with a multivariate polynomial ring in one variable. Annoyingly not much seems to be there yet for the true univariate case. It shouldn't be hard to add that (to Hecke, I guess, @thofma ? should I ask one of our students to work on it?)

julia> R, z = QQ[:z]
(Univariate polynomial ring in z over QQ, z)

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

julia> is_prime(I)
ERROR: MethodError: no method matching is_prime(::Hecke.PIDIdeal{QQPolyRingElem})
The function `is_prime` exists, but no method is defined for this combination of argument types.

julia> I^2  # oops
ERROR: MethodError: no method matching ^(::Hecke.PIDIdeal{QQPolyRingElem}, ::Int64)
The function `^` exists, but no method is defined for this combination of argument types.

julia> I*I == I
false

I've submitted a patch with the missing ^ in thofma/Hecke.jl#1813 for the other methods it'll take a bit more time.

@fingolfin
Copy link
Member

Some more partial progress in thofma/Hecke.jl#1825

In general this issue here however is part of the older issue #1733 so I am going to close this here and add some more details there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants