source: git/Singular/LIB/ainvar.lib @ 0dd77c2

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