123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078 |
- Sun Aug 18 16:27:01 2002 run on Windows
- % Author H.-G. Graebe | Univ. Leipzig | Version 28.6.1995
- % graebe@informatik.uni-leipzig.de
- COMMENT
- This is an example session demonstrating and testing the facilities
- offered by the commutative algebra package CALI.
- END COMMENT;
- algebraic;
- on echo;
- off nat;
- % To make it easier to compare differing output.
- showtime;
- Time: 0 ms
- comment
- ####################################
- ### ###
- ### Introductory Examples ###
- ### ###
- ####################################
- end comment;
- % Example 1 : Generating ideals of affine and projective points.
- vars:={t,x,y,z};
- vars := {t,x,y,z}$
- setring(vars,degreeorder vars,revlex);
- {{t,x,y,z},{{1,1,1,1}},revlex,{1,1,1,1}}$
- mm:=mat((1,1,1,1),(3,2,3,1),(2,1,3,2));
- mm := mat((1,1,1,1),(3,2,3,1),(2,1,3,2))$
- % The ideal with zero set at the point in A^4 with coordinates
- % equal to the row vectors of mm :
- setideal(m1,affine_points mm);
- {z**2 - 3*z + 2,
- y**2 - 4*y + 3,
- t - y + z - 1,
- 2*x - y + 2*z - 3,
- y*z - y - 3*z + 3}$
- % All parameters are as they should be :
- dim m1;
- 0$
- degree m1;
- 3$
- groebfactor m1;
- {{z - 2,y - 3,t - 2,x - 1},
- {z - 1,t - 3,y - 3,x - 2},
- {z - 1,t - 1,y - 1,x - 1}}$
- resolve m1$
- bettinumbers m1;
- {1,5,9,7,2}$
- % The ideal with zero set at the point in P^3 with homogeneous
- % coordinates equal to the row vectors of mm :
- setideal(m2,proj_points mm);
- {2*y**2 - 2*x*z - 7*y*z + 7*z**2,
- 3*t - 2*x - 2*y + z,
- 2*x**2 - 4*x*z - y*z + 3*z**2,
- 2*x*y - 4*x*z - 3*y*z + 5*z**2}$
- % All parameters as they should be ?
- dim m2;
- 1$
- degree m2;
- 3$
- groebfactor m2;
- {{2*y**2 - 2*x*z - 7*y*z + 7*z**2,
- 3*t - 2*x - 2*y + z,
- 2*x**2 - 4*x*z - y*z + 3*z**2,
- 2*x*y - 4*x*z - 3*y*z + 5*z**2}}$
- % It seems to be prime ?
- isprime m2;
- no$
- % Not, of course, but it is known to be unmixed.
- % Hence we can use
- easyprimarydecomposition m2;
- {{{x - 2*z,y - 3*z,t - 3*z},
- {y - 3*z,x - 2*z,t - 3*z}},
- {{x - z,y - z,t - z},
- {y - z,x - z,t - z}},
- {{2*x - z,2*y - 3*z,t - z},
- {2*y - 3*z,2*x - z,t - z}}}$
-
- % Example 2 :
- % The affine monomial curve with generic point (t^7,t^9,t^10).
- setideal(m,affine_monomial_curve({7,9,10},{x,y,z}));
- {x**3*y - z**3,
- x**4 - y**2*z,
- y**3 - x*z**2}$
- % The base ring was changed as side effect :
- getring();
- {{x,y,z},{{7,9,10}},revlex,{7,9,10}}$
-
- vars:=first getring m;
- vars := {x,y,z}$
- % Some advanced commutative algebra :
-
- % The analytic spread of m.
- analytic_spread m;
- 3$
- % The Rees ring Rees_R(vars) over R=S/m.
-
- rees:=blowup(m,vars,{u,v,w});
- rees := {u**2*v*x - w**3,
- u*v*x**2 - w**2*z,
- v*x**3 - w*z**2,
- u**3*x - v**2*w,
- u**2*x**2 - v*w*y,
- u*x**3 - w*y**2,
- - u*w**2 + v**3,
- v**2*y - w**2*x,
- v*y**2 - w*x*z,
- v*z - w*y,
- u*z - w*x,
- u*y - v*x,
- x**3*y - z**3,
- x**4 - y**2*z,
- - x*z**2 + y**3}$
-
- % It is multihomogeneous wrt. the degree vectors, constructed during
- % blow up. Lets compute weighted Hilbert series :
- setideal(rees,rees)$
- weights:=second getring();
- weights := {{0,0,0,7,9,10},{7,9,10,0,0,0}}$
- weightedhilbertseries(gbasis rees,weights);
- ( - x**29*y + x**29 - x**20*y + x**20 - x**19*y**11 + x**19*y**10 - x**19*y + x
- **19 - x**18*y + x**18 - x**10*y**11 + x**10*y**10 - x**10*y + x**10 - x**9*y**
- 21 + x**9*y**20 - x**9*y**11 + x**9*y**9 - x**9*y + x**9 + y**23 - y**22 + y**16
- - y**15 + y**14 - y**11 + y**9 - y**8 + y**7 - y + 1)/(x**7*y - x**7 - y + 1)$
- % gr_R(vars), the associated graded ring of the irrelevant ideal
- % over R. The short way.
- interreduce sub(x=0,y=0,z=0,rees);
- {w**3,v**2*w, - u*w**2 + v**3}$
-
- % The long (and more general) way. Gives the result in another
- % embedding.
-
- % Restore the base ring, since it was changed by blowup as a side
- % effect.
- setring getring m$
- assgrad(m,vars,{u,v,w});
- {x,
- y,
- z,
- w**3,
- v**2*w,
- - u*w**2 + v**3}$
-
- % Comparing the Rees algebra and the symmetric algebra of M :
-
- setring getring m$
- setideal(rees,blowup({},m,{a,b,c}));
- { - y**2*a + z**2*b + x**3*c,
- x*a - y*b - z*c,
- - y**2*a**2 + z**2*a*b + x**2*y*b*c + x**2*z*c**2,
- - 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,
- - 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**3
- + z**3*c**4}$
- % Lets test weighted Hilbert series once more :
- weights:=second getring();
- weights := {{0,0,0,30,28,27},{7,9,10,0,0,0}}$
- weightedhilbertseries(gbasis rees,weights);
- (x**58*y**27 + x**30*y**25 - x**30*y**18 - x**30*y**7 - x**28*y**27 + 1)/(x**85*
- y**26 - x**85*y**19 - x**85*y**17 - x**85*y**16 + x**85*y**10 + x**85*y**9 + x**
- 85*y**7 - x**85 - x**58*y**26 + x**58*y**19 + x**58*y**17 + x**58*y**16 - x**58*
- y**10 - x**58*y**9 - x**58*y**7 + x**58 - x**57*y**26 + x**57*y**19 + x**57*y**
- 17 + x**57*y**16 - x**57*y**10 - x**57*y**9 - x**57*y**7 + x**57 - x**55*y**26 +
- x**55*y**19 + x**55*y**17 + x**55*y**16 - x**55*y**10 - x**55*y**9 - x**55*y**7
- + x**55 + x**30*y**26 - x**30*y**19 - x**30*y**17 - x**30*y**16 + x**30*y**10 +
- x**30*y**9 + x**30*y**7 - x**30 + x**28*y**26 - x**28*y**19 - x**28*y**17 - x**
- 28*y**16 + x**28*y**10 + x**28*y**9 + x**28*y**7 - x**28 + x**27*y**26 - x**27*y
- **19 - x**27*y**17 - x**27*y**16 + x**27*y**10 + x**27*y**9 + x**27*y**7 - x**27
- - y**26 + y**19 + y**17 + y**16 - y**10 - y**9 - y**7 + 1)$
- % The symmetric algebra :
- setring getring m$
- setideal(sym,sym(m,{a,b,c}));
- {y**2*a - z**2*b - x**3*c,
- x*a - y*b - z*c}$
- modequalp(rees,sym);
- yes$
- % Symbolic powers :
- setring getring m$
- setideal(m2,idealpower(m,2));
- {x**6*y**2 - 2*x**3*y*z**3 + z**6,
- x**8 - 2*x**4*y**2*z + y**4*z**2,
- y**6 - 2*x*y**3*z**2 + x**2*z**4,
- x**7*y - x**3*y**3*z - x**4*z**3 + y**2*z**4,
- x**3*y**4 - x**4*y*z**2 - y**3*z**3 + x*z**5,
- x**4*y**3 - y**5*z - x**5*z**2 + x*y**2*z**3}$
- % Let's compute a second symbolic power :
- setideal(m3,symbolic_power(m,2));
- {x**6*y**2 - 2*x**3*y*z**3 + z**6,
- x**8 - 2*x**4*y**2*z + y**4*z**2,
- y**6 - 2*x*y**3*z**2 + x**2*z**4,
- x**2*y**5 + x**7*z - 3*x**3*y**2*z**2 + y*z**5,
- x**7*y - x**3*y**3*z - x**4*z**3 + y**2*z**4,
- x**3*y**4 - x**4*y*z**2 - y**3*z**3 + x*z**5,
- x**4*y**3 - y**5*z - x**5*z**2 + x*y**2*z**3}$
- % It is different from the ordinary second power.
- % Hence m2 has a trivial component.
- modequalp(m2,m3);
- no$
- % Test x for non zero divisor property :
- nzdp(x,m2);
- no$
- nzdp(x,m3);
- yes$
- % Here is the primary decomposition :
- pd:=primarydecomposition m2;
- pd := {{{x**8 - 2*x**4*y**2*z + y**4*z**2,
- x**6*y**2 - 2*x**3*y*z**3 + z**6,
- x**2*z**4 - 2*x*y**3*z**2 + y**6,
- x**7*z - 3*x**3*y**2*z**2 + x**2*y**5 + y*z**5,
- x**7*y - x**4*z**3 - x**3*y**3*z + y**2*z**4,
- - x**4*y*z**2 + x**3*y**4 + x*z**5 - y**3*z**3,
- - x**5*z**2 + x**4*y**3 + x*y**2*z**3 - y**5*z},
- { - x*z**2 + y**3,
- x**4 - y**2*z,
- x**3*y - z**3}},
- {{z**2,
- x**6*y**2,
- y**6,
- x**2*y**5*z,
- x**3*y**4,
- x**4*(x**4 - 2*y**2*z),
- x**3*y*(x**4 - y**2*z),
- y**3*(x**4 - y**2*z)},
- {x,z,y}}}$
- % Compare the result with m2 :
- setideal(m4,matintersect(first first pd, first second pd));
- {y**6 - 2*x*y**3*z**2 + x**2*z**4,
- x**6*y**2 - 2*x**3*y*z**3 + z**6,
- x**8 - 2*x**4*y**2*z + y**4*z**2,
- x**2*y**5*z + x**7*z**2 - 3*x**3*y**2*z**3 + y*z**6,
- x**4*y**3 - y**5*z - x**5*z**2 + x*y**2*z**3,
- x**3*y**4 - x**4*y*z**2 - y**3*z**3 + x*z**5,
- x**7*y - x**3*y**3*z - x**4*z**3 + y**2*z**4}$
- modequalp(m2,m4);
- yes$
- % Compare the result with m3 :
- setideal(m4,first first pd)$
- modequalp(m3,m4);
- yes$
- % The trivial component can also be removed with a stable
- % quotient computation :
- setideal(m5,matstabquot(m2,vars))$
- modequalp(m3,m5);
- yes$
- % Example 3 : The Macaulay curve.
- setideal(m,proj_monomial_curve({0,1,3,4},{w,x,y,z}));
- {x**3 - w**2*y,
- w*y**2 - x**2*z,
- y**3 - x*z**2,
- x*y - w*z}$
- vars:=first getring();
- vars := {w,x,y,z}$
- gbasis m;
- {x**3 - w**2*y,
- w*y**2 - x**2*z,
- y**3 - x*z**2,
- x*y - w*z}$
-
- % Test whether m is prime :
- isprime m;
- yes$
- % A resolution of m :
-
- resolve m;
- {
- mat((x**3 - w**2*y),(w*y**2 - x**2*z),(y**3 - x*z**2),(x*y - w*z))$
- ,
- mat((y,w,0, - x**2),(z,x,0, - w*y),(0, - y,w, - x*z),(0, - z,x, - y**2))$
- ,
- mat((z, - y, - x,w))$
- ,
- mat((0))$
- }$
- % m has depth = 1 as can be seen from the
-
- gradedbettinumbers m;
- {{0},{2,3,3,3},{4,4,4,4},{5}}$
-
- % Another way to see the non perfectness of m :
-
- hilbertseries m;
- ( - w**3 + 2*w**2 + 2*w + 1)/(w**2 - 2*w + 1)$
-
- % Just a third approach. Divide out a parameter system :
- ps:=for i:=1:2 collect random_linear_form(vars,1000);
- ps := {927*w + 880*x + 292*y + 9*z, - 819*w + 224*x - 572*y - 205*z}$
- setideal(m1,matsum(m,ps))$
-
- % dim should be zero and degree > degree m = 4.
- % A Gbasis for m1 is computed automatically.
- dim m1;
- 0$
-
- degree m1;
- 5$
-
- % The projections of m on the coord. hyperplanes.
-
- for each x in vars collect eliminate(m,{x});
- {{ - x*z**2 + y**3},
- { - w*z**3 + y**4},
- { - w**3*z + x**4},
- { - w**2*y + x**3}}$
-
- % Example 4 : Two submodules of S^4.
-
- % Get the stored result of the earlier computation.
- r:=resolve m$
- % See whether cali!=degrees contains a relict from earlier
- % computations.
-
- getdegrees();
- {}$
- % Introduce the 2nd and 3rd syzygy module as new modules.
- % Both are submodules in S^4.
- setmodule(m1,second r)$
- setmodule(m2,third r)$
-
-
- % The second is already a gbasis.
- setgbasis m2;
- mat((z, - y, - x,w))$
-
- getleadterms m1;
- 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,x
- **2),(0,0,0,w*y),(0,0,0,x*z),(0,0,0,y**2))$
- getleadterms m2;
- mat((0,0,0,w))$
- % Since rk(F/M)=rk(F/in(M)), they have ranks 1 resp. 3.
- dim m1;
- 4$
- indepvarsets m1;
- {{w,x,y,z}}$
- % Its intersection is zero :
- matintersect(m1,m2);
- mat((0,0,0,0))$
- % Its sum :
-
- setmodule(m3,matsum(m1,m2));
- mat(( - y, - w,0,x**2),(0,y, - w,x*z),(0,z, - x,y**2),(z, - y, - x,w),( - y*z -
- z,y**2 - x,x*y,0))$
- dim m3;
- 3$
- % Hence it has a nontrivial annihilator :
- annihilator m3;
- {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}$
- % One can compute isolated primes and primary decomposition also for
- % modules. Let's do it, although being trivial here:
-
- isolatedprimes m3;
- {{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}}$
- primarydecomposition m3;
- {{
- 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 +
- 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, - w**3,0)
- ,(z*( - w*y - w - x*z + y**2), - w*x + w*y*z - x**2*z + x*y**2,w**2*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 + x*z), - w**
- 2 + x**2*z,0),( - y*z, - (w*z + x*y),w*x,0),( - w*y**2 + x**2*z, - 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 - w*y*z + x**2*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*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),(
- - z*(y + 1), - x + y**2,x*y,0),(z, - y, - x,w),(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,0,0,0),( - y, - w,0,x**2),(0,y, - w
- ,x*z),(0,z, - x,y**2))$
- ,
- {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}}}$
- % To get a meaningful Hilbert series make m1 homogeneous :
-
- setdegrees {1,x,x,x};
- {1,x,x,x}$
-
-
- % Reevaluate m1 with the new column degrees.
- setmodule(m1,m1)$
- hilbertseries m1;
- (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 - 4
- *w + 1)$
- % Example 5 : From the MACAULAY manual (D.Bayer, M.Stillman).
- % An elliptic curve on the Veronese in P^5.
- rvars:={x,y,z}$
- svars:={a,b,c,d,e,f}$
- r:=setring(rvars,degreeorder rvars,revlex)$
- s:=setring(svars,{for each x in svars collect 2},revlex)$
- map:={s,r,{a=x^2,b=x*y,c=x*z,d=y^2,e=y*z,f=z^2}};
- map := {{{a,
- b,
- c,
- d,
- e,
- f},
- {{2,2,2,2,2,2}},
- revlex,
- {1,1,1,1,1,1}},
- {{x,y,z},
- {{1,1,1}},
- revlex,
- {1,1,1}},
- {a=x**2,
- b=x*y,
- c=x*z,
- d=y**2,
- e=y*z,
- f=z**2}}$
- preimage({y^2z-x^3-x*z^2},map);
- { - a*d + b**2,
- - a*e + b*c,
- - b*e + c*d,
- - a*f + c**2,
- - b*f + c*e,
- - d*f + e**2,
- a**2 + a*f - b*e,
- a*b + b*f - d*e,
- a*c + c*f - d*f}$
- % Example 6 : The preimage under a rational map.
- r:=setring({x,y},{},lex)$
- s:=setring({t},{},lex)$
- map:={r,s,{x=2t/(t^2+1),y=(t^2-1)/(t^2+1)}};
- map := {{{x,y},{},lex,{1,1}},
- {{t},{},lex,{1}},
- {x=(2*t)/(t**2 + 1),y=(t**2 - 1)/(t**2 + 1)}}$
-
- % The preimage of (0) is the equation of the circle :
- ratpreimage({},map);
- {x**2 + y**2 - 1}$
- % The preimage of the point (t=3/2) :
- ratpreimage({2t-3},map);
- {13*x - 12,13*y - 5}$
- % Example 7 : A zerodimensional ideal.
- setring({x,y,z},{},lex)$
- setideal(n,{x**2 + y + z - 3,x + y**2 + z - 3,x + y + z**2 - 3});
- {x**2 + y + z - 3,x + y**2 + z - 3,x + y + z**2 - 3}$
- % The groebner algorithm with factorization :
- groebfactor n;
- {{y - 1,z - 1,x - 1},
- {y + 3,z + 3,x + 3},
- {y - z,z**2 - 2,x + z - 1},
- {z**2 - 2,x - z,y + z - 1},
- {y + z - 1,z**2 - 2*z - 1,x + z - 1}}$
- % Change the term order and reevaluate n :
- setring({x,y,z},{{1,1,1}},revlex)$
- setideal(n,n);
- {x**2 + y + z - 3,y**2 + x + z - 3,z**2 + x + y - 3}$
- % its primes :
-
- zeroprimes n;
- {{x - z,z**2 - 2,y + z - 1},
- {x + z - 1,y + z - 1,z**2 - 2*z - 1},
- {z - 1,x - 1,y - 1},
- {z + 3,x + 3,y + 3},
- {y - z,z**2 - 2,x + z - 1}}$
- % a vector space basis of S/n :
- getkbase n;
- {1,x,x*y,x*y*z,x*z,y,y*z,z}$
- % Example 8 : A modular computation. Since REDUCE has no multivariate
- % factorizer, factorprimes has to be turned off !
- on modular$
- off factorprimes$
- setmod 181;
- 1$
- setideal(n1,n);
- {x**2 + y + z + 178,y**2 + x + z + 178,z**2 + x + y + 178}$
- zeroprimes n1;
- {{y + 180*z,z**2 + 179,x + z + 180},
- {x + z + 180,y + z + 180,z**2 + 179*z + 180},
- {x + 180*z,z**2 + 179,y + z + 180},
- {z + 180,x + 180,y + 180},
- {z + 3,x + 3,y + 3}}$
- setmod 7;
- 181$
- setideal(n1,n);
- {x**2 + y + z + 4,y**2 + x + z + 4,z**2 + x + y + 4}$
- zeroprimes n1;
- {{z + 6,x + 6,y + 6},
- {x + 4,z + 4,y + 2},
- {x + 4,z + 2,y + 4},
- {z + 4,x + 2,y + 4},
- {x + 3,z + 3,y + 3}}$
-
- % Hence some of the primes glue together mod 7.
- zeroprimarydecomposition n1;
- {{{z + 6,x + 6,y + 6},
- {z + 6,x + 6,y + 6}},
- {{z + 4,y + 2,x + 4},
- {x + 4,z + 4,y + 2}},
- {{z + 2,y + 4,x + 4},
- {x + 4,z + 2,y + 4}},
- {{z + 4,x + 2,y + 4},
- {z + 4,x + 2,y + 4}},
- {{x**2 + y + z + 4,
- x + y**2 + z + 4,
- x + y + z**2 + 4,
- 3*(x + 5*y*z + 2*y + 2*z + 5),
- x*z + 6*x + 3*y + 6*z + 1,
- x*y + 6*x + 6*y + 3*z + 1},
- {x + 3,z + 3,y + 3}}}$
- off modular$
- on factorprimes$
- % Example 9 : Independent sets once more.
-
- n:=10$
- vars:=for i:=1:(2*n) collect mkid(x,i)$
- setring(vars,{},lex)$
- setideal(m,for j:=0:n collect
- for i:=(j+1):(j+n) product mkid(x,i));
- {x1*x2*x3*x4*x5*x6*x7*x8*x9*x10,
- x2*x3*x4*x5*x6*x7*x8*x9*x10*x11,
- x3*x4*x5*x6*x7*x8*x9*x10*x11*x12,
- x4*x5*x6*x7*x8*x9*x10*x11*x12*x13,
- x5*x6*x7*x8*x9*x10*x11*x12*x13*x14,
- x6*x7*x8*x9*x10*x11*x12*x13*x14*x15,
- x7*x8*x9*x10*x11*x12*x13*x14*x15*x16,
- x8*x9*x10*x11*x12*x13*x14*x15*x16*x17,
- x9*x10*x11*x12*x13*x14*x15*x16*x17*x18,
- x10*x11*x12*x13*x14*x15*x16*x17*x18*x19,
- x11*x12*x13*x14*x15*x16*x17*x18*x19*x20}$
- setgbasis m$
- indepvarsets m;
- {{x2,x3,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x3,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x12,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x3,x4,x5,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x4,x5,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x5,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x13,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x4,x5,x6,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x5,x6,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x14,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x5,x6,x7,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x15,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x6,x7,x8,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x16,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x7,x8,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x17,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x8,x9,x10,x11,x12,x13,x14,x15,x16,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x15,x16,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x16,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x18,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x9,x10,x11,x12,x13,x14,x15,x16,x17,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x16,x17,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x17,x19,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14,x15,x16,x17,x18,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x17,x18,x20},
- {x1,x2,x3,x4,x5,x6,x7,x8,x9,x11,x12,x13,x14,x15,x16,x17,x18,x19}}$
- dim m;
- 18$
- degree m;
- 55$
- comment
- ####################################
- ### ###
- ### Local Standard Bases ###
- ### ###
- ####################################
- end comment;
- % Example 10 : An example from [ Alonso, Mora, Raimondo ]
- vars := {z,x,y}$
- r:=setring(vars,{},lex)$
- setideal(m,{x^3+(x^2-y^2)*z+z^4,y^3+(x^2-y^2)*z-z^4});
- {z**4 + z*x**2 - z*y**2 + x**3,
- - z**4 + z*x**2 - z*y**2 + y**3}$
- dim m;
- 1$
- degree m;
- 12$
- % 2 = codim m is the codimension of the curve m. The defining
- % equations of the singular locus with their nilpotent structure :
- singular_locus(m,2);
- {x**3 - y**3 + 2*z**4,
- x**3 + 2*x**2*z + y**3 - 2*y**2*z,
- y*(8*x**3 + 3*x**2*y - 11*y**3 + 12*y*z**3),
- y*(x**3 + 3*x**2*y + 2*x*y*z + y**3 - 2*y**2*z),
- 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**4
- - 16*x*y**3 + 18*y**5 - 42*y**4*z - 22*y**4 + 24*y**3*z**2}$
-
- groebfactor ws;
- {{y,x,z},{81*x + 256,27*z - 64,81*y - 256}}$
-
- % Hence this curve has two singular points :
- % (x=y=z=0) and (y=-x=256/81,z=64/27)
- % Let's find the brances of the curve through the origin.
- % The first critical tropism is (-1,-1,-1).
- off noetherian$
- setring(vars,{{-1,-1,-1}},lex)$
- setideal(m,m);
- {z*x**2 - z*y**2 + x**3 + z**4,
- z*x**2 - z*y**2 + y**3 - z**4}$
- % Let's first test two different approaches, not fully
- % integrated into the algebraic interface :
- setideal(m1,homstbasis m);
- {x**3 - y**3 + 2*z**4,
- z*x**2 - z*y**2 + y**3 - z**4,
- z*x*y**2 - z*y**3 - x*y**3 + 2*z**5 + z**4*x,
- 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*y
- **2,
- 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 +
- z**4*x**3 - 2*z**4*x*y**2 + 3*z**4*y**3}$
- setideal(m2,lazystbasis m);
- {x**3 - y**3 + 2*z**4,
- z*x**2 - z*y**2 + y**3 - z**4,
- z*x*y**2 - z*y**3 - x*y**3 + 2*z**5 + z**4*x,
- 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*y
- **2,
- 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*y
- **2 - z**4*x*y**2 + z**4*y**3}$
- setgbasis m1$
- setgbasis m2$
- modequalp(m1,m2);
- yes$
- gbasis m;
- {x**3 - y**3 + 2*z**4,
- z*x**2 - z*y**2 + y**3 - z**4,
- z*x*y**2 - z*y**3 - x*y**3 + 2*z**5 + z**4*x,
- 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*y
- **2,
- 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*y
- **2 - z**4*x*y**2 + z**4*y**3}$
- modequalp(m,m1);
- yes$
- dim m;
- 1$
- degree m;
- 9$
- % Find the tangent directions not in z-direction :
- tangentcone m;
- {x**3 - y**3,
- z*x**2 - z*y**2 + y**3,
- z*x*y**2 - z*y**3 - x*y**3,
- x**2*y**3 + x*y**4 + y**5,
- 3*z*y**5 + x*y**5 - y**6}$
-
- setideal(n,sub(z=1,ws));
- {x**3 - y**3,
- x**2 - y**2 + y**3,
- x*y**2 - y**3 - x*y**3,
- x**2*y**3 + x*y**4 + y**5,
- 3*y**5 + x*y**5 - y**6}$
- setring r$
- on noetherian$
- setideal(n,n)$
- degree n;
- 9$
- % The points of n outside the origin.
- matstabquot(n,{x,y});
- {y**2 - 3*y + 3,x - y + 3}$
-
- % Hence there are two branches x=z'*(a-3+x'),y=z'*(a+y'),z=z'
- % with the algebraic number a : a^2-3a+3=0
- % and the new equations for (z',x',y') :
- setrules {a^2=>3a-3};
- {a**2 => 3*a - 3}$
- sub(x=z*(a-3+x),y=z*(a+y),m);
- {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
- **2 + 21*x - y**2 + z - 18),
- 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**
- 2 - z + 9)}$
- setideal(m1,matqquot(ws,z));
- {x**3 + (3*a - 7)*x**2 - (5*a - 6)*x + y**3 + (3*a - 2)*y**2 + (5*a - 9)*y,
- z - x**2 - (2*a - 6)*x - y**3 - (3*a - 1)*y**2 - (7*a - 9)*y}$
- % This defines a loc. smooth system at the origin, since the
- % jacobian at the origin of the gbasis is nonsingular :
- off noetherian$
- setring getring m;
- {{z,x,y},{{-1,-1,-1}},lex,{1,1,1}}$
- setideal(m1,m1);
- { - (5*a - 6)*x + (5*a - 9)*y + (3*a - 7)*x**2 + (3*a - 2)*y**2 + x**3 + y**3,
- z - (2*a - 6)*x - (7*a - 9)*y - x**2 - (3*a - 1)*y**2 - y**3}$
- gbasis m1;
- {(5*a - 6)*x - (5*a - 9)*y - (3*a - 7)*x**2 - (3*a - 2)*y**2 - x**3 - y**3,
- (5*a - 6)*z + 27*y + (9*a - 18)*x**2 - (18*a - 45)*y**2 - (2*a - 6)*x**3 - (7*a
- - 12)*y**3}$
- % clear the rules previously set.
- setrules {};
- {}$
-
- % Example 11 : The standard basis of another example.
- % Comparing different approaches.
- vars:={x,y}$
- setring(vars,localorder vars,lex);
- {{x,y},{{-1,-1}},lex,{1,1}}$
- ff:=x^5+y^11+(x+x^3)*y^9;
- ff := x**5 + x**3*y**9 + x*y**9 + y**11$
- setideal(p1,mat2list matjac({ff},vars));
- {5*x**4 + y**9 + 3*x**2*y**9,
- 9*x*y**8 + 11*y**10 + 9*x**3*y**8}$
- gbasis p1;
- {5*x**4 + y**9 + 3*x**2*y**9,
- 9*x*y**8 + 11*y**10 + 9*x**3*y**8,
- 73205*y**16 + 6561*y**17 - 32805*x**10*y**8 + 294030*x**6*y**12 - 292820*x**2*y
- **16 + 120285*x**9*y**10 - 239580*x**5*y**14 + 19683*x**2*y**17}$
- gbtestversion 2$
- setideal(p2,p1);
- {5*x**4 + y**9 + 3*x**2*y**9,
- 9*x*y**8 + 11*y**10 + 9*x**3*y**8}$
- gbasis p2;
- {5*x**4 + y**9 + 3*x**2*y**9,
- 9*x*y**8 + 11*y**10 + 9*x**3*y**8,
- 73205*y**16 + 6561*y**17 - 32805*x**10*y**8 + 294030*x**6*y**12 - 292820*x**2*y
- **16 + 120285*x**9*y**10 - 239580*x**5*y**14 + 19683*x**2*y**17}$
- gbtestversion 3$
- setideal(p3,p1);
- {5*x**4 + y**9 + 3*x**2*y**9,
- 9*x*y**8 + 11*y**10 + 9*x**3*y**8}$
- gbasis p3;
- {5*x**4 + y**9 + 3*x**2*y**9,
- 9*x*y**8 + 11*y**10 + 9*x**3*y**8,
- 73205*y**16 + 6561*y**17 - 32805*x**10*y**8 + 294030*x**6*y**12 - 292820*x**2*y
- **16 + 120285*x**9*y**10 - 239580*x**5*y**14 + 19683*x**2*y**17}$
- gbtestversion 1$
- modequalp(p1,p2);
- yes$
- modequalp(p1,p3);
- yes$
- dim p1;
- 0$
- degree p1;
- 40$
- % Example 12 : A local intersection wrt. a non inflimited term order.
- setring({x,y,z},{},revlex);
- {{x,y,z},{},revlex,{1,1,1}}$
- m1:=matintersect({x-y^2,y-x^2},{x-z^2,z-x^2},{y-z^2,z-y^2});
- 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*
- y**2*z**3 - x**4*y**2*z**3,
- 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**2*y*z
- **3 - x**3*y**2*z**3,
- 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*y**2*z
- **2 - x**3*y**3*z**2}$
-
- % Delete polynomial units post factum :
-
- deleteunits ws;
- {y*z,x*z,x*y}$
- % Detecting polynomial units early :
- on detectunits;
- m1:=matintersect({x-y^2,y-x^2},{x-z^2,z-x^2},{y-z^2,z-y^2});
- m1 := {y*z,x*z,x*y}$
- off detectunits;
- comment
- ####################################
- ### ###
- ### More Advanced Computations ###
- ### ###
- ####################################
- end comment;
- % Return to a noetherian term order:
-
- vars:={x,y,z}$
- setring(vars,degreeorder vars,revlex);
- {{x,y,z},{{1,1,1}},revlex,{1,1,1}}$
- on noetherian;
- % Example 13 : Use of "mod".
- % Polynomials modulo ideals :
- setideal(m,{2x^2+y+5,3y^2+z+7,7z^2+x+1});
- {2*x**2 + y + 5,3*y**2 + z + 7,7*z**2 + x + 1}$
- x^2*y^2*z^2 mod m;
- ( - x*y*z - 7*x*y - 5*x*z - 35*x - y*z - 7*y - 5*z - 35)/42$
- % Lists of polynomials modulo ideals :
- {x^3,y^3,z^3} mod gbasis m;
- {(x*( - y - 5))/2,(y*( - z - 7))/3,( - z*(x + 1))/7}$
- % Matrices modulo modules :
- mm:=mat((x^4,y^4,z^4));
- mm := mat((x**4,y**4,z**4))$
- mm1:=tp<< ideal2mat m>>;
- mm1 := mat((2*x**2 + y + 5,3*y**2 + z + 7,x + 7*z**2 + 1))$
- mm mod mm1;
- mat(((y**2 + 10*y + 25)/4,( - 6*x**2*y**2 - 2*x**2*z - 14*x**2 + 4*y**4 + 3*y**3
- + 15*y**2 + y*z + 7*y + 5*z + 35)/4,( - 2*x**3 - 14*x**2*z**2 - 2*x**2 + x*y +
- 5*x + 7*y*z**2 + y + 4*z**4 + 35*z**2 + 5)/4))$
- % Example 14 : Powersums through elementary symmetric functions.
- vars:={a,b,c,d,e1,e2,e3,e4}$
- setring(vars,{},lex)$
- m:=interreduce {a+b+c+d-e1,
- a*b+a*c+a*d+b*c+b*d+c*d-e2,
- a*b*c+a*b*d+a*c*d+b*c*d-e3,
- a*b*c*d-e4};
- m := {d**4 - d**3*e1 + d**2*e2 - d*e3 + e4,
- a + b + c + d - e1,
- c**3 + c**2*d - c**2*e1 + c*d**2 - c*d*e1 + c*e2 + d**3 - d**2*e1 + d*e2 - e3,
- b**2 + b*c + b*d - b*e1 + c**2 + c*d - c*e1 + d**2 - d*e1 + e2}$
-
- for n:=1:5 collect a^n+b^n+c^n+d^n mod m;
- {e1,
- e1**2 - 2*e2,
- e1**3 - 3*e1*e2 + 3*e3,
- e1**4 - 4*e1**2*e2 + 4*e1*e3 + 2*e2**2 - 4*e4,
- e1**5 - 5*e1**3*e2 + 5*e1**2*e3 + 5*e1*e2**2 - 5*e1*e4 - 5*e2*e3}$
-
- % Example 15 : The setrules mechanism.
- setring({x,y,z},{},lex)$
- setrules {aa^3=>aa+1};
- {aa**3 => aa + 1}$
- setideal(m,{x^2+y+z-aa,x+y^2+z-aa,x+y+z^2-aa});
- {x**2 + y + z - aa,x + y**2 + z - aa,x + y + z**2 - aa}$
- gbasis m;
- {y**2 - y - z**2 + z,
- x + y + z**2 - aa,
- 2*y*z**2 - (2*aa - 2)*y + z**4 - (2*aa - 1)*z**2 + (aa**2 - aa),
- z**6 - (3*aa + 1)*z**4 + 4*z**3 + (3*aa**2 - 2*aa - 2)*z**2 - (4*aa - 4)*z + (3*
- aa**2 - 3*aa - 1)}$
-
- % Clear the rules previously set.
- setrules {};
- {}$
- % Example 16 : The same example with advanced coefficient domains.
- load_package arnum;
- defpoly aa^3-aa-1;
- setideal(m,{x^2+y+z-aa,x+y^2+z-aa,x+y+z^2-aa});
- {x**2 + y + z - aa,x + y**2 + z - aa,x + y + z**2 - aa}$
- gbasis m;
- {y**2 - y - z**2 + z,
- x + y + z**2 - aa,
- y*z**2 - (aa - 1)*y + 1/2*z**4 - (aa - 1/2)*z**2 + (1/2*aa**2 - 1/2*aa),
- z**6 - (3*aa + 1)*z**4 + 4*z**3 + (3*aa**2 - 2*aa - 2)*z**2 - (4*aa - 4)*z + (3*
- aa**2 - 3*aa - 1)}$
- % The following needs some more time since factorization of
- % arnum's is not so easy :
- groebfactor m;
- {{y - (aa**2 - aa - 1),
- z - (aa**2 - aa - 1),
- x + (aa**2 - aa - 2)},
- {y + (aa**2 - aa - 1),
- z + (aa**2 - aa - 1),
- x - (aa**2 - aa)},
- {y - z,x - z,z**2 + 2*z - aa},
- {z - (aa**2 - aa),
- y + (aa**2 - aa - 1),
- x + (aa**2 - aa - 1)},
- {z - (aa**2 - aa - 1),
- y + (aa**2 - aa - 2),
- x - (aa**2 - aa - 1)},
- {z + (aa**2 - aa - 2),
- y - (aa**2 - aa - 1),
- x - (aa**2 - aa - 1)},
- {z + (aa**2 - aa - 1),
- y - (aa**2 - aa),
- x + (aa**2 - aa - 1)}}$
- off arnum;
- off rational;
- comment
- ####################################
- ### ###
- ### Using Advanced Scripts in ###
- ### a Complex Example ###
- ### ###
- ####################################
- end comment;
- % Example 17 : The square of the 2-minors of a symmetric 3x3-matrix.
- vars:=for i:=1:6 collect mkid(x,i);
- vars := {x1,
- x2,
- x3,
- x4,
- x5,
- x6}$
- setring(vars,degreeorder vars,revlex);
- {{x1,x2,x3,x4,x5,x6},{{1,1,1,1,1,1}},revlex,{1,1,1,1,1,1}}$
- % Generating the ideal :
- mm:=mat((x1,x2,x3),(x2,x4,x5),(x3,x5,x6));
- mm := mat((x1,x2,x3),(x2,x4,x5),(x3,x5,x6))$
- m:=ideal_of_minors(mm,2);
- m := { - x1*x4 + x2**2,
- - x1*x5 + x2*x3,
- - x1*x6 + x3**2,
- - x2*x5 + x3*x4,
- - x2*x6 + x3*x5,
- - x4*x6 + x5**2}$
- setideal(n,idealpower(m,2));
- {x2**4 - 2*x1*x2**2*x4 + x1**2*x4**2,
- x3**4 - 2*x1*x3**2*x6 + x1**2*x6**2,
- x5**4 - 2*x4*x5**2*x6 + x4**2*x6**2,
- x2**2*x3**2 - 2*x1*x2*x3*x5 + x1**2*x5**2,
- x3**2*x5**2 - 2*x2*x3*x5*x6 + x2**2*x6**2,
- x2**3*x3 - x1*x2*x3*x4 - x1*x2**2*x5 + x1**2*x4*x5,
- x2*x3**3 - x1*x3**2*x5 - x1*x2*x3*x6 + x1**2*x5*x6,
- x2**2*x3*x4 - x1*x3*x4**2 - x2**3*x5 + x1*x2*x4*x5,
- x2**2*x3*x5 - x1*x3*x4*x5 - x2**3*x6 + x1*x2*x4*x6,
- x2*x3**2*x5 - x1*x3*x5**2 - x2**2*x3*x6 + x1*x2*x5*x6,
- x3**3*x5 - x2*x3**2*x6 - x1*x3*x5*x6 + x1*x2*x6**2,
- x2**2*x5**2 - x1*x4*x5**2 - x2**2*x4*x6 + x1*x4**2*x6,
- x2*x3*x5**2 - x1*x5**3 - x2*x3*x4*x6 + x1*x4*x5*x6,
- x3*x4*x5**2 - x2*x5**3 - x3*x4**2*x6 + x2*x4*x5*x6,
- x3*x5**3 - x3*x4*x5*x6 - x2*x5**2*x6 + x2*x4*x6**2,
- x3**2*x4**2 - 2*x2*x3*x4*x5 + x1*x4*x5**2 + x2**2*x4*x6 - x1*x4**2*x6,
- x2*x3**2*x4 - 2*x1*x3*x4*x5 + x1*x2*x5**2 - x2**3*x6 + x1*x2*x4*x6,
- x3**3*x4 - x1*x3*x5**2 - x2**2*x3*x6 - x1*x3*x4*x6 + 2*x1*x2*x5*x6,
- x3**2*x4*x5 - x1*x5**3 - 2*x2*x3*x4*x6 + x2**2*x5*x6 + x1*x4*x5*x6,
- x3**2*x4*x6 - 2*x2*x3*x5*x6 + x1*x5**2*x6 + x2**2*x6**2 - x1*x4*x6**2,
- x1*x3**2*x4 - 2*x1*x2*x3*x5 + x1**2*x5**2 + x1*x2**2*x6 - x1**2*x4*x6}$
- % The ideal itself :
- gbasis n;
- {x2**4 - 2*x1*x2**2*x4 + x1**2*x4**2,
- x3**4 - 2*x1*x3**2*x6 + x1**2*x6**2,
- x5**4 - 2*x4*x5**2*x6 + x4**2*x6**2,
- x2**2*x3**2 - 2*x1*x2*x3*x5 + x1**2*x5**2,
- x3**2*x5**2 - 2*x2*x3*x5*x6 + x2**2*x6**2,
- x2**3*x3 - x1*x2*x3*x4 - x1*x2**2*x5 + x1**2*x4*x5,
- x2*x3**3 - x1*x3**2*x5 - x1*x2*x3*x6 + x1**2*x5*x6,
- x2**2*x3*x4 - x1*x3*x4**2 - x2**3*x5 + x1*x2*x4*x5,
- x2**2*x3*x5 - x1*x3*x4*x5 - x2**3*x6 + x1*x2*x4*x6,
- x2*x3**2*x5 - x1*x3*x5**2 - x2**2*x3*x6 + x1*x2*x5*x6,
- x3**3*x5 - x2*x3**2*x6 - x1*x3*x5*x6 + x1*x2*x6**2,
- x2**2*x5**2 - x1*x4*x5**2 - x2**2*x4*x6 + x1*x4**2*x6,
- x2*x3*x5**2 - x1*x5**3 - x2*x3*x4*x6 + x1*x4*x5*x6,
- x3*x4*x5**2 - x2*x5**3 - x3*x4**2*x6 + x2*x4*x5*x6,
- x3*x5**3 - x3*x4*x5*x6 - x2*x5**2*x6 + x2*x4*x6**2,
- x3**2*x4**2 - 2*x2*x3*x4*x5 + x1*x4*x5**2 + x2**2*x4*x6 - x1*x4**2*x6,
- x2*x3**2*x4 - 2*x1*x3*x4*x5 + x1*x2*x5**2 - x2**3*x6 + x1*x2*x4*x6,
- x3**3*x4 - x1*x3*x5**2 - x2**2*x3*x6 - x1*x3*x4*x6 + 2*x1*x2*x5*x6,
- x3**2*x4*x5 - x1*x5**3 - 2*x2*x3*x4*x6 + x2**2*x5*x6 + x1*x4*x5*x6,
- x3**2*x4*x6 - 2*x2*x3*x5*x6 + x1*x5**2*x6 + x2**2*x6**2 - x1*x4*x6**2,
- x1*x3**2*x4 - 2*x1*x2*x3*x5 + x1**2*x5**2 + x1*x2**2*x6 - x1**2*x4*x6}$
- length n;
- 21$
- dim n;
- 3$
- degree n;
- 16$
- % Its radical.
- radical n;
- { - x1*x5 + x2*x3,
- - x2*x5 + x3*x4,
- - x2*x6 + x3*x5,
- - x1*x4 + x2**2,
- - x1*x6 + x3**2,
- - x4*x6 + x5**2}$
- % Its unmixed radical.
- unmixedradical n;
- { - x1*x5 + x2*x3,
- x2*x5 - x3*x4,
- - x2*x6 + x3*x5,
- - x1*x4 + x2**2,
- - x1*x6 + x3**2,
- - x4*x6 + x5**2}$
- % Its equidimensional hull :
- n1:=eqhull n;
- n1 := {x1**2*x4**2 - 2*x1*x2**2*x4 + x2**4,
- x1**2*x6**2 - 2*x1*x3**2*x6 + x3**4,
- x4**2*x6**2 - 2*x4*x5**2*x6 + x5**4,
- x1**2*x5**2 - 2*x1*x2*x3*x5 + x2**2*x3**2,
- x2**2*x6**2 - 2*x2*x3*x5*x6 + x3**2*x5**2,
- x1**2*x4*x5 - x1*x2**2*x5 - x1*x2*x3*x4 + x2**3*x3,
- x1**2*x5*x6 - x1*x2*x3*x6 - x1*x3**2*x5 + x2*x3**3,
- x1*x2*x4*x5 - x1*x3*x4**2 - x2**3*x5 + x2**2*x3*x4,
- x1*x2*x4*x6 - x1*x3*x4*x5 - x2**3*x6 + x2**2*x3*x5,
- x1*x2*x5*x6 - x1*x3*x5**2 - x2**2*x3*x6 + x2*x3**2*x5,
- x1*x2*x6**2 - x1*x3*x5*x6 - x2*x3**2*x6 + x3**3*x5,
- x1*x4**2*x6 - x1*x4*x5**2 - x2**2*x4*x6 + x2**2*x5**2,
- x1*x4*x5*x6 - x1*x5**3 - x2*x3*x4*x6 + x2*x3*x5**2,
- x2*x4*x5*x6 - x2*x5**3 - x3*x4**2*x6 + x3*x4*x5**2,
- x2*x4*x6**2 - x2*x5**2*x6 - x3*x4*x5*x6 + x3*x5**3,
- - x1*x4*x6 + x1*x5**2 + x2**2*x6 - 2*x2*x3*x5 + x3**2*x4}$
- length n1;
- 16$
- setideal(n1,n1)$
-
- submodulep(n,n1);
- yes$
- submodulep(n1,n);
- no$
- % Hence there is an embedded component. Let's find it making
- % an excursion to symbolic mode. Of course, this can be done
- % also algebraically.
- symbolic;
- nil
- n:=get('n,'basis);
- (dpmat 21 0 ((1 ((((0 0 4) 4) . 1) (((0 1 2 0 1) 4) . -2) (((0 2 0 0 2) 4) . 1))
- 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) 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 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) (((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) . -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) 4) .
- -1) (((0 1 2 0 0 1) 4) . -1) (((0 2 0 0 1 1) 4) . 1)) 4 0 nil) (7 ((((0 0 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 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 0 1) 4)
- . -1) (((0 1 1 0 1 1) 4) . 1)) 4 0 nil) (9 ((((0 0 2 1 0 1) 4) . 1) (((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 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) . -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 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) (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) . -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 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) (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) (((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 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 ((((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 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) (((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) (((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) . -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) 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 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) (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) . 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 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) 4) . 1) (((0 2 0 0 1 0 1) 4) . -1)
- ) 5 0 nil)) nil nil)
- % This needs even more time than the eqhull, of course.
- u:=primarydecomposition!* n;
- (((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
- 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) ((
- (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 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) .
- -1) (((0 1 0 0 1 1 1) 4) . 1)) 4 0 nil) (4 ((((0 0 4) 4) . 1) (((0 1 2 0 1) 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) . -1
- ) (((0 1 2 0 0 1) 4) . -1) (((0 2 0 0 1 1) 4) . 1)) 4 0 nil) (6 ((((0 0 2 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 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) . 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 1 0 1) 4)
- . -1) (((0 1 0 0 2 0 1) 4) . 1)) 4 0 nil) (9 ((((0 0 0 4) 4) . 1) (((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) 4) . 1) (((
- 0 0 0 0 1 2 1) 4) . -2) (((0 0 0 0 2 0 2) 4) . 1)) 3 0 nil) (11 ((((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 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) (((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 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) (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) (((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 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 ((((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 0 0 0 1) 3) . 1) (((0 1
- 0 0 1 0 1) 3) . -1)) 5 0 nil)) nil t) (dpmat 6 0 ((1 ((((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) 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 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 0 nil) (5 ((((0 0 1 1) 2) .
- 1) (((0 1 0 0 0 1) 2) . -1)) 2 0 nil) (6 ((((0 0 2) 2) . 1) (((0 1 0 0 1) 2) . -1
- )) 2 0 nil)) nil t)) ((dpmat 18 0 ((1 ((((0 0 1 0 0 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) . 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)) 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 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) (10 ((((0 0 2 1 0 1) 4) . 1)) 1
- 0 nil) (11 ((((0 0 1 2 0 1) 4) . 1)) 1 0 nil) (12 ((((0 0 2 0 0 2) 4) . 1)) 1 0
- nil) (13 ((((0 0 1 1 0 2) 4) . 1)) 1 0 nil) (14 ((((0 0 4) 4) . 1)) 1 0 nil) (15
- ((((0 0 2 2) 4) . 1)) 1 0 nil) (16 ((((0 1) 1) . 1)) 1 0 nil) (17 ((((0 0 1 3) 4
- ) . 1)) 1 0 nil) (18 ((((0 0 3 1) 4) . 1)) 1 0 nil)) nil t) (dpmat 6 0 ((1 ((((0
- 0 0 0 0 0 1) 1) . 1)) 1 0 nil) (2 ((((0 0 0 0 1) 1) . 1)) 1 0 nil) (3 ((((0 1) 1
- ) . 1)) 1 0 nil) (4 ((((0 0 1) 1) . 1)) 1 0 nil) (5 ((((0 0 0 1) 1) . 1)) 1 0 nil
- ) (6 ((((0 0 0 0 0 1) 1) . 1)) 1 0 nil)) nil t)))
- for each x in u collect easydim!* cadr x;
- (3 0)
- for each x in u collect degree!* car x;
- (16 20)
- % Hence the embedded component is a trivial one. Let's divide
- % it out by a stable ideal quotient calculation :
- algebraic;
- setideal(n2,matstabquot(n,vars));
- {x2**4 - 2*x1*x2**2*x4 + x1**2*x4**2,
- x3**4 - 2*x1*x3**2*x6 + x1**2*x6**2,
- x5**4 - 2*x4*x5**2*x6 + x4**2*x6**2,
- x2**2*x3**2 - 2*x1*x2*x3*x5 + x1**2*x5**2,
- x3**2*x5**2 - 2*x2*x3*x5*x6 + x2**2*x6**2,
- x2**3*x3 - x1*x2*x3*x4 - x1*x2**2*x5 + x1**2*x4*x5,
- x2*x3**3 - x1*x3**2*x5 - x1*x2*x3*x6 + x1**2*x5*x6,
- x2**2*x3*x4 - x1*x3*x4**2 - x2**3*x5 + x1*x2*x4*x5,
- x2**2*x3*x5 - x1*x3*x4*x5 - x2**3*x6 + x1*x2*x4*x6,
- x2*x3**2*x5 - x1*x3*x5**2 - x2**2*x3*x6 + x1*x2*x5*x6,
- x3**3*x5 - x2*x3**2*x6 - x1*x3*x5*x6 + x1*x2*x6**2,
- x2**2*x5**2 - x1*x4*x5**2 - x2**2*x4*x6 + x1*x4**2*x6,
- x2*x3*x5**2 - x1*x5**3 - x2*x3*x4*x6 + x1*x4*x5*x6,
- x3*x4*x5**2 - x2*x5**3 - x3*x4**2*x6 + x2*x4*x5*x6,
- x3*x5**3 - x3*x4*x5*x6 - x2*x5**2*x6 + x2*x4*x6**2,
- x3**2*x4 - 2*x2*x3*x5 + x1*x5**2 + x2**2*x6 - x1*x4*x6}$
- modequalp(n1,n2);
- yes$
- comment
- ########################################
- ### ###
- ### Test Examples for New Features ###
- ### ###
- ########################################
- end comment;
- % ==> Testing the different zerodimensional solver
- vars:={x,y,z}$
- setring(vars,degreeorder vars,revlex);
- {{x,y,z},{{1,1,1}},revlex,{1,1,1}}$
- setideal(m,{x^3+y+z-3,y^3+x+z-3,z^3+x+y-3});
- {x**3 + y + z - 3,y**3 + x + z - 3,z**3 + x + y - 3}$
- zerosolve1 m;
- {{x + y + z**3 - 3,
- y + z**3 + z - 3,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x + y + z**3 - 3,
- 2*y + z**3 - 3,
- z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
- {x + y + z,
- y**2 + y*z + z**2 - 1,
- z**3 - z - 3},
- {x + z**3 + z - 3,
- y - z,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x - z,y - z,z**2 + z + 3},
- {x - 1,y - 1,z - 1}}$
- zerosolve2 m;
- {{x + y + z**3 - 3,
- y + z**3 + z - 3,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x + y + z**3 - 3,
- 2*y + z**3 - 3,
- z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
- {x + y + z,
- y**2 + y*z + z**2 - 1,
- z**3 - z - 3},
- {x + z**3 + z - 3,
- y - z,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x - z,y - z,z**2 + z + 3},
- {x - 1,y - 1,z - 1}}$
- setring(vars,{},lex)$
- setideal(m,m)$
- m1:=gbasis m$
- zerosolve m1;
- {{x - 1,y - 1,z - 1},
- {x - z,y - z,z**2 + z + 3},
- {x + y + z,
- y**2 + y*z + z**2 - 1,
- z**3 - z - 3},
- {2*x + z**3 - 3,
- 2*y + z**3 - 3,
- z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
- {x + z**3 + z - 3,
- y - z,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x - z,
- y + z**3 + z - 3,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8}}$
- zerosolve1 m1;
- {{x - 1,y - 1,z - 1},
- {x - z,y - z,z**2 + z + 3},
- {x + y + z,
- y**2 + y*z + z**2 - 1,
- z**3 - z - 3},
- {x - y,
- 2*y + z**3 - 3,
- z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
- {x + z**3 + z - 3,
- y - z,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x - z,
- y + z**3 + z - 3,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8}}$
- zerosolve2 m1;
- {{x - 1,y - 1,z - 1},
- {x - z,y - z,z**2 + z + 3},
- {x + y + z,
- y**2 + y*z + z**2 - 1,
- z**3 - z - 3},
- {x - y,
- 2*y + z**3 - 3,
- z**6 - 2*z**4 - 6*z**3 + 4*z**2 + 6*z + 5},
- {x + z**3 + z - 3,
- y - z,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8},
- {x - z,
- y + z**3 + z - 3,
- z**6 + z**4 - 6*z**3 + z**2 - 3*z + 8}}$
- % ==> Testing groebfactor, extendedgroebfactor, extendedgroebfactor1
- % Gerdt et al. : Seventh order KdV type equation.
- A1:=-2*L1**2+L1*L2+2*L1*L3-L2**2-7*L5+21*L6$
- A2:=7*L7-2*L1*L4+3/7*L1**3$
- B1:=L1*(5*L1-3*L2+L3)$
- B2:=L1*(2*L6-4*L4)$
- B3:=L1*L7/2$
- P1:=L1*(L4-L5/2+L6)$
- P2:=(2/7*L1**2-L4)*(-10*L1+5*L2-L3)$
- P3:=(2/7*L1**2-L4)*(3*L4-L5+L6)$
- P4:=A1*(-3*L1+2*L2)+21*A2$
- P5:=A1*(2*L4-2*L5)+A2*(-45*L1+15*L2-3*L3)$
- P6:=2*A1*L7+A2*(12*L4-3*L5+2*L6)$
- P7:=B1*(2*L2-L1)+7*B2$
- P8:=B1*L3+7*B2$
- P9:=B1*(-2*L4-2*L5)+B2*(2*L2-8*L1)+84*B3$
- P10:=B1*(8/3*L5+6*L6)+B2*(11*L1-17/3*L2+5/3*L3)-168*B3$
- P11:=15*B1*L7+B2*(5*L4-2*L5)+B3*(-120*L1+30*L2-6*L3)$
- P12:=-3*B1*L7+B2*(-L4/2+L5/4-L6/2)+B3*(24*L1-6*L2)$
- P13:=3*B2*L7+B3*(40*L4-8*L5+4*L6)$
- polys:={P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13};
- polys := {(l1*(2*l4 - l5 + 2*l6))/2,
- ( - 20*l1**3 + 10*l1**2*l2 - 2*l1**2*l3 + 70*l1*l4 - 35*l2*l4 + 7*l3*l4)/7,
- (6*l1**2*l4 - 2*l1**2*l5 + 2*l1**2*l6 - 21*l4**2 + 7*l4*l5 - 7*l4*l6)/7,
- 15*l1**3 - 7*l1**2*l2 - 6*l1**2*l3 + 5*l1*l2**2 + 4*l1*l2*l3 - 42*l1*l4 + 21*l1*
- l5 - 63*l1*l6 - 2*l2**3 - 14*l2*l5 + 42*l2*l6 + 147*l7,
- ( - 135*l1**4 + 45*l1**3*l2 - 9*l1**3*l3 + 602*l1**2*l4 + 28*l1**2*l5 - 196*l1*
- l2*l4 - 14*l1*l2*l5 + 70*l1*l3*l4 - 28*l1*l3*l5 - 2205*l1*l7 - 14*l2**2*l4 + 14*
- l2**2*l5 + 735*l2*l7 - 147*l3*l7 - 98*l4*l5 + 294*l4*l6 + 98*l5**2 - 294*l5*l6)/
- 7,
- (36*l1**3*l4 - 9*l1**3*l5 + 6*l1**3*l6 - 28*l1**2*l7 + 14*l1*l2*l7 + 28*l1*l3*l7
- - 168*l1*l4**2 + 42*l1*l4*l5 - 28*l1*l4*l6 - 14*l2**2*l7 + 588*l4*l7 - 245*l5*
- l7 + 392*l6*l7)/7,
- l1*( - 5*l1**2 + 13*l1*l2 - l1*l3 - 6*l2**2 + 2*l2*l3 - 28*l4 + 14*l6),
- l1*(5*l1*l3 - 3*l2*l3 + l3**2 - 28*l4 + 14*l6),
- 2*l1*(11*l1*l4 - 5*l1*l5 - 8*l1*l6 - l2*l4 + 3*l2*l5 + 2*l2*l6 - l3*l4 - l3*l5 +
- 21*l7),
- (4*l1*( - 33*l1*l4 + 10*l1*l5 + 39*l1*l6 + 17*l2*l4 - 6*l2*l5 - 22*l2*l6 - 5*l3*
- l4 + 2*l3*l5 + 7*l3*l6 - 63*l7))/3,
- l1*(15*l1*l7 - 30*l2*l7 + 12*l3*l7 - 20*l4**2 + 8*l4*l5 + 10*l4*l6 - 4*l5*l6),
- (l1*( - 6*l1*l7 + 12*l2*l7 - 6*l3*l7 + 4*l4**2 - 2*l4*l5 + 2*l4*l6 + l5*l6 - 2*
- l6**2))/2,
- 4*l1*l7*(2*l4 - l5 + 2*l6)}$
- vars:={L7,L6,L5,L4,L3,L2,L1};
- vars := {l7,
- l6,
- l5,
- l4,
- l3,
- l2,
- l1}$
- clear a1,a2,b1,b2,b3$
- off lexefgb;
-
- setring(vars,{},lex);
- {{l7,l6,l5,l4,l3,l2,l1},{},lex,{1,1,1,1,1,1,1}}$
- % The factorized Groebner algorithm.
- groebfactor polys;
- {{l1,l4,l7,21*l6 - 7*l5 - l2**2},
- {l1,
- l4,
- 7*l5 - l3*l2 + 5*l2**2,
- 56*l6 - 5*l3*l2 + 23*l2**2,
- 588*l7 + 7*l3*l2**2 - 37*l2**3},
- {l1,
- l7,
- l3 - 5*l2,
- 14*l6 - 21*l4 - l2**2,
- 14*l5 - 63*l4 - l2**2},
- {l1,l4,l2,l5,l7},
- {7*l4 - 2*l1**2,
- l2 - 2*l1,
- l3 - 3*l1,
- 147*l7 - 4*l1**3,
- 7*l5 - 6*l1**2,
- 7*l6 - l1**2},
- {7*l4 - 2*l1**2,
- 2*l2 - 7*l1,
- l3 - 6*l1,
- 147*l7 - 4*l1**3,
- 7*l5 - 9*l1**2,
- 14*l6 - 5*l1**2},
- {l1,
- l3 - 5*l2,
- 63*l4 + 2*l2**2,
- 63*l5 + 2*l2**2,
- 63*l6 - 4*l2**2,
- 1323*l7 + 10*l2**3},
- {l1,l2,l3,l7,l5 - l4,l6 + 2*l4},
- {l2 - 3*l1,
- l3 - 5*l1,
- 14*l4 - 5*l1**2,
- 98*l7 - 5*l1**3,
- 7*l5 - 10*l1**2,
- 14*l6 - 5*l1**2}}$
- % The extended Groebner factorizer, producing triangular sets.
- extendedgroebfactor polys;
- {{{98*l7 - 5*l1**3,
- 14*l6 - 5*l1**2,
- 7*l5 - 10*l1**2,
- 14*l4 - 5*l1**2,
- l3 - 5*l1,
- l2 - 3*l1},
- {},
- {l1}},
- {{l7,l6 + 2*l4,l5 - l4,l3,l2,l1},{},{l4}},
- {{1323*l7 + 10*l2**3,
- 63*l6 - 4*l2**2,
- 63*l5 + 2*l2**2,
- 63*l4 + 2*l2**2,
- l3 - 5*l2,
- l1},
- {},
- {l2}},
- {{147*l7 - 4*l1**3,
- 14*l6 - 5*l1**2,
- 7*l5 - 9*l1**2,
- 7*l4 - 2*l1**2,
- l3 - 6*l1,
- 2*l2 - 7*l1},
- {},
- {l1}},
- {{147*l7 - 4*l1**3,
- 7*l6 - l1**2,
- 7*l5 - 6*l1**2,
- 7*l4 - 2*l1**2,
- l3 - 3*l1,
- l2 - 2*l1},
- {},
- {l1}},
- {{l7,l5,l4,l2,l1},{},{l6,l3}},
- {{l7,
- 14*l6 - (l2**2 + 21*l4),
- 14*l5 - (l2**2 + 63*l4),
- l3 - 5*l2,
- l1},
- {},
- {l4,l2}},
- {{588*l7 - (37*l2**3 - 7*l2**2*l3),
- 56*l6 + (23*l2**2 - 5*l2*l3),
- 7*l5 + (5*l2**2 - l2*l3),
- l4,
- l1},
- {},
- {l3,l2}},
- {{l7,21*l6 - (l2**2 + 7*l5),l4,l1},{},{l5,l3,l2}}}$
- % The extended Groebner factorizer with subproblem removal check.
- extendedgroebfactor1 polys;
- {{{l7,21*l6 - (l2**2 + 7*l5),l4,l1},{},{l5,l3,l2}},
- {{588*l7 - (37*l2**3 - 7*l2**2*l3),
- 56*l6 + (23*l2**2 - 5*l2*l3),
- 7*l5 + (5*l2**2 - l2*l3),
- l4,
- l1},
- {},
- {l3,l2}},
- {{l7,
- 14*l6 - (l2**2 + 21*l4),
- 14*l5 - (l2**2 + 63*l4),
- l3 - 5*l2,
- l1},
- {},
- {l4,l2}},
- {{l7,l5,l4,l2,l1},{},{l6,l3}},
- {{147*l7 - 4*l1**3,
- 7*l6 - l1**2,
- 7*l5 - 6*l1**2,
- 7*l4 - 2*l1**2,
- l3 - 3*l1,
- l2 - 2*l1},
- {},
- {l1}},
- {{147*l7 - 4*l1**3,
- 14*l6 - 5*l1**2,
- 7*l5 - 9*l1**2,
- 7*l4 - 2*l1**2,
- l3 - 6*l1,
- 2*l2 - 7*l1},
- {},
- {l1}},
- {{1323*l7 + 10*l2**3,
- 63*l6 - 4*l2**2,
- 63*l5 + 2*l2**2,
- 63*l4 + 2*l2**2,
- l3 - 5*l2,
- l1},
- {},
- {l2}},
- {{l7,l6 + 2*l4,l5 - l4,l3,l2,l1},{},{l4}},
- {{98*l7 - 5*l1**3,
- 14*l6 - 5*l1**2,
- 7*l5 - 10*l1**2,
- 14*l4 - 5*l1**2,
- l3 - 5*l1,
- l2 - 3*l1},
- {},
- {l1}}}$
- % Gonnet's example (ACM SIGSAM Bulletin 17 (1983), 48 - 49)
- vars:={a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5};
- vars := {a0,
- a2,
- a3,
- a4,
- a5,
- b0,
- b1,
- b2,
- b3,
- b4,
- b5,
- c0,
- c1,
- c2,
- c3,
- c4,
- c5}$
- polys:={a4*b4,
- a5*b1+b5+a4*b3+a3*b4,
- a2*b2,a5*b5,
- (a0+1+a4)*b2+a2*(b0+b1+b4)+c2,
- (a0+1+a4)*(b0+b1+b4)+(a3+a5)*b2+a2*(b3+b5)+c0+c1+c4,
- (a3+a5)*(b0+b1+b4)+(b3+b5)*(a0+1+a4)+c3+c5-1,
- (a3+a5)*(b3+b5),
- a5*(b3+b5)+b5*(a3+a5),
- b5*(a0+1+2*a4)+a5*(b0+b1+2*b4)+a3*b4+a4*b3+c5,
- a4*(b0+b1+2*b4)+a2*b5+a5*b2+(a0+1)*b4+c4,
- a2*b4+a4*b2,
- a4*b5+a5*b4,
- 2*a3*b3+a3*b5+a5*b3,
- c3+b3*(a0+2+a4)+a3*(b0+2*b1+b4)+b5+a5*b1,
- c1+(a0+2+a4)*b1+a2*b3+a3*b2+(b0+b4),
- a2*b1+b2,
- a5*b3+a3*b5,
- b4+a4*b1};
- polys := {a4*b4,
- a3*b4 + a4*b3 + a5*b1 + b5,
- a2*b2,
- a5*b5,
- a0*b2 + a2*b0 + a2*b1 + a2*b4 + a4*b2 + b2 + c2,
- a0*b0 + a0*b1 + a0*b4 + a2*b3 + a2*b5 + a3*b2 + a4*b0 + a4*b1 + a4*b4 + a5*b2 +
- b0 + b1 + b4 + c0 + c1 + c4,
- a0*b3 + a0*b5 + a3*b0 + a3*b1 + a3*b4 + a4*b3 + a4*b5 + a5*b0 + a5*b1 + a5*b4 +
- b3 + b5 + c3 + c5 - 1,
- a3*b3 + a3*b5 + a5*b3 + a5*b5,
- a3*b5 + a5*b3 + 2*a5*b5,
- a0*b5 + a3*b4 + a4*b3 + 2*a4*b5 + a5*b0 + a5*b1 + 2*a5*b4 + b5 + c5,
- a0*b4 + a2*b5 + a4*b0 + a4*b1 + 2*a4*b4 + a5*b2 + b4 + c4,
- a2*b4 + a4*b2,
- a4*b5 + a5*b4,
- 2*a3*b3 + a3*b5 + a5*b3,
- a0*b3 + a3*b0 + 2*a3*b1 + a3*b4 + a4*b3 + a5*b1 + 2*b3 + b5 + c3,
- a0*b1 + a2*b3 + a3*b2 + a4*b1 + b0 + 2*b1 + b4 + c1,
- a2*b1 + b2,
- a3*b5 + a5*b3,
- a4*b1 + b4}$
- on lexefgb;
- % Switching back to the default.
- setring(vars,{},lex);
- {{a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5},
- {},
- lex,
- {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}$
- groebfactor polys;
- {{c5,
- b5,
- c2,
- c4,
- b2,
- b4,
- a4,
- a2,
- a5,
- b3,
- a3*b1 + 1,
- b0 - b1*c3 + 2*b1,
- a0 - a3*c1 + c3,
- b1*c3**2 - 2*b1*c3 + b1 - c0 + c1*c3 - 2*c1,
- a3*c0 - a3*c1*c3 + 2*a3*c1 + c3**2 - 2*c3 + 1},
- {c5,
- c4,
- b5,
- b4,
- a4,
- b2,
- a5,
- a3,
- b1,
- b3 + 1,
- a0 - c3 + 2,
- b0*c3 - 2*b0 + c0,
- a2 - b0 - c1,
- b0**2 + b0*c1 + c2,
- b0*c0 + c0*c1 - c2*c3 + 2*c2,
- c0**2 - c0*c1*c3 + 2*c0*c1 + c2*c3**2 - 4*c2*c3 + 4*c2},
- {c5,
- b5,
- c2,
- c4,
- b2,
- b4,
- a4,
- a2,
- a5,
- a3,
- b3 + 1,
- b0 + b1*c3 + c1,
- a0 - c3 + 2,
- b1*c3**2 - 2*b1*c3 + b1 - c0 + c1*c3 - 2*c1}}$
- extendedgroebfactor polys;
- {{{b1*a0 + (b1 + c1),
- a2,
- b1*a3 + 1,
- a4,
- a5,
- b0 + b1,
- b2,
- b3,
- b4,
- b5,
- c0 + c1,
- c2,
- c3 - 1,
- c4,
- c5},
- {b1,b1},
- {b1,c1}},
- {{a0,
- a2 - b0 - c1,
- a3,
- a4,
- a5,
- b0**2 + c1*b0 + c2,
- b1,
- b2,
- b3 + 1,
- b4,
- b5,
- c0,
- c3 - 2,
- c4,
- c5},
- {},
- {c1,c2}},
- {{a0 + 1,a2,a3,a4,a5,b0 + (b1 + c1),b2,b3 + 1,b4,b5,c0 + c1,c2,c3 - 1,c4,c5},
- {},
- {b1,c1}},
- {{a0 - (c3 - 2),
- a2,
- a3,
- a4,
- a5,
- (c3**2 - 2*c3 + 1)*b0 + (c0*c3 + c1),
- (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
- b2,
- b3 + 1,
- b4,
- b5,
- c2,
- c4,
- c5},
- {c3**2 - 2*c3 + 1,c3**2 - 2*c3 + 1},
- {c0,c1,c3}},
- {{a0 - (c3 - 2),
- (c3 - 2)*a2 + c0 - (c1*c3 - 2*c1),
- a3,
- a4,
- a5,
- (c3 - 2)*b0 + c0,
- b1,
- b2,
- b3 + 1,
- b4,
- b5,
- c0**2 - (c1*c3 - 2*c1)*c0 + (c2*c3**2 - 4*c2*c3 + 4*c2),
- c4,
- c5},
- {c3 - 2,c3 - 2},
- {c1,c2,c3}},
- {{(c0 - c1*c3 + 2*c1)*a0 + (c0*c3 + c1),
- a2,
- (c0 - c1*c3 + 2*c1)*a3 + (c3**2 - 2*c3 + 1),
- a4,
- a5,
- (c3**2 - 2*c3 + 1)*b0 - (c0*c3 - 2*c0 - c1*c3**2 + 4*c1*c3 - 4*c1),
- (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
- b2,
- b3,
- b4,
- b5,
- c2,
- c4,
- c5},
- {c0 - c1*c3 + 2*c1,
- c0 - c1*c3 + 2*c1,
- c3**2 - 2*c3 + 1,
- c3**2 - 2*c3 + 1},
- {c0,c1,c3}}}$
- extendedgroebfactor1 polys;
- {{{(c0 - c1*c3 + 2*c1)*a0 + (c0*c3 + c1),
- a2,
- (c0 - c1*c3 + 2*c1)*a3 + (c3**2 - 2*c3 + 1),
- a4,
- a5,
- (c3**2 - 2*c3 + 1)*b0 - (c0*c3 - 2*c0 - c1*c3**2 + 4*c1*c3 - 4*c1),
- (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
- b2,
- b3,
- b4,
- b5,
- c2,
- c4,
- c5},
- {c0 - c1*c3 + 2*c1,
- c0 - c1*c3 + 2*c1,
- c3**2 - 2*c3 + 1,
- c3**2 - 2*c3 + 1},
- {c0,c1,c3}},
- {{a0 - (c3 - 2),
- (c3 - 2)*a2 + c0 - (c1*c3 - 2*c1),
- a3,
- a4,
- a5,
- (c3 - 2)*b0 + c0,
- b1,
- b2,
- b3 + 1,
- b4,
- b5,
- c0**2 - (c1*c3 - 2*c1)*c0 + (c2*c3**2 - 4*c2*c3 + 4*c2),
- c4,
- c5},
- {c3 - 2,c3 - 2},
- {c1,c2,c3}},
- {{a0 - (c3 - 2),
- a2,
- a3,
- a4,
- a5,
- (c3**2 - 2*c3 + 1)*b0 + (c0*c3 + c1),
- (c3**2 - 2*c3 + 1)*b1 - (c0 - c1*c3 + 2*c1),
- b2,
- b3 + 1,
- b4,
- b5,
- c2,
- c4,
- c5},
- {c3**2 - 2*c3 + 1,c3**2 - 2*c3 + 1},
- {c0,c1,c3}}}$
- % Schwarz' example s5
- vars:=for k:=1:5 collect mkid(x,k);
- vars := {x1,
- x2,
- x3,
- x4,
- x5}$
- s5:={
- x1**2+x1+2*x2*x5+2*x3*x4,
- 2*x1*x2+x2+2*x3*x5+x4**2,
- 2*x1*x3+x2**2+x3+2*x4*x5,
- 2*x1*x4+2*x2*x3+x4+x5**2,
- 2*x1*x5+2*x2*x4+x3**2+x5};
- s5 := {x1**2 + x1 + 2*x2*x5 + 2*x3*x4,
- 2*x1*x2 + x2 + 2*x3*x5 + x4**2,
- 2*x1*x3 + x2**2 + x3 + 2*x4*x5,
- 2*x1*x4 + 2*x2*x3 + x4 + x5**2,
- 2*x1*x5 + 2*x2*x4 + x3**2 + x5}$
- setring(vars,degreeorder vars,revlex);
- {{x1,x2,x3,x4,x5},{{1,1,1,1,1}},revlex,{1,1,1,1,1}}$
- m:=groebfactor s5;
- m := {{x1**2 + 2*x3*x4 + 2*x2*x5 + x1,
- 2*x1*x2 + x4**2 + 2*x3*x5 + x2,
- x2**2 + 2*x1*x3 + 2*x4*x5 + x3,
- 2*x2*x3 + 2*x1*x4 + x5**2 + x4,
- x3**2 + 2*x2*x4 + 2*x1*x5 + x5,
- 2*x1*x3*x4 + 2*x4**2*x5 + x3*x5**2 + x3*x4,
- 5*x4**3 + 30*x3*x4*x5 + 15*x2*x5**2 - 2*x5,
- 10*x3*x4**2 - 10*x1*x5**2 - 5*x5**2 - x4,
- 625*x4*x5**3 + 50*x3*x4 + 75*x2*x5 - 6,
- 15*x2*x4**2 + 30*x1*x4*x5 + 5*x5**3 + 15*x4*x5 + x3,
- 100*x1*x4*x5**2 + 25*x5**4 + 50*x4*x5**2 + x4**2 + 4*x3*x5,
- 1250*x1*x3*x5**2 + 625*x3*x5**2 - 75*x3*x4 - 50*x2*x5 + 8,
- 75*x4**2*x5**2 + 50*x3*x5**3 + x2*x4 + 4*x1*x5 + 2*x5,
- 150*x3*x4*x5**2 + 100*x2*x5**3 - 2*x1*x4 - 13*x5**2 - x4,
- 625*x2*x5**4 - 50*x1*x4*x5 - 75*x5**3 - 25*x4*x5 - x3,
- 1250*x3*x5**4 - 200*x2*x4*x5 - 50*x1*x5**2 - 25*x5**2 + 3*x4,
- 625*x5**5 + 375*x4**2*x5 + 500*x3*x5**2 + 24*x1 + 12,
- 10*x1*x4**2 + 20*x1*x3*x5 + 20*x4*x5**2 + 5*x4**2 + 10*x3*x5 + x2,
- 75*x2*x4*x5**2 + 50*x1*x5**3 + 25*x5**3 - 2*x1*x3 - 3*x4*x5 - x3,
- 1250*x1*x5**4 + 625*x5**4 + 100*x1*x3*x5 + 150*x4*x5**2 + 50*x3*x5 + 3*x2},
- {x5,x2,x4,x3,x1},
- {x5,x2,x4,x3,x1 + 1}}$
- % Recompute a list of problems with listgroebfactor for another term
- % order.
- setring(vars,{},lex);
- {{x1,x2,x3,x4,x5},{},lex,{1,1,1,1,1}}$
- listgroebfactor m;
- {{5*x5 - 1,
- 5*x4 - 1,
- 5*x1 + 4,
- 5*x2 - 1,
- 5*x3 - 1},
- {5*x5 + 1,
- 5*x4 + 1,
- 5*x1 + 1,
- 5*x2 + 1,
- 5*x3 + 1},
- {5*x1 + 2,
- x2 - x5,
- 25*x5**2 - 5*x5 - 1,
- 5*x4 + 5*x5 - 1,
- 5*x3 + 5*x5 - 1},
- {5*x1 + 3,
- x2 - x5,
- 25*x5**2 + 5*x5 - 1,
- 5*x4 + 5*x5 + 1,
- 5*x3 + 5*x5 + 1},
- {5*x1 + 3,
- 5*x4 - 25*x5**2 + 10*x5 - 2,
- x3 - 25*x5**3 + 15*x5**2 - 3*x5,
- 5*x2 + 125*x5**3 - 50*x5**2 + 10*x5 - 1,
- 625*x5**4 - 375*x5**3 + 100*x5**2 - 10*x5 + 1},
- {5*x1 + 2,
- 5*x2 + 5*x5 - 1,
- 5*x4 - 250*x5**3 + 75*x5**2 - 30*x5 + 2,
- 5*x3 + 250*x5**3 - 75*x5**2 + 30*x5 - 3,
- 625*x5**4 - 250*x5**3 + 100*x5**2 - 15*x5 + 1},
- {x4 + 5*x5**2,
- 5*x1 + 1,
- x3 - 25*x5**3,
- 5*x2 + 125*x5**3 - 25*x5**2 + 5*x5 - 1,
- 625*x5**4 - 125*x5**3 + 25*x5**2 - 5*x5 + 1},
- {x4 - 5*x5**2,
- 5*x1 + 4,
- x3 - 25*x5**3,
- 5*x2 + 125*x5**3 + 25*x5**2 + 5*x5 + 1,
- 625*x5**4 + 125*x5**3 + 25*x5**2 + 5*x5 + 1},
- {5*x1 + 3,
- 5*x2 + 5*x5 + 1,
- 5*x4 - 250*x5**3 - 75*x5**2 - 30*x5 - 2,
- 5*x3 + 250*x5**3 + 75*x5**2 + 30*x5 + 3,
- 625*x5**4 + 250*x5**3 + 100*x5**2 + 15*x5 + 1},
- {5*x1 + 2,
- 5*x4 + 25*x5**2 + 10*x5 + 2,
- x3 - 25*x5**3 - 15*x5**2 - 3*x5,
- 5*x2 + 125*x5**3 + 50*x5**2 + 10*x5 + 1,
- 625*x5**4 + 375*x5**3 + 100*x5**2 + 10*x5 + 1},
- {x5,
- x2,
- x4,
- x3,
- x1 + 1},
- {x5,
- x2,
- x4,
- x3,
- x1}}$
- % ==> Testing the linear algebra package
- % Find the ideal of points in affine and projective space.
- vars:=for k:=1:6 collect mkid(x,k);
- vars := {x1,
- x2,
- x3,
- x4,
- x5,
- x6}$
- setring(vars,degreeorder vars,revlex);
- {{x1,x2,x3,x4,x5,x6},{{1,1,1,1,1,1}},revlex,{1,1,1,1,1,1}}$
- matrix mm(10,6);
- on rounded;
- for k:=1:6 do for l:=1:10 do mm(l,k):=floor(exp((k+l)/4));
- off rounded;
- mm;
- 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,
- 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,25
- ,33,42,54))$
- setideal(u,affine_points mm);
- {48337*x5**2 - 318*x4*x6 - 75336*x5*x6 + 29579*x6**2 - 11598*x1 - 11016*x2 -
- 11352*x3 - 2502*x4 + 18371*x5 - 1837*x6 - 1836,
- 386696*x1*x6 + 175678*x4*x6 + 20108*x5*x6 - 233347*x6**2 - 5821074*x1 - 831000*
- x2 + 1382952*x3 + 741984*x4 - 2153934*x5 + 2692351*x6 - 1491936,
- 386696*x3*x6 + 239238*x4*x6 - 185716*x5*x6 - 182039*x6**2 - 270738*x1 - 1255800*
- x2 - 5052384*x3 - 2106864*x4 + 2351946*x5 + 2434483*x6 - 1562736,
- 48337*x4**2 - 58746*x4*x6 + 148*x5*x6 + 17725*x6**2 + 2502*x1 + 576*x2 - 1302*x3
- + 25721*x4 - 3488*x5 - 12857*x6 + 96,
- 193348*x4*x5 - 151394*x4*x6 - 118604*x5*x6 + 92869*x6**2 + 1590*x1 + 8712*x2 +
- 16560*x3 - 3708*x4 + 43918*x5 - 43409*x6 + 1452,
- 386696*x2*x6 - 382090*x4*x6 - 43364*x5*x6 + 123645*x6**2 - 1313130*x1 - 4809120*
- x2 + 91464*x3 + 5853096*x4 + 1118658*x5 - 2323361*x6 - 28128,
- 193348*x6**3 - 78919578*x4*x6 - 63413004*x5*x6 + 81565689*x6**2 + 1412352942*x1
- + 1563160200*x2 + 761482008*x3 + 10324224*x4 + 304232130*x5 - 1255484065*x6 -
- 643375200,
- 193348*x1*x4 - 3606*x4*x6 + 6664*x5*x6 - 36689*x6**2 - 1729374*x1 - 256248*x2 +
- 422132*x3 + 345556*x4 - 671778*x5 + 747089*x6 - 429404,
- 193348*x3*x4 - 19782*x4*x6 - 57060*x5*x6 + 1407*x6**2 - 86718*x1 - 378840*x2 -
- 1475924*x3 - 576996*x4 + 715078*x5 + 671885*x6 - 449836,
- 386696*x1*x5 + 139942*x4*x6 - 99156*x5*x6 - 94107*x6**2 - 4388370*x1 - 668088*x2
- + 1063040*x3 + 468112*x4 - 1464774*x5 + 1964239*x6 - 1078088,
- 386696*x3*x5 + 184150*x4*x6 - 329484*x5*x6 + 3733*x6**2 - 302634*x1 - 1062840*x2
- - 3845096*x3 - 1562608*x4 + 1956858*x5 + 1752663*x6 - 1143880,
- 193348*x1**2 + 50726*x4*x6 + 4164*x5*x6 - 49995*x6**2 - 1502518*x1 - 234624*x2 +
- 337000*x3 + 189344*x4 - 544926*x5 + 709519*x6 - 425800,
- 193348*x1*x2 - 22834*x4*x6 - 3056*x5*x6 - 4123*x6**2 - 1183010*x1 - 780060*x2 +
- 282940*x3 + 989552*x4 - 238902*x5 + 102179*x6 - 226684,
- 386696*x1*x3 + 153254*x4*x6 - 46332*x5*x6 - 109011*x6**2 - 2706290*x1 - 776040*
- x2 - 650592*x3 - 288096*x4 - 295470*x5 + 1856303*x6 - 1096080,
- 96674*x3**2 + 56278*x4*x6 - 44916*x5*x6 - 20423*x6**2 - 85218*x1 - 315900*x2 -
- 1104614*x3 - 478348*x4 + 559514*x5 + 528787*x6 - 342672,
- 193348*x2*x4 - 186922*x4*x6 - 13484*x5*x6 + 80823*x6**2 - 400398*x1 - 1437268*x2
- + 32400*x3 + 1825348*x4 + 346526*x5 - 749039*x6 - 13972,
- 386696*x2*x5 - 299774*x4*x6 - 183476*x5*x6 + 214259*x6**2 - 1032390*x1 - 3818088
- *x2 + 38568*x3 + 4563624*x4 + 1175646*x5 - 2005927*x6 - 56304,
- 193348*x5*x6**2 - 59111766*x4*x6 - 58092824*x5*x6 + 68856463*x6**2 + 1134803514*
- x1 + 1224865560*x2 + 591403776*x3 - 36549312*x4 + 316517430*x5 - 1023460331*x6 -
- 498675720,
- 96674*x2**2 - 69590*x4*x6 - 7908*x5*x6 + 35327*x6**2 - 243426*x1 - 832910*x2 +
- 14700*x3 + 1041208*x4 + 204662*x5 - 420851*x6 - 26032,
- 386696*x2*x3 - 95202*x4*x6 - 92692*x5*x6 + 63421*x6**2 - 736122*x1 - 2670472*x2
- - 1669344*x3 + 2061800*x4 + 1466002*x5 - 394913*x6 - 509528,
- 96674*x4*x6**2 - 29277416*x4*x6 - 19752504*x5*x6 + 28388673*x6**2 + 433544670*x1
- + 473916360*x2 + 235723620*x3 + 39729120*x4 + 97903830*x5 - 411516489*x6 -
- 188800920}$
- setgbasis u$
- dim u;
- 0$
- degree u;
- 10$
- setideal(u,proj_points mm);
- {457380*x5**3 - 13500*x2*x5*x6 - 20835*x3*x5*x6 + 76950*x4*x5*x6 - 1050234*x5**2
- *x6 + 100*x1*x6**2 + 10800*x2*x6**2 + 16568*x3*x6**2 - 60271*x4*x6**2 + 771366*
- x5*x6**2 - 179875*x6**3,
- 330*x4**2 + 1665*x2*x5 + 555*x3*x5 - 4337*x4*x5 - 626*x5**2 + 6*x1*x6 - 1332*x2*
- x6 - 450*x3*x6 + 3013*x4*x6 + 2740*x5*x6 - 1635*x6**2,
- 33*x1*x5 - 90*x2*x5 - 63*x3*x5 + 216*x4*x5 + 60*x5**2 - 25*x1*x6 + 72*x2*x6 + 49
- *x3*x6 - 170*x4*x6 - 171*x5*x6 + 97*x6**2,
- 90*x3**2 - 483*x2*x5 - 183*x3*x5 + 1197*x4*x5 + 174*x5**2 - 2*x1*x6 + 384*x2*x6
- + 68*x3*x6 - 937*x4*x6 - 738*x5*x6 + 485*x6**2,
- 330*x3*x4 + 555*x2*x5 + 75*x3*x5 - 1519*x4*x5 - 172*x5**2 + 2*x1*x6 - 444*x2*x6
- - 260*x3*x6 + 1041*x4*x6 + 950*x5*x6 - 545*x6**2,
- 457380*x4*x5**2 - 10800*x2*x5*x6 - 9045*x3*x5*x6 - 662625*x4*x5*x6 - 265413*x5**
- 2*x6 + 80*x1*x6**2 + 8640*x2*x6**2 + 7156*x3*x6**2 + 238408*x4*x6**2 + 391452*x5
- *x6**2 - 143900*x6**3,
- 495*x1*x2 + 1977*x2*x5 + 87*x3*x5 - 4824*x4*x5 - 339*x5**2 - 164*x1*x6 - 1707*x2
- *x6 - 97*x3*x6 + 3782*x4*x6 + 2697*x5*x6 - 1840*x6**2,
- 495*x2**2 + 1134*x2*x5 + 939*x3*x5 - 3771*x4*x5 - 822*x5**2 - 4*x1*x6 - 1257*x2*
- x6 - 734*x3*x6 + 2956*x4*x6 + 2709*x5*x6 - 1550*x6**2,
- 990*x1*x3 - 5043*x2*x5 - 1263*x3*x5 + 12321*x4*x5 + 1866*x5**2 - 464*x1*x6 +
- 4008*x2*x6 + 788*x3*x6 - 9643*x4*x6 - 7968*x5*x6 + 5165*x6**2,
- 495*x2*x3 + 1242*x2*x5 - 48*x3*x5 - 3555*x4*x5 - 267*x5**2 + 4*x1*x6 - 1218*x2*
- x6 - 157*x3*x6 + 2786*x4*x6 + 2142*x5*x6 - 1420*x6**2,
- 66*x1*x4 + 345*x2*x5 + 93*x3*x5 - 861*x4*x5 - 120*x5**2 - 38*x1*x6 - 276*x2*x6 -
- 76*x3*x6 + 659*x4*x6 + 540*x5*x6 - 337*x6**2,
- 495*x2*x4 + 1770*x2*x5 + 645*x3*x5 - 4908*x4*x5 - 729*x5**2 + 4*x1*x6 - 1713*x2*
- x6 - 520*x3*x6 + 3677*x4*x6 + 3165*x5*x6 - 1915*x6**2,
- 152460*x3*x5**2 + 5880*x2*x5*x6 - 237983*x3*x5*x6 - 6896*x4*x5*x6 - 71438*x5**2*
- x6 + 64*x1*x6**2 - 4704*x2*x6**2 + 92748*x3*x6**2 + 5427*x4*x6**2 + 113560*x5*x6
- **2 - 45061*x6**3,
- 990*x1**2 - 1893*x2*x5 + 447*x3*x5 + 3771*x4*x5 + 426*x5**2 - 524*x1*x6 + 1488*
- x2*x6 - 322*x3*x6 - 2923*x4*x6 - 2478*x5*x6 + 1715*x6**2,
- 457380*x2*x5**2 - 754524*x2*x5*x6 - 31530*x3*x5*x6 + 156561*x4*x5*x6 - 132597*x5
- **2*x6 + 136*x1*x6**2 + 310896*x2*x6**2 + 25088*x3*x6**2 - 122581*x4*x6**2 +
- 141732*x5*x6**2 - 30097*x6**3}$
- setgbasis u$
- dim u;
- 1$
- degree u;
- 10$
- % Change the term order to pure lex in dimension zero.
- % Test both approaches, with and without precomputed borderbasis.
- vars:=for k:=1:6 collect mkid(x,k);
- vars := {x1,
- x2,
- x3,
- x4,
- x5,
- x6}$
- r1:=setring(vars,{},lex);
- r1 := {{x1,x2,x3,x4,x5,x6},{},lex,{1,1,1,1,1,1}}$
- r2:=setring(vars,degreeorder vars,revlex);
- r2 := {{x1,x2,x3,x4,x5,x6},{{1,1,1,1,1,1}},revlex,{1,1,1,1,1,1}}$
- setideal(m,{x1**2+x1+2*x2*x6+2*x3*x5+x4**2,
- 2*x1*x2+x2+2*x3*x6+2*x4*x5,
- 2*x1*x3+x2**2+x3+2*x4*x6+x5**2,
- 2*x1*x4+2*x2*x3+x4+2*x5*x6,
- 2*x1*x5+2*x2*x4+x3**2+x5+x6**2,
- 2*x1*x6+2*x2*x5+2*x3*x4+x6});
- {x1**2 + x4**2 + 2*x3*x5 + 2*x2*x6 + x1,
- 2*x1*x2 + 2*x4*x5 + 2*x3*x6 + x2,
- x2**2 + 2*x1*x3 + x5**2 + 2*x4*x6 + x3,
- 2*x2*x3 + 2*x1*x4 + 2*x5*x6 + x4,
- x3**2 + 2*x2*x4 + 2*x1*x5 + x6**2 + x5,
- 2*x3*x4 + 2*x2*x5 + 2*x1*x6 + x6}$
- gbasis m;
- {72*x1*x3*x5*x6 + 36*x3*x5*x6 - 2*x1*x6 - x6,
- 2*x1*x2 + 2*x4*x5 + 2*x3*x6 + x2,
- 2*x2*x3 + 2*x1*x4 + 2*x5*x6 + x4,
- 2*x3*x4 + 2*x2*x5 + 2*x1*x6 + x6,
- 10368*x6**7 + 5040*x4*x6**4 + 140*x4**2*x6 + 252*x2*x6**2 - 15*x6,
- 1296*x4*x6**5 + 180*x4**2*x6**2 + 180*x2*x6**3 + 4*x2*x4 - 15*x6**2,
- 2592*x3*x6**5 - 360*x2*x5*x6**2 + 2*x1*x4 + 12*x5*x6 + x4,
- 72*x3*x5**2*x6 + 72*x2*x5*x6**2 - 2*x1*x4 - 8*x5*x6 - x4,
- 36*x2*x5**3 - 108*x1*x4*x6**2 - 72*x5*x6**3 - 54*x4*x6**2 - 5*x3*x6,
- 18*x4**2*x5 + 18*x3*x5**2 - 18*x1*x6**2 - 9*x6**2 - 2*x5,
- 36*x4*x5**2 + 36*x4**2*x6 + 72*x3*x5*x6 + 36*x2*x6**2 - 5*x6,
- x1**2 + x4**2 + 2*x3*x5 + 2*x2*x6 + x1,
- x2**2 + 2*x1*x3 + x5**2 + 2*x4*x6 + x3,
- x3**2 + 2*x2*x4 + 2*x1*x5 + x6**2 + x5,
- 2592*x5*x6**5 + 360*x4*x5*x6**2 + 360*x3*x6**3 - 2*x2*x5 + 10*x1*x6 + 5*x6,
- 2592*x5**2*x6**3 + 1296*x4*x6**4 + 36*x4**2*x6 + 144*x3*x5*x6 + 180*x2*x6**2 -
- 13*x6,
- 72*x5**3*x6 + 216*x4*x5*x6**2 + 72*x3*x6**3 + 2*x2*x5 + 6*x1*x6 + 3*x6,
- 4*x4**3 - 12*x2*x5**2 - 24*x1*x5*x6 - 4*x6**3 - 12*x5*x6 - x4,
- 12*x2*x4**2 - 24*x1*x3*x6 - 12*x5**2*x6 - 12*x4*x6**2 - 12*x3*x6 - x2,
- 1296*x1*x6**5 + 648*x6**5 + 180*x1*x4*x6**2 + 180*x5*x6**3 + 90*x4*x6**2 + x4*x5
- + 6*x3*x6,
- 2592*x2*x6**5 + 360*x2*x4*x6**2 - 180*x6**4 - 6*x1*x3 - 3*x5**2 - 16*x4*x6 - 3*
- x3,
- 72*x3*x5*x6**3 + 36*x2*x6**4 - x2*x5**2 - 4*x2*x4*x6 - 4*x1*x5*x6 - 6*x6**3 - 2*
- x5*x6,
- 648*x4*x5*x6**3 + 324*x3*x6**4 - 9*x3*x5**2 - 18*x2*x5*x6 + 18*x1*x6**2 + 9*x6**
- 2 + x5,
- 2592*x1*x3*x6**3 + 1296*x4*x6**4 + 1296*x3*x6**3 - 36*x4**2*x6 - 72*x3*x5*x6 +
- 36*x2*x6**2 + 5*x6,
- 1080*x2*x4*x6**3 + 216*x6**5 - 60*x1*x3*x6 - 30*x5**2*x6 - 90*x4*x6**2 - 30*x3*
- x6 - x2,
- 72*x4**2*x6**3 + 36*x2*x6**4 + 3*x2*x5**2 + 8*x2*x4*x6 + 6*x1*x5*x6 - 2*x6**3 +
- 3*x5*x6,
- 36*x1*x5**2*x6 + 36*x1*x4*x6**2 + 36*x5*x6**3 + 18*x5**2*x6 + 18*x4*x6**2 + x4*
- x5 + 2*x3*x6,
- 18*x1*x5**3 - 54*x1*x3*x6**2 - 36*x4*x6**3 + 9*x5**3 - 27*x3*x6**2 + x3*x5 - 2*
- x2*x6,
- 18*x1*x4*x5 + 18*x1*x3*x6 + 18*x5**2*x6 + 18*x4*x6**2 + 9*x4*x5 + 9*x3*x6 + x2,
- 18*x2*x4*x5 + 18*x1*x5**2 + 18*x1*x4*x6 + 18*x5*x6**2 + 9*x5**2 + 9*x4*x6 + x3,
- 2*x1*x4**2 + 4*x1*x3*x5 + 2*x5**3 + 8*x4*x5*x6 + 2*x3*x6**2 + x4**2 + 2*x3*x5,
- 72*x1*x4*x6**3 + 36*x5*x6**4 + 36*x4*x6**3 - 2*x1*x3*x5 - x5**3 - 2*x4*x5*x6 + 2
- *x3*x6**2 - x3*x5,
- 3240*x1*x5*x6**3 + 648*x6**5 + 1620*x5*x6**3 + 90*x1*x3*x6 + 90*x5**2*x6 + 180*
- x4*x6**2 + 45*x3*x6 + 2*x2,
- 72*x2*x5**2*x6 + 72*x2*x4*x6**2 + 144*x1*x5*x6**2 + 36*x6**4 + 72*x5*x6**2 - 2*
- x1*x3 - x5**2 - x3,
- 36*x5**4 - 216*x4**2*x6**2 - 432*x3*x5*x6**2 - 288*x2*x6**3 + 2*x2*x4 + 8*x1*x5
- + 39*x6**2 + 4*x5,
- 72*x3*x5**3 - 216*x1*x5*x6**2 - 36*x6**4 - 108*x5*x6**2 - 2*x1*x3 - 9*x5**2 - 8*
- x4*x6 - x3,
- 1296*x2*x5*x6**3 + 648*x1*x6**4 + 324*x6**4 - 18*x1*x5**2 - 36*x1*x4*x6 - 72*x5*
- x6**2 - 9*x5**2 - 18*x4*x6 - x3,
- 18*x1*x3*x5**2 + 18*x4**2*x6**2 + 54*x3*x5*x6**2 + 36*x2*x6**3 + 9*x3*x5**2 - x2
- *x4 - 2*x1*x5 - 5*x6**2 - x5}$
- m1:=change_termorder(m,r1);
- m1 := {46656*x4*x5*x6**6 - x4*x5,
- 80621568*x5*x6**13 + 44928*x5*x6**7 - x5*x6,
- 637*x2 + 1077507256320*x6**17 - 927987840*x6**11 - 806157*x6**5,
- 7*x4**2*x5 + 252*x4*x5*x6**3 - 30233088*x5*x6**12 - 17496*x5*x6**6,
- 58773123072*x6**19 - 47869056*x6**13 - 45657*x6**7 + x6,
- 2*x1*x4 + x4 + 1296*x5**3*x6**3 + 3*x5*x6,
- 2548*x4**2*x6 + 91728*x4*x6**4 + 362797056*x6**13 - 33696*x6**7 - 141*x6,
- 8491392*x4*x6**7 - 182*x4*x6 + 19591041024*x6**16 + 10917504*x6**10 - 243*x6**4,
- 17199*x5**4*x6 + 1238328*x5**2*x6**5 + 4353564672*x6**15 - 5003856*x6**9 - 1328*
- x6**3,
- 4245696*x5**2*x6**7 - 91*x5**2*x6 + 8707129344*x6**17 - 12130560*x6**11 + 256*x6
- **5,
- 7*x3 - 567*x5**5 - 204120*x5**3*x6**4 + 524880*x5*x6**8 - 90*x5*x6**2,
- 2916*x5**7 - 567*x5**3*x6**2 + 347680512*x5*x6**12 + 196668*x5*x6**6 - 4*x5,
- 14*x1*x6 + 504*x4*x5*x6**2 + 252*x5**3*x6 + 20155392*x5*x6**11 + 8640*x5*x6**5 +
- 7*x6,
- 2548*x4**3 + 19813248*x4*x6**6 - 637*x4 + 39182082048*x6**15 + 30326400*x6**9 +
- 4428*x6**3,
- 1911*x4*x5**2 - 68796*x4*x6**4 - 68796*x5**2*x6**3 - 362797056*x6**13 + 151632*
- x6**7 + 50*x6,
- 1274*x1*x5 + 1651104*x4*x6**5 + 5733*x5**4 + 1238328*x5**2*x6**4 + 637*x5 +
- 6530347008*x6**14 - 1667952*x6**8 + 192*x6**2,
- 1274*x1**2 + 1274*x1 + 1274*x4**2 + 206388*x5**6 - 85995*x5**2*x6**2 -
- 11754624614400*x6**18 + 9498228480*x6**12 + 9295668*x6**6}$
- setring r2$
- m2:=change_termorder1(m,r1);
- m2 := {46656*x4*x5*x6**6 - x4*x5,
- 80621568*x5*x6**13 + 44928*x5*x6**7 - x5*x6,
- 2*x1*x4 + x4 + 1296*x5**3*x6**3 + 3*x5*x6,
- 637*x2 + 1077507256320*x6**17 - 927987840*x6**11 - 806157*x6**5,
- 7*x4**2*x5 + 252*x4*x5*x6**3 - 30233088*x5*x6**12 - 17496*x5*x6**6,
- 58773123072*x6**19 - 47869056*x6**13 - 45657*x6**7 + x6,
- 2548*x4**2*x6 + 91728*x4*x6**4 + 362797056*x6**13 - 33696*x6**7 - 141*x6,
- 17199*x5**4*x6 + 1238328*x5**2*x6**5 + 4353564672*x6**15 - 5003856*x6**9 - 1328*
- x6**3,
- 4245696*x5**2*x6**7 - 91*x5**2*x6 + 8707129344*x6**17 - 12130560*x6**11 + 256*x6
- **5,
- 7*x3 - 567*x5**5 - 204120*x5**3*x6**4 + 524880*x5*x6**8 - 90*x5*x6**2,
- 8491392*x4*x6**7 - 182*x4*x6 + 19591041024*x6**16 + 10917504*x6**10 - 243*x6**4,
- 2916*x5**7 - 567*x5**3*x6**2 + 347680512*x5*x6**12 + 196668*x5*x6**6 - 4*x5,
- 14*x1*x6 + 504*x4*x5*x6**2 + 252*x5**3*x6 + 20155392*x5*x6**11 + 8640*x5*x6**5 +
- 7*x6,
- 1911*x4*x5**2 - 68796*x4*x6**4 - 68796*x5**2*x6**3 - 362797056*x6**13 + 151632*
- x6**7 + 50*x6,
- 2548*x4**3 + 19813248*x4*x6**6 - 637*x4 + 39182082048*x6**15 + 30326400*x6**9 +
- 4428*x6**3,
- 1274*x1*x5 + 1651104*x4*x6**5 + 5733*x5**4 + 1238328*x5**2*x6**4 + 637*x5 +
- 6530347008*x6**14 - 1667952*x6**8 + 192*x6**2,
- 1274*x1**2 + 1274*x1 + 1274*x4**2 + 206388*x5**6 - 85995*x5**2*x6**2 -
- 11754624614400*x6**18 + 9498228480*x6**12 + 9295668*x6**6}$
- setideal(m1,m1)$
- setideal(m2,m2)$
- setgbasis m1$
- setgbasis m2$
- modequalp(m1,m2);
- yes$
- % ==> Different hilbert series driver
-
- setideal(m,proj_monomial_curve(w1:={0,2,5,9},{w,x,y,z}));
- {x**5 - w**3*y**2,
- w*y**3 - x**3*z,
- y**4 - w*x*z**2,
- x**2*y - w**2*z}$
- weights:={{1,1,1,1},w1};
- weights := {{1,1,1,1},{0,2,5,9}}$
- hftestversion 2;
- hf!=whilb2$
- f1:=weightedhilbertseries(gbasis m,weights);
- f1 := ( - w**5*x**17 + w**4*x**17 - w**4*x**15 + w**4*x**8 + w**3*x**15 + w**3*x
- **12 + w**3*x**6 + w**2*x**10 + w**2*x**7 + w**2*x**4 + w*x**5 + w*x**2 + 1)/(w
- **2*x**9 - w*x**9 - w + 1)$
- sub(x=1,ws);
- ( - w**5 + w**4 + 3*w**3 + 3*w**2 + 2*w + 1)/(w**2 - 2*w + 1)$
- % The ordinary Hilbert series.
- hftestversion 1;
- hf!=whilb1$
- % The default.
- f2:=weightedhilbertseries(gbasis m,weights);
- f2 := ( - w**5*x**17 + w**4*x**17 - w**4*x**15 + w**4*x**8 + w**3*x**15 + w**3*x
- **12 + w**3*x**6 + w**2*x**10 + w**2*x**7 + w**2*x**4 + w*x**5 + w*x**2 + 1)/(w
- **2*x**9 - w*x**9 - w + 1)$
- sub(x=1,ws);
- ( - w**5 + w**4 + 3*w**3 + 3*w**2 + 2*w + 1)/(w**2 - 2*w + 1)$
-
- f1-f2;
- 0$
- % ==> Different primary decomposition approaches. The example is due
- % to Shimoyama Takeshi. CALI 2.2. produced auxiliary embedded
- % primes on it.
- vars:={dx,dy,x,y};
- vars := {dx,dy,x,y}$
- setring(vars,degreeorder vars,revlex);
- {{dx,dy,x,y},{{1,1,1,1}},revlex,{1,1,1,1}}$
- f3:={DY*( - X*DX + Y**2*DY - Y*DY),DX*(X**2*DX - X*DX - Y*DY)}$
- primarydecomposition f3;
- {{{dx**3,
- dy**3,
- dx**2*dy,
- dx*dy**2,
- dy*( - dx*x + dy*y**2 - dy*y),
- dx*(dx*x**2 - dx*x - dy*y)},
- {dx,dy}},
- {{x*y - x - y,
- dx*x - dx - dy*y + dy,
- - dx + dy*y**2 - 2*dy*y + dy},
- {x*y - x - y,
- dx*x - dx - dy*y + dy,
- - dx + dy*y**2 - 2*dy*y + dy}},
- {{dy,x - 1},{dy,x - 1}},
- {{dy**2,
- dy*x,
- x**2,
- dx*x + dy*y},
- {dy,x}},
- {{dx,y - 1},{dx,y - 1}},
- {{dx**2,
- dx*y,
- y**2,
- dx*x + dy*y},
- {dx,y}},
- {{y**2,
- x**2,
- x*y,
- dx*x + dy*y},
- {y,x}}}$
- showtime;
- Time: 662524 ms plus GC time: 7111 ms
- end;
- Time for test: 662694 ms, plus GC time: 7111 ms
|