# Quotient of Polynomial rings reduction not working

 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 close merge delete

Sort by » oldest newest most voted

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

more

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.

1

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

sage: I.reduce??


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