1 | initial version |
This answer ignores completely the Groebner basis. Just "lift" the corresponding element.
In an example:
R.<x,y,z> = QQ[]
f1, f2, f3 = (x + y + z)^2, x*y + y*z + z*x, x^3 + y^3 + z^3
J = R.ideal([f1, f2, f3])
h = x*y*z
print("Is h in J? {}".format(h in J))
q1, q2, q3 = h.lift(J)
print(f"q1 = {q1}\nq2 = {q2}\nq3 = {q3}")
This gives:
Is h in J? True
q1 = -1/3*x - 1/3*y - 1/3*z
q2 = x + y + z
q3 = 1/3
We have
sage: h == f1*q1 + f2*q2 + f3*q3
True
The line answering the question is q1, q2, q3 = h.lift(J)
.