#10934: is_maximal is broken
--------------------------+-------------------------------------------------
Reporter: jhpalmieri | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.7
Component: algebra | Keywords: maximal ideal
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
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.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10934>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.