ideals.tst 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. I_setting(x,y,z);
  2. torder revgradlex;
  3. u := I(x*z-y**2, x**3-y*z);
  4. y member I(x,y^2);
  5. x member I(x,y^2);
  6. I(x,y^2) subset I(x,y); % yes
  7. I(x,y) subset I(x,y^2); % no
  8. % examples taken from Cox, Little, O'Shea: "Ideals, Varieties and Algorithms"
  9. q1 := u .: I(x); % quotient ideal
  10. q2 := u .+ I(x^2 * y - z^2); % sum ideal
  11. if q1 .= q2 then write "same ideal"; % test equality
  12. intersection(u,I(y)); % ideal intersection
  13. u .: I(y);
  14. u .: I(x,y);
  15. %-----------------------------------------------------
  16. u1 := I(x,y^2);
  17. u1u1:= u1 .* u1; % square ideal
  18. u0 :=I(x,y);
  19. % test equality/inclusion for u1,u1u1,u0
  20. u1 .= u1u1; % no
  21. u1 subset u1u1; % no
  22. u1u1 subset u1; % yes
  23. u1 .= u0; % no
  24. u1 subset u0; % yes
  25. intersection (I(x) , I(x^2,x*y,y^2)) .= intersection(I(x) , I(x^2,y));
  26. end;