Bug(?) in the division of polynomials with the TermOrder('neglex')

39 views
Skip to first unread message

Sho Takemori

unread,
Nov 17, 2016, 9:03:01 PM11/17/16
to sage-support
Dear all,

I created a polynomial ring with the "neglex" term order and computed the division of polynomials as follows.

sage: R.<a> = PolynomialRing(QQ, 1, order=TermOrder('neglex'))
sage: (1/2 + a) / (1 + 2 * a)
1/2 + a

I expected the result was 1/2.
The Sage version is 7.4 and Sage is running on Ubuntu 16.04.

Best regards,
Sho Takemori

Enrique Artal

unread,
Nov 22, 2016, 5:27:58 AM11/22/16
to sage-support
This is an old bug affecting polynomials with local or semilocal orders. The problem is that at some point, the definition of the division by a polynomial checks first if the polynomial is a unit and in that case it identifies it with the constant term. This works for global orderings, but it causes this problems with local ones. Some people suggested to create a new class of rings to take into account that when considering non global rings the actual ring is bigger than the polynomial ring. For me, this is beyond my sage abilities.

Sho Takemori

unread,
Nov 22, 2016, 7:19:37 AM11/22/16
to sage-support
Thank you very much for your explanation. I have seen your post at sage-devel before, but completely forgot it.

I guess it would be better to raise an error or print a message than to return a wrong result, if it is a known bug and not fixed yet.

Sho Takemori

2016年11月22日火曜日 19時27分58秒 UTC+9 Enrique Artal:

Dima Pasechnik

unread,
Nov 22, 2016, 8:40:23 AM11/22/16
to sage-support

On Tuesday, November 22, 2016 at 12:19:37 PM UTC, Sho Takemori wrote:
Thank you very much for your explanation. I have seen your post at sage-devel before, but completely forgot it.

I guess it would be better to raise an error or print a message than to return a wrong result, if it is a known bug and not fixed yet.

In fact, Singular 4.0.3 (now in Sage 7.5.beta3)
does the right thing:

> ring r=0,(a),ls;
> (1/2+a)/(1+2*a);
1/2

(same if I use more variables while defining r, not just one)

Thus I guess Sage does not get from Singular the data right...

Justin C. Walker

unread,
Nov 22, 2016, 1:18:07 PM11/22/16
to sage-s...@googlegroups.com

On Nov 22, 2016, at 05:40 , Dima Pasechnik wrote:

>
> On Tuesday, November 22, 2016 at 12:19:37 PM UTC, Sho Takemori wrote:
>>
>> Thank you very much for your explanation. I have seen your post at
>> sage-devel before, but completely forgot it.
>>
>> I guess it would be better to raise an error or print a message than to
>> return a wrong result, if it is a known bug and not fixed yet.
>>
>
> In fact, Singular 4.0.3 (now in Sage 7.5.beta3)
> does the right thing:
>
>> ring r=0,(a),ls;
>> (1/2+a)/(1+2*a);
> 1/2
>
> (same if I use more variables while defining r, not just one)
>
> Thus I guess Sage does not get from Singular the data right...

I see the same with Singular 3.1.3:
$ Singular
SINGULAR / Development
A Computer Algebra System for Polynomial Computations / version 3-1-3
0<
by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \ March 2011
FB Mathematik der Universitaet, D-67653 Kaiserslautern \
// ** executing /SandBox/Justin/sb/Singular/3-1-3/LIB/.singularrc
> ring R=0,x,dp;
// ** redefining R **
> poly f1=(1/2)+x;
> poly f2=1+2*x;
> f1/f2;
1/2

FWIW.

Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
-----------
I want to die, peacefully in my sleep, like my grandfather;
not screaming in terror, like his passengers.




Enrique Artal

unread,
Nov 26, 2016, 9:28:02 AM11/26/16
to sage-support
I think the problem was not in Singular but in the Sage code for division of polynomials. There is a ticket, https://trac.sagemath.org/ticket/17638. I may help but my skills are not enough to solve the problem.
Reply all
Reply to author
Forward
0 new messages