Sage: Ticket #10708: Ideal dimension wrong, depends on term order.
https://trac.sagemath.org/ticket/10708
<p>
The dimension of an ideal, that is the Krull dimension of the quotient <code>R/I</code>, does not depend on the monomial order. But
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ,order='neglex')
sage: P.ideal(x).dimension()
1
sage: P.ideal(x-1).dimension()
-1
</pre><p>
I think this uses Singular "ls" ordering which is related to the localization at <code><x,y></code> though I have never used (or properly understood) that functionality in Singular.
</p>
<p>
Maybe we need to change the term order to a global one internally?
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/10708
Trac 1.1.6BouillaguetTue, 13 Nov 2012 11:24:49 GMTcc set
https://trac.sagemath.org/ticket/10708#comment:1
https://trac.sagemath.org/ticket/10708#comment:1
<ul>
<li><strong>cc</strong>
<em>Bouillaguet</em> added
</li>
</ul>
<p>
More fundamentally, a (Krull) dimension should not be negative, should it?
</p>
TicketvbraunTue, 13 Nov 2012 17:35:19 GMT
https://trac.sagemath.org/ticket/10708#comment:2
https://trac.sagemath.org/ticket/10708#comment:2
<p>
Well I don't mind denoting the dimension of the emtpy set at -1. Or, in this case, the supremum of the lengths of the elements of the empty set. Its of course more a matter of definition...
</p>
TicketBouillaguetWed, 14 Nov 2012 08:31:25 GMT
https://trac.sagemath.org/ticket/10708#comment:3
https://trac.sagemath.org/ticket/10708#comment:3
<p>
Apparently some other things go wrong :
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ,order='neglex')
sage: 1 in P.ideal(x-1)
True
sage: P.ideal(x-1).groebner_basis()
[1]
</pre><p>
This is obviously crazy. And membership inside an ideal should not depend on the term order:
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ)
sage: sage: 1 in P.ideal(x-1)
False
sage: sage: P.ideal(x-1).groebner_basis()
[x - 1]
</pre>
TicketBouillaguetWed, 14 Nov 2012 08:47:15 GMTowner, cc, component changed
https://trac.sagemath.org/ticket/10708#comment:4
https://trac.sagemath.org/ticket/10708#comment:4
<ul>
<li><strong>owner</strong>
changed from <em>AlexGhitza</em> to <em>malb</em>
</li>
<li><strong>cc</strong>
<em>malb</em> <em>mstreng</em> added
</li>
<li><strong>component</strong>
changed from <em>algebra</em> to <em>commutative algebra</em>
</li>
</ul>
TicketBouillaguetWed, 14 Nov 2012 09:07:07 GMT
https://trac.sagemath.org/ticket/10708#comment:5
https://trac.sagemath.org/ticket/10708#comment:5
<p>
The problem <em>could</em> be caused by the fact that <code>neglex</code> is not a "monomial order" in the usual sense, as it is not Well-founded:
</p>
<pre class="wiki">sage: R.<x,y> = PolynomialRing(QQ, order='neglex')
sage: 1 > x > x^2 > x^3 > x^4
True
</pre><p>
This clearly is an infinite descending chain.
</p>
TicketvbraunWed, 14 Nov 2012 10:29:00 GMT
https://trac.sagemath.org/ticket/10708#comment:6
https://trac.sagemath.org/ticket/10708#comment:6
<p>
Thats definitely the problem, but how to fix it?
</p>
TicketBouillaguetWed, 14 Nov 2012 11:24:12 GMT
https://trac.sagemath.org/ticket/10708#comment:7
https://trac.sagemath.org/ticket/10708#comment:7
<p>
More generally, it seems that the problem occurs with all the "negated" term orders.
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ,order='neglex')
sage: P.ideal(x-1).groebner_basis()
[1]
</pre><p>
With "negdegrevlex":
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ,order='negdegrevlex')
sage: P.ideal(x-1).groebner_basis()
[1]
</pre><p>
With "negdeglex":
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ,order='negdeglex')
sage: P.ideal(x-1).groebner_basis()
[1]
</pre><p>
With "negwdegrevlex"
</p>
<pre class="wiki">sage: P.<x,y> = PolynomialRing(QQ, order=TermOrder('negwdegrevlex',(1,2)))
sage: P.ideal(x-1).groebner_basis()
[1]
</pre><p>
Digging deeper into this, it seems that we imported from singular the concepts of <em>global</em> and <em>local</em> orderings. The global ones match my own understanding of what a "monomial order" is. In singular they also allow a generalization thereof, by dropping the well-foundedness requirement (the "local" orderings are those such that 1 > x).
</p>
<p>
Pretty much everything will eventually rely on the groebner basis computation routine, which apparently only works properly on "global" orderings. So a cheap fix would consist in raising an exception in <code>I.groebner_basis</code> if the underlying term-order is not "global"...
</p>
<p>
Opinions?
</p>
<p>
In fact, the page of the reference manual on term orderings specifies which orders are "global", but it does not specify what this means (this notion is not present in the textbooks I used to work with, and I suspect that some users won't know about it). It does not say that most routines are broken on the non-global orders. This could possibly be confusing to some users. We should at least mimic the <a class="ext-link" href="http://www.singular.uni-kl.de/Manual/latest/sing_801.htm"><span class="icon"></span>singular documentation on term orderings</a>, which is much more explicit and less confusing about all this.
</p>
TicketmstrengWed, 14 Nov 2012 11:44:09 GMT
https://trac.sagemath.org/ticket/10708#comment:8
https://trac.sagemath.org/ticket/10708#comment:8
<p>
I assume "local" here means "locally around (0,0)" (which is the only interpretation of the word "local" that makes sense to me in this context). Then these algorithms are not for the ring QQ[x,y], but for the localization (or maybe the completion) of that ring at (x,y), i.e., these algorithms assume that all polynomials f with f(0,0)!=0 are invertible. So the Groebner basis <code>[1]</code> with dimension -1 makes complete sense, as the ideal is the unit ideal locally at (0,0).
</p>
<p>
I don't know about the design of these PolynomialRing objects with "<code>order=</code>", and I don't know how Singular works, so I don't know whether what happens here is "wrong". Maybe the functionality of the local orderings is in the wrong place? Or maybe even though it only makes sense mathematically for localizations, it is a function of polynomials for efficiency reasons?
</p>
TicketBouillaguetWed, 14 Nov 2012 12:37:27 GMT
https://trac.sagemath.org/ticket/10708#comment:9
https://trac.sagemath.org/ticket/10708#comment:9
<p>
While this "functionality" may have some use, it is very confusing. The content of an ideal should not depend on the term order. Either a given polynomial belongs to <code>I</code>, or it doesn't --- the order plays no role here. However, currently we allow the counter-intuitive example in comment 3, where the term order influences the content of an ideal.
</p>
<p>
This (indirectly) surprised vbraun, the original author of the ticket, and I don't like it either. It looks like a computational hack is exposed to the user, and messes with the usual mathematical definitions.
</p>
<p>
If the functionality is useful, we should probably not remove it, but we should at least be very explicit that contrarily to what one would expect following the usual textbooks, some orders will change the contents of your ideals.
</p>
TicketBouillaguetSat, 24 Nov 2012 08:53:16 GMT
https://trac.sagemath.org/ticket/10708#comment:10
https://trac.sagemath.org/ticket/10708#comment:10
<p>
In fact, we have two options :
</p>
<ul><li>either we close this ticket as invalid, acknowledging that the use of "local" orders is fine, and that users should know what they are doing (i.e. the singular approach).
</li></ul><ul><li>or we prevent users from using "local" orders in the same way they would use normal orders (for instance by requesting them to explicitly pass a <code>Localization=True</code> flag to the <code>PolynomialRing</code> constructor). This way, our intuitive understanding of most properties (e.g., the ideal dimension, or content) would not depend on the term order, unless the user explicitly says so.
</li></ul><p>
I vote for the second one...
</p>
<p>
Charles
</p>
TicketnbruinThu, 19 Feb 2015 17:34:27 GMT
https://trac.sagemath.org/ticket/10708#comment:11
https://trac.sagemath.org/ticket/10708#comment:11
<p>
I concur that "neglex" should not be allowed as a term order on a *polynomial ring*. Instead, we can have <code>LocalPolynomialRing</code> or something similar that interfaces somehow with this functionality in singular.
</p>
<p>
This looks like an abuse of terminology on the side of Singular. Probably one that is algorithmically very advantageous for them, but you clearly need to work very carefully with these rings, because there are now "units" in the ring for which the inverse is not expressible in the representation used:
</p>
<pre class="wiki">sage: R.<x,y>=PolynomialRing(QQ,order='neglex')
sage: (1+x).is_unit()
True
sage: 1/(1+x)
1
sage: (1+x) * (1/(1+x))
1 + x
</pre><p>
I am sure the functionality in singular is very useful, but we can't expose it in the way we're doing here.
</p>
TicketjakobkroekerThu, 19 Feb 2015 18:19:41 GMTcc changed
https://trac.sagemath.org/ticket/10708#comment:12
https://trac.sagemath.org/ticket/10708#comment:12
<ul>
<li><strong>cc</strong>
<em>jakobkroeker</em> added
</li>
</ul>
TicketsoehmsMon, 13 Apr 2020 07:15:39 GMT
https://trac.sagemath.org/ticket/10708#comment:13
https://trac.sagemath.org/ticket/10708#comment:13
<p>
See new discussion about this on <a class="ext-link" href="https://groups.google.com/forum/#!topic/sage-devel/nDoUXqpJ6OU"><span class="icon"></span>sage-devel</a>.
</p>
Ticket