source: git/Singular/LIB/ainvar.lib @ 49f94f

spielwiese
Last change on this file since 49f94f was 49f94f, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: typos reported by gorzel git-svn-id: file:///usr/local/Singular/svn/trunk@11088 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 19.4 KB
Line 
1// $Id: ainvar.lib,v 1.9 2008-10-01 15:29:23 Singular Exp $
2/////////////////////////////////////////////////////////////////////////////
3version="$Id: ainvar.lib,v 1.9 2008-10-01 15:29:23 Singular Exp $";
4category="Invariant theory";
5info="
6LIBRARY: ainvar.lib    Invariant Rings of the Additive Group
7AUTHORS: Gerhard Pfister (email: pfister@mathematik.uni-kl.de),
8         Gert-Martin Greuel (email: greuel@mathematik.uni-kl.de)
9
10PROCEDURES:
11  invariantRing(m..);  compute ring of invariants of (K,+)-action given by m
12  derivate(m,f);       derivation of f with respect to the vector field m
13  actionIsProper(m);   tests whether action defined by m is proper
14  reduction(p,I);      SAGBI reduction of p in the subring generated by I
15  completeReduction(); complete SAGBI reduction
16  localInvar(m,p..);   invariant polynomial under m computed from p,...
17  furtherInvar(m..);   compute further invariants of m from the given ones
18  sortier(id);         sorts generators of id by increasing leading terms
19";
20
21LIB "inout.lib";
22LIB "general.lib";
23LIB "algebra.lib";
24///////////////////////////////////////////////////////////////////////////////
25
26proc sortier(id)
27"USAGE:   sortier(id);  id ideal/module
28RETURN:  the same ideal/module but with generators ordered by their
29         leading terms, starting with the smallest
30EXAMPLE: example sortier; shows an example
31"
32{
33  if(size(id)==0)
34  {return(id); }
35  intvec i=sortvec(id);
36  int j;
37  if( typeof(id)=="ideal")
38  { ideal m; }
39  if( typeof(id)=="module")
40  { module m; }
41  if( typeof(id)!="ideal" and  typeof(id)!="module")
42  { ERROR("input must be of type ideal or module"); }
43  for (j=1;j<=size(i);j++)
44  {
45    m[j] = id[i[j]];
46  }
47  return(m);
48}
49example
50{ "EXAMPLE:"; echo = 2;
51   ring q=0,(x,y,z,u,v,w),dp;
52   ideal i=w,x,z,y,v;
53   sortier(i);
54}
55///////////////////////////////////////////////////////////////////////////////
56
57proc derivate (matrix m, id)
58"USAGE:  derivate(m,id);  m matrix, id poly/vector/ideal
59ASSUME:  m is an nx1 matrix, where n = number of variables of the basering
60RETURN:  poly/vector/ideal (same type as input), result of applying the
61         vector field by the matrix m componentwise to id;
62NOTE:    the vector field is m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n)
63EXAMPLE: example derivate; shows an example
64"
65{
66  execute (typeof(id)+ " j;");
67  ideal I = ideal(id);
68  matrix mh=matrix(jacob(I))*m;
69  if(typeof(j)=="poly")
70  { j = mh[1,1];
71  }
72  else
73  { j = mh[1];
74  }
75  return(j);
76}
77example
78{ "EXAMPLE:"; echo = 2;
79   ring q=0,(x,y,z,u,v,w),dp;
80   poly f=2xz-y2;
81   matrix m[6][1] =x,y,0,u,v;
82   derivate(m,f);
83   vector v = [2xz-y2,u6-3];
84   derivate(m,v);
85   derivate(m,ideal(2xz-y2,u6-3));
86}
87
88///////////////////////////////////////////////////////////////////////////////
89
90proc actionIsProper(matrix m)
91"USAGE:  actionIsProper(m); m matrix
92ASSUME:  m is a nx1 matrix, where n = number of variables of the basering
93RETURN:  int = 1, if the action defined by m is proper, 0 if not
94NOTE:    m defines a group action which is the exponential of the vector
95         field  m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n)
96EXAMPLE: example actionIsProper; shows an example
97"
98{
99  int i;
100  ideal id=maxideal(1);
101  def bsr=basering;
102
103  //changes the basering bsr to bsr[@t]
104  execute("ring s="+charstr(basering)+",("+varstr(basering)+",@t),dp;");
105  poly inv,delta,tee,j;
106  ideal id=imap(bsr,id);
107  matrix @m[size(id)+1][1];
108  @m=imap(bsr,m),0;
109
110  //computes the exp(@t*m)(var(i)) for all i
111  for(i=1;i<=nvars(basering)-1;i++)
112  {
113     inv=var(i);
114     delta=derivate(@m,inv);
115     j=1;
116     tee=@t;
117     while(delta!=0)
118     {
119        inv=inv+1/j*delta*tee;
120        j=j*(j+1);
121        tee=tee*@t;
122        delta=derivate(@m,delta);
123     }
124     id=id+ideal(inv);
125  }
126  i=inSubring(@t,id)[1];
127  setring(bsr);
128  return(i);
129}
130example
131{ "EXAMPLE:"; echo = 2;
132
133  ring rf=0,x(1..7),dp;
134  matrix m[7][1];
135  m[4,1]=x(1)^3;
136  m[5,1]=x(2)^3;
137  m[6,1]=x(3)^3;
138  m[7,1]=(x(1)*x(2)*x(3))^2;
139  actionIsProper(m);
140
141  ring rd=0,x(1..5),dp;
142  matrix m[5][1];
143  m[3,1]=x(1);
144  m[4,1]=x(2);
145  m[5,1]=1+x(1)*x(4)^2;
146  actionIsProper(m);
147}
148///////////////////////////////////////////////////////////////////////////////
149
150proc reduction(poly p, ideal dom, list #)
151"USAGE:   reduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int (optional)]
152RETURN:  a polynomial equal to  p-H(f1,...,fr), in case the leading
153         term LT(p) of p is of the form H(LT(f1),...,LT(fr)) for some
154         polynomial H in r variables over the base field, I=f1,...,fr;
155         if q is given, a maximal power a is computed such that q^a divides
156         p-H(f1,...,fr), and then (p-H(f1,...,fr))/q^a is returned;
157         return p if no H is found
158         if n=1, a different algorithm is chosen which is sometimes faster
159         (default: n=0; q and n can be given (or not) in any order)
160NOTE:    this is a kind of SAGBI reduction in the subalgebra K[f1,...,fr] of
161         the basering
162EXAMPLE: example reduction; shows an example
163"
164{
165  int i,choose;
166  int z=ncols(dom);
167  def bsr=basering;
168  if( size(#) >0 )
169  { if( typeof(#[1]) == "int")
170    { choose = #[1];
171    }
172    if( typeof(#[1]) == "poly")
173    { poly q = #[1];
174    }
175    if( size(#)>1 )
176    {  if( typeof(#[2]) == "poly")
177       { poly q = #[2];
178       }
179       if( typeof(#[2]) == "int")
180      { choose = #[2];
181      }
182    }
183  }
184
185  // -------------------- first algorithm (default) -----------------------
186  if ( choose == 0 )
187  {
188     list L = algebra_containment(lead(p),lead(dom),1);
189     if( L[1]==1 )
190     {
191  // the ring L[2] = char(bsr),(x(1..nvars(bsr)),y(1..z)),(dp(n),dp(m)),
192  // contains poly check s.t. LT(p) is of the form check(LT(f1),...,LT(fr))
193       def s1 = L[2];
194       map psi = s1,maxideal(1),dom;
195       poly re = p - psi(check);
196       // divide by the maximal power of #[1]
197          if ( defined(q) == voice )
198          {  while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0))
199             {  re=re/#[1];
200             }
201          }
202          return(re);
203     }
204  return(p);
205  }
206  // ------------------------- second algorithm ---------------------------
207  else
208  {
209  //----------------- arranges the monomial v for elimination -------------
210     poly v=product(maxideal(1));
211
212  //------------- changes the basering bsr to bsr[@(0),...,@(z)] ----------
213  execute("ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;");
214// Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber entsprechend
215// geaendert werden:
216//  execute("ring s="+charstr(basering)+",(@(0..z),"+varstr(basering)+"),dp;");
217
218  //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z))
219     ideal dom=imap(bsr,dom);
220     for (i=1;i<=z;i++)
221     {
222        dom[i]=lead(dom[i])-var(nvars(bsr)+i+1);
223     }
224     dom=lead(imap(bsr,p))-@(0),dom;
225
226  //---------- eliminates the variables of the basering bsr --------------
227  //i.e. computes dom intersected with K[@(0),...,@(z)] (this is hard)
228  //### hier Variante analog zu algebra_containment einbauen!
229     ideal kern=eliminate(dom,imap(bsr,v));
230
231  //---------  test wether @(0)-h(@(1),...,@(z)) is in ker ---------------
232  // for some poly h and divide by maximal power of q=#[1]
233     poly h;
234     z=size(kern);
235     for (i=1;i<=z;i++)
236     {
237        h=kern[i]/@(0);
238        if (deg(h)==0)
239        {  h=(1/h)*kern[i];
240        // define the map psi : s ---> bsr defined by @(i) ---> p,dom[i]
241           setring bsr;
242           map psi=s,maxideal(1),p,dom;
243           poly re=psi(h);
244           // divide by the maximal power of #[1]
245           if (size(#)>0)
246           {  while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0))
247              {  re=re/#[1];
248              }
249           }
250           return(re);
251        }
252     }
253     setring bsr;
254     return(p);
255  }
256}
257
258example
259{ "EXAMPLE:"; echo = 2;
260   ring q=0,(x,y,z,u,v,w),dp;
261   poly p=x2yz-x2v;
262   ideal dom =x-w,u2w+1,yz-v;
263   reduction(p,dom);
264   reduction(p,dom,w);
265}
266
267///////////////////////////////////////////////////////////////////////////////
268
269proc completeReduction(poly p, ideal dom, list #)
270"USAGE:   completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int]
271RETURN:  a polynomial, the SAGBI reduction of the polynomial p with respect to I
272         via the procedure 'reduction' as long as possible
273         if n=1, a different algorithm is chosen which is sometimes faster
274         (default: n=0; q and n can be given (or not) in any order)
275NOTE:    help reduction; shows an explanation of SAGBI reduction
276EXAMPLE: example completeReduction; shows an example
277"
278{
279  poly p1=p;
280  poly p2=reduction(p,dom,#);
281  while (p1!=p2)
282  {
283    p1=p2;
284    p2=reduction(p1,dom,#);
285  }
286  return(p2);
287}
288example
289{ "EXAMPLE:"; echo = 2;
290   ring q=0,(x,y,z,u,v,w),dp;
291   poly p=x2yz-x2v;
292   ideal dom =x-w,u2w+1,yz-v;
293   completeReduction(p,dom);
294   completeReduction(p,dom,w);
295}
296
297///////////////////////////////////////////////////////////////////////////////
298
299proc completeReductionnew(poly p, ideal dom, list #)
300"USAGE:   completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int]
301RETURN:  a polynomial, the SAGBI reduction of the polynomial p with I
302         via the procedure 'reduction' as long as possible
303         if n=1, a different algorithm is chosen which is sometimes faster
304         (default: n=0; q and n can be given (or not) in any order)
305NOTE:    help reduction; shows an explanation of SAGBI reduction
306EXAMPLE: example completeReduction; shows an example
307"
308{
309  if(p==0)
310  {
311     return(p);
312  }
313  poly p1=p;
314  poly p2=reduction(p,dom,#);
315  while (p1!=p2)
316  {
317    p1=p2;
318    p2=reduction(p1,dom,#);
319  }
320  poly re=lead(p2)+completeReduction(p2-lead(p2),dom,#);
321  return(re);
322}
323
324///////////////////////////////////////////////////////////////////////////////
325
326proc localInvar(matrix m, poly p, poly q, poly h)
327"USAGE:   localInvar(m,p,q,h); m matrix, p,q,h polynomials
328ASSUME:  m(q) and h are invariant under the vector field m, i.e. m(m(q))=m(h)=0
329         h must be a ring variable
330RETURN:  a polynomial, the invariant polynomial of the vector field
331@format
332         m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n)
333@end format
334         with respect to p,q,h. It is defined as follows: set inv = p if p is
335         invariant, and else set
336         inv = m(q)^N * sum_i=1..N-1{ (-1)^i*(1/i!)*m^i(p)*(q/m(q))^i }
337         where m^N(p) = 0,  m^(N-1)(p) != 0; the result is inv divided by h
338         as often as possible
339EXAMPLE: example localInvar; shows an example
340"
341{
342  if ((derivate(m,h) !=0) || (derivate(m,derivate(m,q)) !=0))
343  {
344    "//the last two polynomials of the input must be invariant functions";
345    return(q);
346  }
347  int ii,k;
348  for ( k=1; k <= nvars(basering); k++  )
349  {  if (h == var(k))
350     { ii=1;
351     }
352  }
353  if( ii==0 )
354  {  "// the last argument must be a ring variable";
355     return(q);
356  }
357
358  poly inv=p;
359  poly dif= derivate(m,inv);
360  poly a=derivate(m,q);
361  poly sgn=-1;
362  poly coeff=sgn*q;
363  k=1;
364  if (dif==0)
365  {
366    return(inv);
367  }
368  while (dif!=0)
369  {
370    inv=(a*inv)+(coeff*dif);
371    dif=derivate(m,dif);
372    k=k+1;
373    coeff=q*coeff*sgn/k;
374  }
375  while ((inv!=0) && (inv!=h) &&(subst(inv,h,0)==0))
376 {
377   inv=inv/h;
378  }
379  return(inv);
380}
381example
382{ "EXAMPLE:"; echo = 2;
383   ring q=0,(x,y,z),dp;
384   matrix m[3][1];
385   m[2,1]=x;
386   m[3,1]=y;
387   poly in=localInvar(m,z,y,x);
388   in;
389}
390///////////////////////////////////////////////////////////////////////////////
391
392proc furtherInvar(matrix m, ideal id, ideal karl, poly q, list #)
393"USAGE:   furtherInvar(m,id,karl,q); m matrix, id,karl ideals, q poly, n int
394ASSUME:  karl,id,q are invariant under the vector field m,
395         moreover, q must be a variable
396RETURN:  list of two ideals, the first ideal contains further invariants of
397         the vector field
398@format
399         m = sum m[i,1]*d/dx(i) with respect to id,p,q,
400@end format
401         i.e. we compute elements in the (invariant) subring generated by id
402         which are divisible by q and divide them by q as often as possible.
403         The second ideal contains all invariants given before.
404         If n=1, a different algorithm is chosen which is sometimes faster
405         (default: n=0)
406EXAMPLE: example furtherInvar; shows an example
407"
408{
409  list ll = q;
410  if ( size(#)>0 )
411  {  ll = ll+list(#[1]);
412  }
413  int i;
414  ideal null;
415  int z=ncols(id);
416  intvec v;
417  def br=basering;
418  ideal su;
419  for (i=1; i<=z; i++)
420  {
421    su[i]=subst(id[i],q,0);
422  }
423  // -- define the map phi : r1 ---> br defined by y(i) ---> id[i](q=0) --
424  execute ("ring r1="+charstr(basering)+",(y(1..z)),dp;");
425  setring br;
426  map phi=r1,su;
427  setring r1;
428  // --------------- compute the kernel of phi ---------------------------
429  ideal ker=preimage(br,phi,null);
430  ker=mstd(ker)[2];
431  // ---- define the map psi : r1 ---> br defined by y(i) ---> id[i] -----
432  setring br;
433  map psi=r1,id;
434  // -------------------  compute psi(ker(phi)) --------------------------
435  ideal rel=psi(ker);
436  // divide by maximal power of q, test wether we really obtain invariants
437  for (i=1;i<=size(rel);i++)
438  {
439    while ((rel[i]!=0) && (rel[i]!=q) &&(subst(rel[i],q,0)==0))
440    {
441      rel[i]=rel[i]/q;
442      if (derivate(m,rel[i])!=0)
443      {
444         "// error in furtherInvar, function not invariant:";
445         rel[i];
446      }
447    }
448    rel[i]=simplify(rel[i],1);
449  }
450  // ---------------------------------------------------------------------
451  // test whether some variables occur linearly and then delete the
452  // corresponding invariant function
453  setring r1;
454  int j;
455  for (i=1;i<=size(ker);i=i+1)
456  {
457     for (j=1;j<=z;j++)
458     {
459        if (deg(ker[i]/y(j))==0)
460        {
461           setring br;
462           rel[i]= completeReduction(rel[i],karl,ll);
463           if(rel[i]!=0)
464           {
465              karl[j+1]=rel[i];
466              rel[i]=0;
467           }
468           setring r1;
469        }
470     }
471
472  }
473  setring br;
474  list l=rel+null,karl;
475  return(l);
476}
477example
478{ "EXAMPLE:"; echo = 2;
479   ring r=0,(x,y,z,u),dp;
480   matrix m[4][1];
481   m[2,1]=x;
482   m[3,1]=y;
483   m[4,1]=z;
484   ideal id=localInvar(m,z,y,x),localInvar(m,u,y,x);
485   ideal karl=id,x;
486   list in=furtherInvar(m,id,karl,x);
487   in;
488}
489///////////////////////////////////////////////////////////////////////////////
490
491proc invariantRing(matrix m, poly p, poly q, int b, list #)
492"USAGE:   invariantRing(m,p,q,b[,r,pa]); m matrix, p,q poly, b,r int, pa string
493ASSUME:  p,q variables with m(p)=q and q invariant under m
494         i.e. if p=x(i) and q=x(j) then m[j,1]=0 and m[i,1]=x(j)
495RETURN:  ideal, containing generators of the ring of invariants of the
496         additive group (K,+) given by the vector field
497@format
498         m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n).
499@end format
500         If b>0 the computation stops after all invariants of degree <= b
501         (and at least one of higher degree) are found or when all invariants
502         are computed.
503         If b<=0, the computation continues until all generators
504         of the ring of invariants are computed (should be used only if the
505         ring of invariants is known to be finitely generated, otherwise the
506         algorithm might not stop).
507         If r=1 a different reduction is used which is sometimes faster
508         (default r=0).
509DISPLAY: if pa is given (any string as 5th or 6th argument), the computation
510         pauses whenever new invariants are found and displays them
511THEORY:  The algorithm for computing the ring of invariants works in char 0
512         or suffiently large characteristic.
513         (K,+) acts as the exponential of the vector field defined by the
514         matrix m.
515         For background see G.-M. Greuel, G. Pfister,
516         Geometric quotients of unipotent group actions, Proc.
517         London Math. Soc. (3) 67, 75-105 (1993).
518EXAMPLE: example invariantRing; shows an example
519"
520{
521  ideal j;
522  int i,it;
523  list ll=q;
524  int bou=b;
525  if( size(#) >0 )
526  { if( typeof(#[1]) == "int")
527    { ll=ll+list(#[1]);
528    }
529    if( typeof(#[1]) == "string")
530    { string pau=#[1];
531    }
532    if( size(#)>1 )
533    {  if( typeof(#[2]) == "string")
534       { string pau=#[2];
535       }
536       if( typeof(#[2]) == "int")
537      { ll=ll+list(#[2]);
538      }
539    }
540  }
541  int z;
542  ideal karl;
543  ideal k1=1;
544  list k2;
545  //------------------ computation of local invariants ------------------
546  for (i=1;i<=nvars(basering);i++)
547  {
548    karl=karl+localInvar(m,var(i),p,q);
549  }
550  if( defined(pau) )
551  {  "";
552     "// local invariants computed:";
553     "";
554     karl;
555     "";
556     pause("// hit return key to continue!");
557     "";
558  }
559  //------------------ computation of further invariants ----------------
560  it=0;
561  while (size(k1)!=0)
562  {
563    // test if the new invariants are already in the ring generated
564    // by the invariants we constructed so far
565    it++;
566    karl=sortier(karl);
567    j=q;
568    for (i=1;i<=size(karl);i++)
569    {
570       j=j + simplify(completeReduction(karl[i],j,ll),1);
571    }
572    karl=j;
573    j[1]=0;
574    j=simplify(j,2);
575    k2=furtherInvar(m,j,karl,q);
576    k1=k2[1];
577    karl=k2[2];
578    k1=sortier(k1);
579    z=size(k1);
580
581    for (i=1;i<=z;i++)
582    {
583      k1[i]= completeReduction(k1[i],karl,ll);
584      if (k1[i]!=0)
585      {
586        karl=karl+simplify(k1[i],1);
587      }
588    }
589    if( defined(pau) == voice)
590    {
591       "// the invariants after",it,"iteration(s):"; "";
592       karl;"";
593       pause("// hit return key to continue!");
594       "";
595    }
596    if( (bou>0) && (size(k1)>0) )
597    {
598      if( deg(k1[size(k1)])>bou )
599      {
600         return(karl);
601      }
602    }
603  }
604  return(karl);
605}
606example
607{ "EXAMPLE:"; echo = 2;
608
609  //Winkelmann: free action but Spec(k[x(1),...,x(5)]) --> Spec(invariant ring)
610  //is not surjective
611
612  ring rw=0,(x(1..5)),dp;
613  matrix m[5][1];
614  m[3,1]=x(1);
615  m[4,1]=x(2);
616  m[5,1]=1+x(1)*x(4)+x(2)*x(3);
617  ideal in=invariantRing(m,x(3),x(1),0);      //compute full invarint ring
618  in;
619
620  //Deveney/Finston: The ring of invariants is not finitely generated
621
622  ring rf=0,(x(1..7)),dp;
623  matrix m[7][1];
624  m[4,1]=x(1)^3;
625  m[5,1]=x(2)^3;
626  m[6,1]=x(3)^3;
627  m[7,1]=(x(1)*x(2)*x(3))^2;
628  ideal in=invariantRing(m,x(4),x(1),6);      //all invariants up to degree 6
629  in;
630}
631
632///////////////////////////////////////////////////////////////////////////////
633/*             Further examplex
634
635  //Deveney/Finston: Proper Ga-action which is not locally trivial
636  //r[x(1),...,x(5)] is not flat over the ring of invariants
637  LIB "invar.lib";
638  ring rd=0,(x(1..5)),dp;
639  matrix m[5][1];
640  m[3,1]=x(1);
641  m[4,1]=x(2);
642  m[5,1]=1+x(1)*x(4)^2;
643  ideal in=invariantRing(m,x(3),x(1),0,1);
644  in;
645
646  actionIsProper(m);
647
648  //compute the algebraic relations between the invariants
649  int z=size(in);
650  ideal null;
651  ring r1=0,(y(1..z)),dp;
652  setring rd;
653  map phi=r1,in;
654  setring r1;
655  ideal ker=preimage(rd,phi,null);
656  ker;
657
658  //the discriminant
659
660  ring r=0,(x(1..2),y(1..2),z,t),dp;
661  poly p=z+(1+x(1)*y(2)^2)*t+x(1)*y(1)*y(2)*t^2+(1/3)*x(1)*y(1)^2*t^3;
662
663  matrix m[5][5];
664  m[1,1]=z;
665  m[1,2]=x(1)*y(2)^2+1;
666  m[1,3]=x(1)*y(1)*y(2);
667  m[1,4]=1/3*x(1)*y(1)^2;
668  m[1,5]=0;
669  m[2,1]=0;
670  m[2,2]=z;
671  m[2,3]=x(1)*y(2)^2+1;
672  m[2,4]=x(1)*y(1)*y(2);
673  m[2,5]=1/3*x(1)*y(1)^2;
674  m[3,1]=x(1)*y(2)^2+1;
675  m[3,2]=2*x(1)*y(1)*y(2);
676  m[3,3]=x(1)*y(1)^2;
677  m[3,4]=0;
678  m[3,5]=0;
679  m[4,1]=0;
680  m[4,2]=x(1)*y(2)^2+1;
681  m[4,3]=2*x(1)*y(1)*y(2);
682  m[4,4]=x(1)*y(1)^2;
683  m[4,5]=0;
684  m[5,1]=0;
685  m[5,2]=0;
686  m[5,3]=x(1)*y(2)^2+1;
687  m[5,4]=2*x(1)*y(1)*y(2);
688  m[5,5]=x(1)*y(1)^2;
689
690  poly disc=9*det(m)/(x(1)^2*y(1)^4);
691
692  LIB "invar.lib";
693  matrix n[6][1];
694  n[2,1]=x(1);
695  n[4,1]=y(1);
696  n[5,1]=1+x(1)*y(2)^2;
697
698  derivate(n,disc);
699
700//x(1)^3*y(2)^6-6*x(1)^2*y(1)*y(2)^3*z+6*x(1)^2*y(2)^4+9*x(1)*y(1)^2*z^2-18*x(1)*y(1)*y(2)*z+9*x(1)*y(2)^2+4
701
702//////////////////////////////////////////////////////////////////////////////
703//constructive approach to Weizenboecks theorem
704
705  int n=5;
706  // int n=6;  //limit
707  ring w=32003,(x(1..n)),wp(1..n);
708
709  // definition of the vector field m=sum m[i]*d/dx(i)
710  matrix m[n][1];
711  int i;
712  for (i=1;i<=n-1;i=i+1)
713  {
714    m[i+1,1]=x(i);
715  }
716  ideal in=invariantRing(m,x(2),x(1),0,"");
717
718  in;
719*/
Note: See TracBrowser for help on using the repository browser.