ideals.rlg 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. Tue Feb 10 12:28:14 2004 run on Linux
  2. I_setting(x,y,z);
  3. torder revgradlex;
  4. {{},lex}
  5. u := I(x*z-y**2, x**3-y*z);
  6. 2 3
  7. u := i(x*z - y ,x - y*z)
  8. y member I(x,y^2);
  9. 0
  10. x member I(x,y^2);
  11. 1
  12. I(x,y^2) subset I(x,y);
  13. 1
  14. % yes
  15. I(x,y) subset I(x,y^2);
  16. 0
  17. % no
  18. % examples taken from Cox, Little, O'Shea: "Ideals, Varieties and Algorithms"
  19. q1 := u .: I(x);
  20. 3 2 2 2
  21. q1 := i(x - y*z,x *y - z , - x*z + y )
  22. % quotient ideal
  23. q2 := u .+ I(x^2 * y - z^2);
  24. 3 2 2 2
  25. q2 := i(x - y*z,x *y - z , - x*z + y )
  26. % sum ideal
  27. if q1 .= q2 then write "same ideal";
  28. same ideal
  29. % test equality
  30. intersection(u,I(y));
  31. 3 2 2 2 2 3
  32. i(x *y - y *z,x *y - y*z , - x*y*z + y )
  33. % ideal intersection
  34. u .: I(y);
  35. 3 2 2 2
  36. i(x - y*z,x *y - z , - x*z + y )
  37. u .: I(x,y);
  38. 3 2 2 2
  39. i(x - y*z,x *y - z , - x*z + y )
  40. %-----------------------------------------------------
  41. u1 := I(x,y^2);
  42. 2
  43. u1 := i(x,y )
  44. u1u1:= u1 .* u1;
  45. 4 2 2
  46. u1u1 := i(y ,x*y ,x )
  47. % square ideal
  48. u0 :=I(x,y);
  49. u0 := i(x,y)
  50. % test equality/inclusion for u1,u1u1,u0
  51. u1 .= u1u1;
  52. 0
  53. % no
  54. u1 subset u1u1;
  55. 0
  56. % no
  57. u1u1 subset u1;
  58. 1
  59. % yes
  60. u1 .= u0;
  61. 0
  62. % no
  63. u1 subset u0;
  64. 1
  65. % yes
  66. intersection (I(x) , I(x^2,x*y,y^2)) .= intersection(I(x) , I(x^2,y));
  67. 1
  68. end;
  69. Time for test: 10 ms, plus GC time: 10 ms