source: git/Singular/LIB/ainvar.lib @ 2ab830

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