f.reduce(I) output is incorrect for lex order (tail reduction is forgotten)

41 views
Skip to first unread message

Ricardo Buring

unread,
Apr 17, 2020, 8:58:22 AM4/17/20
to sage-devel
Dear sage-devel,

Consider the following example, sent to me by Theo de Jong (Mainz):

    sage: R.<x,y> = PolynomialRing(QQ, order='lex')
    sage: I = R.ideal([x^2 + y^3 - 2*y^2, x*y^2 - 3*x*y + x, y^4 - 3*y^3 + y^2])
    sage: f = x^2*y + x*y^2
    sage: f.reduce(I)
    3*x*y - x - y^4 + 2*y^3

This remainder r is incorrect, because (according to the documentation) "No term in r is divisible by any of the leading monomials of I", while we clearly see y^4.
The basis is a Groebner basis, and reduction with respect to the list of polynomials gives the correct result:

    sage: I.basis_is_groebner()
    True
    sage: G = I.gens()
    sage: f.reduce(G)
    3*x*y - x - y^3 + y^2

The problem seems to be that tail reduction is (unintentionally) turned off in case the ordering is lex and reduction is done w.r.t. an ideal, as previously reported here: https://trac.sagemath.org/ticket/27508
As suggested by Dima Pasechnik, a workaround is to use the Singular notation 'lp' instead of 'lex'.
Evidently, the problem lies in the communication between SageMath and (lib)Singular.
Possible solutions (some with patches) are mentioned in the trac ticket (and the required changes seem relatively minor), but apparently have not been implemented yet.
Having to work around this bug in an educational setting is frustrating. Is there a hero on sage-devel able and willing to work on a fix?

Best regards,
Ricardo

Dima Pasechnik

unread,
Apr 17, 2020, 10:04:10 AM4/17/20
to sage-devel
I think this is
https://trac.sagemath.org/ticket/27508
which needs an effort to fix, as it's far from easy.


>
> Best regards,
> Ricardo
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/1ea251d3-0437-4d5c-8640-d5e0cdb628f8%40googlegroups.com.

Ricardo Buring

unread,
Apr 17, 2020, 11:18:46 AM4/17/20
to sage-devel
On Friday, April 17, 2020 at 4:04:10 PM UTC+2, Dima Pasechnik wrote:
I think this is
https://trac.sagemath.org/ticket/27508
which needs an effort to fix, as it's far from easy.


Dear Dima,

If I'm not mistaken: For the documentation of SageMath's reduce to become correct ("No term in r is divisible by any of the leading monomials of I") tail reduction should always be done.
My impression is that your two-line patch https://trac.sagemath.org/ticket/27508#comment:36 achieves this and hence fixes the issue.
(One could consider changing the documentation of reduce, but still the variant which it currently describes seems to me the most common interpretation.)
The rest of the discussion seems to be about how to use the (lib)Singular interface better, which would be more elegant, but it seems not essential for fixing this issue.

Best wishes,
Ricardo

Dima Pasechnik

unread,
Apr 17, 2020, 11:25:16 PM4/17/20
to sage-devel
Beste Ricardo,

AJB, zie https://trac.sagemath.org/ticket/27508#comment:50

mvg
Dima
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/884eeb2c-2831-4241-8c76-0eb0ef314ca2%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages