Ask Your Question

polynomial ring over another polynomial ring

asked 2021-05-25 22:40:18 +0200

Tim02130 gravatar image

updated 2021-05-26 01:05:59 +0200

slelievre gravatar image

I'd like to see what one multivariate polynomial $f$ looks like when another one $g$ vanishes, by rewriting the former as $f = r + q g$ and setting $g = 0$. In Maple, one could do that just by computing r = prem( f, g, x ) where x is one of the indeterminates of f and g, which is effectively treating f and g as univariate polynomials over the ring of polynomials in the remaining indeterminates. Unfortunately when I try to do that in Sage it gives me the following error (but perhaps there's a simpler way?).


R.<y, z> = QQ['y, z']
S.<x> = PolynomialRing(R, 'x')
a = x^2*y - x - z


Error in lines 4-4
Traceback (most recent call last):
File "/cocalc/lib/python3.8/site-packages/smc_sagews/",
line 1230, in execute
File "", line 1, in <module>
File "sage/structure/element.pyx", line 493,
in sage.structure.element.Element.__getattr__
return self.getattr_from_category(name)
File "sage/structure/element.pyx", line 506,
in sage.structure.element.Element.getattr_from_category
return getattr_from_other_class(self, cls, name)
File "sage/cpython/getattr.pyx", line 372,
in sage.cpython.getattr.getattr_from_other_class
raise AttributeError(dummy_error_message)
object has no attribute 'reduce'
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-26 01:14:29 +0200

slelievre gravatar image

I assume f is a and g is x*y - z?

If so, maybe this does what you want?

sage: R.<x, y, z> = QQ['x, y, z']

sage: f = x^2*y - x - z
sage: g = x*y - z

sage: J = R.ideal(g)
sage: r = J.reduce(f)
sage: r
x*z - x - z
edit flag offensive delete link more


Not quite; your solution eliminated y, but what if I want to eliminate x? Since as I understand it Sage uses degrevlex order by default, I would've expected it to do that? But in any case, what I want to be able to do is control what gets eliminated, which is easy to do if one treats the polynomial ring Q[x,y,z] as Q[y,z][x] (if we want to eliminate x). Which is want I was trying to do, though Sage choked on it for some reason.

Tim02130 gravatar imageTim02130 ( 2021-05-26 01:31:29 +0200 )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

1 follower


Asked: 2021-05-25 22:40:18 +0200

Seen: 162 times

Last updated: May 26 '21