# Ticket #10708(new defect)

Opened 2 years ago

## Ideal dimension wrong, depends on term order.

Reported by: Owned by: vbraun malb major commutative algebra Singular ideal dimension Bouillaguet, malb, mstreng N/A

### Description

The dimension of an ideal, that is the Krull dimension of the quotient R/I, does not depend on the monomial order. But

```sage: P.<x,y> = PolynomialRing(QQ,order='neglex')
sage: P.ideal(x).dimension()
1
sage: P.ideal(x-1).dimension()
-1
```

I think this uses Singular "ls" ordering which is related to the localization at <x,y> though I have never used (or properly understood) that functionality in Singular.

Maybe we need to change the term order to a global one internally?

## Change History

### comment:1 Changed 7 months ago by Bouillaguet

More fundamentally, a (Krull) dimension should not be negative, should it?

### comment:2 Changed 7 months ago by vbraun

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...

### comment:3 Changed 7 months ago by Bouillaguet

Apparently some other things go wrong :

```sage: P.<x,y> = PolynomialRing(QQ,order='neglex')
sage: 1 in P.ideal(x-1)
True
sage: P.ideal(x-1).groebner_basis()
[1]
```

This is obviously crazy. And membership inside an ideal should not depend on the term order:

```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]
```
Last edited 7 months ago by Bouillaguet (previous) (diff)

### comment:4 Changed 7 months ago by Bouillaguet

• Owner changed from AlexGhitza to malb
• Component changed from algebra to commutative algebra

### comment:5 Changed 7 months ago by Bouillaguet

The problem could be caused by the fact that neglex is not a "monomial order" in the usual sense, as it is not Well-founded:

```sage: R.<x,y> = PolynomialRing(QQ, order='neglex')
sage: 1 > x > x^2 > x^3 > x^4
True
```

This clearly is an infinite descending chain.

### comment:6 Changed 7 months ago by vbraun

Thats definitely the problem, but how to fix it?

### comment:7 Changed 7 months ago by Bouillaguet

More generally, it seems that the problem occurs with all the "negated" term orders.

```sage: P.<x,y> = PolynomialRing(QQ,order='neglex')
sage: P.ideal(x-1).groebner_basis()
[1]
```

With "negdegrevlex":

```sage: P.<x,y> = PolynomialRing(QQ,order='negdegrevlex')
sage: P.ideal(x-1).groebner_basis()
[1]
```

With "negdeglex":

```sage: P.<x,y> = PolynomialRing(QQ,order='negdeglex')
sage: P.ideal(x-1).groebner_basis()
[1]
```

With "negwdegrevlex"

```sage: P.<x,y> = PolynomialRing(QQ, order=TermOrder('negwdegrevlex',(1,2)))
sage: P.ideal(x-1).groebner_basis()
[1]
```

Digging deeper into this, it seems that we imported from singular the concepts of global and local 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).

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 I.groebner_basis if the underlying term-order is not "global"...

Opinions?

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  singular documentation on term orderings, which is much more explicit and less confusing about all this.

### comment:8 Changed 7 months ago by mstreng

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 [1] with dimension -1 makes complete sense, as the ideal is the unit ideal locally at (0,0).

I don't know about the design of these PolynomialRing objects with "order=", 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?

### comment:9 Changed 7 months ago by Bouillaguet

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 I, 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.

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.

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.

### comment:10 Changed 7 months ago by Bouillaguet

In fact, we have two options :

• 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).
• 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 Localization=True flag to the PolynomialRing 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.

I vote for the second one...

Charles

Note: See TracTickets for help on using tickets.