Ask Your Question
1

Quotient of Polynomial rings reduction not working

asked 2015-06-09 15:44:26 +0100

Wizq gravatar image

updated 2015-06-09 16:45:17 +0100


R.<x>=PolynomialRing(QQ)
R.ideal(x^4).reduce(x^8+1)
R.<x>=PolynomialRing(ZZ)
R.ideal(x^4).reduce(x^8+1)

1 x^8 + 1

Why am I not getting the result 1 in both cases?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-06-09 16:58:59 +0100

tmonteil gravatar image

updated 2015-06-09 17:03:15 +0100

It seems that in the second case, the .reduce() method is the generic one which is just:

def reduce(self, f):
    r"""
    Return the reduction of the element of `f` modulo ``self``.

    This is an element of `R` that is equivalent modulo `I` to `f` where
    `I` is ``self``.

    EXAMPLES::

        sage: ZZ.ideal(5).reduce(17)
        2
        sage: parent(ZZ.ideal(5).reduce(17))
        Integer Ring
    """
    return f       # default

If you want a better reduction in this particular case, you can put the polynomial in the quotient and lift it:

sage: R.<x>=PolynomialRing(ZZ)
sage: I = R.ideal(x^4)
sage: R.quotient(I)(x^8+1).lift()
1
edit flag offensive delete link more

Comments

Thank you very much for your answer. I googled the commented code and found the source code, and I now understand why it wasn't working as expected. Since I'm working with a slightly more complicated ring than this (Z[x]/poly1/poly2), I am now trying to use overriding and inheritance (of PolynomialQuotientRing and QuotientRing, I hope that "_domain_with_category" isn't significant for this) to obtain the behaviour that I want (reduce, quo_rem...). Thank you.

Wizq gravatar imageWizq ( 2015-06-09 18:37:33 +0100 )edit
1

Note that, you can access directly to the source code of a method with two question marks:

sage: I.reduce??
tmonteil gravatar imagetmonteil ( 2015-06-09 19:13:40 +0100 )edit

I didn't know that, and it's going to help me tremendously. Thank you!

Wizq gravatar imageWizq ( 2015-06-09 19:57:59 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-06-09 15:44:26 +0100

Seen: 628 times

Last updated: Jun 09 '15