CALI.LOG 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % Author H.-G. Graebe | Univ. Leipzig | Version 28.6.1995
  3. % graebe@informatik.uni-leipzig.de
  4. COMMENT
  5. This is an example session demonstrating and testing the facilities
  6. offered by the commutative algebra package CALI.
  7. END COMMENT;
  8. algebraic;
  9. on echo;
  10. off nat;
  11. % To make it easier to compare differing output.
  12. showtime;
  13. Time: 30 ms
  14. comment
  15. ####################################
  16. ### ###
  17. ### Introductory Examples ###
  18. ### ###
  19. ####################################
  20. end comment;
  21. % Example 1 : Generating ideals of affine and projective points.
  22. vars:={t,x,y,z};
  23. vars := {t,x,y,z}$
  24. setring(vars,degreeorder vars,revlex);
  25. {{t,x,y,z},{{1,1,1,1}},revlex,{1,1,1,1}}$
  26. mm:=mat((1,1,1,1),(3,2,3,1),(2,1,3,2));
  27. mm := mat((1,1,1,1),(3,2,3,1),(2,1,3,2))$
  28. % The ideal with zero set at the point in A^4 with coordinates
  29. % equal to the row vectors of mm :
  30. setideal(m1,affine_points mm);
  31. {z**2 - 3*z + 2,
  32. y**2 - 4*y + 3,
  33. t - y + z - 1,
  34. 2*x - y + 2*z - 3,
  35. y*z - y - 3*z + 3}$
  36. % All parameters are as they should be :
  37. dim m1;
  38. 0$
  39. degree m1;
  40. 3$
  41. groebfactor m1;
  42. {{z - 2,y - 3,t - 2,x - 1},
  43. {z - 1,t - 3,y - 3,x - 2},
  44. {z - 1,t - 1,y - 1,x - 1}}$
  45. resolve m1$
  46. bettinumbers m1;
  47. {1,5,9,7,2}$
  48. % The ideal with zero set at the point in P^3 with homogeneous
  49. % coordinates equal to the row vectors of mm :
  50. setideal(m2,proj_points mm);
  51. {2*y**2 - 2*x*z - 7*y*z + 7*z**2,
  52. 3*t - 2*x - 2*y + z,
  53. 2*x**2 - 4*x*z - y*z + 3*z**2,
  54. 2*x*y - 4*x*z - 3*y*z + 5*z**2}$
  55. % All parameters as they should be ?
  56. dim m2;
  57. 1$
  58. degree m2;
  59. 3$
  60. groebfactor m2;
  61. {{2*y**2 - 2*x*z - 7*y*z + 7*z**2,
  62. 3*t - 2*x - 2*y + z,
  63. 2*x**2 - 4*x*z - y*z + 3*z**2,
  64. 2*x*y - 4*x*z - 3*y*z + 5*z**2}}$
  65. % It seems to be prime ?
  66. isprime m2;
  67. no$
  68. % Not, of course, but it is known to be unmixed.
  69. % Hence we can use
  70. easyprimarydecomposition m2;
  71. {{{x - 2*z,y - 3*z,t - 3*z},
  72. {y - 3*z,x - 2*z,t - 3*z}},
  73. {{x - z,y - z,t - z},
  74. {y - z,x - z,t - z}},
  75. {{2*x - z,2*y - 3*z,t - z},
  76. {2*y - 3*z,2*x - z,t - z}}}$
  77. % Example 2 :
  78. % The affine monomial curve with generic point (t^7,t^9,t^10).
  79. setideal(m,affine_monomial_curve({7,9,10},{x,y,z}));
  80. {x**3*y - z**3,
  81. x**4 - y**2*z,
  82. y**3 - x*z**2}$
  83. % The base ring was changed as side effect :
  84. getring();
  85. {{x,y,z},{{7,9,10}},revlex,{7,9,10}}$
  86. vars:=first getring m;
  87. vars := {x,y,z}$
  88. % Some advanced commutative algebra :
  89. % The analytic spread of m.
  90. analytic_spread m;
  91. 3$
  92. % The Rees ring Rees_R(vars) over R=S/m.
  93. rees:=blowup(m,vars,{u,v,w});
  94. rees := {u**2*v*x - w**3,
  95. u*v*x**2 - w**2*z,
  96. v*x**3 - w*z**2,
  97. u**3*x - v**2*w,
  98. u**2*x**2 - v*w*y,
  99. u*x**3 - w*y**2,
  100. - u*w**2 + v**3,
  101. v**2*y - w**2*x,
  102. v*y**2 - w*x*z,
  103. v*z - w*y,
  104. u*z - w*x,
  105. u*y - v*x,
  106. x**3*y - z**3,
  107. x**4 - y**2*z,
  108. - x*z**2 + y**3}$
  109. % It is multihomogeneous wrt. the degree vectors, constructed during
  110. % blow up. Lets compute weighted Hilbert series :
  111. setideal(rees,rees)$
  112. weights:=second getring();
  113. weights := {{0,0,0,7,9,10},{7,9,10,0,0,0}}$
  114. weightedhilbertseries(gbasis rees,weights);
  115. ( - x**29*y + x**29 - x**20*y + x**20 - x**19*y**11 + x**19*y**10 - x**19*y + x
  116. **19 - x**18*y + x**18 - x**10*y**11 + x**10*y**10 - x**10*y + x**10 - x**9*y
  117. **21 + x**9*y**20 - x**9*y**11 + x**9*y**9 - x**9*y + x**9 + y**23 - y**22 + y
  118. **16 - y**15 + y**14 - y**11 + y**9 - y**8 + y**7 - y + 1)/(x**7*y - x**7 - y
  119. + 1)$
  120. % gr_R(vars), the associated graded ring of the irrelevant ideal
  121. % over R. The short way.
  122. interreduce sub(x=0,y=0,z=0,rees);
  123. {w**3,v**2*w, - u*w**2 + v**3}$
  124. % The long (and more general) way. Gives the result in another
  125. % embedding.
  126. % Restore the base ring, since it was changed by blowup as a side
  127. % effect.
  128. setring getring m$
  129. assgrad(m,vars,{u,v,w});
  130. {x,
  131. y,
  132. z,
  133. w**3,
  134. v**2*w,
  135. - u*w**2 + v**3}$
  136. % Comparing the Rees algebra and the symmetric algebra of M :
  137. setring getring m$
  138. setideal(rees,blowup({},m,{a,b,c}));
  139. { - y**2*a + z**2*b + x**3*c,
  140. x*a - y*b - z*c,
  141. - y**2*a**2 + z**2*a*b + x**2*y*b*c + x**2*z*c**2,
  142. - y**2*a**3 + z**2*a**2*b + x*y**2*b**2*c + 2*x*y*z*b*c**2 + x*z**2*c**3,
  143. - y**2*a**4 + z**2*a**3*b + y**3*b**3*c + 3*y**2*z*b**2*c**2 + 3*y*z**2*b*c**
  144. 3 + z**3*c**4}$
  145. % Lets test weighted Hilbert series once more :
  146. weights:=second getring();
  147. weights := {{0,0,0,30,28,27},{7,9,10,0,0,0}}$
  148. weightedhilbertseries(gbasis rees,weights);
  149. (x**58*y**27 + x**30*y**25 - x**30*y**18 - x**30*y**7 - x**28*y**27 + 1)/(x**85
  150. *y**26 - x**85*y**19 - x**85*y**17 - x**85*y**16 + x**85*y**10 + x**85*y**9
  151. + x**85*y**7 - x**85 - x**58*y**26 + x**58*y**19 + x**58*y**17 + x**58*y**16
  152. - x**58*y**10 - x**58*y**9 - x**58*y**7 + x**58 - x**57*y**26 + x**57*y**19
  153. + x**57*y**17 + x**57*y**16 - x**57*y**10 - x**57*y**9 - x**57*y**7 + x**57
  154. - x**55*y**26 + x**55*y**19 + x**55*y**17 + x**55*y**16 - x**55*y**10 - x**
  155. 55*y**9 - x**55*y**7 + x**55 + x**30*y**26 - x**30*y**19 - x**30*y**17 - x**
  156. 30*y**16 + x**30*y**10 + x**30*y**9 + x**30*y**7 - x**30 + x**28*y**26 - x**
  157. 28*y**19 - x**28*y**17 - x**28*y**16 + x**28*y**10 + x**28*y**9 + x**28*y**7
  158. - x**28 + x**27*y**26 - x**27*y**19 - x**27*y**17 - x**27*y**16 + x**27*y**
  159. 10 + x**27*y**9 + x**27*y**7 - x**27 - y**26 + y**19 + y**17 + y**16 - y**10
  160. - y**9 - y**7 + 1)$
  161. % The symmetric algebra :
  162. setring getring m$
  163. setideal(sym,sym(m,{a,b,c}));
  164. {y**2*a - z**2*b - x**3*c,
  165. x*a - y*b - z*c}$
  166. modequalp(rees,sym);
  167. yes$
  168. % Symbolic powers :
  169. setring getring m$
  170. setideal(m2,idealpower(m,2));
  171. {x**6*y**2 - 2*x**3*y*z**3 + z**6,
  172. x**8 - 2*x**4*y**2*z + y**4*z**2,
  173. y**6 - 2*x*y**3*z**2 + x**2*z**4,
  174. x**7*y - x**3*y**3*z - x**4*z**3 + y**2*z**4,
  175. x**3*y**4 - x**4*y*z**2 - y**3*z**3 + x*z**5,
  176. x**4*y**3 - y**5*z - x**5*z**2 + x*y**2*z**3}$
  177. % Let's compute a second symbolic power :
  178. setideal(m3,symbolic_power(m,2));
  179. {x**6*y**2 - 2*x**3*y*z**3 + z**6,
  180. x**8 - 2*x**4*y**2*z + y**4*z**2,
  181. y**6 - 2*x*y**3*z**2 + x**2*z**4,
  182. x**2*y**5 + x**7*z - 3*x**3*y**2*z**2 + y*z**5,
  183. x**7*y - x**3*y**3*z - x**4*z**3 + y**2*z**4,
  184. x**3*y**4 - x**4*y*z**2 - y**3*z**3 + x*z**5,
  185. x**4*y**3 - y**5*z - x**5*z**2 + x*y**2*z**3}$
  186. % It is different from the ordinary second power.
  187. % Hence m2 has a trivial component.
  188. modequalp(m2,m3);
  189. no$
  190. % Test x for non zero divisor property :
  191. nzdp(x,m2);
  192. no$
  193. nzdp(x,m3);
  194. yes$
  195. % Here is the primary decomposition :
  196. pd:=primarydecomposition m2;
  197. pd := {{{x**8 - 2*x**4*y**2*z + y**4*z**2,
  198. x**6*y**2 - 2*x**3*y*z**3 + z**6,
  199. x**2*z**4 - 2*x*y**3*z**2 + y**6,
  200. x**7*z - 3*x**3*y**2*z**2 + x**2*y**5 + y*z**5,
  201. x**7*y - x**4*z**3 - x**3*y**3*z + y**2*z**4,
  202. - x**4*y*z**2 + x**3*y**4 + x*z**5 - y**3*z**3,
  203. - x**5*z**2 + x**4*y**3 + x*y**2*z**3 - y**5*z},
  204. { - x*z**2 + y**3,
  205. x**4 - y**2*z,
  206. x**3*y - z**3}},
  207. {{z**2,
  208. x**6*y**2,
  209. y**6,
  210. x**2*y**5*z,
  211. x**3*y**4,
  212. x**4*(x**4 - 2*y**2*z),
  213. x**3*y*(x**4 - y**2*z),
  214. y**3*(x**4 - y**2*z)},
  215. {x,z,y}}}$
  216. % Compare the result with m2 :
  217. setideal(m4,matintersect(first first pd, first second pd));
  218. {y**6 - 2*x*y**3*z**2 + x**2*z**4,
  219. x**6*y**2 - 2*x**3*y*z**3 + z**6,
  220. x**8 - 2*x**4*y**2*z + y**4*z**2,
  221. x**2*y**5*z + x**7*z**2 - 3*x**3*y**2*z**3 + y*z**6,
  222. x**4*y**3 - y**5*z - x**5*z**2 + x*y**2*z**3,
  223. x**3*y**4 - x**4*y*z**2 - y**3*z**3 + x*z**5,
  224. x**7*y - x**3*y**3*z - x**4*z**3 + y**2*z**4}$
  225. modequalp(m2,m4);
  226. yes$
  227. % Compare the result with m3 :
  228. setideal(m4,first first pd)$
  229. modequalp(m3,m4);
  230. yes$
  231. % The trivial component can also be removed with a stable
  232. % quotient computation :
  233. setideal(m5,matstabquot(m2,vars))$
  234. modequalp(m3,m5);
  235. yes$
  236. % Example 3 : The Macaulay curve.
  237. setideal(m,proj_monomial_curve({0,1,3,4},{w,x,y,z}));
  238. {x**3 - w**2*y,
  239. w*y**2 - x**2*z,
  240. y**3 - x*z**2,
  241. x*y - w*z}$
  242. vars:=first getring();
  243. vars := {w,x,y,z}$
  244. gbasis m;
  245. {x**3 - w**2*y,
  246. w*y**2 - x**2*z,
  247. y**3 - x*z**2,
  248. x*y - w*z}$
  249. % Test whether m is prime :
  250. isprime m;
  251. yes$
  252. % A resolution of m :
  253. resolve m;
  254. {
  255. mat((x**3 - w**2*y),(w*y**2 - x**2*z),(y**3 - x*z**2),(x*y - w*z))$
  256. ,
  257. mat((y,w,0, - x**2),(z,x,0, - w*y),(0, - y,w, - x*z),(0, - z,x, - y**2))$
  258. ,
  259. mat((z, - y, - x,w))$
  260. ,
  261. mat((0))$
  262. }$
  263. % m has depth = 1 as can be seen from the
  264. gradedbettinumbers m;
  265. {{0},{2,3,3,3},{4,4,4,4},{5}}$
  266. % Another way to see the non perfectness of m :
  267. hilbertseries m;
  268. ( - w**3 + 2*w**2 + 2*w + 1)/(w**2 - 2*w + 1)$
  269. % Just a third approach. Divide out a parameter system :
  270. ps:=for i:=1:2 collect random_linear_form(vars,1000);
  271. ps := {927*w + 880*x + 292*y + 9*z, - 819*w + 224*x - 572*y - 205*z}$
  272. setideal(m1,matsum(m,ps))$
  273. % dim should be zero and degree > degree m = 4.
  274. % A Gbasis for m1 is computed automatically.
  275. dim m1;
  276. 0$
  277. degree m1;
  278. 5$
  279. % The projections of m on the coord. hyperplanes.
  280. for each x in vars collect eliminate(m,{x});
  281. {{ - x*z**2 + y**3},
  282. { - w*z**3 + y**4},
  283. { - w**3*z + x**4},
  284. { - w**2*y + x**3}}$
  285. % Example 4 : Two submodules of S^4.
  286. % Get the stored result of the earlier computation.
  287. r:=resolve m$
  288. % See whether cali!=degrees contains a relict from earlier
  289. % computations.
  290. getdegrees();
  291. {}$
  292. % Introduce the 2nd and 3rd syzygy module as new modules.
  293. % Both are submodules in S^4.
  294. setmodule(m1,second r)$
  295. setmodule(m2,third r)$
  296. % The second is already a gbasis.
  297. setgbasis m2;
  298. mat((z, - y, - x,w))$
  299. getleadterms m1;
  300. mat((0,x**3,0,0),(0,0,x**3,0),(0,0,w**2*y,0),(0,0,w*y**2,0),(0,0,w*x,0),(0,0,0,
  301. x**2),(0,0,0,w*y),(0,0,0,x*z),(0,0,0,y**2))$
  302. getleadterms m2;
  303. mat((0,0,0,w))$
  304. % Since rk(F/M)=rk(F/in(M)), they have ranks 1 resp. 3.
  305. dim m1;
  306. 4$
  307. indepvarsets m1;
  308. {{w,x,y,z}}$
  309. % Its intersection is zero :
  310. matintersect(m1,m2);
  311. mat((0,0,0,0))$
  312. % Its sum :
  313. setmodule(m3,matsum(m1,m2));
  314. mat(( - y, - w,0,x**2),(0,y, - w,x*z),(0,z, - x,y**2),(z, - y, - x,w),( - y*z -
  315. z,y**2 - x,x*y,0))$
  316. dim m3;
  317. 3$
  318. % Hence it has a nontrivial annihilator :
  319. annihilator m3;
  320. {w**2*y*z + w**2*z - w*x*y + w*y**3 - x**3*z - x**2*y*z - x**2*z**2 + x*y**3}$
  321. % One can compute isolated primes and primary decomposition also for
  322. % modules. Let's do it, although being trivial here:
  323. isolatedprimes m3;
  324. {{w**2*y*z + w**2*z - w*x*y + w*y**3 - x**3*z - x**2*y*z - x**2*z**2 + x*y**3}}
  325. $
  326. primarydecomposition m3;
  327. {{
  328. mat((z*( - w*x*z - w*y*z + w*y - w*z + x**2*z + x*y*z - y**3 + y**2*z),w**2*y
  329. + w**2*z + w*x*y*z + w*x*z**2 - w*x*z + w*y*z**2 - x**2*z**2 + x*y**2*z
  330. , - w**3,0),(z*( - w*y - w - x*z + y**2), - w*x + w*y*z - x**2*z + x*y**2,w**2*
  331. y,0),( - x*z**2,w*y + x*y*z + x*z**2 - y**3,w*( - w + y**2),0),( - x*z**2,y*(w
  332. + x*z), - w**2 + x**2*z,0),( - y*z, - (w*z + x*y),w*x,0),( - w*y**2 + x**2*z, -
  333. w**2*y + x**3,0,0),(w*y*z - w*y + w*z - x**2*z + y**3 - y**2*z, - w**2 + w*x -
  334. w*y*z + x**2*
  335. y + x**2*z - x*y**2,0,0),( - w*y*z - w*z - y**3 + y**2*z, - w*x + w*y*z - x**2*
  336. z + x*y**2,x**3,0),(z*( - w*y - w + y**2), - w*x + w*y**2 + w*y*z + x*y**2,0,0)
  337. ,( - z*(y + 1), - x + y**2,x*y,0),(z, - y, - x,w),(w**2*y*z + w**2*z - w*x*y +
  338. w*y**3 - x**3*z - x**2*y*z - x**2*z**2 + x*y
  339. **3,0,0,0),( - y, - w,0,x**2),(0,y, - w,x*z),(0,z, - x,y**2))$
  340. ,
  341. {w**2*y*z + w**2*z - w*x*y + w*y**3 - x**3*z - x**2*y*z - x**2*z**2 + x*y**3}}}
  342. $
  343. % To get a meaningful Hilbert series make m1 homogeneous :
  344. setdegrees {1,x,x,x};
  345. {1,x,x,x}$
  346. % Reevaluate m1 with the new column degrees.
  347. setmodule(m1,m1)$
  348. hilbertseries m1;
  349. (w**7 - 5*w**6 + 8*w**5 - 2*w**4 - 5*w**3 + 3*w + 1)/(w**4 - 4*w**3 + 6*w**2 -
  350. 4*w + 1)$
  351. % Example 5 : From the MACAULAY manual (D.Bayer, M.Stillman).
  352. % An elliptic curve on the Veronese in P^5.
  353. rvars:={x,y,z}$
  354. svars:={a,b,c,d,e,f}$
  355. r:=setring(rvars,degreeorder rvars,revlex)$
  356. s:=setring(svars,{for each x in svars collect 2},revlex)$
  357. map:={s,r,{a=x^2,b=x*y,c=x*z,d=y^2,e=y*z,f=z^2}};
  358. map := {{{a,
  359. b,
  360. c,
  361. d,
  362. e,
  363. f},
  364. {{2,2,2,2,2,2}},
  365. revlex,
  366. {1,1,1,1,1,1}},
  367. {{x,y,z},
  368. {{1,1,1}},
  369. revlex,
  370. {1,1,1}},
  371. {a=x**2,
  372. b=x*y,
  373. c=x*z,
  374. d=y**2,
  375. e=y*z,
  376. f=z**2}}$
  377. preimage({y^2z-x^3-x*z^2},map);
  378. { - a*d + b**2,
  379. - a*e + b*c,
  380. - b*e + c*d,
  381. - a*f + c**2,
  382. - b*f + c*e,
  383. - d*f + e**2,
  384. a**2 + a*f - b*e,
  385. a*b + b*f - d*e,
  386. a*c + c*f - d*f}$
  387. % Example 6 : The preimage under a rational map.
  388. r:=setring({x,y},{},lex)$
  389. s:=setring({t},{},lex)$
  390. map:={r,s,{x=2t/(t^2+1),y=(t^2-1)/(t^2+1)}};
  391. map := {{{x,y},{},lex,{1,1}},
  392. {{t},{},lex,{1}},
  393. {x=(2*t)/(t**2 + 1),y=(t**2 - 1)/(t**2 + 1)}}$
  394. % The preimage of (0) is the equation of the circle :
  395. ratpreimage({},map);
  396. {x**2 + y**2 - 1}$
  397. % The preimage of the point (t=3/2) :
  398. ratpreimage({2t-3},map);
  399. {13*x - 12,13*y - 5}$
  400. % Example 7 : A zerodimensional ideal.
  401. setring({x,y,z},{},lex)$
  402. setideal(n,{x**2 + y + z - 3,x + y**2 + z - 3,x + y + z**2 - 3});
  403. {x**2 + y + z - 3,x + y**2 + z - 3,x + y + z**2 - 3}$
  404. % The groebner algorithm with factorization :
  405. groebfactor n;
  406. {{y - 1,z - 1,x - 1},
  407. {y + 3,z + 3,x + 3},
  408. {y - z,z**2 - 2,x + z - 1},
  409. {z**2 - 2,x - z,y + z - 1},
  410. {y + z - 1,z**2 - 2*z - 1,x + z - 1}}$
  411. % Change the term order and reevaluate n :
  412. setring({x,y,z},{{1,1,1}},revlex)$
  413. setideal(n,n);
  414. {x**2 + y + z - 3,y**2 + x + z - 3,z**2 + x + y - 3}$
  415. % its primes :
  416. zeroprimes n;
  417. {{x - z,z**2 - 2,y + z - 1},
  418. {x + z - 1,y + z - 1,z**2 - 2*z - 1},
  419. {z - 1,x - 1,y - 1},
  420. {z + 3,x + 3,y + 3},
  421. {y - z,z**2 - 2,x + z - 1}}$
  422. % a vector space basis of S/n :
  423. getkbase n;
  424. {1,x,x*y,x*y*z,x*z,y,y*z,z}$
  425. % Example 8 : A modular computation. Since REDUCE has no multivariate
  426. % factorizer, factorprimes has to be turned off !
  427. on modular$
  428. off factorprimes$
  429. setmod 181;
  430. 1$
  431. setideal(n1,n);
  432. {x**2 + y + z + 178,y**2 + x + z + 178,z**2 + x + y + 178}$
  433. zeroprimes n1;
  434. {{y + 180*z,z**2 + 179,x + z + 180},
  435. {x + z + 180,y + z + 180,z**2 + 179*z + 180},
  436. {x + 180*z,z**2 + 179,y + z + 180},
  437. {z + 180,x + 180,y + 180},
  438. {z + 3,x + 3,y + 3}}$
  439. setmod 7;
  440. 181$
  441. setideal(n1,n);
  442. {x**2 + y + z + 4,y**2 + x + z + 4,z**2 + x + y + 4}$
  443. zeroprimes n1;
  444. {{z + 6,x + 6,y + 6},
  445. {x + 4,z + 4,y + 2},
  446. {x + 4,z + 2,y + 4},
  447. {z + 4,x + 2,y + 4},
  448. {x + 3,z + 3,y + 3}}$
  449. % Hence some of the primes glue together mod 7.
  450. zeroprimarydecomposition n1;
  451. {{{z + 6,x + 6,y + 6},
  452. {z + 6,x + 6,y + 6}},
  453. {{z + 4,y + 2,x + 4},
  454. {x + 4,z + 4,y + 2}},
  455. {{z + 2,y + 4,x + 4},
  456. {x + 4,z + 2,y + 4}},
  457. {{z + 4,x + 2,y + 4},
  458. {z + 4,x + 2,y + 4}},
  459. {{x**2 + y + z + 4,
  460. x + y**2 + z + 4,
  461. x + y + z**2 + 4,
  462. 3*(x + 5*y*z + 2*y + 2*z + 5),
  463. x*z + 6*x + 3*y + 6*z + 1,
  464. x*y + 6*x + 6*y + 3*z + 1},
  465. {x + 3,z + 3,y + 3}}}$
  466. off modular$
  467. on factorprimes$
  468. % Example 9 : Independent sets once more.
  469. n:=10$
  470. vars:=for i:=1:(2*n) collect mkid(x,i)$
  471. setring(vars,{},lex)$
  472. setideal(m,for j:=0:n collect
  473. for i:=(j+1):(j+n) product mkid(x,i));
  474. {x1*x2*x3*x4*x5*x6*x7*x8*x9*x10,
  475. x2*x3*x4*x5*x6*x7*x8*x9*x10*x11,
  476. x3*x4*x5*x6*x7*x8*x9*x10*x11*x12,
  477. x4*x5*x6*x7*x8*x9*x10*x11*x12*x13,
  478. x5*x6*x7*x8*x9*x10*x11*x12*x13*x14,
  479. x6*x7*x8*x9*x10*x11*x12*x13*x14*x15,
  480. x7*x8*x9*x10*x11*x12*x13*x14*x15*x16,
  481. x8*x9*x10*x11*x12*x13*x14*x15*x16*x17,
  482. x9*x10*x11*x12*x13*x14*x15*x16*x17*x18,
  483. x10*x11*x12*x13*x14*x15*x16*x17*x18*x19,
  484. x11*x12*x13*x14*x15*x16*x17*x18*x19*x20}$
  485. setgbasis m$
  486. indepvarsets m;
  487. {{x2,x3,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  488. {x1,x3,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  489. {x1,x2,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  490. {x1,x2,x3,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  491. {x1,x2,x3,x4,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  492. {x1,x2,x3,x4,x5,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  493. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  494. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  495. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  496. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x12,x13,x14,x15,x16,x17,x18,x19,x20},
  497. {x1,x3,x4,x5,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  498. {x1,x2,x4,x5,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  499. {x1,x2,x3,x5,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  500. {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  501. {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  502. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  503. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  504. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  505. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x13,x14,x15,x16,x17,x18,x19,x20},
  506. {x1,x2,x4,x5,x6,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  507. {x1,x2,x3,x5,x6,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  508. {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  509. {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  510. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  511. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  512. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  513. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x14,x15,x16,x17,x18,x19,x20},
  514. {x1,x2,x3,x5,x6,x7,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  515. {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  516. {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  517. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  518. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  519. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  520. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x15,x16,x17,x18,x19,x20},
  521. {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
  522. {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
  523. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
  524. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
  525. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
  526. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x16,x17,x18,x19,x20},
  527. {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
  528. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
  529. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
  530. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
  531. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x17,x18,x19,x20},
  532. {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x14,x15,x16,x18,x19,x20},
  533. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x15,x16,x18,x19,x20},
  534. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x16,x18,x19,x20},
  535. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x18,x19,x20},
  536. {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x15,x16,x17,x19,x20},
  537. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x16,x17,x19,x20},
  538. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x17,x19,x20},
  539. {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x16,x17,x18,x20},
  540. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x17,x18,x20},
  541. {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x17,x18,x19}}$
  542. dim m;
  543. 18$
  544. degree m;
  545. 55$
  546. comment
  547. ####################################
  548. ### ###
  549. ### Local Standard Bases ###
  550. ### ###
  551. ####################################
  552. end comment;
  553. % Example 10 : An example from [ Alonso, Mora, Raimondo ]
  554. vars := {z,x,y}$
  555. r:=setring(vars,{},lex)$
  556. setideal(m,{x^3+(x^2-y^2)*z+z^4,y^3+(x^2-y^2)*z-z^4});
  557. {z**4 + z*x**2 - z*y**2 + x**3,
  558. - z**4 + z*x**2 - z*y**2 + y**3}$
  559. dim m;
  560. 1$
  561. degree m;
  562. 12$
  563. % 2 = codim m is the codimension of the curve m. The defining
  564. % equations of the singular locus with their nilpotent structure :
  565. singular_locus(m,2);
  566. {x**3 - y**3 + 2*z**4,
  567. x**3 + 2*x**2*z + y**3 - 2*y**2*z,
  568. y*(8*x**3 + 3*x**2*y - 11*y**3 + 12*y*z**3),
  569. y*(x**3 + 3*x**2*y + 2*x*y*z + y**3 - 2*y**2*z),
  570. 3*x**5 + 3*x**4*y + 22*x**4 + 18*x**3*y**2 + 16*x**3*y + 21*x**2*y**3 + 3*x*y
  571. **4 - 16*x*y**3 + 18*y**5 - 42*y**4*z - 22*y**4 + 24*y**3*z**2}$
  572. groebfactor ws;
  573. {{y,x,z},{81*x + 256,27*z - 64,81*y - 256}}$
  574. % Hence this curve has two singular points :
  575. % (x=y=z=0) and (y=-x=256/81,z=64/27)
  576. % Let's find the brances of the curve through the origin.
  577. % The first critical tropism is (-1,-1,-1).
  578. off noetherian$
  579. setring(vars,{{-1,-1,-1}},lex)$
  580. setideal(m,m);
  581. {z*x**2 - z*y**2 + x**3 + z**4,
  582. z*x**2 - z*y**2 + y**3 - z**4}$
  583. % Let's first test two different approaches, not fully
  584. % integrated into the algebraic interface :
  585. setideal(m1,homstbasis m);
  586. {x**3 - y**3 + 2*z**4,
  587. z*x**2 - z*y**2 + y**3 - z**4,
  588. z*x*y**2 - z*y**3 - x*y**3 + 2*z**5 + z**4*x,
  589. x**2*y**3 + x*y**4 + y**5 - 2*z**5*x - 2*z**5*y - z**4*x**2 - z**4*x*y - z**4*
  590. y**2,
  591. 6*z*y**5 + 2*x*y**5 - 2*y**6 - 4*z**6*x - 4*z**6*y - 2*z**5*x*y - 8*z**5*y**2
  592. + z**4*x**3 - 2*z**4*x*y**2 + 3*z**4*y**3}$
  593. setideal(m2,lazystbasis m);
  594. {x**3 - y**3 + 2*z**4,
  595. z*x**2 - z*y**2 + y**3 - z**4,
  596. z*x*y**2 - z*y**3 - x*y**3 + 2*z**5 + z**4*x,
  597. x**2*y**3 + x*y**4 + y**5 - 2*z**5*x - 2*z**5*y - z**4*x**2 - z**4*x*y - z**4*
  598. y**2,
  599. 3*z*y**5 + x*y**5 - y**6 - 2*z**6*x - 2*z**6*y - z**5*x**2 - z**5*x*y - 3*z**5
  600. *y**2 - z**4*x*y**2 + z**4*y**3}$
  601. setgbasis m1$
  602. setgbasis m2$
  603. modequalp(m1,m2);
  604. yes$
  605. gbasis m;
  606. {x**3 - y**3 + 2*z**4,
  607. z*x**2 - z*y**2 + y**3 - z**4,
  608. z*x*y**2 - z*y**3 - x*y**3 + 2*z**5 + z**4*x,
  609. x**2*y**3 + x*y**4 + y**5 - 2*z**5*x - 2*z**5*y - z**4*x**2 - z**4*x*y - z**4*
  610. y**2,
  611. 3*z*y**5 + x*y**5 - y**6 - 2*z**6*x - 2*z**6*y - z**5*x**2 - z**5*x*y - 3*z**5
  612. *y**2 - z**4*x*y**2 + z**4*y**3}$
  613. modequalp(m,m1);
  614. yes$
  615. dim m;
  616. 1$
  617. degree m;
  618. 9$
  619. % Find the tangent directions not in z-direction :
  620. tangentcone m;
  621. {x**3 - y**3,
  622. z*x**2 - z*y**2 + y**3,
  623. z*x*y**2 - z*y**3 - x*y**3,
  624. x**2*y**3 + x*y**4 + y**5,
  625. 3*z*y**5 + x*y**5 - y**6}$
  626. setideal(n,sub(z=1,ws));
  627. {x**3 - y**3,
  628. x**2 - y**2 + y**3,
  629. x*y**2 - y**3 - x*y**3,
  630. x**2*y**3 + x*y**4 + y**5,
  631. 3*y**5 + x*y**5 - y**6}$
  632. setring r$
  633. on noetherian$
  634. setideal(n,n)$
  635. degree n;
  636. 9$
  637. % The points of n outside the origin.
  638. matstabquot(n,{x,y});
  639. {y**2 - 3*y + 3,x - y + 3}$
  640. % Hence there are two branches x=z'*(a-3+x'),y=z'*(a+y'),z=z'
  641. % with the algebraic number a : a^2-3a+3=0
  642. % and the new equations for (z',x',y') :
  643. setrules {a^2=>3a-3};
  644. {a**2 => 3*a - 3}$
  645. sub(x=z*(a-3+x),y=z*(a+y),m);
  646. {z**3*(a**3 + 3*a**2*x - 9*a**2 + 3*a*x**2 - 16*a*x - 2*a*y + 21*a + x**3 - 8*x
  647. **2 + 21*x - y**2 + z - 18),
  648. z**3*(a**3 + 3*a**2*y + 2*a*x + 3*a*y**2 - 2*a*y - 6*a + x**2 - 6*x + y**3 - y
  649. **2 - z + 9)}$
  650. setideal(m1,matqquot(ws,z));
  651. {x**3 + (3*a - 7)*x**2 - (5*a - 6)*x + y**3 + (3*a - 2)*y**2 + (5*a - 9)*y,
  652. z - x**2 - (2*a - 6)*x - y**3 - (3*a - 1)*y**2 - (7*a - 9)*y}$
  653. % This defines a loc. smooth system at the origin, since the
  654. % jacobian at the origin of the gbasis is nonsingular :
  655. off noetherian$
  656. setring getring m;
  657. {{z,x,y},{{-1,-1,-1}},lex,{1,1,1}}$
  658. setideal(m1,m1);
  659. { - (5*a - 6)*x + (5*a - 9)*y + (3*a - 7)*x**2 + (3*a - 2)*y**2 + x**3 + y**3,
  660. z - (2*a - 6)*x - (7*a - 9)*y - x**2 - (3*a - 1)*y**2 - y**3}$
  661. gbasis m1;
  662. {(5*a - 6)*x - (5*a - 9)*y - (3*a - 7)*x**2 - (3*a - 2)*y**2 - x**3 - y**3,
  663. (5*a - 6)*z + 27*y + (9*a - 18)*x**2 - (18*a - 45)*y**2 - (2*a - 6)*x**3 - (7*
  664. a - 12)*y**3}$
  665. % clear the rules previously set.
  666. setrules {};
  667. {}$
  668. % Example 11 : The standard basis of another example.
  669. % Comparing different approaches.
  670. vars:={x,y}$
  671. setring(vars,localorder vars,lex);
  672. {{x,y},{{-1,-1}},lex,{1,1}}$
  673. ff:=x^5+y^11+(x+x^3)*y^9;
  674. ff := x**5 + x**3*y**9 + x*y**9 + y**11$
  675. setideal(p1,mat2list matjac({ff},vars));
  676. {5*x**4 + y**9 + 3*x**2*y**9,
  677. 9*x*y**8 + 11*y**10 + 9*x**3*y**8}$
  678. gbasis p1;
  679. {5*x**4 + y**9 + 3*x**2*y**9,
  680. 9*x*y**8 + 11*y**10 + 9*x**3*y**8,
  681. 73205*y**16 + 6561*y**17 - 32805*x**10*y**8 + 294030*x**6*y**12 - 292820*x**2*
  682. y**16 + 120285*x**9*y**10 - 239580*x**5*y**14 + 19683*x**2*y**17}$
  683. gbtestversion 2$
  684. setideal(p2,p1);
  685. {5*x**4 + y**9 + 3*x**2*y**9,
  686. 9*x*y**8 + 11*y**10 + 9*x**3*y**8}$
  687. gbasis p2;
  688. {5*x**4 + y**9 + 3*x**2*y**9,
  689. 9*x*y**8 + 11*y**10 + 9*x**3*y**8,
  690. 73205*y**16 + 6561*y**17 - 32805*x**10*y**8 + 294030*x**6*y**12 - 292820*x**2*
  691. y**16 + 120285*x**9*y**10 - 239580*x**5*y**14 + 19683*x**2*y**17}$
  692. gbtestversion 3$
  693. setideal(p3,p1);
  694. {5*x**4 + y**9 + 3*x**2*y**9,
  695. 9*x*y**8 + 11*y**10 + 9*x**3*y**8}$
  696. gbasis p3;
  697. {5*x**4 + y**9 + 3*x**2*y**9,
  698. 9*x*y**8 + 11*y**10 + 9*x**3*y**8,
  699. 73205*y**16 + 6561*y**17 - 32805*x**10*y**8 + 294030*x**6*y**12 - 292820*x**2*
  700. y**16 + 120285*x**9*y**10 - 239580*x**5*y**14 + 19683*x**2*y**17}$
  701. gbtestversion 1$
  702. modequalp(p1,p2);
  703. yes$
  704. modequalp(p1,p3);
  705. yes$
  706. dim p1;
  707. 0$
  708. degree p1;
  709. 40$
  710. % Example 12 : A local intersection wrt. a non inflimited term order.
  711. setring({x,y,z},{},revlex);
  712. {{x,y,z},{},revlex,{1,1,1}}$
  713. m1:=matintersect({x-y^2,y-x^2},{x-z^2,z-x^2},{y-z^2,z-y^2});
  714. m1 := {y*z - x**3*y*z - x*y*z**2 + x**4*y*z**2 - y**2*z**2 + x**3*y**2*z**2 + x
  715. *y**2*z**3 - x**4*y**2*z**3,
  716. x*z - x**2*y*z - x**2*z**2 - x*y*z**2 + x**3*y*z**2 + x**2*y**2*z**2 + x
  717. **2*y*z**3 - x**3*y**2*z**3,
  718. x*y - x**2*y**2 - x**2*y*z - x*y**2*z + x**3*y**2*z + x**2*y**3*z + x**2
  719. *y**2*z**2 - x**3*y**3*z**2}$
  720. % Delete polynomial units post factum :
  721. deleteunits ws;
  722. {y*z,x*z,x*y}$
  723. % Detecting polynomial units early :
  724. on detectunits;
  725. m1:=matintersect({x-y^2,y-x^2},{x-z^2,z-x^2},{y-z^2,z-y^2});
  726. m1 := {y*z,x*z,x*y}$
  727. off detectunits;
  728. comment
  729. ####################################
  730. ### ###
  731. ### More Advanced Computations ###
  732. ### ###
  733. ####################################
  734. end comment;
  735. % Return to a noetherian term order:
  736. vars:={x,y,z}$
  737. setring(vars,degreeorder vars,revlex);
  738. {{x,y,z},{{1,1,1}},revlex,{1,1,1}}$
  739. on noetherian;
  740. % Example 13 : Use of "mod".
  741. % Polynomials modulo ideals :
  742. setideal(m,{2x^2+y+5,3y^2+z+7,7z^2+x+1});
  743. {2*x**2 + y + 5,3*y**2 + z + 7,7*z**2 + x + 1}$
  744. x^2*y^2*z^2 mod m;
  745. ( - x*y*z - 7*x*y - 5*x*z - 35*x - y*z - 7*y - 5*z - 35)/42$
  746. % Lists of polynomials modulo ideals :
  747. {x^3,y^3,z^3} mod gbasis m;
  748. {(x*( - y - 5))/2,(y*( - z - 7))/3,( - z*(x + 1))/7}$
  749. % Matrices modulo modules :
  750. mm:=mat((x^4,y^4,z^4));
  751. mm := mat((x**4,y**4,z**4))$
  752. mm1:=tp<< ideal2mat m>>;
  753. mm1 := mat((2*x**2 + y + 5,3*y**2 + z + 7,x + 7*z**2 + 1))$
  754. mm mod mm1;
  755. mat(((y**2 + 10*y + 25)/4,( - 6*x**2*y**2 - 2*x**2*z - 14*x**2 + 4*y**4 + 3*y**
  756. 3 + 15*y**2 + y*z + 7*y + 5*z + 35)/4,( - 2*x**3 - 14*x**2*z**2 - 2*x**
  757. 2 + x*y + 5*x + 7*y*z**2 + y + 4*z**4 + 35*z**2 + 5)/4))$
  758. % Example 14 : Powersums through elementary symmetric functions.
  759. vars:={a,b,c,d,e1,e2,e3,e4}$
  760. setring(vars,{},lex)$
  761. m:=interreduce {a+b+c+d-e1,
  762. a*b+a*c+a*d+b*c+b*d+c*d-e2,
  763. a*b*c+a*b*d+a*c*d+b*c*d-e3,
  764. a*b*c*d-e4};
  765. m := {d**4 - d**3*e1 + d**2*e2 - d*e3 + e4,
  766. a + b + c + d - e1,
  767. c**3 + c**2*d - c**2*e1 + c*d**2 - c*d*e1 + c*e2 + d**3 - d**2*e1 + d*e2
  768. - e3,
  769. b**2 + b*c + b*d - b*e1 + c**2 + c*d - c*e1 + d**2 - d*e1 + e2}$
  770. for n:=1:5 collect a^n+b^n+c^n+d^n mod m;
  771. {e1,
  772. e1**2 - 2*e2,
  773. e1**3 - 3*e1*e2 + 3*e3,
  774. e1**4 - 4*e1**2*e2 + 4*e1*e3 + 2*e2**2 - 4*e4,
  775. e1**5 - 5*e1**3*e2 + 5*e1**2*e3 + 5*e1*e2**2 - 5*e1*e4 - 5*e2*e3}$
  776. % Example 15 : The setrules mechanism.
  777. setring({x,y,z},{},lex)$
  778. setrules {aa^3=>aa+1};
  779. {aa**3 => aa + 1}$
  780. setideal(m,{x^2+y+z-aa,x+y^2+z-aa,x+y+z^2-aa});
  781. {x**2 + y + z - aa,x + y**2 + z - aa,x + y + z**2 - aa}$
  782. gbasis m;
  783. {y**2 - y - z**2 + z,
  784. x + y + z**2 - aa,
  785. 2*y*z**2 - (2*aa - 2)*y + z**4 - (2*aa - 1)*z**2 + (aa**2 - aa),
  786. z**6 - (3*aa + 1)*z**4 + 4*z**3 + (3*aa**2 - 2*aa - 2)*z**2 - (4*aa - 4)*z + (
  787. 3*aa**2 - 3*aa - 1)}$
  788. % Clear the rules previously set.
  789. setrules {};
  790. {}$
  791. % Example 16 : The same example with advanced coefficient domains.
  792. load_package arnum;
  793. defpoly aa^3-aa-1;
  794. setideal(m,{x^2+y+z-aa,x+y^2+z-aa,x+y+z^2-aa});
  795. {x**2 + y + z - aa,x + y**2 + z - aa,x + y + z**2 - aa}$
  796. gbasis m;
  797. {y**2 - y - z**2 + z,
  798. x + y + z**2 - aa,
  799. y*z**2 - (aa - 1)*y + 1/2*z**4 - (aa - 1/2)*z**2 + (1/2*aa**2 - 1/2*aa),
  800. z**6 - (3*aa + 1)*z**4 + 4*z**3 + (3*aa**2 - 2*aa - 2)*z**2 - (4*aa - 4)*z + (
  801. 3*aa**2 - 3*aa - 1)}$
  802. % The following needs some more time since factorization of
  803. % arnum's is not so easy :
  804. groebfactor m;
  805. {{y - (aa**2 - aa - 1),
  806. z - (aa**2 - aa - 1),
  807. x + (aa**2 - aa - 2)},
  808. {y + (aa**2 - aa - 1),
  809. z + (aa**2 - aa - 1),
  810. x - (aa**2 - aa)},
  811. {y - z,x - z,z**2 + 2*z - aa},
  812. {z - (aa**2 - aa),
  813. y + (aa**2 - aa - 1),
  814. x + (aa**2 - aa - 1)},
  815. {z - (aa**2 - aa - 1),
  816. y + (aa**2 - aa - 2),
  817. x - (aa**2 - aa - 1)},
  818. {z + (aa**2 - aa - 2),
  819. y - (aa**2 - aa - 1),
  820. x - (aa**2 - aa - 1)},
  821. {z + (aa**2 - aa - 1),
  822. y - (aa**2 - aa),
  823. x + (aa**2 - aa - 1)}}$
  824. off arnum;
  825. off rational;
  826. comment
  827. ####################################
  828. ### ###
  829. ### Using Advanced Scripts in ###
  830. ### a Complex Example ###
  831. ### ###
  832. ####################################
  833. end comment;
  834. % Example 17 : The square of the 2-minors of a symmetric 3x3-matrix.
  835. vars:=for i:=1:6 collect mkid(x,i);
  836. vars := {x1,
  837. x2,
  838. x3,
  839. x4,
  840. x5,
  841. x6}$
  842. setring(vars,degreeorder vars,revlex);
  843. {{x1,x2,x3,x4,x5,x6},{{1,1,1,1,1,1}},revlex,{1,1,1,1,1,1}}$
  844. % Generating the ideal :
  845. mm:=mat((x1,x2,x3),(x2,x4,x5),(x3,x5,x6));
  846. mm := mat((x1,x2,x3),(x2,x4,x5),(x3,x5,x6))$
  847. m:=ideal_of_minors(mm,2);
  848. m := { - x1*x4 + x2**2,
  849. - x1*x5 + x2*x3,
  850. - x1*x6 + x3**2,
  851. - x2*x5 + x3*x4,
  852. - x2*x6 + x3*x5,
  853. - x4*x6 + x5**2}$
  854. setideal(n,idealpower(m,2));
  855. {x2**4 - 2*x1*x2**2*x4 + x1**2*x4**2,
  856. x3**4 - 2*x1*x3**2*x6 + x1**2*x6**2,
  857. x5**4 - 2*x4*x5**2*x6 + x4**2*x6**2,
  858. x2**2*x3**2 - 2*x1*x2*x3*x5 + x1**2*x5**2,
  859. x3**2*x5**2 - 2*x2*x3*x5*x6 + x2**2*x6**2,
  860. x2**3*x3 - x1*x2*x3*x4 - x1*x2**2*x5 + x1**2*x4*x5,
  861. x2*x3**3 - x1*x3**2*x5 - x1*x2*x3*x6 + x1**2*x5*x6,
  862. x2**2*x3*x4 - x1*x3*x4**2 - x2**3*x5 + x1*x2*x4*x5,
  863. x2**2*x3*x5 - x1*x3*x4*x5 - x2**3*x6 + x1*x2*x4*x6,
  864. x2*x3**2*x5 - x1*x3*x5**2 - x2**2*x3*x6 + x1*x2*x5*x6,
  865. x3**3*x5 - x2*x3**2*x6 - x1*x3*x5*x6 + x1*x2*x6**2,
  866. x2**2*x5**2 - x1*x4*x5**2 - x2**2*x4*x6 + x1*x4**2*x6,
  867. x2*x3*x5**2 - x1*x5**3 - x2*x3*x4*x6 + x1*x4*x5*x6,
  868. x3*x4*x5**2 - x2*x5**3 - x3*x4**2*x6 + x2*x4*x5*x6,
  869. x3*x5**3 - x3*x4*x5*x6 - x2*x5**2*x6 + x2*x4*x6**2,
  870. x3**2*x4**2 - 2*x2*x3*x4*x5 + x1*x4*x5**2 + x2**2*x4*x6 - x1*x4**2*x6,
  871. x2*x3**2*x4 - 2*x1*x3*x4*x5 + x1*x2*x5**2 - x2**3*x6 + x1*x2*x4*x6,
  872. x3**3*x4 - x1*x3*x5**2 - x2**2*x3*x6 - x1*x3*x4*x6 + 2*x1*x2*x5*x6,
  873. x3**2*x4*x5 - x1*x5**3 - 2*x2*x3*x4*x6 + x2**2*x5*x6 + x1*x4*x5*x6,
  874. x3**2*x4*x6 - 2*x2*x3*x5*x6 + x1*x5**2*x6 + x2**2*x6**2 - x1*x4*x6**2,
  875. x1*x3**2*x4 - 2*x1*x2*x3*x5 + x1**2*x5**2 + x1*x2**2*x6 - x1**2*x4*x6}$
  876. % The ideal itself :
  877. gbasis n;
  878. {x2**4 - 2*x1*x2**2*x4 + x1**2*x4**2,
  879. x3**4 - 2*x1*x3**2*x6 + x1**2*x6**2,
  880. x5**4 - 2*x4*x5**2*x6 + x4**2*x6**2,
  881. x2**2*x3**2 - 2*x1*x2*x3*x5 + x1**2*x5**2,
  882. x3**2*x5**2 - 2*x2*x3*x5*x6 + x2**2*x6**2,
  883. x2**3*x3 - x1*x2*x3*x4 - x1*x2**2*x5 + x1**2*x4*x5,
  884. x2*x3**3 - x1*x3**2*x5 - x1*x2*x3*x6 + x1**2*x5*x6,
  885. x2**2*x3*x4 - x1*x3*x4**2 - x2**3*x5 + x1*x2*x4*x5,
  886. x2**2*x3*x5 - x1*x3*x4*x5 - x2**3*x6 + x1*x2*x4*x6,
  887. x2*x3**2*x5 - x1*x3*x5**2 - x2**2*x3*x6 + x1*x2*x5*x6,
  888. x3**3*x5 - x2*x3**2*x6 - x1*x3*x5*x6 + x1*x2*x6**2,
  889. x2**2*x5**2 - x1*x4*x5**2 - x2**2*x4*x6 + x1*x4**2*x6,
  890. x2*x3*x5**2 - x1*x5**3 - x2*x3*x4*x6 + x1*x4*x5*x6,
  891. x3*x4*x5**2 - x2*x5**3 - x3*x4**2*x6 + x2*x4*x5*x6,
  892. x3*x5**3 - x3*x4*x5*x6 - x2*x5**2*x6 + x2*x4*x6**2,
  893. x3**2*x4**2 - 2*x2*x3*x4*x5 + x1*x4*x5**2 + x2**2*x4*x6 - x1*x4**2*x6,
  894. x2*x3**2*x4 - 2*x1*x3*x4*x5 + x1*x2*x5**2 - x2**3*x6 + x1*x2*x4*x6,
  895. x3**3*x4 - x1*x3*x5**2 - x2**2*x3*x6 - x1*x3*x4*x6 + 2*x1*x2*x5*x6,
  896. x3**2*x4*x5 - x1*x5**3 - 2*x2*x3*x4*x6 + x2**2*x5*x6 + x1*x4*x5*x6,
  897. x3**2*x4*x6 - 2*x2*x3*x5*x6 + x1*x5**2*x6 + x2**2*x6**2 - x1*x4*x6**2,
  898. x1*x3**2*x4 - 2*x1*x2*x3*x5 + x1**2*x5**2 + x1*x2**2*x6 - x1**2*x4*x6}$
  899. length n;
  900. 21$
  901. dim n;
  902. 3$
  903. degree n;
  904. 16$
  905. % Its radical.
  906. radical n;
  907. { - x1*x5 + x2*x3,
  908. - x2*x5 + x3*x4,
  909. - x2*x6 + x3*x5,
  910. - x1*x4 + x2**2,
  911. - x1*x6 + x3**2,
  912. - x4*x6 + x5**2}$
  913. % Its unmixed radical.
  914. unmixedradical n;
  915. { - x1*x5 + x2*x3,
  916. x2*x5 - x3*x4,
  917. - x2*x6 + x3*x5,
  918. - x1*x4 + x2**2,
  919. - x1*x6 + x3**2,
  920. - x4*x6 + x5**2}$
  921. % Its equidimensional hull :
  922. n1:=eqhull n;
  923. n1 := {x1**2*x4**2 - 2*x1*x2**2*x4 + x2**4,
  924. x1**2*x6**2 - 2*x1*x3**2*x6 + x3**4,
  925. x4**2*x6**2 - 2*x4*x5**2*x6 + x5**4,
  926. x1**2*x5**2 - 2*x1*x2*x3*x5 + x2**2*x3**2,
  927. x2**2*x6**2 - 2*x2*x3*x5*x6 + x3**2*x5**2,
  928. x1**2*x4*x5 - x1*x2**2*x5 - x1*x2*x3*x4 + x2**3*x3,
  929. x1**2*x5*x6 - x1*x2*x3*x6 - x1*x3**2*x5 + x2*x3**3,
  930. x1*x2*x4*x5 - x1*x3*x4**2 - x2**3*x5 + x2**2*x3*x4,
  931. x1*x2*x4*x6 - x1*x3*x4*x5 - x2**3*x6 + x2**2*x3*x5,
  932. x1*x2*x5*x6 - x1*x3*x5**2 - x2**2*x3*x6 + x2*x3**2*x5,
  933. x1*x2*x6**2 - x1*x3*x5*x6 - x2*x3**2*x6 + x3**3*x5,
  934. x1*x4**2*x6 - x1*x4*x5**2 - x2**2*x4*x6 + x2**2*x5**2,
  935. x1*x4*x5*x6 - x1*x5**3 - x2*x3*x4*x6 + x2*x3*x5**2,
  936. x2*x4*x5*x6 - x2*x5**3 - x3*x4**2*x6 + x3*x4*x5**2,
  937. x2*x4*x6**2 - x2*x5**2*x6 - x3*x4*x5*x6 + x3*x5**3,
  938. - x1*x4*x6 + x1*x5**2 + x2**2*x6 - 2*x2*x3*x5 + x3**2*x4}$
  939. length n1;
  940. 16$
  941. setideal(n1,n1)$
  942. submodulep(n,n1);
  943. yes$
  944. submodulep(n1,n);
  945. no$
  946. % Hence there is an embedded component. Let's find it making
  947. % an excursion to symbolic mode. Of course, this can be done
  948. % also algebraically.
  949. symbolic;
  950. nil
  951. n:=get('n,'basis);
  952. (dpmat 21 0 ((1 ((((0 0 4) 4) . 1) (((0 1 2 0 1) 4) . -2) (((0 2 0 0 2) 4) . 1)
  953. ) 3 0 nil) (2 ((((0 0 0 4) 4) . 1) (((0 1 0 2 0 0 1) 4) . -2) (((0 2 0 0 0 0 2)
  954. 4) . 1)) 3 0 nil) (3 ((((0 0 0 0 0 4) 4) . 1) (((0 0 0 0 1 2 1) 4) . -2) (((0 0
  955. 0 0 2 0 2) 4) . 1)) 3 0 nil) (4 ((((0 0 2 2) 4) . 1) (((0 1 1 1 0 1) 4) . -2) (
  956. ((0 2 0 0 0 2) 4) . 1)) 3 0 nil) (5 ((((0 0 0 2 0 2) 4) . 1) (((0 0 1 1 0 1 1) 4
  957. ) . -2) (((0 0 2 0 0 0 2) 4) . 1)) 3 0 nil) (6 ((((0 0 3 1) 4) . 1) (((0 1 1 1 1
  958. ) 4) . -1) (((0 1 2 0 0 1) 4) . -1) (((0 2 0 0 1 1) 4) . 1)) 4 0 nil) (7 ((((0 0
  959. 1 3) 4) . 1) (((0 1 0 2 0 1) 4) . -1) (((0 1 1 1 0 0 1) 4) . -1) (((0 2 0 0 0 1
  960. 1) 4) . 1)) 4 0 nil) (8 ((((0 0 2 1 1) 4) . 1) (((0 1 0 1 2) 4) . -1) (((0 0 3 0
  961. 0 1) 4) . -1) (((0 1 1 0 1 1) 4) . 1)) 4 0 nil) (9 ((((0 0 2 1 0 1) 4) . 1) (((
  962. 0 1 0 1 1 1) 4) . -1) (((0 0 3 0 0 0 1) 4) . -1) (((0 1 1 0 1 0 1) 4) . 1)) 4 0
  963. nil) (10 ((((0 0 1 2 0 1) 4) . 1) (((0 1 0 1 0 2) 4) . -1) (((0 0 2 1 0 0 1) 4)
  964. . -1) (((0 1 1 0 0 1 1) 4) . 1)) 4 0 nil) (11 ((((0 0 0 3 0 1) 4) . 1) (((0 0 1
  965. 2 0 0 1) 4) . -1) (((0 1 0 1 0 1 1) 4) . -1) (((0 1 1 0 0 0 2) 4) . 1)) 4 0 nil
  966. ) (12 ((((0 0 2 0 0 2) 4) . 1) (((0 1 0 0 1 2) 4) . -1) (((0 0 2 0 1 0 1) 4) .
  967. -1) (((0 1 0 0 2 0 1) 4) . 1)) 4 0 nil) (13 ((((0 0 1 1 0 2) 4) . 1) (((0 1 0 0
  968. 0 3) 4) . -1) (((0 0 1 1 1 0 1) 4) . -1) (((0 1 0 0 1 1 1) 4) . 1)) 4 0 nil) (
  969. 14 ((((0 0 0 1 1 2) 4) . 1) (((0 0 1 0 0 3) 4) . -1) (((0 0 0 1 2 0 1) 4) . -1)
  970. (((0 0 1 0 1 1 1) 4) . 1)) 4 0 nil) (15 ((((0 0 0 1 0 3) 4) . 1) (((0 0 0 1 1 1
  971. 1) 4) . -1) (((0 0 1 0 0 2 1) 4) . -1) (((0 0 1 0 1 0 2) 4) . 1)) 4 0 nil) (16 (
  972. (((0 0 0 2 2) 4) . 1) (((0 0 1 1 1 1) 4) . -2) (((0 1 0 0 1 2) 4) . 1) (((0 0 2
  973. 0 1 0 1) 4) . 1) (((0 1 0 0 2 0 1) 4) . -1)) 5 0 nil) (17 ((((0 0 1 2 1) 4) . 1
  974. ) (((0 1 0 1 1 1) 4) . -2) (((0 1 1 0 0 2) 4) . 1) (((0 0 3 0 0 0 1) 4) . -1) (
  975. ((0 1 1 0 1 0 1) 4) . 1)) 5 0 nil) (18 ((((0 0 0 3 1) 4) . 1) (((0 1 0 1 0 2) 4
  976. ) . -1) (((0 0 2 1 0 0 1) 4) . -1) (((0 1 0 1 1 0 1) 4) . -1) (((0 1 1 0 0 1 1)
  977. 4) . 2)) 5 0 nil) (19 ((((0 0 0 2 1 1) 4) . 1) (((0 1 0 0 0 3) 4) . -1) (((0 0 1
  978. 1 1 0 1) 4) . -2) (((0 0 2 0 0 1 1) 4) . 1) (((0 1 0 0 1 1 1) 4) . 1)) 5 0 nil)
  979. (20 ((((0 0 0 2 1 0 1) 4) . 1) (((0 0 1 1 0 1 1) 4) . -2) (((0 1 0 0 0 2 1) 4) .
  980. 1) (((0 0 2 0 0 0 2) 4) . 1) (((0 1 0 0 1 0 2) 4) . -1)) 5 0 nil) (21 ((((0 1 0
  981. 2 1) 4) . 1) (((0 1 1 1 0 1) 4) . -2) (((0 2 0 0 0 2) 4) . 1) (((0 1 2 0 0 0 1)
  982. 4) . 1) (((0 2 0 0 1 0 1) 4) . -1)) 5 0 nil)) nil nil)
  983. % This needs even more time than the eqhull, of course.
  984. u:=primarydecomposition!* n;
  985. (((dpmat 16 0 ((1 ((((0 0 2 1 0 1) 4) . 1) (((0 1 0 1 1 1) 4) . -1) (((0 0 3 0 0
  986. 0 1) 4) . -1) (((0 1 1 0 1 0 1) 4) . 1)) 4 0 nil) (2 ((((0 0 1 2 0 1) 4) . 1) (
  987. ((0 1 0 1 0 2) 4) . -1) (((0 0 2 1 0 0 1) 4) . -1) (((0 1 1 0 0 1 1) 4) . 1)) 4
  988. 0 nil) (3 ((((0 0 1 1 0 2) 4) . 1) (((0 1 0 0 0 3) 4) . -1) (((0 0 1 1 1 0 1) 4
  989. ) . -1) (((0 1 0 0 1 1 1) 4) . 1)) 4 0 nil) (4 ((((0 0 4) 4) . 1) (((0 1 2 0 1)
  990. 4) . -2) (((0 2 0 0 2) 4) . 1)) 3 0 nil) (5 ((((0 0 3 1) 4) . 1) (((0 1 1 1 1) 4
  991. ) . -1) (((0 1 2 0 0 1) 4) . -1) (((0 2 0 0 1 1) 4) . 1)) 4 0 nil) (6 ((((0 0 2
  992. 2) 4) . 1) (((0 1 1 1 0 1) 4) . -2) (((0 2 0 0 0 2) 4) . 1)) 3 0 nil) (7 ((((0 0
  993. 2 1 1) 4) . 1) (((0 1 0 1 2) 4) . -1) (((0 0 3 0 0 1) 4) . -1) (((0 1 1 0 1 1) 4
  994. ) . 1)) 4 0 nil) (8 ((((0 0 2 0 0 2) 4) . 1) (((0 1 0 0 1 2) 4) . -1) (((0 0 2 0
  995. 1 0 1) 4) . -1) (((0 1 0 0 2 0 1) 4) . 1)) 4 0 nil) (9 ((((0 0 0 4) 4) . 1) (((
  996. 0 1 0 2 0 0 1) 4) . -2) (((0 2 0 0 0 0 2) 4) . 1)) 3 0 nil) (10 ((((0 0 0 0 0 4
  997. ) 4) . 1) (((0 0 0 0 1 2 1) 4) . -2) (((0 0 0 0 2 0 2) 4) . 1)) 3 0 nil) (11 ((
  998. ((0 0 0 2 0 2) 4) . 1) (((0 0 1 1 0 1 1) 4) . -2) (((0 0 2 0 0 0 2) 4) . 1)) 3 0
  999. nil) (12 ((((0 0 1 3) 4) . 1) (((0 1 0 2 0 1) 4) . -1) (((0 1 1 1 0 0 1) 4) . -1
  1000. ) (((0 2 0 0 0 1 1) 4) . 1)) 4 0 nil) (13 ((((0 0 0 3 0 1) 4) . 1) (((0 0 1 2 0
  1001. 0 1) 4) . -1) (((0 1 0 1 0 1 1) 4) . -1) (((0 1 1 0 0 0 2) 4) . 1)) 4 0 nil) (
  1002. 14 ((((0 0 0 1 1 2) 4) . 1) (((0 0 1 0 0 3) 4) . -1) (((0 0 0 1 2 0 1) 4) . -1)
  1003. (((0 0 1 0 1 1 1) 4) . 1)) 4 0 nil) (15 ((((0 0 0 1 0 3) 4) . 1) (((0 0 0 1 1 1
  1004. 1) 4) . -1) (((0 0 1 0 0 2 1) 4) . -1) (((0 0 1 0 1 0 2) 4) . 1)) 4 0 nil) (16 (
  1005. (((0 0 0 2 1) 3) . 1) (((0 0 1 1 0 1) 3) . -2) (((0 1 0 0 0 2) 3) . 1) (((0 0 2
  1006. 0 0 0 1) 3) . 1) (((0 1 0 0 1 0 1) 3) . -1)) 5 0 nil)) nil t) (dpmat 6 0 ((1 ((
  1007. ((0 0 0 1 0 1) 2) . 1) (((0 0 1 0 0 0 1) 2) . -1)) 2 0 nil) (2 ((((0 0 0 0 0 2)
  1008. 2) . 1) (((0 0 0 0 1 0 1) 2) . -1)) 2 0 nil) (3 ((((0 0 0 1 1) 2) . 1) (((0 0 1
  1009. 0 0 1) 2) . -1)) 2 0 nil) (4 ((((0 0 0 2) 2) . 1) (((0 1 0 0 0 0 1) 2) . -1)) 2
  1010. 0 nil) (5 ((((0 0 1 1) 2) . 1) (((0 1 0 0 0 1) 2) . -1)) 2 0 nil) (6 ((((0 0 2)
  1011. 2) . 1) (((0 1 0 0 1) 2) . -1)) 2 0 nil)) nil t)) ((dpmat 18 0 ((1 ((((0 0 1 0 0
  1012. 3) 4) . 1)) 1 0 nil) (2 ((((0 0 0 0 0 0 1) 1) . 1)) 1 0 nil) (3 ((((0 0 0 4) 4)
  1013. . 1)) 1 0 nil) (4 ((((0 0 0 0 0 4) 4) . 1)) 1 0 nil) (5 ((((0 0 0 2 0 2) 4) . 1
  1014. )) 1 0 nil) (6 ((((0 0 0 3 0 1) 4) . 1)) 1 0 nil) (7 ((((0 0 0 1 0 3) 4) . 1)) 1
  1015. 0 nil) (8 ((((0 0 0 0 1) 1) . 1)) 1 0 nil) (9 ((((0 0 3 0 0 1) 4) . 1)) 1 0 nil
  1016. ) (10 ((((0 0 2 1 0 1) 4) . 1)) 1 0 nil) (11 ((((0 0 1 2 0 1) 4) . 1)) 1 0 nil)
  1017. (12 ((((0 0 2 0 0 2) 4) . 1)) 1 0 nil) (13 ((((0 0 1 1 0 2) 4) . 1)) 1 0 nil) (
  1018. 14 ((((0 0 4) 4) . 1)) 1 0 nil) (15 ((((0 0 2 2) 4) . 1)) 1 0 nil) (16 ((((0 1)
  1019. 1) . 1)) 1 0 nil) (17 ((((0 0 1 3) 4) . 1)) 1 0 nil) (18 ((((0 0 3 1) 4) . 1)) 1
  1020. 0 nil)) nil t) (dpmat 6 0 ((1 ((((0 0 0 0 0 0 1) 1) . 1)) 1 0 nil) (2 ((((0 0 0
  1021. 0 1) 1) . 1)) 1 0 nil) (3 ((((0 1) 1) . 1)) 1 0 nil) (4 ((((0 0 1) 1) . 1)) 1 0
  1022. nil) (5 ((((0 0 0 1) 1) . 1)) 1 0 nil) (6 ((((0 0 0 0 0 1) 1) . 1)) 1 0 nil))
  1023. nil t)))
  1024. for each x in u collect easydim!* cadr x;
  1025. (3 0)
  1026. for each x in u collect degree!* car x;
  1027. (16 20)
  1028. % Hence the embedded component is a trivial one. Let's divide
  1029. % it out by a stable ideal quotient calculation :
  1030. algebraic;
  1031. setideal(n2,matstabquot(n,vars));
  1032. {x2**4 - 2*x1*x2**2*x4 + x1**2*x4**2,
  1033. x3**4 - 2*x1*x3**2*x6 + x1**2*x6**2,
  1034. x5**4 - 2*x4*x5**2*x6 + x4**2*x6**2,
  1035. x2**2*x3**2 - 2*x1*x2*x3*x5 + x1**2*x5**2,
  1036. x3**2*x5**2 - 2*x2*x3*x5*x6 + x2**2*x6**2,
  1037. x2**3*x3 - x1*x2*x3*x4 - x1*x2**2*x5 + x1**2*x4*x5,
  1038. x2*x3**3 - x1*x3**2*x5 - x1*x2*x3*x6 + x1**2*x5*x6,
  1039. x2**2*x3*x4 - x1*x3*x4**2 - x2**3*x5 + x1*x2*x4*x5,
  1040. x2**2*x3*x5 - x1*x3*x4*x5 - x2**3*x6 + x1*x2*x4*x6,
  1041. x2*x3**2*x5 - x1*x3*x5**2 - x2**2*x3*x6 + x1*x2*x5*x6,
  1042. x3**3*x5 - x2*x3**2*x6 - x1*x3*x5*x6 + x1*x2*x6**2,
  1043. x2**2*x5**2 - x1*x4*x5**2 - x2**2*x4*x6 + x1*x4**2*x6,
  1044. x2*x3*x5**2 - x1*x5**3 - x2*x3*x4*x6 + x1*x4*x5*x6,
  1045. x3*x4*x5**2 - x2*x5**3 - x3*x4**2*x6 + x2*x4*x5*x6,
  1046. x3*x5**3 - x3*x4*x5*x6 - x2*x5**2*x6 + x2*x4*x6**2,
  1047. x3**2*x4 - 2*x2*x3*x5 + x1*x5**2 + x2**2*x6 - x1*x4*x6}$
  1048. modequalp(n1,n2);
  1049. yes$
  1050. comment
  1051. ########################################
  1052. ### ###
  1053. ### Test Examples for New Features ###
  1054. ### ###
  1055. ########################################
  1056. end comment;
  1057. % ==> Testing the different zerodimensional solver
  1058. vars:={x,y,z}$
  1059. setring(vars,degreeorder vars,revlex);
  1060. {{x,y,z},{{1,1,1}},revlex,{1,1,1}}$
  1061. setideal(m,{x^3+y+z-3,y^3+x+z-3,z^3+x+y-3});
  1062. {x**3 + y + z - 3,y**3 + x + z - 3,z**3 + x + y - 3}$
  1063. zerosolve1 m;
  1064. {{x + y + z**3 - 3,
  1065. y + z**3 + z - 3,
  1066. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1067. {x + y + z**3 - 3,
  1068. 2*y + z**3 - 3,
  1069. z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
  1070. {x + y + z,
  1071. y**2 + y*z + z**2 - 1,
  1072. z**3 - z - 3},
  1073. {x + z**3 + z - 3,
  1074. y - z,
  1075. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1076. {x - z,y - z,z**2 + z + 3},
  1077. {x - 1,y - 1,z - 1}}$
  1078. zerosolve2 m;
  1079. {{x + y + z**3 - 3,
  1080. y + z**3 + z - 3,
  1081. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1082. {x + y + z**3 - 3,
  1083. 2*y + z**3 - 3,
  1084. z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
  1085. {x + y + z,
  1086. y**2 + y*z + z**2 - 1,
  1087. z**3 - z - 3},
  1088. {x + z**3 + z - 3,
  1089. y - z,
  1090. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1091. {x - z,y - z,z**2 + z + 3},
  1092. {x - 1,y - 1,z - 1}}$
  1093. setring(vars,{},lex)$
  1094. setideal(m,m)$
  1095. m1:=gbasis m$
  1096. zerosolve m1;
  1097. {{x - 1,y - 1,z - 1},
  1098. {x - z,y - z,z**2 + z + 3},
  1099. {x + y + z,
  1100. y**2 + y*z + z**2 - 1,
  1101. z**3 - z - 3},
  1102. {2*x + z**3 - 3,
  1103. 2*y + z**3 - 3,
  1104. z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
  1105. {x + z**3 + z - 3,
  1106. y - z,
  1107. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1108. {x - z,
  1109. y + z**3 + z - 3,
  1110. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8}}$
  1111. zerosolve1 m1;
  1112. {{x - 1,y - 1,z - 1},
  1113. {x - z,y - z,z**2 + z + 3},
  1114. {x + y + z,
  1115. y**2 + y*z + z**2 - 1,
  1116. z**3 - z - 3},
  1117. {x - y,
  1118. 2*y + z**3 - 3,
  1119. z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
  1120. {x + z**3 + z - 3,
  1121. y - z,
  1122. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1123. {x - z,
  1124. y + z**3 + z - 3,
  1125. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8}}$
  1126. zerosolve2 m1;
  1127. {{x - 1,y - 1,z - 1},
  1128. {x - z,y - z,z**2 + z + 3},
  1129. {x + y + z,
  1130. y**2 + y*z + z**2 - 1,
  1131. z**3 - z - 3},
  1132. {x - y,
  1133. 2*y + z**3 - 3,
  1134. z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
  1135. {x + z**3 + z - 3,
  1136. y - z,
  1137. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
  1138. {x - z,
  1139. y + z**3 + z - 3,
  1140. z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8}}$
  1141. % ==> Testing groebfactor, extendedgroebfactor, extendedgroebfactor1
  1142. % Gerdt et al. : Seventh order KdV type equation.
  1143. A1:=-2*L1**2+L1*L2+2*L1*L3-L2**2-7*L5+21*L6$
  1144. A2:=7*L7-2*L1*L4+3/7*L1**3$
  1145. B1:=L1*(5*L1-3*L2+L3)$
  1146. B2:=L1*(2*L6-4*L4)$
  1147. B3:=L1*L7/2$
  1148. P1:=L1*(L4-L5/2+L6)$
  1149. P2:=(2/7*L1**2-L4)*(-10*L1+5*L2-L3)$
  1150. P3:=(2/7*L1**2-L4)*(3*L4-L5+L6)$
  1151. P4:=A1*(-3*L1+2*L2)+21*A2$
  1152. P5:=A1*(2*L4-2*L5)+A2*(-45*L1+15*L2-3*L3)$
  1153. P6:=2*A1*L7+A2*(12*L4-3*L5+2*L6)$
  1154. P7:=B1*(2*L2-L1)+7*B2$
  1155. P8:=B1*L3+7*B2$
  1156. P9:=B1*(-2*L4-2*L5)+B2*(2*L2-8*L1)+84*B3$
  1157. P10:=B1*(8/3*L5+6*L6)+B2*(11*L1-17/3*L2+5/3*L3)-168*B3$
  1158. P11:=15*B1*L7+B2*(5*L4-2*L5)+B3*(-120*L1+30*L2-6*L3)$
  1159. P12:=-3*B1*L7+B2*(-L4/2+L5/4-L6/2)+B3*(24*L1-6*L2)$
  1160. P13:=3*B2*L7+B3*(40*L4-8*L5+4*L6)$
  1161. polys:={P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13};
  1162. polys := {(l1*(2*l4 - l5 + 2*l6))/2,
  1163. ( - 20*l1**3 + 10*l1**2*l2 - 2*l1**2*l3 + 70*l1*l4 - 35*l2*l4 + 7*l3*
  1164. l4)/7,
  1165. (6*l1**2*l4 - 2*l1**2*l5 + 2*l1**2*l6 - 21*l4**2 + 7*l4*l5 - 7*l4*l6)
  1166. /7,
  1167. 15*l1**3 - 7*l1**2*l2 - 6*l1**2*l3 + 5*l1*l2**2 + 4*l1*l2*l3 - 42*l1*
  1168. l4 + 21*l1*l5 - 63*l1*l6 - 2*l2**3 - 14*l2*l5 + 42*l2*l6 + 147*l7,
  1169. ( - 135*l1**4 + 45*l1**3*l2 - 9*l1**3*l3 + 602*l1**2*l4 + 28*l1**2*l5
  1170. - 196*l1*l2*l4 - 14*l1*l2*l5 + 70*l1*l3*l4 - 28*l1*l3*l5 - 2205*l1*
  1171. l7 - 14*l2**2*l4 + 14*l2**2*l5 + 735*l2*l7 - 147*l3*l7 - 98*l4*l5 +
  1172. 294*l4*l6 + 98*l5**2 - 294*l5*l6)/7,
  1173. (36*l1**3*l4 - 9*l1**3*l5 + 6*l1**3*l6 - 28*l1**2*l7 + 14*l1*l2*l7 +
  1174. 28*l1*l3*l7 - 168*l1*l4**2 + 42*l1*l4*l5 - 28*l1*l4*l6 - 14*l2**2*l7
  1175. + 588*l4*l7 - 245*l5*l7 + 392*l6*l7)/7,
  1176. l1*( - 5*l1**2 + 13*l1*l2 - l1*l3 - 6*l2**2 + 2*l2*l3 - 28*l4 + 14*l6
  1177. ),
  1178. l1*(5*l1*l3 - 3*l2*l3 + l3**2 - 28*l4 + 14*l6),
  1179. 2*l1*(11*l1*l4 - 5*l1*l5 - 8*l1*l6 - l2*l4 + 3*l2*l5 + 2*l2*l6 - l3*
  1180. l4 - l3*l5 + 21*l7),
  1181. (4*l1*( - 33*l1*l4 + 10*l1*l5 + 39*l1*l6 + 17*l2*l4 - 6*l2*l5 - 22*l2
  1182. *l6 - 5*l3*l4 + 2*l3*l5 + 7*l3*l6 - 63*l7))/3,
  1183. l1*(15*l1*l7 - 30*l2*l7 + 12*l3*l7 - 20*l4**2 + 8*l4*l5 + 10*l4*l6 -
  1184. 4*l5*l6),
  1185. (l1*( - 6*l1*l7 + 12*l2*l7 - 6*l3*l7 + 4*l4**2 - 2*l4*l5 + 2*l4*l6 +
  1186. l5*l6 - 2*l6**2))/2,
  1187. 4*l1*l7*(2*l4 - l5 + 2*l6)}$
  1188. vars:={L7,L6,L5,L4,L3,L2,L1};
  1189. vars := {l7,
  1190. l6,
  1191. l5,
  1192. l4,
  1193. l3,
  1194. l2,
  1195. l1}$
  1196. clear a1,a2,b1,b2,b3$
  1197. off lexefgb;
  1198. setring(vars,{},lex);
  1199. {{l7,l6,l5,l4,l3,l2,l1},{},lex,{1,1,1,1,1,1,1}}$
  1200. % The factorized Groebner algorithm.
  1201. groebfactor polys;
  1202. {{l1,l4,l7,21*l6 - 7*l5 - l2**2},
  1203. {l1,
  1204. l4,
  1205. 7*l5 - l3*l2 + 5*l2**2,
  1206. 56*l6 - 5*l3*l2 + 23*l2**2,
  1207. 588*l7 + 7*l3*l2**2 - 37*l2**3},
  1208. {l1,
  1209. l7,
  1210. l3 - 5*l2,
  1211. 14*l6 - 21*l4 - l2**2,
  1212. 14*l5 - 63*l4 - l2**2},
  1213. {l1,l4,l2,l5,l7},
  1214. {7*l4 - 2*l1**2,
  1215. l2 - 2*l1,
  1216. l3 - 3*l1,
  1217. 147*l7 - 4*l1**3,
  1218. 7*l5 - 6*l1**2,
  1219. 7*l6 - l1**2},
  1220. {7*l4 - 2*l1**2,
  1221. 2*l2 - 7*l1,
  1222. l3 - 6*l1,
  1223. 147*l7 - 4*l1**3,
  1224. 7*l5 - 9*l1**2,
  1225. 14*l6 - 5*l1**2},
  1226. {l1,
  1227. l3 - 5*l2,
  1228. 63*l4 + 2*l2**2,
  1229. 63*l5 + 2*l2**2,
  1230. 63*l6 - 4*l2**2,
  1231. 1323*l7 + 10*l2**3},
  1232. {l1,l2,l3,l7,l5 - l4,l6 + 2*l4},
  1233. {l2 - 3*l1,
  1234. l3 - 5*l1,
  1235. 14*l4 - 5*l1**2,
  1236. 98*l7 - 5*l1**3,
  1237. 7*l5 - 10*l1**2,
  1238. 14*l6 - 5*l1**2}}$
  1239. % The extended Groebner factorizer, producing triangular sets.
  1240. extendedgroebfactor polys;
  1241. {{{98*l7 - 5*l1**3,
  1242. 14*l6 - 5*l1**2,
  1243. 7*l5 - 10*l1**2,
  1244. 14*l4 - 5*l1**2,
  1245. l3 - 5*l1,
  1246. l2 - 3*l1},
  1247. {},
  1248. {l1}},
  1249. {{l7,l6 + 2*l4,l5 - l4,l3,l2,l1},{},{l4}},
  1250. {{1323*l7 + 10*l2**3,
  1251. 63*l6 - 4*l2**2,
  1252. 63*l5 + 2*l2**2,
  1253. 63*l4 + 2*l2**2,
  1254. l3 - 5*l2,
  1255. l1},
  1256. {},
  1257. {l2}},
  1258. {{147*l7 - 4*l1**3,
  1259. 14*l6 - 5*l1**2,
  1260. 7*l5 - 9*l1**2,
  1261. 7*l4 - 2*l1**2,
  1262. l3 - 6*l1,
  1263. 2*l2 - 7*l1},
  1264. {},
  1265. {l1}},
  1266. {{147*l7 - 4*l1**3,
  1267. 7*l6 - l1**2,
  1268. 7*l5 - 6*l1**2,
  1269. 7*l4 - 2*l1**2,
  1270. l3 - 3*l1,
  1271. l2 - 2*l1},
  1272. {},
  1273. {l1}},
  1274. {{l7,l5,l4,l2,l1},{},{l6,l3}},
  1275. {{l7,
  1276. 14*l6 - (l2**2 + 21*l4),
  1277. 14*l5 - (l2**2 + 63*l4),
  1278. l3 - 5*l2,
  1279. l1},
  1280. {},
  1281. {l4,l2}},
  1282. {{588*l7 - (37*l2**3 - 7*l2**2*l3),
  1283. 56*l6 + (23*l2**2 - 5*l2*l3),
  1284. 7*l5 + (5*l2**2 - l2*l3),
  1285. l4,
  1286. l1},
  1287. {},
  1288. {l3,l2}},
  1289. {{l7,21*l6 - (l2**2 + 7*l5),l4,l1},{},{l5,l3,l2}}}$
  1290. % The extended Groebner factorizer with subproblem removal check.
  1291. extendedgroebfactor1 polys;
  1292. {{{l7,21*l6 - (l2**2 + 7*l5),l4,l1},{},{l5,l3,l2}},
  1293. {{588*l7 - (37*l2**3 - 7*l2**2*l3),
  1294. 56*l6 + (23*l2**2 - 5*l2*l3),
  1295. 7*l5 + (5*l2**2 - l2*l3),
  1296. l4,
  1297. l1},
  1298. {},
  1299. {l3,l2}},
  1300. {{l7,
  1301. 14*l6 - (l2**2 + 21*l4),
  1302. 14*l5 - (l2**2 + 63*l4),
  1303. l3 - 5*l2,
  1304. l1},
  1305. {},
  1306. {l4,l2}},
  1307. {{l7,l5,l4,l2,l1},{},{l6,l3}},
  1308. {{147*l7 - 4*l1**3,
  1309. 7*l6 - l1**2,
  1310. 7*l5 - 6*l1**2,
  1311. 7*l4 - 2*l1**2,
  1312. l3 - 3*l1,
  1313. l2 - 2*l1},
  1314. {},
  1315. {l1}},
  1316. {{147*l7 - 4*l1**3,
  1317. 14*l6 - 5*l1**2,
  1318. 7*l5 - 9*l1**2,
  1319. 7*l4 - 2*l1**2,
  1320. l3 - 6*l1,
  1321. 2*l2 - 7*l1},
  1322. {},
  1323. {l1}},
  1324. {{1323*l7 + 10*l2**3,
  1325. 63*l6 - 4*l2**2,
  1326. 63*l5 + 2*l2**2,
  1327. 63*l4 + 2*l2**2,
  1328. l3 - 5*l2,
  1329. l1},
  1330. {},
  1331. {l2}},
  1332. {{l7,l6 + 2*l4,l5 - l4,l3,l2,l1},{},{l4}},
  1333. {{98*l7 - 5*l1**3,
  1334. 14*l6 - 5*l1**2,
  1335. 7*l5 - 10*l1**2,
  1336. 14*l4 - 5*l1**2,
  1337. l3 - 5*l1,
  1338. l2 - 3*l1},
  1339. {},
  1340. {l1}}}$
  1341. % Gonnet's example (ACM SIGSAM Bulletin 17 (1983), 48 - 49)
  1342. vars:={a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5};
  1343. vars := {a0,
  1344. a2,
  1345. a3,
  1346. a4,
  1347. a5,
  1348. b0,
  1349. b1,
  1350. b2,
  1351. b3,
  1352. b4,
  1353. b5,
  1354. c0,
  1355. c1,
  1356. c2,
  1357. c3,
  1358. c4,
  1359. c5}$
  1360. polys:={a4*b4,
  1361. a5*b1+b5+a4*b3+a3*b4,
  1362. a2*b2,a5*b5,
  1363. (a0+1+a4)*b2+a2*(b0+b1+b4)+c2,
  1364. (a0+1+a4)*(b0+b1+b4)+(a3+a5)*b2+a2*(b3+b5)+c0+c1+c4,
  1365. (a3+a5)*(b0+b1+b4)+(b3+b5)*(a0+1+a4)+c3+c5-1,
  1366. (a3+a5)*(b3+b5),
  1367. a5*(b3+b5)+b5*(a3+a5),
  1368. b5*(a0+1+2*a4)+a5*(b0+b1+2*b4)+a3*b4+a4*b3+c5,
  1369. a4*(b0+b1+2*b4)+a2*b5+a5*b2+(a0+1)*b4+c4,
  1370. a2*b4+a4*b2,
  1371. a4*b5+a5*b4,
  1372. 2*a3*b3+a3*b5+a5*b3,
  1373. c3+b3*(a0+2+a4)+a3*(b0+2*b1+b4)+b5+a5*b1,
  1374. c1+(a0+2+a4)*b1+a2*b3+a3*b2+(b0+b4),
  1375. a2*b1+b2,
  1376. a5*b3+a3*b5,
  1377. b4+a4*b1};
  1378. polys := {a4*b4,
  1379. a3*b4 + a4*b3 + a5*b1 + b5,
  1380. a2*b2,
  1381. a5*b5,
  1382. a0*b2 + a2*b0 + a2*b1 + a2*b4 + a4*b2 + b2 + c2,
  1383. a0*b0 + a0*b1 + a0*b4 + a2*b3 + a2*b5 + a3*b2 + a4*b0 + a4*b1 + a4*b4
  1384. + a5*b2 + b0 + b1 + b4 + c0 + c1 + c4,
  1385. a0*b3 + a0*b5 + a3*b0 + a3*b1 + a3*b4 + a4*b3 + a4*b5 + a5*b0 + a5*b1
  1386. + a5*b4 + b3 + b5 + c3 + c5 - 1,
  1387. a3*b3 + a3*b5 + a5*b3 + a5*b5,
  1388. a3*b5 + a5*b3 + 2*a5*b5,
  1389. a0*b5 + a3*b4 + a4*b3 + 2*a4*b5 + a5*b0 + a5*b1 + 2*a5*b4 + b5 + c5,
  1390. a0*b4 + a2*b5 + a4*b0 + a4*b1 + 2*a4*b4 + a5*b2 + b4 + c4,
  1391. a2*b4 + a4*b2,
  1392. a4*b5 + a5*b4,
  1393. 2*a3*b3 + a3*b5 + a5*b3,
  1394. a0*b3 + a3*b0 + 2*a3*b1 + a3*b4 + a4*b3 + a5*b1 + 2*b3 + b5 + c3,
  1395. a0*b1 + a2*b3 + a3*b2 + a4*b1 + b0 + 2*b1 + b4 + c1,
  1396. a2*b1 + b2,
  1397. a3*b5 + a5*b3,
  1398. a4*b1 + b4}$
  1399. on lexefgb;
  1400. % Switching back to the default.
  1401. setring(vars,{},lex);
  1402. {{a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5},
  1403. {},
  1404. lex,
  1405. {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}$
  1406. groebfactor polys;
  1407. {{c5,
  1408. b5,
  1409. c2,
  1410. c4,
  1411. b2,
  1412. b4,
  1413. a4,
  1414. a2,
  1415. a5,
  1416. b3,
  1417. a3*b1 + 1,
  1418. b0 - b1*c3 + 2*b1,
  1419. a0 - a3*c1 + c3,
  1420. b1*c3**2 - 2*b1*c3 + b1 - c0 + c1*c3 - 2*c1,
  1421. a3*c0 - a3*c1*c3 + 2*a3*c1 + c3**2 - 2*c3 + 1},
  1422. {c5,
  1423. c4,
  1424. b5,
  1425. b4,
  1426. a4,
  1427. b2,
  1428. a5,
  1429. a3,
  1430. b1,
  1431. b3 + 1,
  1432. a0 - c3 + 2,
  1433. b0*c3 - 2*b0 + c0,
  1434. a2 - b0 - c1,
  1435. b0**2 + b0*c1 + c2,
  1436. b0*c0 + c0*c1 - c2*c3 + 2*c2,
  1437. c0**2 - c0*c1*c3 + 2*c0*c1 + c2*c3**2 - 4*c2*c3 + 4*c2},
  1438. {c5,
  1439. b5,
  1440. c2,
  1441. c4,
  1442. b2,
  1443. b4,
  1444. a4,
  1445. a2,
  1446. a5,
  1447. a3,
  1448. b3 + 1,
  1449. b0 + b1*c3 + c1,
  1450. a0 - c3 + 2,
  1451. b1*c3**2 - 2*b1*c3 + b1 - c0 + c1*c3 - 2*c1}}$
  1452. extendedgroebfactor polys;
  1453. {{{b1*a0 + (b1 + c1),
  1454. a2,
  1455. b1*a3 + 1,
  1456. a4,
  1457. a5,
  1458. b0 + b1,
  1459. b2,
  1460. b3,
  1461. b4,
  1462. b5,
  1463. c0 + c1,
  1464. c2,
  1465. c3 - 1,
  1466. c4,
  1467. c5},
  1468. {b1,b1},
  1469. {b1,c1}},
  1470. {{a0,
  1471. a2 - b0 - c1,
  1472. a3,
  1473. a4,
  1474. a5,
  1475. b0**2 + c1*b0 + c2,
  1476. b1,
  1477. b2,
  1478. b3 + 1,
  1479. b4,
  1480. b5,
  1481. c0,
  1482. c3 - 2,
  1483. c4,
  1484. c5},
  1485. {},
  1486. {c1,c2}},
  1487. {{a0 + 1,a2,a3,a4,a5,b0 + (b1 + c1),b2,b3 + 1,b4,b5,c0 + c1,c2,c3 - 1,c4,c5},
  1488. {},
  1489. {b1,c1}},
  1490. {{a0 - (c3 - 2),
  1491. a2,
  1492. a3,
  1493. a4,
  1494. a5,
  1495. (c3**2 - 2*c3 + 1)*b0 + (c0*c3 + c1),
  1496. (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
  1497. b2,
  1498. b3 + 1,
  1499. b4,
  1500. b5,
  1501. c2,
  1502. c4,
  1503. c5},
  1504. {c3**2 - 2*c3 + 1,c3**2 - 2*c3 + 1},
  1505. {c0,c1,c3}},
  1506. {{a0 - (c3 - 2),
  1507. (c3 - 2)*a2 + c0 - (c1*c3 - 2*c1),
  1508. a3,
  1509. a4,
  1510. a5,
  1511. (c3 - 2)*b0 + c0,
  1512. b1,
  1513. b2,
  1514. b3 + 1,
  1515. b4,
  1516. b5,
  1517. c0**2 - (c1*c3 - 2*c1)*c0 + (c2*c3**2 - 4*c2*c3 + 4*c2),
  1518. c4,
  1519. c5},
  1520. {c3 - 2,c3 - 2},
  1521. {c1,c2,c3}},
  1522. {{(c0 - c1*c3 + 2*c1)*a0 + (c0*c3 + c1),
  1523. a2,
  1524. (c0 - c1*c3 + 2*c1)*a3 + (c3**2 - 2*c3 + 1),
  1525. a4,
  1526. a5,
  1527. (c3**2 - 2*c3 + 1)*b0 - (c0*c3 - 2*c0 - c1*c3**2 + 4*c1*c3 - 4*c1),
  1528. (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
  1529. b2,
  1530. b3,
  1531. b4,
  1532. b5,
  1533. c2,
  1534. c4,
  1535. c5},
  1536. {c0 - c1*c3 + 2*c1,
  1537. c0 - c1*c3 + 2*c1,
  1538. c3**2 - 2*c3 + 1,
  1539. c3**2 - 2*c3 + 1},
  1540. {c0,c1,c3}}}$
  1541. extendedgroebfactor1 polys;
  1542. {{{(c0 - c1*c3 + 2*c1)*a0 + (c0*c3 + c1),
  1543. a2,
  1544. (c0 - c1*c3 + 2*c1)*a3 + (c3**2 - 2*c3 + 1),
  1545. a4,
  1546. a5,
  1547. (c3**2 - 2*c3 + 1)*b0 - (c0*c3 - 2*c0 - c1*c3**2 + 4*c1*c3 - 4*c1),
  1548. (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
  1549. b2,
  1550. b3,
  1551. b4,
  1552. b5,
  1553. c2,
  1554. c4,
  1555. c5},
  1556. {c0 - c1*c3 + 2*c1,
  1557. c0 - c1*c3 + 2*c1,
  1558. c3**2 - 2*c3 + 1,
  1559. c3**2 - 2*c3 + 1},
  1560. {c0,c1,c3}},
  1561. {{a0 - (c3 - 2),
  1562. (c3 - 2)*a2 + c0 - (c1*c3 - 2*c1),
  1563. a3,
  1564. a4,
  1565. a5,
  1566. (c3 - 2)*b0 + c0,
  1567. b1,
  1568. b2,
  1569. b3 + 1,
  1570. b4,
  1571. b5,
  1572. c0**2 - (c1*c3 - 2*c1)*c0 + (c2*c3**2 - 4*c2*c3 + 4*c2),
  1573. c4,
  1574. c5},
  1575. {c3 - 2,c3 - 2},
  1576. {c1,c2,c3}},
  1577. {{a0 - (c3 - 2),
  1578. a2,
  1579. a3,
  1580. a4,
  1581. a5,
  1582. (c3**2 - 2*c3 + 1)*b0 + (c0*c3 + c1),
  1583. (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
  1584. b2,
  1585. b3 + 1,
  1586. b4,
  1587. b5,
  1588. c2,
  1589. c4,
  1590. c5},
  1591. {c3**2 - 2*c3 + 1,c3**2 - 2*c3 + 1},
  1592. {c0,c1,c3}}}$
  1593. % Schwarz' example s5
  1594. vars:=for k:=1:5 collect mkid(x,k);
  1595. vars := {x1,
  1596. x2,
  1597. x3,
  1598. x4,
  1599. x5}$
  1600. s5:={
  1601. x1**2+x1+2*x2*x5+2*x3*x4,
  1602. 2*x1*x2+x2+2*x3*x5+x4**2,
  1603. 2*x1*x3+x2**2+x3+2*x4*x5,
  1604. 2*x1*x4+2*x2*x3+x4+x5**2,
  1605. 2*x1*x5+2*x2*x4+x3**2+x5};
  1606. s5 := {x1**2 + x1 + 2*x2*x5 + 2*x3*x4,
  1607. 2*x1*x2 + x2 + 2*x3*x5 + x4**2,
  1608. 2*x1*x3 + x2**2 + x3 + 2*x4*x5,
  1609. 2*x1*x4 + 2*x2*x3 + x4 + x5**2,
  1610. 2*x1*x5 + 2*x2*x4 + x3**2 + x5}$
  1611. setring(vars,degreeorder vars,revlex);
  1612. {{x1,x2,x3,x4,x5},{{1,1,1,1,1}},revlex,{1,1,1,1,1}}$
  1613. m:=groebfactor s5;
  1614. m := {{x1**2 + 2*x3*x4 + 2*x2*x5 + x1,
  1615. 2*x1*x2 + x4**2 + 2*x3*x5 + x2,
  1616. x2**2 + 2*x1*x3 + 2*x4*x5 + x3,
  1617. 2*x2*x3 + 2*x1*x4 + x5**2 + x4,
  1618. x3**2 + 2*x2*x4 + 2*x1*x5 + x5,
  1619. 2*x1*x3*x4 + 2*x4**2*x5 + x3*x5**2 + x3*x4,
  1620. 5*x4**3 + 30*x3*x4*x5 + 15*x2*x5**2 - 2*x5,
  1621. 10*x3*x4**2 - 10*x1*x5**2 - 5*x5**2 - x4,
  1622. 625*x4*x5**3 + 50*x3*x4 + 75*x2*x5 - 6,
  1623. 15*x2*x4**2 + 30*x1*x4*x5 + 5*x5**3 + 15*x4*x5 + x3,
  1624. 100*x1*x4*x5**2 + 25*x5**4 + 50*x4*x5**2 + x4**2 + 4*x3*x5,
  1625. 1250*x1*x3*x5**2 + 625*x3*x5**2 - 75*x3*x4 - 50*x2*x5 + 8,
  1626. 75*x4**2*x5**2 + 50*x3*x5**3 + x2*x4 + 4*x1*x5 + 2*x5,
  1627. 150*x3*x4*x5**2 + 100*x2*x5**3 - 2*x1*x4 - 13*x5**2 - x4,
  1628. 625*x2*x5**4 - 50*x1*x4*x5 - 75*x5**3 - 25*x4*x5 - x3,
  1629. 1250*x3*x5**4 - 200*x2*x4*x5 - 50*x1*x5**2 - 25*x5**2 + 3*x4,
  1630. 625*x5**5 + 375*x4**2*x5 + 500*x3*x5**2 + 24*x1 + 12,
  1631. 10*x1*x4**2 + 20*x1*x3*x5 + 20*x4*x5**2 + 5*x4**2 + 10*x3*x5 + x2,
  1632. 75*x2*x4*x5**2 + 50*x1*x5**3 + 25*x5**3 - 2*x1*x3 - 3*x4*x5 - x3,
  1633. 1250*x1*x5**4 + 625*x5**4 + 100*x1*x3*x5 + 150*x4*x5**2 + 50*x3*x5 + 3*
  1634. x2},
  1635. {x5,x2,x4,x3,x1},
  1636. {x5,x2,x4,x3,x1 + 1}}$
  1637. % Recompute a list of problems with listgroebfactor for another term
  1638. % order.
  1639. setring(vars,{},lex);
  1640. {{x1,x2,x3,x4,x5},{},lex,{1,1,1,1,1}}$
  1641. listgroebfactor m;
  1642. {{5*x5 - 1,
  1643. 5*x4 - 1,
  1644. 5*x1 + 4,
  1645. 5*x2 - 1,
  1646. 5*x3 - 1},
  1647. {5*x5 + 1,
  1648. 5*x4 + 1,
  1649. 5*x1 + 1,
  1650. 5*x2 + 1,
  1651. 5*x3 + 1},
  1652. {5*x1 + 2,
  1653. x2 - x5,
  1654. 25*x5**2 - 5*x5 - 1,
  1655. 5*x4 + 5*x5 - 1,
  1656. 5*x3 + 5*x5 - 1},
  1657. {5*x1 + 3,
  1658. x2 - x5,
  1659. 25*x5**2 + 5*x5 - 1,
  1660. 5*x4 + 5*x5 + 1,
  1661. 5*x3 + 5*x5 + 1},
  1662. {5*x1 + 3,
  1663. 5*x4 - 25*x5**2 + 10*x5 - 2,
  1664. x3 - 25*x5**3 + 15*x5**2 - 3*x5,
  1665. 5*x2 + 125*x5**3 - 50*x5**2 + 10*x5 - 1,
  1666. 625*x5**4 - 375*x5**3 + 100*x5**2 - 10*x5 + 1},
  1667. {5*x1 + 2,
  1668. 5*x2 + 5*x5 - 1,
  1669. 5*x4 - 250*x5**3 + 75*x5**2 - 30*x5 + 2,
  1670. 5*x3 + 250*x5**3 - 75*x5**2 + 30*x5 - 3,
  1671. 625*x5**4 - 250*x5**3 + 100*x5**2 - 15*x5 + 1},
  1672. {x4 + 5*x5**2,
  1673. 5*x1 + 1,
  1674. x3 - 25*x5**3,
  1675. 5*x2 + 125*x5**3 - 25*x5**2 + 5*x5 - 1,
  1676. 625*x5**4 - 125*x5**3 + 25*x5**2 - 5*x5 + 1},
  1677. {x4 - 5*x5**2,
  1678. 5*x1 + 4,
  1679. x3 - 25*x5**3,
  1680. 5*x2 + 125*x5**3 + 25*x5**2 + 5*x5 + 1,
  1681. 625*x5**4 + 125*x5**3 + 25*x5**2 + 5*x5 + 1},
  1682. {5*x1 + 3,
  1683. 5*x2 + 5*x5 + 1,
  1684. 5*x4 - 250*x5**3 - 75*x5**2 - 30*x5 - 2,
  1685. 5*x3 + 250*x5**3 + 75*x5**2 + 30*x5 + 3,
  1686. 625*x5**4 + 250*x5**3 + 100*x5**2 + 15*x5 + 1},
  1687. {5*x1 + 2,
  1688. 5*x4 + 25*x5**2 + 10*x5 + 2,
  1689. x3 - 25*x5**3 - 15*x5**2 - 3*x5,
  1690. 5*x2 + 125*x5**3 + 50*x5**2 + 10*x5 + 1,
  1691. 625*x5**4 + 375*x5**3 + 100*x5**2 + 10*x5 + 1},
  1692. {x5,
  1693. x2,
  1694. x4,
  1695. x3,
  1696. x1 + 1},
  1697. {x5,
  1698. x2,
  1699. x4,
  1700. x3,
  1701. x1}}$
  1702. % ==> Testing the linear algebra package
  1703. % Find the ideal of points in affine and projective space.
  1704. vars:=for k:=1:6 collect mkid(x,k);
  1705. vars := {x1,
  1706. x2,
  1707. x3,
  1708. x4,
  1709. x5,
  1710. x6}$
  1711. setring(vars,degreeorder vars,revlex);
  1712. {{x1,x2,x3,x4,x5,x6},{{1,1,1,1,1,1}},revlex,{1,1,1,1,1,1}}$
  1713. matrix mm(10,6);
  1714. on rounded;
  1715. for k:=1:6 do for l:=1:10 do mm(l,k):=floor(exp((k+l)/4));
  1716. off rounded;
  1717. mm;
  1718. mat((1,2,2,3,4,5),(2,2,3,4,5,7),(2,3,4,5,7,9),(3,4,5,7,9,12),(4,5,7,9,12,15),(5
  1719. ,7,9,12,15,20),(7,9,12,15,20,25),(9,12,15,20,25,33),(12,15,20,25,33,42),(15,20,
  1720. 25,33,42,54))$
  1721. setideal(u,affine_points mm);
  1722. {48337*x5**2 - 318*x4*x6 - 75336*x5*x6 + 29579*x6**2 - 11598*x1 - 11016*x2 -
  1723. 11352*x3 - 2502*x4 + 18371*x5 - 1837*x6 - 1836,
  1724. 386696*x1*x6 + 175678*x4*x6 + 20108*x5*x6 - 233347*x6**2 - 5821074*x1 - 831000
  1725. *x2 + 1382952*x3 + 741984*x4 - 2153934*x5 + 2692351*x6 - 1491936,
  1726. 386696*x3*x6 + 239238*x4*x6 - 185716*x5*x6 - 182039*x6**2 - 270738*x1 -
  1727. 1255800*x2 - 5052384*x3 - 2106864*x4 + 2351946*x5 + 2434483*x6 - 1562736,
  1728. 48337*x4**2 - 58746*x4*x6 + 148*x5*x6 + 17725*x6**2 + 2502*x1 + 576*x2 - 1302*
  1729. x3 + 25721*x4 - 3488*x5 - 12857*x6 + 96,
  1730. 193348*x4*x5 - 151394*x4*x6 - 118604*x5*x6 + 92869*x6**2 + 1590*x1 + 8712*x2 +
  1731. 16560*x3 - 3708*x4 + 43918*x5 - 43409*x6 + 1452,
  1732. 386696*x2*x6 - 382090*x4*x6 - 43364*x5*x6 + 123645*x6**2 - 1313130*x1 -
  1733. 4809120*x2 + 91464*x3 + 5853096*x4 + 1118658*x5 - 2323361*x6 - 28128,
  1734. 193348*x6**3 - 78919578*x4*x6 - 63413004*x5*x6 + 81565689*x6**2 + 1412352942*
  1735. x1 + 1563160200*x2 + 761482008*x3 + 10324224*x4 + 304232130*x5 - 1255484065*x6
  1736. - 643375200,
  1737. 193348*x1*x4 - 3606*x4*x6 + 6664*x5*x6 - 36689*x6**2 - 1729374*x1 - 256248*x2
  1738. + 422132*x3 + 345556*x4 - 671778*x5 + 747089*x6 - 429404,
  1739. 193348*x3*x4 - 19782*x4*x6 - 57060*x5*x6 + 1407*x6**2 - 86718*x1 - 378840*x2 -
  1740. 1475924*x3 - 576996*x4 + 715078*x5 + 671885*x6 - 449836,
  1741. 386696*x1*x5 + 139942*x4*x6 - 99156*x5*x6 - 94107*x6**2 - 4388370*x1 - 668088*
  1742. x2 + 1063040*x3 + 468112*x4 - 1464774*x5 + 1964239*x6 - 1078088,
  1743. 386696*x3*x5 + 184150*x4*x6 - 329484*x5*x6 + 3733*x6**2 - 302634*x1 - 1062840*
  1744. x2 - 3845096*x3 - 1562608*x4 + 1956858*x5 + 1752663*x6 - 1143880,
  1745. 193348*x1**2 + 50726*x4*x6 + 4164*x5*x6 - 49995*x6**2 - 1502518*x1 - 234624*x2
  1746. + 337000*x3 + 189344*x4 - 544926*x5 + 709519*x6 - 425800,
  1747. 193348*x1*x2 - 22834*x4*x6 - 3056*x5*x6 - 4123*x6**2 - 1183010*x1 - 780060*x2
  1748. + 282940*x3 + 989552*x4 - 238902*x5 + 102179*x6 - 226684,
  1749. 386696*x1*x3 + 153254*x4*x6 - 46332*x5*x6 - 109011*x6**2 - 2706290*x1 - 776040
  1750. *x2 - 650592*x3 - 288096*x4 - 295470*x5 + 1856303*x6 - 1096080,
  1751. 96674*x3**2 + 56278*x4*x6 - 44916*x5*x6 - 20423*x6**2 - 85218*x1 - 315900*x2 -
  1752. 1104614*x3 - 478348*x4 + 559514*x5 + 528787*x6 - 342672,
  1753. 193348*x2*x4 - 186922*x4*x6 - 13484*x5*x6 + 80823*x6**2 - 400398*x1 - 1437268*
  1754. x2 + 32400*x3 + 1825348*x4 + 346526*x5 - 749039*x6 - 13972,
  1755. 386696*x2*x5 - 299774*x4*x6 - 183476*x5*x6 + 214259*x6**2 - 1032390*x1 -
  1756. 3818088*x2 + 38568*x3 + 4563624*x4 + 1175646*x5 - 2005927*x6 - 56304,
  1757. 193348*x5*x6**2 - 59111766*x4*x6 - 58092824*x5*x6 + 68856463*x6**2 +
  1758. 1134803514*x1 + 1224865560*x2 + 591403776*x3 - 36549312*x4 + 316517430*x5 -
  1759. 1023460331*x6 - 498675720,
  1760. 96674*x2**2 - 69590*x4*x6 - 7908*x5*x6 + 35327*x6**2 - 243426*x1 - 832910*x2 +
  1761. 14700*x3 + 1041208*x4 + 204662*x5 - 420851*x6 - 26032,
  1762. 386696*x2*x3 - 95202*x4*x6 - 92692*x5*x6 + 63421*x6**2 - 736122*x1 - 2670472*
  1763. x2 - 1669344*x3 + 2061800*x4 + 1466002*x5 - 394913*x6 - 509528,
  1764. 96674*x4*x6**2 - 29277416*x4*x6 - 19752504*x5*x6 + 28388673*x6**2 + 433544670*
  1765. x1 + 473916360*x2 + 235723620*x3 + 39729120*x4 + 97903830*x5 - 411516489*x6 -
  1766. 188800920}$
  1767. setgbasis u$
  1768. dim u;
  1769. 0$
  1770. degree u;
  1771. 10$
  1772. setideal(u,proj_points mm);
  1773. {457380*x5**3 - 13500*x2*x5*x6 - 20835*x3*x5*x6 + 76950*x4*x5*x6 - 1050234*x5**
  1774. 2*x6 + 100*x1*x6**2 + 10800*x2*x6**2 + 16568*x3*x6**2 - 60271*x4*x6**2 +
  1775. 771366*x5*x6**2 - 179875*x6**3,
  1776. 330*x4**2 + 1665*x2*x5 + 555*x3*x5 - 4337*x4*x5 - 626*x5**2 + 6*x1*x6 - 1332*
  1777. x2*x6 - 450*x3*x6 + 3013*x4*x6 + 2740*x5*x6 - 1635*x6**2,
  1778. 33*x1*x5 - 90*x2*x5 - 63*x3*x5 + 216*x4*x5 + 60*x5**2 - 25*x1*x6 + 72*x2*x6 +
  1779. 49*x3*x6 - 170*x4*x6 - 171*x5*x6 + 97*x6**2,
  1780. 90*x3**2 - 483*x2*x5 - 183*x3*x5 + 1197*x4*x5 + 174*x5**2 - 2*x1*x6 + 384*x2*
  1781. x6 + 68*x3*x6 - 937*x4*x6 - 738*x5*x6 + 485*x6**2,
  1782. 330*x3*x4 + 555*x2*x5 + 75*x3*x5 - 1519*x4*x5 - 172*x5**2 + 2*x1*x6 - 444*x2*
  1783. x6 - 260*x3*x6 + 1041*x4*x6 + 950*x5*x6 - 545*x6**2,
  1784. 457380*x4*x5**2 - 10800*x2*x5*x6 - 9045*x3*x5*x6 - 662625*x4*x5*x6 - 265413*x5
  1785. **2*x6 + 80*x1*x6**2 + 8640*x2*x6**2 + 7156*x3*x6**2 + 238408*x4*x6**2 +
  1786. 391452*x5*x6**2 - 143900*x6**3,
  1787. 495*x1*x2 + 1977*x2*x5 + 87*x3*x5 - 4824*x4*x5 - 339*x5**2 - 164*x1*x6 - 1707*
  1788. x2*x6 - 97*x3*x6 + 3782*x4*x6 + 2697*x5*x6 - 1840*x6**2,
  1789. 495*x2**2 + 1134*x2*x5 + 939*x3*x5 - 3771*x4*x5 - 822*x5**2 - 4*x1*x6 - 1257*
  1790. x2*x6 - 734*x3*x6 + 2956*x4*x6 + 2709*x5*x6 - 1550*x6**2,
  1791. 990*x1*x3 - 5043*x2*x5 - 1263*x3*x5 + 12321*x4*x5 + 1866*x5**2 - 464*x1*x6 +
  1792. 4008*x2*x6 + 788*x3*x6 - 9643*x4*x6 - 7968*x5*x6 + 5165*x6**2,
  1793. 495*x2*x3 + 1242*x2*x5 - 48*x3*x5 - 3555*x4*x5 - 267*x5**2 + 4*x1*x6 - 1218*x2
  1794. *x6 - 157*x3*x6 + 2786*x4*x6 + 2142*x5*x6 - 1420*x6**2,
  1795. 66*x1*x4 + 345*x2*x5 + 93*x3*x5 - 861*x4*x5 - 120*x5**2 - 38*x1*x6 - 276*x2*x6
  1796. - 76*x3*x6 + 659*x4*x6 + 540*x5*x6 - 337*x6**2,
  1797. 495*x2*x4 + 1770*x2*x5 + 645*x3*x5 - 4908*x4*x5 - 729*x5**2 + 4*x1*x6 - 1713*
  1798. x2*x6 - 520*x3*x6 + 3677*x4*x6 + 3165*x5*x6 - 1915*x6**2,
  1799. 152460*x3*x5**2 + 5880*x2*x5*x6 - 237983*x3*x5*x6 - 6896*x4*x5*x6 - 71438*x5**
  1800. 2*x6 + 64*x1*x6**2 - 4704*x2*x6**2 + 92748*x3*x6**2 + 5427*x4*x6**2 + 113560*
  1801. x5*x6**2 - 45061*x6**3,
  1802. 990*x1**2 - 1893*x2*x5 + 447*x3*x5 + 3771*x4*x5 + 426*x5**2 - 524*x1*x6 + 1488
  1803. *x2*x6 - 322*x3*x6 - 2923*x4*x6 - 2478*x5*x6 + 1715*x6**2,
  1804. 457380*x2*x5**2 - 754524*x2*x5*x6 - 31530*x3*x5*x6 + 156561*x4*x5*x6 - 132597*
  1805. x5**2*x6 + 136*x1*x6**2 + 310896*x2*x6**2 + 25088*x3*x6**2 - 122581*x4*x6**2 +
  1806. 141732*x5*x6**2 - 30097*x6**3}$
  1807. setgbasis u$
  1808. dim u;
  1809. 1$
  1810. degree u;
  1811. 10$
  1812. % Change the term order to pure lex in dimension zero.
  1813. % Test both approaches, with and without precomputed borderbasis.
  1814. vars:=for k:=1:6 collect mkid(x,k);
  1815. vars := {x1,
  1816. x2,
  1817. x3,
  1818. x4,
  1819. x5,
  1820. x6}$
  1821. r1:=setring(vars,{},lex);
  1822. r1 := {{x1,x2,x3,x4,x5,x6},{},lex,{1,1,1,1,1,1}}$
  1823. r2:=setring(vars,degreeorder vars,revlex);
  1824. r2 := {{x1,x2,x3,x4,x5,x6},{{1,1,1,1,1,1}},revlex,{1,1,1,1,1,1}}$
  1825. setideal(m,{x1**2+x1+2*x2*x6+2*x3*x5+x4**2,
  1826. 2*x1*x2+x2+2*x3*x6+2*x4*x5,
  1827. 2*x1*x3+x2**2+x3+2*x4*x6+x5**2,
  1828. 2*x1*x4+2*x2*x3+x4+2*x5*x6,
  1829. 2*x1*x5+2*x2*x4+x3**2+x5+x6**2,
  1830. 2*x1*x6+2*x2*x5+2*x3*x4+x6});
  1831. {x1**2 + x4**2 + 2*x3*x5 + 2*x2*x6 + x1,
  1832. 2*x1*x2 + 2*x4*x5 + 2*x3*x6 + x2,
  1833. x2**2 + 2*x1*x3 + x5**2 + 2*x4*x6 + x3,
  1834. 2*x2*x3 + 2*x1*x4 + 2*x5*x6 + x4,
  1835. x3**2 + 2*x2*x4 + 2*x1*x5 + x6**2 + x5,
  1836. 2*x3*x4 + 2*x2*x5 + 2*x1*x6 + x6}$
  1837. gbasis m;
  1838. {72*x1*x3*x5*x6 + 36*x3*x5*x6 - 2*x1*x6 - x6,
  1839. 2*x1*x2 + 2*x4*x5 + 2*x3*x6 + x2,
  1840. 2*x2*x3 + 2*x1*x4 + 2*x5*x6 + x4,
  1841. 2*x3*x4 + 2*x2*x5 + 2*x1*x6 + x6,
  1842. 10368*x6**7 + 5040*x4*x6**4 + 140*x4**2*x6 + 252*x2*x6**2 - 15*x6,
  1843. 1296*x4*x6**5 + 180*x4**2*x6**2 + 180*x2*x6**3 + 4*x2*x4 - 15*x6**2,
  1844. 2592*x3*x6**5 - 360*x2*x5*x6**2 + 2*x1*x4 + 12*x5*x6 + x4,
  1845. 72*x3*x5**2*x6 + 72*x2*x5*x6**2 - 2*x1*x4 - 8*x5*x6 - x4,
  1846. 36*x2*x5**3 - 108*x1*x4*x6**2 - 72*x5*x6**3 - 54*x4*x6**2 - 5*x3*x6,
  1847. 18*x4**2*x5 + 18*x3*x5**2 - 18*x1*x6**2 - 9*x6**2 - 2*x5,
  1848. 36*x4*x5**2 + 36*x4**2*x6 + 72*x3*x5*x6 + 36*x2*x6**2 - 5*x6,
  1849. x1**2 + x4**2 + 2*x3*x5 + 2*x2*x6 + x1,
  1850. x2**2 + 2*x1*x3 + x5**2 + 2*x4*x6 + x3,
  1851. x3**2 + 2*x2*x4 + 2*x1*x5 + x6**2 + x5,
  1852. 2592*x5*x6**5 + 360*x4*x5*x6**2 + 360*x3*x6**3 - 2*x2*x5 + 10*x1*x6 + 5*x6,
  1853. 2592*x5**2*x6**3 + 1296*x4*x6**4 + 36*x4**2*x6 + 144*x3*x5*x6 + 180*x2*x6**2 -
  1854. 13*x6,
  1855. 72*x5**3*x6 + 216*x4*x5*x6**2 + 72*x3*x6**3 + 2*x2*x5 + 6*x1*x6 + 3*x6,
  1856. 4*x4**3 - 12*x2*x5**2 - 24*x1*x5*x6 - 4*x6**3 - 12*x5*x6 - x4,
  1857. 12*x2*x4**2 - 24*x1*x3*x6 - 12*x5**2*x6 - 12*x4*x6**2 - 12*x3*x6 - x2,
  1858. 1296*x1*x6**5 + 648*x6**5 + 180*x1*x4*x6**2 + 180*x5*x6**3 + 90*x4*x6**2 + x4*
  1859. x5 + 6*x3*x6,
  1860. 2592*x2*x6**5 + 360*x2*x4*x6**2 - 180*x6**4 - 6*x1*x3 - 3*x5**2 - 16*x4*x6 - 3
  1861. *x3,
  1862. 72*x3*x5*x6**3 + 36*x2*x6**4 - x2*x5**2 - 4*x2*x4*x6 - 4*x1*x5*x6 - 6*x6**3 -
  1863. 2*x5*x6,
  1864. 648*x4*x5*x6**3 + 324*x3*x6**4 - 9*x3*x5**2 - 18*x2*x5*x6 + 18*x1*x6**2 + 9*x6
  1865. **2 + x5,
  1866. 2592*x1*x3*x6**3 + 1296*x4*x6**4 + 1296*x3*x6**3 - 36*x4**2*x6 - 72*x3*x5*x6 +
  1867. 36*x2*x6**2 + 5*x6,
  1868. 1080*x2*x4*x6**3 + 216*x6**5 - 60*x1*x3*x6 - 30*x5**2*x6 - 90*x4*x6**2 - 30*x3
  1869. *x6 - x2,
  1870. 72*x4**2*x6**3 + 36*x2*x6**4 + 3*x2*x5**2 + 8*x2*x4*x6 + 6*x1*x5*x6 - 2*x6**3
  1871. + 3*x5*x6,
  1872. 36*x1*x5**2*x6 + 36*x1*x4*x6**2 + 36*x5*x6**3 + 18*x5**2*x6 + 18*x4*x6**2 + x4
  1873. *x5 + 2*x3*x6,
  1874. 18*x1*x5**3 - 54*x1*x3*x6**2 - 36*x4*x6**3 + 9*x5**3 - 27*x3*x6**2 + x3*x5 - 2
  1875. *x2*x6,
  1876. 18*x1*x4*x5 + 18*x1*x3*x6 + 18*x5**2*x6 + 18*x4*x6**2 + 9*x4*x5 + 9*x3*x6 + x2
  1877. ,
  1878. 18*x2*x4*x5 + 18*x1*x5**2 + 18*x1*x4*x6 + 18*x5*x6**2 + 9*x5**2 + 9*x4*x6 + x3
  1879. ,
  1880. 2*x1*x4**2 + 4*x1*x3*x5 + 2*x5**3 + 8*x4*x5*x6 + 2*x3*x6**2 + x4**2 + 2*x3*x5,
  1881. 72*x1*x4*x6**3 + 36*x5*x6**4 + 36*x4*x6**3 - 2*x1*x3*x5 - x5**3 - 2*x4*x5*x6 +
  1882. 2*x3*x6**2 - x3*x5,
  1883. 3240*x1*x5*x6**3 + 648*x6**5 + 1620*x5*x6**3 + 90*x1*x3*x6 + 90*x5**2*x6 + 180
  1884. *x4*x6**2 + 45*x3*x6 + 2*x2,
  1885. 72*x2*x5**2*x6 + 72*x2*x4*x6**2 + 144*x1*x5*x6**2 + 36*x6**4 + 72*x5*x6**2 - 2
  1886. *x1*x3 - x5**2 - x3,
  1887. 36*x5**4 - 216*x4**2*x6**2 - 432*x3*x5*x6**2 - 288*x2*x6**3 + 2*x2*x4 + 8*x1*
  1888. x5 + 39*x6**2 + 4*x5,
  1889. 72*x3*x5**3 - 216*x1*x5*x6**2 - 36*x6**4 - 108*x5*x6**2 - 2*x1*x3 - 9*x5**2 -
  1890. 8*x4*x6 - x3,
  1891. 1296*x2*x5*x6**3 + 648*x1*x6**4 + 324*x6**4 - 18*x1*x5**2 - 36*x1*x4*x6 - 72*
  1892. x5*x6**2 - 9*x5**2 - 18*x4*x6 - x3,
  1893. 18*x1*x3*x5**2 + 18*x4**2*x6**2 + 54*x3*x5*x6**2 + 36*x2*x6**3 + 9*x3*x5**2 -
  1894. x2*x4 - 2*x1*x5 - 5*x6**2 - x5}$
  1895. m1:=change_termorder(m,r1);
  1896. m1 := {46656*x4*x5*x6**6 - x4*x5,
  1897. 80621568*x5*x6**13 + 44928*x5*x6**7 - x5*x6,
  1898. 637*x2 + 1077507256320*x6**17 - 927987840*x6**11 - 806157*x6**5,
  1899. 7*x4**2*x5 + 252*x4*x5*x6**3 - 30233088*x5*x6**12 - 17496*x5*x6**6,
  1900. 58773123072*x6**19 - 47869056*x6**13 - 45657*x6**7 + x6,
  1901. 2*x1*x4 + x4 + 1296*x5**3*x6**3 + 3*x5*x6,
  1902. 2548*x4**2*x6 + 91728*x4*x6**4 + 362797056*x6**13 - 33696*x6**7 - 141*x6
  1903. ,
  1904. 8491392*x4*x6**7 - 182*x4*x6 + 19591041024*x6**16 + 10917504*x6**10 -
  1905. 243*x6**4,
  1906. 17199*x5**4*x6 + 1238328*x5**2*x6**5 + 4353564672*x6**15 - 5003856*x6**9
  1907. - 1328*x6**3,
  1908. 4245696*x5**2*x6**7 - 91*x5**2*x6 + 8707129344*x6**17 - 12130560*x6**11
  1909. + 256*x6**5,
  1910. 7*x3 - 567*x5**5 - 204120*x5**3*x6**4 + 524880*x5*x6**8 - 90*x5*x6**2,
  1911. 2916*x5**7 - 567*x5**3*x6**2 + 347680512*x5*x6**12 + 196668*x5*x6**6 - 4
  1912. *x5,
  1913. 14*x1*x6 + 504*x4*x5*x6**2 + 252*x5**3*x6 + 20155392*x5*x6**11 + 8640*x5
  1914. *x6**5 + 7*x6,
  1915. 2548*x4**3 + 19813248*x4*x6**6 - 637*x4 + 39182082048*x6**15 + 30326400*
  1916. x6**9 + 4428*x6**3,
  1917. 1911*x4*x5**2 - 68796*x4*x6**4 - 68796*x5**2*x6**3 - 362797056*x6**13 +
  1918. 151632*x6**7 + 50*x6,
  1919. 1274*x1*x5 + 1651104*x4*x6**5 + 5733*x5**4 + 1238328*x5**2*x6**4 + 637*
  1920. x5 + 6530347008*x6**14 - 1667952*x6**8 + 192*x6**2,
  1921. 1274*x1**2 + 1274*x1 + 1274*x4**2 + 206388*x5**6 - 85995*x5**2*x6**2 -
  1922. 11754624614400*x6**18 + 9498228480*x6**12 + 9295668*x6**6}$
  1923. setring r2$
  1924. m2:=change_termorder1(m,r1);
  1925. m2 := {46656*x4*x5*x6**6 - x4*x5,
  1926. 80621568*x5*x6**13 + 44928*x5*x6**7 - x5*x6,
  1927. 2*x1*x4 + x4 + 1296*x5**3*x6**3 + 3*x5*x6,
  1928. 637*x2 + 1077507256320*x6**17 - 927987840*x6**11 - 806157*x6**5,
  1929. 7*x4**2*x5 + 252*x4*x5*x6**3 - 30233088*x5*x6**12 - 17496*x5*x6**6,
  1930. 58773123072*x6**19 - 47869056*x6**13 - 45657*x6**7 + x6,
  1931. 2548*x4**2*x6 + 91728*x4*x6**4 + 362797056*x6**13 - 33696*x6**7 - 141*x6
  1932. ,
  1933. 17199*x5**4*x6 + 1238328*x5**2*x6**5 + 4353564672*x6**15 - 5003856*x6**9
  1934. - 1328*x6**3,
  1935. 4245696*x5**2*x6**7 - 91*x5**2*x6 + 8707129344*x6**17 - 12130560*x6**11
  1936. + 256*x6**5,
  1937. 7*x3 - 567*x5**5 - 204120*x5**3*x6**4 + 524880*x5*x6**8 - 90*x5*x6**2,
  1938. 8491392*x4*x6**7 - 182*x4*x6 + 19591041024*x6**16 + 10917504*x6**10 -
  1939. 243*x6**4,
  1940. 2916*x5**7 - 567*x5**3*x6**2 + 347680512*x5*x6**12 + 196668*x5*x6**6 - 4
  1941. *x5,
  1942. 14*x1*x6 + 504*x4*x5*x6**2 + 252*x5**3*x6 + 20155392*x5*x6**11 + 8640*x5
  1943. *x6**5 + 7*x6,
  1944. 1911*x4*x5**2 - 68796*x4*x6**4 - 68796*x5**2*x6**3 - 362797056*x6**13 +
  1945. 151632*x6**7 + 50*x6,
  1946. 2548*x4**3 + 19813248*x4*x6**6 - 637*x4 + 39182082048*x6**15 + 30326400*
  1947. x6**9 + 4428*x6**3,
  1948. 1274*x1*x5 + 1651104*x4*x6**5 + 5733*x5**4 + 1238328*x5**2*x6**4 + 637*
  1949. x5 + 6530347008*x6**14 - 1667952*x6**8 + 192*x6**2,
  1950. 1274*x1**2 + 1274*x1 + 1274*x4**2 + 206388*x5**6 - 85995*x5**2*x6**2 -
  1951. 11754624614400*x6**18 + 9498228480*x6**12 + 9295668*x6**6}$
  1952. setideal(m1,m1)$
  1953. setideal(m2,m2)$
  1954. setgbasis m1$
  1955. setgbasis m2$
  1956. modequalp(m1,m2);
  1957. yes$
  1958. % ==> Different hilbert series driver
  1959. setideal(m,proj_monomial_curve(w1:={0,2,5,9},{w,x,y,z}));
  1960. {x**5 - w**3*y**2,
  1961. w*y**3 - x**3*z,
  1962. y**4 - w*x*z**2,
  1963. x**2*y - w**2*z}$
  1964. weights:={{1,1,1,1},w1};
  1965. weights := {{1,1,1,1},{0,2,5,9}}$
  1966. hftestversion 2;
  1967. hf!=whilb2$
  1968. f1:=weightedhilbertseries(gbasis m,weights);
  1969. f1 := ( - w**5*x**17 + w**4*x**17 - w**4*x**15 + w**4*x**8 + w**3*x**15 + w**3*
  1970. x**12 + w**3*x**6 + w**2*x**10 + w**2*x**7 + w**2*x**4 + w*x**5 + w*x**2
  1971. + 1)/(w**2*x**9 - w*x**9 - w + 1)$
  1972. sub(x=1,ws);
  1973. ( - w**5 + w**4 + 3*w**3 + 3*w**2 + 2*w + 1)/(w**2 - 2*w + 1)$
  1974. % The ordinary Hilbert series.
  1975. hftestversion 1;
  1976. hf!=whilb1$
  1977. % The default.
  1978. f2:=weightedhilbertseries(gbasis m,weights);
  1979. f2 := ( - w**5*x**17 + w**4*x**17 - w**4*x**15 + w**4*x**8 + w**3*x**15 + w**3*
  1980. x**12 + w**3*x**6 + w**2*x**10 + w**2*x**7 + w**2*x**4 + w*x**5 + w*x**2
  1981. + 1)/(w**2*x**9 - w*x**9 - w + 1)$
  1982. sub(x=1,ws);
  1983. ( - w**5 + w**4 + 3*w**3 + 3*w**2 + 2*w + 1)/(w**2 - 2*w + 1)$
  1984. f1-f2;
  1985. 0$
  1986. % ==> Different primary decomposition approaches. The example is due
  1987. % to Shimoyama Takeshi. CALI 2.2. produced auxiliary embedded
  1988. % primes on it.
  1989. vars:={dx,dy,x,y};
  1990. vars := {dx,dy,x,y}$
  1991. setring(vars,degreeorder vars,revlex);
  1992. {{dx,dy,x,y},{{1,1,1,1}},revlex,{1,1,1,1}}$
  1993. f3:={DY*( - X*DX + Y**2*DY - Y*DY),DX*(X**2*DX - X*DX - Y*DY)}$
  1994. primarydecomposition f3;
  1995. {{{dx**3,
  1996. dy**3,
  1997. dx**2*dy,
  1998. dx*dy**2,
  1999. dy*( - dx*x + dy*y**2 - dy*y),
  2000. dx*(dx*x**2 - dx*x - dy*y)},
  2001. {dx,dy}},
  2002. {{x*y - x - y,
  2003. dx*x - dx - dy*y + dy,
  2004. - dx + dy*y**2 - 2*dy*y + dy},
  2005. {x*y - x - y,
  2006. dx*x - dx - dy*y + dy,
  2007. - dx + dy*y**2 - 2*dy*y + dy}},
  2008. {{dy,x - 1},{dy,x - 1}},
  2009. {{dy**2,
  2010. dy*x,
  2011. x**2,
  2012. dx*x + dy*y},
  2013. {dy,x}},
  2014. {{dx,y - 1},{dx,y - 1}},
  2015. {{dx**2,
  2016. dx*y,
  2017. y**2,
  2018. dx*x + dy*y},
  2019. {dx,y}},
  2020. {{y**2,
  2021. x**2,
  2022. x*y,
  2023. dx*x + dy*y},
  2024. {y,x}}}$
  2025. showtime;
  2026. Time: 277500 ms plus GC time: 10350 ms
  2027. end;
  2028. (TIME: cali 277530 287880)