# How to express Groebner Basis in terms of original elements?

I have polynomials {A1,B1} and then I find their Groebner basis to be {g1,g2,g3,g4}.

Is there a way for me to express each polynomial g1,g2,g3,g4 in terms of A1, B1? (ie have g1= h1 A1 + h2 B1 where h1,h2 are some polynomial)

I also have the following relation(if it helps), where {k1,k3,j1,j2,j3} are polynomials.

A1 = k1 g1 + k3 g3

B1 = j1 g1 + j2 g2 + j3 g3

Side note: The answer in the similar post was for a different question, and the article linked was too difficult for me to understand and use. Any help would be greatly appreciated.

Edit: Example Request

$A1=-\frac{(M - t)^2 (M + t)^2 (-1 + M t) (1 + M t) (M^2 + t^2)^2 (1 + M^2 t^2)}{M^6 t^6}$

$B1=-\frac{(-1 + M) (1 + M) (1 + M^2) (M - t) (M + t) (-1 + M t) (1 + M t) (M^2 + t^2) (1 + M^2 t^2) (-M^4 + t^4 - M^2 t^4 - M^6 t^4 + M^8 t^4 - M^4 t^8)}{M^{10} t^8}$

The solution given by Michael works wonderfully once I get rid of the denominator. (Though I will have to see whether this affects my problem or not.)

• Duplicate of this? Also, an explicit example would be helpful here. – Daniel Lichtblau Feb 3 '18 at 22:22
• @DanielLichtblau Yes it is a duplicate, but if you read the answer you will see that the original question was not answered. The article that was also linked, I could sadly not understand it. I just want want to express g1,g2,g3,g4 in terms of A1,B1. I am thinking this should be possible since g1,g2,g3,g4 are the groebner basis to A1,B1. – Andy Nguyen Feb 3 '18 at 23:12
• Umm, what about an example? – Daniel Lichtblau Feb 3 '18 at 23:31
• @DanielLichtblau Thanks for the suggestion, I was not sure if people liked explicit examples or not. I put my problem in the edit. – Andy Nguyen Feb 4 '18 at 18:32
• We not only like explicit examples, we really need them. In cut-and-pastable form. – Daniel Lichtblau Feb 4 '18 at 23:41

bas = {x^2 + y^2 + z^2 - 1, x - 2 y^3 - 3};
{gb, mat} = GroebnerBasisBasisAndConversionMatrix[bas, {x,y,z}, {}]
`
• @AndyNguyen I'm not sure. A copy-pastable example (code, not TeX), would make it easier to try out ideas. It seems like the monomial ordering of $1/t^{-1}, 1/t^{-2}$ is the opposite of $t,1$ in $(t+1)/t^2$ (for the purposes of a Gröbner basis). – Michael E2 Feb 7 '18 at 0:44