source: git/Singular/LIB/ainvar.lib @ 5bc4ee3

spielwiese
Last change on this file since 5bc4ee3 was 5b9dd1, checked in by Hans Schönemann <hannes@…>, 22 years ago
*hannes/lossen: added reference git-svn-id: file:///usr/local/Singular/svn/trunk@6064 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 19.4 KB
Line 
1// $Id: ainvar.lib,v 1.7 2002-04-12 16:19:41 Singular Exp $
2/////////////////////////////////////////////////////////////////////////////
3version="$Id: ainvar.lib,v 1.7 2002-04-12 16:19:41 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 there
29         leading term, starting with the smallest
30EXAMPLE: example sortier; shows an example
31"
32{
33  if(size(id)==0)
34  {return(id);
35  }
36  intvec i=sortvec(id);
37  int j;
38  if( typeof(id)=="ideal")
39  { ideal m;
40  }
41  if( typeof(id)=="module")
42  { module m;
43  }
44 if( typeof(id)!="ideal" and  typeof(id)!="module")
45 { "// input must be of type ideal or module"
46     return();
47 }
48 for (j=1;j<=size(i);j++)
49  {
50    m[j] = id[i[j]];
51  }
52  return(m);
53}
54example
55{ "EXAMPLE:"; echo = 2;
56   ring q=0,(x,y,z,u,v,w),dp;
57   ideal i=w,x,z,y,v;
58   sortier(i);
59}
60///////////////////////////////////////////////////////////////////////////////
61
62proc derivate (matrix m, id)
63"USAGE:  derivate(m,id);  m matrix, id poly/vector/ideal
64ASSUME:  m is a nx1 matrix, where n = number of variables of the basering
65RETURN:  poly/vector/ideal (same type as input), result of applying the
66         vector field by the matrix m componentwise to id;
67NOTE:    the vector field is m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n)
68EXAMPLE: example derivate; shows an example
69"
70{
71  execute (typeof(id)+ " j;");
72  ideal I = ideal(id);
73  matrix mh=matrix(jacob(I))*m;
74  if(typeof(j)=="poly")
75  { j = mh[1,1];
76  }
77  else
78  { j = mh[1];
79  }
80  return(j);
81}
82example
83{ "EXAMPLE:"; echo = 2;
84   ring q=0,(x,y,z,u,v,w),dp;
85   poly f=2xz-y2;
86   matrix m[6][1] =x,y,0,u,v;
87   derivate(m,f);
88   vector v = [2xz-y2,u6-3];
89   derivate(m,v);
90   derivate(m,ideal(2xz-y2,u6-3));
91}
92
93///////////////////////////////////////////////////////////////////////////////
94
95proc actionIsProper(matrix m)
96"USAGE:  actionIsProper(m); m matrix
97ASSUME:  m is a nx1 matrix, where n = number of variables of the basering
98RETURN:  int = 1, if the action defined by m is proper, 0 if not
99NOTE:    m defines a group action which is the exponential of the vector
100         field  m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n)
101EXAMPLE: example actionIsProper; shows an example
102"
103{
104  int i;
105  ideal id=maxideal(1);
106  def bsr=basering;
107
108  //changes the basering bsr to bsr[@t]
109  execute("ring s="+charstr(basering)+",("+varstr(basering)+",@t),dp;");
110  poly inv,delta,tee,j;
111  ideal id=imap(bsr,id);
112  matrix @m[size(id)+1][1];
113  @m=imap(bsr,m),0;
114
115  //computes the exp(@t*m)(var(i)) for all i
116  for(i=1;i<=nvars(basering)-1;i++)
117  {
118     inv=var(i);
119     delta=derivate(@m,inv);
120     j=1;
121     tee=@t;
122     while(delta!=0)
123     {
124        inv=inv+1/j*delta*tee;
125        j=j*(j+1);
126        tee=tee*@t;
127        delta=derivate(@m,delta);
128     }
129     id=id+ideal(inv);
130  }
131  i=inSubring(@t,id)[1];
132  setring(bsr);
133  return(i);
134}
135example
136{ "EXAMPLE:"; echo = 2;
137
138  ring rf=0,x(1..7),dp;
139  matrix m[7][1];
140  m[4,1]=x(1)^3;
141  m[5,1]=x(2)^3;
142  m[6,1]=x(3)^3;
143  m[7,1]=(x(1)*x(2)*x(3))^2;
144  actionIsProper(m);
145
146  ring rd=0,x(1..5),dp;
147  matrix m[5][1];
148  m[3,1]=x(1);
149  m[4,1]=x(2);
150  m[5,1]=1+x(1)*x(4)^2;
151  actionIsProper(m);
152}
153///////////////////////////////////////////////////////////////////////////////
154
155proc reduction(poly p, ideal dom, list #)
156"USAGE:   reduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int (optional)]
157RETURN:  a polynomial equal to  p-H(f1,...,fr), in case the leading
158         term LT(p) of p is of the form H(LT(f1),...,LT(fr)) for some
159         polynomial H in r variables over the base field, I=f1,...,fr;
160         if q is given, a maximal power a is computed such that q^a divides
161         p-H(f1,...,fr), and then (p-H(f1,...,fr))/q^a is returned;
162         return p if no H is found
163         if n=1, a different algorithm is chosen which is sometimes faster
164         (default: n=0; q and n can be given (or not) in any order)
165NOTE:    this is a kind of SAGBI reduction in the subalgebra K[f1,...,fr] of
166         the basering
167EXAMPLE: example reduction; shows an example
168"
169{
170  int i,choose;
171  int z=ncols(dom);
172  def bsr=basering;
173  if( size(#) >0 )
174  { if( typeof(#[1]) == "int")
175    { choose = #[1];
176    }
177    if( typeof(#[1]) == "poly")
178    { poly q = #[1];
179    }
180    if( size(#)>1 )
181    {  if( typeof(#[2]) == "poly")
182       { poly q = #[2];
183       }
184       if( typeof(#[2]) == "int")
185      { choose = #[2];
186      }
187    }
188  }
189
190  // -------------------- first algorithm (default) -----------------------
191  if ( choose == 0 )
192  {
193     list L = algebra_containment(lead(p),lead(dom),1);
194     if( L[1]==1 )
195     {
196  // the ring L[2] = char(bsr),(x(1..nvars(bsr)),y(1..z)),(dp(n),dp(m)),
197  // contains poly check s.t. LT(p) is of the form check(LT(f1),...,LT(fr))
198       def s1 = L[2];
199       map psi = s1,maxideal(1),dom;
200       poly re = p - psi(check);
201       // divide by the maximal power of #[1]
202          if ( defined(q) == voice )
203          {  while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0))
204             {  re=re/#[1];
205             }
206          }
207          return(re);
208     }
209  return(p);
210  }
211  // ------------------------- second algorithm ---------------------------
212  else
213  {
214  //----------------- arranges the monomial v for elimination -------------
215     poly v=product(maxideal(1));
216
217  //------------- changes the basering bsr to bsr[@(0),...,@(z)] ----------
218  execute("ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;");
219// Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber entsprechend
220// geaendert werden:
221//  execute("ring s="+charstr(basering)+",(@(0..z),"+varstr(basering)+"),dp;");
222
223  //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z))
224     ideal dom=imap(bsr,dom);
225     for (i=1;i<=z;i++)
226     {
227        dom[i]=lead(dom[i])-var(nvars(bsr)+i+1);
228     }
229     dom=lead(imap(bsr,p))-@(0),dom;
230
231  //---------- eliminates the variables of the basering bsr --------------
232  //i.e. computes dom intersected with K[@(0),...,@(z)] (this is hard)
233  //### hier Variante analog zu algebra_containment einbauen!
234     ideal kern=eliminate(dom,imap(bsr,v));
235
236  //---------  test wether @(0)-h(@(1),...,@(z)) is in ker ---------------
237  // for some poly h and divide by maximal power of q=#[1]
238     poly h;
239     z=size(kern);
240     for (i=1;i<=z;i++)
241     {
242        h=kern[i]/@(0);
243        if (deg(h)==0)
244        {  h=(1/h)*kern[i];
245        // define the map psi : s ---> bsr defined by @(i) ---> p,dom[i]
246           setring bsr;
247           map psi=s,maxideal(1),p,dom;
248           poly re=psi(h);
249           // divide by the maximal power of #[1]
250           if (size(#)>0)
251           {  while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0))
252              {  re=re/#[1];
253              }
254           }
255           return(re);
256        }
257     }
258     setring bsr;
259     return(p);
260  }
261}
262
263example
264{ "EXAMPLE:"; echo = 2;
265   ring q=0,(x,y,z,u,v,w),dp;
266   poly p=x2yz-x2v;
267   ideal dom =x-w,u2w+1,yz-v;
268   reduction(p,dom);
269   reduction(p,dom,w);
270}
271
272///////////////////////////////////////////////////////////////////////////////
273
274proc completeReduction(poly p, ideal dom, list #)
275"USAGE:   completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int]
276RETURN:  a polynomial, the SAGBI reduction of the polynomial p with I
277         via the procedure 'reduction' as long as possible
278         if n=1, a different algorithm is chosen which is sometimes faster
279         (default: n=0; q and n can be given (or not) in any order)
280NOTE:    help reduction; shows an explanation of SAGBI reduction
281EXAMPLE: example completeReduction; shows an example
282"
283{
284  poly p1=p;
285  poly p2=reduction(p,dom,#);
286  while (p1!=p2)
287  {
288    p1=p2;
289    p2=reduction(p1,dom,#);
290  }
291  return(p2);
292}
293example
294{ "EXAMPLE:"; echo = 2;
295   ring q=0,(x,y,z,u,v,w),dp;
296   poly p=x2yz-x2v;
297   ideal dom =x-w,u2w+1,yz-v;
298   completeReduction(p,dom);
299   completeReduction(p,dom,w);
300}
301
302///////////////////////////////////////////////////////////////////////////////
303
304proc completeReductionnew(poly p, ideal dom, list #)
305"USAGE:   completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int]
306RETURN:  a polynomial, the SAGBI reduction of the polynomial p with I
307         via the procedure 'reduction' as long as possible
308         if n=1, a different algorithm is chosen which is sometimes faster
309         (default: n=0; q and n can be given (or not) in any order)
310NOTE:    help reduction; shows an explanation of SAGBI reduction
311EXAMPLE: example completeReduction; shows an example
312"
313{
314  if(p==0)
315  {
316     return(p);
317  }
318  poly p1=p;
319  poly p2=reduction(p,dom,#);
320  while (p1!=p2)
321  {
322    p1=p2;
323    p2=reduction(p1,dom,#);
324  }
325  poly re=lead(p2)+completeReduction(p2-lead(p2),dom,#);
326  return(re);
327}
328
329///////////////////////////////////////////////////////////////////////////////
330
331proc localInvar(matrix m, poly p, poly q, poly h)
332"USAGE:   localInvar(m,p,q,h); m matrix, p,q,h polynomials
333ASSUME:  m(q) and h are invariant under the vector field m, i.e. m(m(q))=m(h)=0
334         h must be a ring variable
335RETURN:  a polynomial, the invariant polynomial of the vector field
336@format
337         m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n)
338@end format
339         with respect to p,q,h. It is defined as follows: set inv = p if p is
340         invariant, and else as
341         inv = m(q)^N * sum_i=1..N-1{ (-1)^i*(1/i!)*m^i(p)*(q/m(q))^i }
342         where m^N(p) = 0,  m^(N-1)(p) != 0;
343         the result is inv divided by h as much as possible
344EXAMPLE: example localInvar; shows an example
345"
346{
347  if ((derivate(m,h) !=0) || (derivate(m,derivate(m,q)) !=0))
348  {
349    "//the last two polynomials of the input must be invariant functions";
350    return(q);
351  }
352  int ii,k;
353  for ( k=1; k <= nvars(basering); k++  )
354  {  if (h == var(k))
355     { ii=1;
356     }
357  }
358  if( ii==0 )
359  {  "// the last argument must be a ring variable";
360     return(q);
361  }
362
363  poly inv=p;
364  poly dif= derivate(m,inv);
365  poly a=derivate(m,q);
366  poly sgn=-1;
367  poly coeff=sgn*q;
368  k=1;
369  if (dif==0)
370  {
371    return(inv);
372  }
373  while (dif!=0)
374  {
375    inv=(a*inv)+(coeff*dif);
376    dif=derivate(m,dif);
377    k=k+1;
378    coeff=q*coeff*sgn/k;
379  }
380  while ((inv!=0) && (inv!=h) &&(subst(inv,h,0)==0))
381 {
382   inv=inv/h;
383  }
384  return(inv);
385}
386example
387{ "EXAMPLE:"; echo = 2;
388   ring q=0,(x,y,z),dp;
389   matrix m[3][1];
390   m[2,1]=x;
391   m[3,1]=y;
392   poly in=localInvar(m,z,y,x);
393   in;
394}
395///////////////////////////////////////////////////////////////////////////////
396
397proc furtherInvar(matrix m, ideal id, ideal karl, poly q, list #)
398"USAGE:   furtherInvar(m,id,karl,q); m matrix, id,karl ideals, q poly, n int
399ASSUME:  karl,id,q are invariant under the vector field m,
400         moreover, q must be a variable
401RETURN:  list of two ideals, the first ideal contains further invariants of
402         the vector field
403@format
404         m = sum m[i,1]*d/dx(i) with respect to id,p,q,
405@end format
406         i.e. we compute elements in the (invariant) subring generated by id
407         which are divisible by q and divide them by q as much as possible
408         the second ideal contains all invariants given before
409         if n=1, a different algorithm is chosen which is sometimes faster
410         (default: n=0)
411EXAMPLE: example furtherInvar; shows an example
412"
413{
414  list ll = q;
415  if ( size(#)>0 )
416  {  ll = ll+list(#[1]);
417  }
418  int i;
419  ideal null;
420  int z=ncols(id);
421  intvec v;
422  def br=basering;
423  ideal su;
424  for (i=1; i<=z; i++)
425  {
426    su[i]=subst(id[i],q,0);
427  }
428  // -- define the map phi : r1 ---> br defined by y(i) ---> id[i](q=0) --
429  execute ("ring r1="+charstr(basering)+",(y(1..z)),dp;");
430  setring br;
431  map phi=r1,su;
432  setring r1;
433  // --------------- compute the kernel of phi ---------------------------
434  ideal ker=preimage(br,phi,null);
435  ker=mstd(ker)[2];
436  // ---- define the map psi : r1 ---> br defined by y(i) ---> id[i] -----
437  setring br;
438  map psi=r1,id;
439  // -------------------  compute psi(ker(phi)) --------------------------
440  ideal rel=psi(ker);
441  // divide by maximal power of q, test wether we really obtain invariants
442  for (i=1;i<=size(rel);i++)
443  {
444    while ((rel[i]!=0) && (rel[i]!=q) &&(subst(rel[i],q,0)==0))
445    {
446      rel[i]=rel[i]/q;
447      if (derivate(m,rel[i])!=0)
448      {
449         "// error in furtherInvar, function not invariant:";
450         rel[i];
451      }
452    }
453    rel[i]=simplify(rel[i],1);
454  }
455  // ---------------------------------------------------------------------
456  // test whether some variables occur linearly and then delete the
457  // corresponding invariant function
458  setring r1;
459  int j;
460  for (i=1;i<=size(ker);i=i+1)
461  {
462     for (j=1;j<=z;j++)
463     {
464        if (deg(ker[i]/y(j))==0)
465        {
466           setring br;
467           rel[i]= completeReduction(rel[i],karl,ll);
468           if(rel[i]!=0)
469           {
470              karl[j+1]=rel[i];
471              rel[i]=0;
472           }
473           setring r1;
474        }
475     }
476
477  }
478  setring br;
479  list l=rel+null,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 to compute the ring of invariants works in char 0
517         or big enough characteristic. (K,+) acts as the exponential of the
518         vector field defined by the matrix m. For background see G.-M. Greuel,
519         G. Pfister, 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.