Ask Your Question

Revision history [back]

You should work modulo the ideal generated by the $x_i^2-x_i$:

sage: R = PolynomialRing(QQ,3,'x') ; R
Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
sage: R.inject_variables()
Defining x0, x1, x2
sage: I = R.ideal([m^2-m for m in R.gens()]) ; I
Ideal (x0^2 - x0, x1^2 - x1, x2^2 - x2) of Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
sage: P = x1^2*x2^4 + 7*x0*x1^4*x2^5 - 12*x0*x2^7 ; P
7*x0*x1^4*x2^5 - 12*x0*x2^7 + x1^2*x2^4
sage: P.mod(I)
7*x0*x1*x2 - 12*x0*x2 + x1*x2