restart QQ[x_1..x_5] R = QQ[x,y,z] -- default is GRevLex R = QQ[x,y,z,MonomialOrder=>Lex] help "monomial orderings" viewHelp "monomial orderings" f = random(3,R) -- random homogeneous polynomial of degree 3 R1 = QQ[x,y,z,Weights=>{2,1,3}] R2 = QQ[x,y,z,Weights=>{{1,0,0},{0,1,0},{0,0,1}}] f sub(f,R1) sub(f,R2) use R -- make sure x,y,z live in R again g = x^2+y^2+z^2 f//g -- quotient f%g -- remainder leadMonomial f leadTerm f I = ideal{f,g} leadTerm I inI = ideal leadTerm I mingens inI -- minimal generators of the monomial ideal