Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

GB for I=ideal(x^3-3*x^2-y+1,-x^2+y^2-1) leaves out a further step.

asked 3 years ago

tunekamae gravatar image

updated 3 years ago

slelievre gravatar image

I am looking for an example of solving multivariate polynomials using Groebner basis.

I found a sample solved with GAP.

gap> ideal := [x^3-3*x^2-y+1, -x^2+y^2-1];;
gap> G := ReducedGroebnerBasis(ideal, lex);;
gap> Display(G);
[ y^5+y^4-11*y^3-17*y^2+9*y+17, -y^4+x*y+11*y^2-x+3*y-13, x^2-y^2+1 ]

In Sage, I tried and got

sage: R.<x, y> = QQ[]
sage: R = PolynomialRing(QQ, 'x, y')
sage: x, y = R.gens()
sage: I = ideal(x^3 - 3*x^2 - y + 1, -x^2 + y^2 - 1)
sage: I
Ideal (x^3 - 3*x^2 - y + 1, -x^2 + y^2 - 1) of Multivariate Polynomial Ring in x, y over Rational Field
sage: B = I.groebner_basis()
sage: B
[y^4 - x*y - 11*y^2 + x - 3*y + 13, x*y^2 - 3*y^2 - x - y + 4, x^2 - y^2 + 1]

I could manipulate to get what GAP gives from what I got in Sage.

Is there a way to eliminate x in the first poly automatically?

Preview: (hide)

Comments

Welcome to Ask Sage! Thank you for your question.

slelievre gravatar imageslelievre ( 3 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 3 years ago

rburing gravatar image

Whenever the monomial/term ordering is fixed, the reduced Groebner basis of an ideal is unique (up to reordering of the list of elements). In GAP you used the lexicographic ordering, and in SageMath you didn't specify a monomial ordering, so it used the default of degrevlex, which is not lex, so you got a different result. Here is how to specify the monomial ordering (and get the same result as in GAP, up to reordering):

sage: R.<x, y> = PolynomialRing(QQ, order='lex')
sage: I = R.ideal(x^3 - 3*x^2 - y + 1, -x^2 + y^2 - 1)
sage: I.groebner_basis()
[x^2 - y^2 + 1, x*y - x - y^4 + 11*y^2 + 3*y - 13, y^5 + y^4 - 11*y^3 - 17*y^2 + 9*y + 17]

Or conversely, use GAP to get the same result as in SageMath, by choosing the degrevlex (a.k.a. grevlex) monomial ordering:

gap> R := PolynomialRing(Rationals, [ "x", "y" ]);;
gap> x := IndeterminatesOfPolynomialRing(R)[1];;
gap> y := IndeterminatesOfPolynomialRing(R)[2];;
gap> degrevlex := MonomialGrevlexOrdering(x,y);;
gap> ideal := [x^3-3*x^2-y+1, -x^2+y^2-1];;
gap> G := ReducedGroebnerBasis(ideal, degrevlex);;
gap> Display(G);
[ x^2-y^2+1, x*y^2-3*y^2-x-y+4, y^4-x*y-11*y^2+x-3*y+13 ]
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 3 years ago

Seen: 224 times

Last updated: Feb 27 '22