source: git/Singular/LIB/ainvar.lib @ fd3fb7

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