-- Here we demonstrate how Macaulay2 can implement many of the -- operations described in Chater 4 of CLS R = QQ[x,y,z, MonomialOrder=>Lex]; I = ideal( x*y^2, x*z ); J = ideal( x ); K = ideal( y, z ); -- Ideal sum: I + J -- Ideal product: I * J -- Ideal powers (i.e. iterated products I*I*...*I): I^2 -- Ideal intersection: intersect(I,J) -- Ideal quotient: quotient(I,K) -- Ideal saturation: saturate(I,K) -- Radical of an ideal: radical(I) -- The primary decomposition of an ideal: primaryDecomposition(I) -- lcms and gcds of polynomials lcm( x^2*y, x*y*z^3 ) gcd( x^2*y, x*y*z^3 )