Ask Your Question
2

Find expansion of polynomial in an ideal

asked 2020-04-29 21:54:09 +0200

heluani gravatar image

I have a polynomial p and some other polynomials p_1,...,p_k which are elements of a multivariate polynomial ring. Say something like P = PolynomialRing(QQ,'a,b,c,d,e,f,g') . I know that p belongs to the ideal generated by p_1,..,p_k because when I ask for a groebner basis of I I can see explicitly p there. How do I find the expression of p as a linear combination of the p_i's with coefficients in P?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2020-04-30 13:45:05 +0200

rburing gravatar image

You can do this with the lift method of p, passing the ideal I as the argument:

sage: R.<x,y> = QQ[]
sage: I = R.ideal([x-1,y-1])
sage: p = x^2 - y^2 - 2*x + 2*y
sage: c = p.lift(I); c
[x - 1, -y + 1]
sage: sum(c_k*p_k for (c_k,p_k) in zip(c,I.gens()))
x^2 - y^2 - 2*x + 2*y
edit flag offensive delete link more

Comments

I tried in 3d but failed. Why? R.<x,y,z> = QQ[] I=R.ideal([x^2+z^2-1,x^2+z^2+(z^2-1)^2]) p=x^2+(1/2)y^2z-z-1 c=p.lift(I);c ValueError: polynomial is not in the ideal

tunekamae gravatar imagetunekamae ( 2022-05-02 06:01:14 +0200 )edit

That p does not belong to that I, so no valid choice of c exists in that case. Did you make a typing mistake somewhere in your input?

rburing gravatar imagerburing ( 2022-05-02 07:47:41 +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

Stats

Asked: 2020-04-29 21:54:09 +0200

Seen: 257 times

Last updated: Apr 30 '20