sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.33k stars 453 forks source link

reduce method of polynomial ideals gives incorrect results #18598

Closed lftabera closed 3 years ago

lftabera commented 9 years ago

Define the following polynomial ring, polynomial, and ideal:

sage: term_order = TermOrder('degrevlex', 2) + TermOrder('degrevlex', 2)
sage: K = PolynomialRing(QQ, 'x,y,a0,a1', order=term_order)
sage: x, y, a0, a1 = K.gens()
sage: f = x**3 + x**2*y
sage: m = Ideal(x**4, x**2*y, y**2)

Before #27508, we get an incorrect reduction:

sage: m.reduce(f) == f.reduce(m.groebner_basis())
False
sage: m.reduce(f)
x^3 + x^2*y
sage: f.reduce(m.groebner_basis())
x^3

Singular computes correctly the reduction as x^3.

The problem is we call singular via libsingular without asking for tail reduction.

This was fixed in #27508, after which we get correct results:

sage: m.reduce(f) == f.reduce(m.groebner_basis())
True
sage: m.reduce(f)
x^3
sage: f.reduce(m.groebner_basis())
x^3

CC: @dimpase

Component: algebra

Keywords: days94

Reviewer: Dima Pasechnik

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

lftabera commented 6 years ago

Changed keywords from none to days94

lftabera commented 6 years ago
comment:2

I am not able to debug this. For me, it seems that this is an error in libsingular and, probably, a duplicate of #12529

videlec commented 6 years ago
comment:3

update milestone 8.3 -> 8.4

mwageringel commented 4 years ago
comment:4

This works correctly in 9.2.beta10, possibly since #27508.

dimpase commented 4 years ago

Reviewer: Dima Pasechnik

dimpase commented 4 years ago
comment:5

indeed

slel commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,10 +1,16 @@
-The following fails
+Define the following polynomial ring, polynomial, and ideal:

-sage: K=PolynomialRing(QQ,'x,y,a0,a1',order=TermOrder('degrevlex',2)+TermOrder('degrevlex',2)) -sage: x,y,a0,a1=K.gens() -sage: f = x3+x2y -sage: m = Ideal(x4,x2y,y2) +sage: term_order = TermOrder('degrevlex', 2) + TermOrder('degrevlex', 2) +sage: K = PolynomialRing(QQ, 'x,y,a0,a1', order=term_order) +sage: x, y, a0, a1 = K.gens() +sage: f = x3 + x2y +sage: m = Ideal(x4, x2y, y2) + + +Before #27508, we get an incorrect reduction: + + sage: m.reduce(f) == f.reduce(m.groebner_basis()) False sage: m.reduce(f) @@ -13,4 +19,19 @@ x^3


-The reduction should be `x^3`. Singular computes correctly the reduction, so the problem is in the Sage library.
+Singular computes correctly the reduction as `x^3`.
+
+The problem is we call singular via libsingular without
+asking for tail reduction.
+
+This was fixed in #27508, after which we get correct results:
+
+```
+sage: m.reduce(f) == f.reduce(m.groebner_basis())
+True
+sage: m.reduce(f)
+x^3
+sage: f.reduce(m.groebner_basis())
+x^3
+```
+