CALI.TST 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. % Author H.-G. Graebe | Univ. Leipzig | Version 28.6.1995
  2. % graebe@informatik.uni-leipzig.de
  3. COMMENT
  4. This is an example session demonstrating and testing the facilities
  5. offered by the commutative algebra package CALI.
  6. END COMMENT;
  7. algebraic;
  8. on echo;
  9. off nat; % To make it easier to compare differing output.
  10. showtime;
  11. comment
  12. ####################################
  13. ### ###
  14. ### Introductory Examples ###
  15. ### ###
  16. ####################################
  17. end comment;
  18. % Example 1 : Generating ideals of affine and projective points.
  19. vars:={t,x,y,z};
  20. setring(vars,degreeorder vars,revlex);
  21. mm:=mat((1,1,1,1),(3,2,3,1),(2,1,3,2));
  22. % The ideal with zero set at the point in A^4 with coordinates
  23. % equal to the row vectors of mm :
  24. setideal(m1,affine_points mm);
  25. % All parameters are as they should be :
  26. dim m1;
  27. degree m1;
  28. groebfactor m1;
  29. resolve m1$
  30. bettinumbers m1;
  31. % The ideal with zero set at the point in P^3 with homogeneous
  32. % coordinates equal to the row vectors of mm :
  33. setideal(m2,proj_points mm);
  34. % All parameters as they should be ?
  35. dim m2;
  36. degree m2;
  37. groebfactor m2;
  38. % It seems to be prime ?
  39. isprime m2;
  40. % Not, of course, but it is known to be unmixed.
  41. % Hence we can use
  42. easyprimarydecomposition m2;
  43. % Example 2 :
  44. % The affine monomial curve with generic point (t^7,t^9,t^10).
  45. setideal(m,affine_monomial_curve({7,9,10},{x,y,z}));
  46. % The base ring was changed as side effect :
  47. getring();
  48. vars:=first getring m;
  49. % Some advanced commutative algebra :
  50. % The analytic spread of m.
  51. analytic_spread m;
  52. % The Rees ring Rees_R(vars) over R=S/m.
  53. rees:=blowup(m,vars,{u,v,w});
  54. % It is multihomogeneous wrt. the degree vectors, constructed during
  55. % blow up. Lets compute weighted Hilbert series :
  56. setideal(rees,rees)$
  57. weights:=second getring();
  58. weightedhilbertseries(gbasis rees,weights);
  59. % gr_R(vars), the associated graded ring of the irrelevant ideal
  60. % over R. The short way.
  61. interreduce sub(x=0,y=0,z=0,rees);
  62. % The long (and more general) way. Gives the result in another
  63. % embedding.
  64. % Restore the base ring, since it was changed by blowup as a side
  65. % effect.
  66. setring getring m$
  67. assgrad(m,vars,{u,v,w});
  68. % Comparing the Rees algebra and the symmetric algebra of M :
  69. setring getring m$
  70. setideal(rees,blowup({},m,{a,b,c}));
  71. % Lets test weighted Hilbert series once more :
  72. weights:=second getring();
  73. weightedhilbertseries(gbasis rees,weights);
  74. % The symmetric algebra :
  75. setring getring m$
  76. setideal(sym,sym(m,{a,b,c}));
  77. modequalp(rees,sym);
  78. % Symbolic powers :
  79. setring getring m$
  80. setideal(m2,idealpower(m,2));
  81. % Let's compute a second symbolic power :
  82. setideal(m3,symbolic_power(m,2));
  83. % It is different from the ordinary second power.
  84. % Hence m2 has a trivial component.
  85. modequalp(m2,m3);
  86. % Test x for non zero divisor property :
  87. nzdp(x,m2);
  88. nzdp(x,m3);
  89. % Here is the primary decomposition :
  90. pd:=primarydecomposition m2;
  91. % Compare the result with m2 :
  92. setideal(m4,matintersect(first first pd, first second pd));
  93. modequalp(m2,m4);
  94. % Compare the result with m3 :
  95. setideal(m4,first first pd)$
  96. modequalp(m3,m4);
  97. % The trivial component can also be removed with a stable
  98. % quotient computation :
  99. setideal(m5,matstabquot(m2,vars))$
  100. modequalp(m3,m5);
  101. % Example 3 : The Macaulay curve.
  102. setideal(m,proj_monomial_curve({0,1,3,4},{w,x,y,z}));
  103. vars:=first getring();
  104. gbasis m;
  105. % Test whether m is prime :
  106. isprime m;
  107. % A resolution of m :
  108. resolve m;
  109. % m has depth = 1 as can be seen from the
  110. gradedbettinumbers m;
  111. % Another way to see the non perfectness of m :
  112. hilbertseries m;
  113. % Just a third approach. Divide out a parameter system :
  114. ps:=for i:=1:2 collect random_linear_form(vars,1000);
  115. setideal(m1,matsum(m,ps))$
  116. % dim should be zero and degree > degree m = 4.
  117. % A Gbasis for m1 is computed automatically.
  118. dim m1;
  119. degree m1;
  120. % The projections of m on the coord. hyperplanes.
  121. for each x in vars collect eliminate(m,{x});
  122. % Example 4 : Two submodules of S^4.
  123. % Get the stored result of the earlier computation.
  124. r:=resolve m$
  125. % See whether cali!=degrees contains a relict from earlier
  126. % computations.
  127. getdegrees();
  128. % Introduce the 2nd and 3rd syzygy module as new modules.
  129. % Both are submodules in S^4.
  130. setmodule(m1,second r)$ setmodule(m2,third r)$
  131. % The second is already a gbasis.
  132. setgbasis m2;
  133. getleadterms m1; getleadterms m2;
  134. % Since rk(F/M)=rk(F/in(M)), they have ranks 1 resp. 3.
  135. dim m1;
  136. indepvarsets m1;
  137. % Its intersection is zero :
  138. matintersect(m1,m2);
  139. % Its sum :
  140. setmodule(m3,matsum(m1,m2));
  141. dim m3;
  142. % Hence it has a nontrivial annihilator :
  143. annihilator m3;
  144. % One can compute isolated primes and primary decomposition also for
  145. % modules. Let's do it, although being trivial here:
  146. isolatedprimes m3;
  147. primarydecomposition m3;
  148. % To get a meaningful Hilbert series make m1 homogeneous :
  149. setdegrees {1,x,x,x};
  150. % Reevaluate m1 with the new column degrees.
  151. setmodule(m1,m1)$
  152. hilbertseries m1;
  153. % Example 5 : From the MACAULAY manual (D.Bayer, M.Stillman).
  154. % An elliptic curve on the Veronese in P^5.
  155. rvars:={x,y,z}$ svars:={a,b,c,d,e,f}$
  156. r:=setring(rvars,degreeorder rvars,revlex)$
  157. s:=setring(svars,{for each x in svars collect 2},revlex)$
  158. map:={s,r,{a=x^2,b=x*y,c=x*z,d=y^2,e=y*z,f=z^2}};
  159. preimage({y^2z-x^3-x*z^2},map);
  160. % Example 6 : The preimage under a rational map.
  161. r:=setring({x,y},{},lex)$ s:=setring({t},{},lex)$
  162. map:={r,s,{x=2t/(t^2+1),y=(t^2-1)/(t^2+1)}};
  163. % The preimage of (0) is the equation of the circle :
  164. ratpreimage({},map);
  165. % The preimage of the point (t=3/2) :
  166. ratpreimage({2t-3},map);
  167. % Example 7 : A zerodimensional ideal.
  168. setring({x,y,z},{},lex)$
  169. setideal(n,{x**2 + y + z - 3,x + y**2 + z - 3,x + y + z**2 - 3});
  170. % The groebner algorithm with factorization :
  171. groebfactor n;
  172. % Change the term order and reevaluate n :
  173. setring({x,y,z},{{1,1,1}},revlex)$
  174. setideal(n,n);
  175. % its primes :
  176. zeroprimes n;
  177. % a vector space basis of S/n :
  178. getkbase n;
  179. % Example 8 : A modular computation. Since REDUCE has no multivariate
  180. % factorizer, factorprimes has to be turned off !
  181. on modular$ off factorprimes$
  182. setmod 181; setideal(n1,n); zeroprimes n1;
  183. setmod 7; setideal(n1,n); zeroprimes n1;
  184. % Hence some of the primes glue together mod 7.
  185. zeroprimarydecomposition n1;
  186. off modular$ on factorprimes$
  187. % Example 9 : Independent sets once more.
  188. n:=10$
  189. vars:=for i:=1:(2*n) collect mkid(x,i)$
  190. setring(vars,{},lex)$
  191. setideal(m,for j:=0:n collect
  192. for i:=(j+1):(j+n) product mkid(x,i));
  193. setgbasis m$
  194. indepvarsets m;
  195. dim m;
  196. degree m;
  197. comment
  198. ####################################
  199. ### ###
  200. ### Local Standard Bases ###
  201. ### ###
  202. ####################################
  203. end comment;
  204. % Example 10 : An example from [ Alonso, Mora, Raimondo ]
  205. vars := {z,x,y}$
  206. r:=setring(vars,{},lex)$
  207. setideal(m,{x^3+(x^2-y^2)*z+z^4,y^3+(x^2-y^2)*z-z^4});
  208. dim m;
  209. degree m;
  210. % 2 = codim m is the codimension of the curve m. The defining
  211. % equations of the singular locus with their nilpotent structure :
  212. singular_locus(m,2);
  213. groebfactor ws;
  214. % Hence this curve has two singular points :
  215. % (x=y=z=0) and (y=-x=256/81,z=64/27)
  216. % Let's find the brances of the curve through the origin.
  217. % The first critical tropism is (-1,-1,-1).
  218. off noetherian$
  219. setring(vars,{{-1,-1,-1}},lex)$
  220. setideal(m,m);
  221. % Let's first test two different approaches, not fully
  222. % integrated into the algebraic interface :
  223. setideal(m1,homstbasis m);
  224. setideal(m2,lazystbasis m);
  225. setgbasis m1$ setgbasis m2$
  226. modequalp(m1,m2);
  227. gbasis m;
  228. modequalp(m,m1);
  229. dim m;
  230. degree m;
  231. % Find the tangent directions not in z-direction :
  232. tangentcone m;
  233. setideal(n,sub(z=1,ws));
  234. setring r$ on noetherian$ setideal(n,n)$
  235. degree n;
  236. % The points of n outside the origin.
  237. matstabquot(n,{x,y});
  238. % Hence there are two branches x=z'*(a-3+x'),y=z'*(a+y'),z=z'
  239. % with the algebraic number a : a^2-3a+3=0
  240. % and the new equations for (z',x',y') :
  241. setrules {a^2=>3a-3};
  242. sub(x=z*(a-3+x),y=z*(a+y),m);
  243. setideal(m1,matqquot(ws,z));
  244. % This defines a loc. smooth system at the origin, since the
  245. % jacobian at the origin of the gbasis is nonsingular :
  246. off noetherian$
  247. setring getring m;
  248. setideal(m1,m1);
  249. gbasis m1;
  250. % clear the rules previously set.
  251. setrules {};
  252. % Example 11 : The standard basis of another example.
  253. % Comparing different approaches.
  254. vars:={x,y}$
  255. setring(vars,localorder vars,lex);
  256. ff:=x^5+y^11+(x+x^3)*y^9;
  257. setideal(p1,mat2list matjac({ff},vars));
  258. gbasis p1;
  259. gbtestversion 2$
  260. setideal(p2,p1);
  261. gbasis p2;
  262. gbtestversion 3$
  263. setideal(p3,p1);
  264. gbasis p3;
  265. gbtestversion 1$
  266. modequalp(p1,p2);
  267. modequalp(p1,p3);
  268. dim p1;
  269. degree p1;
  270. % Example 12 : A local intersection wrt. a non inflimited term order.
  271. setring({x,y,z},{},revlex);
  272. m1:=matintersect({x-y^2,y-x^2},{x-z^2,z-x^2},{y-z^2,z-y^2});
  273. % Delete polynomial units post factum :
  274. deleteunits ws;
  275. % Detecting polynomial units early :
  276. on detectunits;
  277. m1:=matintersect({x-y^2,y-x^2},{x-z^2,z-x^2},{y-z^2,z-y^2});
  278. off detectunits;
  279. comment
  280. ####################################
  281. ### ###
  282. ### More Advanced Computations ###
  283. ### ###
  284. ####################################
  285. end comment;
  286. % Return to a noetherian term order:
  287. vars:={x,y,z}$
  288. setring(vars,degreeorder vars,revlex);
  289. on noetherian;
  290. % Example 13 : Use of "mod".
  291. % Polynomials modulo ideals :
  292. setideal(m,{2x^2+y+5,3y^2+z+7,7z^2+x+1});
  293. x^2*y^2*z^2 mod m;
  294. % Lists of polynomials modulo ideals :
  295. {x^3,y^3,z^3} mod gbasis m;
  296. % Matrices modulo modules :
  297. mm:=mat((x^4,y^4,z^4));
  298. mm1:=tp<< ideal2mat m>>;
  299. mm mod mm1;
  300. % Example 14 : Powersums through elementary symmetric functions.
  301. vars:={a,b,c,d,e1,e2,e3,e4}$
  302. setring(vars,{},lex)$
  303. m:=interreduce {a+b+c+d-e1,
  304. a*b+a*c+a*d+b*c+b*d+c*d-e2,
  305. a*b*c+a*b*d+a*c*d+b*c*d-e3,
  306. a*b*c*d-e4};
  307. for n:=1:5 collect a^n+b^n+c^n+d^n mod m;
  308. % Example 15 : The setrules mechanism.
  309. setring({x,y,z},{},lex)$
  310. setrules {aa^3=>aa+1};
  311. setideal(m,{x^2+y+z-aa,x+y^2+z-aa,x+y+z^2-aa});
  312. gbasis m;
  313. % Clear the rules previously set.
  314. setrules {};
  315. % Example 16 : The same example with advanced coefficient domains.
  316. load_package arnum;
  317. defpoly aa^3-aa-1;
  318. setideal(m,{x^2+y+z-aa,x+y^2+z-aa,x+y+z^2-aa});
  319. gbasis m;
  320. % The following needs some more time since factorization of
  321. % arnum's is not so easy :
  322. groebfactor m;
  323. off arnum;
  324. off rational;
  325. comment
  326. ####################################
  327. ### ###
  328. ### Using Advanced Scripts in ###
  329. ### a Complex Example ###
  330. ### ###
  331. ####################################
  332. end comment;
  333. % Example 17 : The square of the 2-minors of a symmetric 3x3-matrix.
  334. vars:=for i:=1:6 collect mkid(x,i);
  335. setring(vars,degreeorder vars,revlex);
  336. % Generating the ideal :
  337. mm:=mat((x1,x2,x3),(x2,x4,x5),(x3,x5,x6));
  338. m:=ideal_of_minors(mm,2);
  339. setideal(n,idealpower(m,2));
  340. % The ideal itself :
  341. gbasis n;
  342. length n;
  343. dim n;
  344. degree n;
  345. % Its radical.
  346. radical n;
  347. % Its unmixed radical.
  348. unmixedradical n;
  349. % Its equidimensional hull :
  350. n1:=eqhull n;
  351. length n1;
  352. setideal(n1,n1)$
  353. submodulep(n,n1);
  354. submodulep(n1,n);
  355. % Hence there is an embedded component. Let's find it making
  356. % an excursion to symbolic mode. Of course, this can be done
  357. % also algebraically.
  358. symbolic;
  359. n:=get('n,'basis);
  360. % This needs even more time than the eqhull, of course.
  361. u:=primarydecomposition!* n;
  362. for each x in u collect easydim!* cadr x;
  363. for each x in u collect degree!* car x;
  364. % Hence the embedded component is a trivial one. Let's divide
  365. % it out by a stable ideal quotient calculation :
  366. algebraic;
  367. setideal(n2,matstabquot(n,vars));
  368. modequalp(n1,n2);
  369. comment
  370. ########################################
  371. ### ###
  372. ### Test Examples for New Features ###
  373. ### ###
  374. ########################################
  375. end comment;
  376. % ==> Testing the different zerodimensional solver
  377. vars:={x,y,z}$
  378. setring(vars,degreeorder vars,revlex);
  379. setideal(m,{x^3+y+z-3,y^3+x+z-3,z^3+x+y-3});
  380. zerosolve1 m;
  381. zerosolve2 m;
  382. setring(vars,{},lex)$ setideal(m,m)$ m1:=gbasis m$
  383. zerosolve m1;
  384. zerosolve1 m1;
  385. zerosolve2 m1;
  386. % ==> Testing groebfactor, extendedgroebfactor, extendedgroebfactor1
  387. % Gerdt et al. : Seventh order KdV type equation.
  388. A1:=-2*L1**2+L1*L2+2*L1*L3-L2**2-7*L5+21*L6$
  389. A2:=7*L7-2*L1*L4+3/7*L1**3$
  390. B1:=L1*(5*L1-3*L2+L3)$
  391. B2:=L1*(2*L6-4*L4)$
  392. B3:=L1*L7/2$
  393. P1:=L1*(L4-L5/2+L6)$
  394. P2:=(2/7*L1**2-L4)*(-10*L1+5*L2-L3)$
  395. P3:=(2/7*L1**2-L4)*(3*L4-L5+L6)$
  396. P4:=A1*(-3*L1+2*L2)+21*A2$
  397. P5:=A1*(2*L4-2*L5)+A2*(-45*L1+15*L2-3*L3)$
  398. P6:=2*A1*L7+A2*(12*L4-3*L5+2*L6)$
  399. P7:=B1*(2*L2-L1)+7*B2$
  400. P8:=B1*L3+7*B2$
  401. P9:=B1*(-2*L4-2*L5)+B2*(2*L2-8*L1)+84*B3$
  402. P10:=B1*(8/3*L5+6*L6)+B2*(11*L1-17/3*L2+5/3*L3)-168*B3$
  403. P11:=15*B1*L7+B2*(5*L4-2*L5)+B3*(-120*L1+30*L2-6*L3)$
  404. P12:=-3*B1*L7+B2*(-L4/2+L5/4-L6/2)+B3*(24*L1-6*L2)$
  405. P13:=3*B2*L7+B3*(40*L4-8*L5+4*L6)$
  406. polys:={P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13};
  407. vars:={L7,L6,L5,L4,L3,L2,L1};
  408. clear a1,a2,b1,b2,b3$
  409. off lexefgb;
  410. setring(vars,{},lex);
  411. % The factorized Groebner algorithm.
  412. groebfactor polys;
  413. % The extended Groebner factorizer, producing triangular sets.
  414. extendedgroebfactor polys;
  415. % The extended Groebner factorizer with subproblem removal check.
  416. extendedgroebfactor1 polys;
  417. % Gonnet's example (ACM SIGSAM Bulletin 17 (1983), 48 - 49)
  418. vars:={a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5};
  419. polys:={a4*b4,
  420. a5*b1+b5+a4*b3+a3*b4,
  421. a2*b2,a5*b5,
  422. (a0+1+a4)*b2+a2*(b0+b1+b4)+c2,
  423. (a0+1+a4)*(b0+b1+b4)+(a3+a5)*b2+a2*(b3+b5)+c0+c1+c4,
  424. (a3+a5)*(b0+b1+b4)+(b3+b5)*(a0+1+a4)+c3+c5-1,
  425. (a3+a5)*(b3+b5),
  426. a5*(b3+b5)+b5*(a3+a5),
  427. b5*(a0+1+2*a4)+a5*(b0+b1+2*b4)+a3*b4+a4*b3+c5,
  428. a4*(b0+b1+2*b4)+a2*b5+a5*b2+(a0+1)*b4+c4,
  429. a2*b4+a4*b2,
  430. a4*b5+a5*b4,
  431. 2*a3*b3+a3*b5+a5*b3,
  432. c3+b3*(a0+2+a4)+a3*(b0+2*b1+b4)+b5+a5*b1,
  433. c1+(a0+2+a4)*b1+a2*b3+a3*b2+(b0+b4),
  434. a2*b1+b2,
  435. a5*b3+a3*b5,
  436. b4+a4*b1};
  437. on lexefgb; % Switching back to the default.
  438. setring(vars,{},lex);
  439. groebfactor polys;
  440. extendedgroebfactor polys;
  441. extendedgroebfactor1 polys;
  442. % Schwarz' example s5
  443. vars:=for k:=1:5 collect mkid(x,k);
  444. s5:={
  445. x1**2+x1+2*x2*x5+2*x3*x4,
  446. 2*x1*x2+x2+2*x3*x5+x4**2,
  447. 2*x1*x3+x2**2+x3+2*x4*x5,
  448. 2*x1*x4+2*x2*x3+x4+x5**2,
  449. 2*x1*x5+2*x2*x4+x3**2+x5};
  450. setring(vars,degreeorder vars,revlex);
  451. m:=groebfactor s5;
  452. % Recompute a list of problems with listgroebfactor for another term
  453. % order.
  454. setring(vars,{},lex);
  455. listgroebfactor m;
  456. % ==> Testing the linear algebra package
  457. % Find the ideal of points in affine and projective space.
  458. vars:=for k:=1:6 collect mkid(x,k);
  459. setring(vars,degreeorder vars,revlex);
  460. matrix mm(10,6);
  461. on rounded;
  462. for k:=1:6 do for l:=1:10 do mm(l,k):=floor(exp((k+l)/4));
  463. off rounded;
  464. mm;
  465. setideal(u,affine_points mm); setgbasis u$ dim u; degree u;
  466. setideal(u,proj_points mm); setgbasis u$ dim u; degree u;
  467. % Change the term order to pure lex in dimension zero.
  468. % Test both approaches, with and without precomputed borderbasis.
  469. vars:=for k:=1:6 collect mkid(x,k);
  470. r1:=setring(vars,{},lex);
  471. r2:=setring(vars,degreeorder vars,revlex);
  472. setideal(m,{x1**2+x1+2*x2*x6+2*x3*x5+x4**2,
  473. 2*x1*x2+x2+2*x3*x6+2*x4*x5,
  474. 2*x1*x3+x2**2+x3+2*x4*x6+x5**2,
  475. 2*x1*x4+2*x2*x3+x4+2*x5*x6,
  476. 2*x1*x5+2*x2*x4+x3**2+x5+x6**2,
  477. 2*x1*x6+2*x2*x5+2*x3*x4+x6});
  478. gbasis m;
  479. m1:=change_termorder(m,r1);
  480. setring r2$ m2:=change_termorder1(m,r1);
  481. setideal(m1,m1)$ setideal(m2,m2)$
  482. setgbasis m1$ setgbasis m2$ modequalp(m1,m2);
  483. % ==> Different hilbert series driver
  484. setideal(m,proj_monomial_curve(w1:={0,2,5,9},{w,x,y,z}));
  485. weights:={{1,1,1,1},w1};
  486. hftestversion 2;
  487. f1:=weightedhilbertseries(gbasis m,weights);
  488. sub(x=1,ws); % The ordinary Hilbert series.
  489. hftestversion 1; % The default.
  490. f2:=weightedhilbertseries(gbasis m,weights);
  491. sub(x=1,ws);
  492. f1-f2;
  493. % ==> Different primary decomposition approaches. The example is due
  494. % to Shimoyama Takeshi. CALI 2.2. produced auxiliary embedded
  495. % primes on it.
  496. vars:={dx,dy,x,y};
  497. setring(vars,degreeorder vars,revlex);
  498. f3:={DY*( - X*DX + Y**2*DY - Y*DY),DX*(X**2*DX - X*DX - Y*DY)}$
  499. primarydecomposition f3;
  500. showtime;
  501. end;