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_maximal is broken #10934

Closed
jhpalmieri opened this issue Mar 14, 2011 · 5 comments
Closed

is_maximal is broken #10934

jhpalmieri opened this issue Mar 14, 2011 · 5 comments

Comments

@jhpalmieri
Copy link
Member

The method "is_maximal" in sage/rings/ideal.py is broken:

sage: R = IntegerModRing(8)
sage: R.principal_ideal(0).is_maximal()
True
sage: R.principal_ideal(2).is_maximal()
True
sage: R.principal_ideal(4).is_maximal()
True

Admittedly, the docstring does say

TODO: Make self.is_maximal() work! Write this code!

but we need a trac ticket for this. The comments in the code are not right, either:

        kd = self.ring().krull_dimension()
        if kd == 0: # every non-trivial ideal is maximal

This appears to be false, as the example above (Z/8Z) illustrates. It would be true if the ring were an integral domain (because Krull dimension 0 + integral domain = field). Alternatively, it would be true if the ideal were prime, but we have limited primality testing right now, so this is not the best way to go: with R as above, R.principal_ideal(2).is_prime() raises a NotImplementedError. Next:

        elif kd == 1 and self.ring().is_integral_domain(): # every nontrivial ideal is maximal
            return self.is_prime()

The comment should say "every nontrivial prime ideal is maximal, so the code is right but the comment isn't.

Component: algebra

Keywords: maximal ideal

Author: John Palmieri

Reviewer: Simon Spicer

Merged: sage-4.7.alpha5

Issue created by migration from https://trac.sagemath.org/ticket/10934

@jhpalmieri
Copy link
Member Author

comment:1

Attachment: trac_10934-is-maximal.patch.gz

Here's a patch: apply

  • trac_10934-is-maximal.patch

All tests pass for me on sage.math.

@haikona
Copy link
Mannequin

haikona mannequin commented Mar 25, 2011

Author: John Palmieri

@haikona
Copy link
Mannequin

haikona mannequin commented Mar 25, 2011

Reviewer: Simon Spicer

@haikona
Copy link
Mannequin

haikona mannequin commented Mar 25, 2011

comment:2

All tests pass for me too, and the code behaves as intended on all the examples I could think of. Positive review.

Since this is only a partial implementation of is_maximal() i.e. only for quotient rings of ZZ, should we open a separate ticket for implementing this over general rings? Or does such a ticket already exist?

@jdemeyer
Copy link

Merged: sage-4.7.alpha5

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

No branches or pull requests

3 participants