1 | // $Id: ainvar.lib,v 1.4 2000-12-22 13:32:17 greuel Exp $ |
---|
2 | ///////////////////////////////////////////////////////////////////////////// |
---|
3 | version="$Id: ainvar.lib,v 1.4 2000-12-22 13:32:17 greuel Exp $"; |
---|
4 | category="Invariant theory"; |
---|
5 | info=" |
---|
6 | LIBRARY: ainvar.lib Invariant Rings of the Additive Group |
---|
7 | AUTHORS: Gerhard Pfister, email: pfister@mathematik.uni-kl.de |
---|
8 | Gert-Martin Greuel, email: greuel@mathematik.uni-kl.de |
---|
9 | |
---|
10 | PROCEDURES: |
---|
11 | invariantRing(m..); compute ring of invariants of (K,+)-action given by m |
---|
12 | derivate(m,f); derivation of f with respect to the vectorfield 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 inariants of m from the given ones |
---|
18 | sortier(id); sorts generators of id by increasing leading terms |
---|
19 | "; |
---|
20 | |
---|
21 | LIB "inout.lib"; |
---|
22 | LIB "general.lib"; |
---|
23 | LIB "algebra.lib"; |
---|
24 | /////////////////////////////////////////////////////////////////////////////// |
---|
25 | |
---|
26 | proc sortier(id) |
---|
27 | "USAGE: sotier(id); id ideal/module |
---|
28 | RETURN: the same ideal/module but with generators ordered by there |
---|
29 | leading term, starting with the smallest |
---|
30 | EXAMPLE: 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 | } |
---|
54 | example |
---|
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 | |
---|
62 | proc derivate (matrix m, id) |
---|
63 | "USAGE: derivate(m,id); m matrix, id poly/vector/ideal |
---|
64 | ASSUME: m is a nx1 matrix, where n = number of variables of the basering |
---|
65 | RETURN: poly/vector/ideal (same type as input), result of applying the |
---|
66 | vectorfield by the matrix m componentwise to id; |
---|
67 | NOTE: the vectorfield is m[1,1]*d/dx(1) +...+ m[1,n]*d/dx(n) |
---|
68 | EXAMPLE: 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 | } |
---|
82 | example |
---|
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 | |
---|
95 | proc actionIsProper(matrix m) |
---|
96 | "USAGE: actionIsProper(m); m matrix |
---|
97 | ASSUME: m is a nx1 matrix, where n = number of variables of the basering |
---|
98 | RETURN: int = 1, if the action defined by m is proper, 0 if not |
---|
99 | NOTE: 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) |
---|
101 | EXAMPLE: 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 | } |
---|
135 | example |
---|
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 | |
---|
155 | proc reduction(poly p, ideal dom, list #) |
---|
156 | "USAGE: reduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int (optional)] |
---|
157 | RETURN: 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 devides |
---|
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 choosen which is sometimes faster |
---|
164 | (default: n=0; q and n can be given (or not) in any order) |
---|
165 | NOTE: this is a kind of SAGBI reduction in the subalgebra K[f1,...,fr] of |
---|
166 | the basering |
---|
167 | EXAMPLE: 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 | // devide 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 | // devide 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 | |
---|
263 | example |
---|
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 | |
---|
274 | proc completeReduction(poly p, ideal dom, list #) |
---|
275 | "USAGE: completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int] |
---|
276 | RETURN: 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 choosen which is sometimes faster |
---|
279 | (default: n=0; q and n can be given (or not) in any order) |
---|
280 | NOTE: help reduction; shows an explanation of SAGBI reduction |
---|
281 | EXAMPLE: 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 | } |
---|
293 | example |
---|
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 | |
---|
304 | proc completeReductionnew(poly p, ideal dom, list #) |
---|
305 | "USAGE: completeReduction(p,I[,q,n]); p poly, I ideal, [q monomial, n int] |
---|
306 | RETURN: 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 choosen which is sometimes faster |
---|
309 | (default: n=0; q and n can be given (or not) in any order) |
---|
310 | NOTE: help reduction; shows an explanation of SAGBI reduction |
---|
311 | EXAMPLE: 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 | |
---|
331 | proc localInvar(matrix m, poly p, poly q, poly h) |
---|
332 | "USAGE: localInvar(m,p,q,h); m matrix, p,q,h polynomials |
---|
333 | ASSUME: m(q) and h are invariant under the vectorfield m, i.e. m(m(q))=m(h)=0 |
---|
334 | h must be a ring variable |
---|
335 | RETURN: a polynomial, the invariant polynomial of the vectorfield |
---|
336 | m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n) |
---|
337 | with respect to p,q,h. It is defined as follows: set inv = p if p is |
---|
338 | invariant, and else as |
---|
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; |
---|
341 | the result is inv divided by h as much as possible |
---|
342 | EXAMPLE: 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 | } |
---|
384 | example |
---|
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 | |
---|
395 | proc 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 |
---|
397 | ASSUME: karl,id,q are invariant under the vectorfield m, |
---|
398 | moreover, q must be a variable |
---|
399 | RETURN: list of two ideals, the first ideal contains further invariants of |
---|
400 | the vectorfield |
---|
401 | m = sum m[i,1]*d/dx(i) with respect to id,p,q, |
---|
402 | i.e. we compute elements in the (invariant) subring generated by id |
---|
403 | which are divisible by q and divde them by q as much as possible |
---|
404 | the second ideal contains all invariants given before |
---|
405 | if n=1, a different algorithm is choosen which is sometimes faster |
---|
406 | (default: n=0) |
---|
407 | EXAMPLE: example furtherInvar; shows an example |
---|
408 | " |
---|
409 | { |
---|
410 | list ll = q; |
---|
411 | if ( size(#)>0 ) |
---|
412 | { ll = ll+list(#[1]); |
---|
413 | } |
---|
414 | int i; |
---|
415 | ideal null; |
---|
416 | int z=ncols(id); |
---|
417 | intvec v; |
---|
418 | def br=basering; |
---|
419 | ideal su; |
---|
420 | for (i=1; i<=z; i++) |
---|
421 | { |
---|
422 | su[i]=subst(id[i],q,0); |
---|
423 | } |
---|
424 | // -- define the map phi : r1 ---> br defined by y(i) ---> id[i](q=0) -- |
---|
425 | execute ("ring r1="+charstr(basering)+",(y(1..z)),dp;"); |
---|
426 | setring br; |
---|
427 | map phi=r1,su; |
---|
428 | setring r1; |
---|
429 | // --------------- compute the kernel of phi --------------------------- |
---|
430 | ideal ker=preimage(br,phi,null); |
---|
431 | ker=mstd(ker)[2]; |
---|
432 | // ---- define the map psi : r1 ---> br defined by y(i) ---> id[i] ----- |
---|
433 | setring br; |
---|
434 | map psi=r1,id; |
---|
435 | // ------------------- compute psi(ker(phi)) -------------------------- |
---|
436 | ideal rel=psi(ker); |
---|
437 | // devide by maximal power of q, test wether we really obtain invariants |
---|
438 | for (i=1;i<=size(rel);i++) |
---|
439 | { |
---|
440 | while ((rel[i]!=0) && (rel[i]!=q) &&(subst(rel[i],q,0)==0)) |
---|
441 | { |
---|
442 | rel[i]=rel[i]/q; |
---|
443 | if (derivate(m,rel[i])!=0) |
---|
444 | { |
---|
445 | "// error in furtherInvar, function not invariant:"; |
---|
446 | rel[i]; |
---|
447 | } |
---|
448 | } |
---|
449 | rel[i]=simplify(rel[i],1); |
---|
450 | } |
---|
451 | // --------------------------------------------------------------------- |
---|
452 | // test whether some variables occur linearly and then delete the |
---|
453 | // corresponding invariant function |
---|
454 | setring r1; |
---|
455 | int j; |
---|
456 | for (i=1;i<=size(ker);i=i+1) |
---|
457 | { |
---|
458 | for (j=1;j<=z;j++) |
---|
459 | { |
---|
460 | if (deg(ker[i]/y(j))==0) |
---|
461 | { |
---|
462 | setring br; |
---|
463 | rel[i]= completeReduction(rel[i],karl,ll); |
---|
464 | if(rel[i]!=0) |
---|
465 | { |
---|
466 | karl[j+1]=rel[i]; |
---|
467 | rel[i]=0; |
---|
468 | } |
---|
469 | setring r1; |
---|
470 | } |
---|
471 | } |
---|
472 | |
---|
473 | } |
---|
474 | setring br; |
---|
475 | list l=rel+null,karl; |
---|
476 | return(l); |
---|
477 | } |
---|
478 | example |
---|
479 | { "EXAMPLE:"; echo = 2; |
---|
480 | ring r=0,(x,y,z,u),dp; |
---|
481 | matrix m[4][1]; |
---|
482 | m[2,1]=x; |
---|
483 | m[3,1]=y; |
---|
484 | m[4,1]=z; |
---|
485 | ideal id=localInvar(m,z,y,x),localInvar(m,u,y,x); |
---|
486 | ideal karl=id,x; |
---|
487 | list in=furtherInvar(m,id,karl,x); |
---|
488 | in; |
---|
489 | } |
---|
490 | /////////////////////////////////////////////////////////////////////////////// |
---|
491 | |
---|
492 | proc invariantRing(matrix m, poly p, poly q, int b, list #) |
---|
493 | "USAGE: invariantRing(m,p,q,b[,r,pa]); m matrix, p,q poly, b,r int, pa string |
---|
494 | ASSUME: p,q variables with m(p)=q and q invariant under m |
---|
495 | i.e. if p=x(i) and q=x(j) then m[j,1]=0 and m[i,1]=x(j) |
---|
496 | RETURN: ideal, containing generators of the ring of invariants of the |
---|
497 | additive gropup (K,+) given by the vectorfield |
---|
498 | m = m[1,1]*d/dx(1) +...+ m[n,1]*d/dx(n). |
---|
499 | If b>0 the computation stops after all invariants of degree <= b |
---|
500 | (and at least one of higher degree) are found or when all invariants |
---|
501 | are computed. |
---|
502 | If b<=0, the computation continues until all generators |
---|
503 | of the ring of invariants are computed (should be used only if the |
---|
504 | ring of invariants is known to be finitey generated otherwise the |
---|
505 | algorithm might not stop). |
---|
506 | If r=1 a different reduction is used which is sometimes faster |
---|
507 | (default r=0). |
---|
508 | DISPLAY: if pa is given (any string as 5th or 6th argument), the computation |
---|
509 | pauses whenever new invariants are found and displays them |
---|
510 | THEORY: The algoritm to compute the ring of invariants works in char 0 |
---|
511 | or big enough characteristic. (K,+) acts as the exponential of the |
---|
512 | vectorfield defined by the matrix m. For background see G.-M. Greuel, |
---|
513 | G. Pfister, Geometric quotients of unipotent group actions, Proc. |
---|
514 | London Math. Soc. ??,???,1993? |
---|
515 | EXAMPLE: example invariantRing; shows an example |
---|
516 | " |
---|
517 | { |
---|
518 | ideal j; |
---|
519 | int i,it; |
---|
520 | list ll=q; |
---|
521 | int bou=b; |
---|
522 | if( size(#) >0 ) |
---|
523 | { if( typeof(#[1]) == "int") |
---|
524 | { ll=ll+list(#[1]); |
---|
525 | } |
---|
526 | if( typeof(#[1]) == "string") |
---|
527 | { string pau=#[1]; |
---|
528 | } |
---|
529 | if( size(#)>1 ) |
---|
530 | { if( typeof(#[2]) == "string") |
---|
531 | { string pau=#[2]; |
---|
532 | } |
---|
533 | if( typeof(#[2]) == "int") |
---|
534 | { ll=ll+list(#[2]); |
---|
535 | } |
---|
536 | } |
---|
537 | } |
---|
538 | int z; |
---|
539 | ideal karl; |
---|
540 | ideal k1=1; |
---|
541 | list k2; |
---|
542 | //------------------ computation of local invariants ------------------ |
---|
543 | for (i=1;i<=nvars(basering);i++) |
---|
544 | { |
---|
545 | karl=karl+localInvar(m,var(i),p,q); |
---|
546 | } |
---|
547 | if( defined(pau) ) |
---|
548 | { ""; |
---|
549 | "// local invariants computed:"; |
---|
550 | ""; |
---|
551 | karl; |
---|
552 | ""; |
---|
553 | pause("// hit return key to continue!"); |
---|
554 | ""; |
---|
555 | } |
---|
556 | //------------------ computation of further invariants ---------------- |
---|
557 | it=0; |
---|
558 | while (size(k1)!=0) |
---|
559 | { |
---|
560 | // test if the new invariants are already in the ring generated |
---|
561 | // by the invariants we constructed so far |
---|
562 | it++; |
---|
563 | karl=sortier(karl); |
---|
564 | j=q; |
---|
565 | for (i=1;i<=size(karl);i++) |
---|
566 | { |
---|
567 | j=j + simplify(completeReduction(karl[i],j,ll),1); |
---|
568 | } |
---|
569 | karl=j; |
---|
570 | j[1]=0; |
---|
571 | j=simplify(j,2); |
---|
572 | k2=furtherInvar(m,j,karl,q); |
---|
573 | k1=k2[1]; |
---|
574 | karl=k2[2]; |
---|
575 | k1=sortier(k1); |
---|
576 | z=size(k1); |
---|
577 | |
---|
578 | for (i=1;i<=z;i++) |
---|
579 | { |
---|
580 | k1[i]= completeReduction(k1[i],karl,ll); |
---|
581 | if (k1[i]!=0) |
---|
582 | { |
---|
583 | karl=karl+simplify(k1[i],1); |
---|
584 | } |
---|
585 | } |
---|
586 | if( defined(pau) == voice) |
---|
587 | { |
---|
588 | "// the invariants after",it,"iteration(s):"; ""; |
---|
589 | karl;""; |
---|
590 | pause("// hit return key to continue!"); |
---|
591 | ""; |
---|
592 | } |
---|
593 | if( (bou>0) && (size(k1)>0) ) |
---|
594 | { |
---|
595 | if( deg(k1[size(k1)])>bou ) |
---|
596 | { |
---|
597 | return(karl); |
---|
598 | } |
---|
599 | } |
---|
600 | } |
---|
601 | return(karl); |
---|
602 | } |
---|
603 | example |
---|
604 | { "EXAMPLE:"; echo = 2; |
---|
605 | |
---|
606 | //Winkelmann: free action but Spec(k[x(1),...,x(5)]) --> Spec(invariant ring) |
---|
607 | //is not surjective |
---|
608 | |
---|
609 | ring rw=0,(x(1..5)),dp; |
---|
610 | matrix m[5][1]; |
---|
611 | m[3,1]=x(1); |
---|
612 | m[4,1]=x(2); |
---|
613 | m[5,1]=1+x(1)*x(4)+x(2)*x(3); |
---|
614 | ideal in=invariantRing(m,x(3),x(1),0); //compute full invarint ring |
---|
615 | in; |
---|
616 | |
---|
617 | //Deveney/Finston: The ring of invariants is not finitely generated |
---|
618 | |
---|
619 | ring rf=0,(x(1..7)),dp; |
---|
620 | matrix m[7][1]; |
---|
621 | m[4,1]=x(1)^3; |
---|
622 | m[5,1]=x(2)^3; |
---|
623 | m[6,1]=x(3)^3; |
---|
624 | m[7,1]=(x(1)*x(2)*x(3))^2; |
---|
625 | ideal in=invariantRing(m,x(4),x(1),6); //all invariants up to degree 6 |
---|
626 | in; |
---|
627 | } |
---|
628 | |
---|
629 | /////////////////////////////////////////////////////////////////////////////// |
---|
630 | /* Further examplex |
---|
631 | |
---|
632 | //Deveney/Finston: Proper Ga-action which is not locally trivial |
---|
633 | //r[x(1),...,x(5)] is not flat over the ring of invariants |
---|
634 | LIB "invar.lib"; |
---|
635 | ring rd=0,(x(1..5)),dp; |
---|
636 | matrix m[5][1]; |
---|
637 | m[3,1]=x(1); |
---|
638 | m[4,1]=x(2); |
---|
639 | m[5,1]=1+x(1)*x(4)^2; |
---|
640 | ideal in=invariantRing(m,x(3),x(1),0,1); |
---|
641 | in; |
---|
642 | |
---|
643 | actionIsProper(m); |
---|
644 | |
---|
645 | //compute the algebraic relations between the invariants |
---|
646 | int z=size(in); |
---|
647 | ideal null; |
---|
648 | ring r1=0,(y(1..z)),dp; |
---|
649 | setring rd; |
---|
650 | map phi=r1,in; |
---|
651 | setring r1; |
---|
652 | ideal ker=preimage(rd,phi,null); |
---|
653 | ker; |
---|
654 | |
---|
655 | //the discriminant |
---|
656 | |
---|
657 | ring r=0,(x(1..2),y(1..2),z,t),dp; |
---|
658 | 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; |
---|
659 | |
---|
660 | matrix m[5][5]; |
---|
661 | m[1,1]=z; |
---|
662 | m[1,2]=x(1)*y(2)^2+1; |
---|
663 | m[1,3]=x(1)*y(1)*y(2); |
---|
664 | m[1,4]=1/3*x(1)*y(1)^2; |
---|
665 | m[1,5]=0; |
---|
666 | m[2,1]=0; |
---|
667 | m[2,2]=z; |
---|
668 | m[2,3]=x(1)*y(2)^2+1; |
---|
669 | m[2,4]=x(1)*y(1)*y(2); |
---|
670 | m[2,5]=1/3*x(1)*y(1)^2; |
---|
671 | m[3,1]=x(1)*y(2)^2+1; |
---|
672 | m[3,2]=2*x(1)*y(1)*y(2); |
---|
673 | m[3,3]=x(1)*y(1)^2; |
---|
674 | m[3,4]=0; |
---|
675 | m[3,5]=0; |
---|
676 | m[4,1]=0; |
---|
677 | m[4,2]=x(1)*y(2)^2+1; |
---|
678 | m[4,3]=2*x(1)*y(1)*y(2); |
---|
679 | m[4,4]=x(1)*y(1)^2; |
---|
680 | m[4,5]=0; |
---|
681 | m[5,1]=0; |
---|
682 | m[5,2]=0; |
---|
683 | m[5,3]=x(1)*y(2)^2+1; |
---|
684 | m[5,4]=2*x(1)*y(1)*y(2); |
---|
685 | m[5,5]=x(1)*y(1)^2; |
---|
686 | |
---|
687 | poly disc=9*det(m)/(x(1)^2*y(1)^4); |
---|
688 | |
---|
689 | LIB "invar.lib"; |
---|
690 | matrix n[6][1]; |
---|
691 | n[2,1]=x(1); |
---|
692 | n[4,1]=y(1); |
---|
693 | n[5,1]=1+x(1)*y(2)^2; |
---|
694 | |
---|
695 | derivate(n,disc); |
---|
696 | |
---|
697 | //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 |
---|
698 | |
---|
699 | ////////////////////////////////////////////////////////////////////////////// |
---|
700 | //constructive approach to Weizenboecks theorem |
---|
701 | |
---|
702 | int n=5; |
---|
703 | // int n=6; //limit |
---|
704 | ring w=32003,(x(1..n)),wp(1..n); |
---|
705 | |
---|
706 | // definition of the vectorfield m=sum m[i]*d/dx(i) |
---|
707 | matrix m[n][1]; |
---|
708 | int i; |
---|
709 | for (i=1;i<=n-1;i=i+1) |
---|
710 | { |
---|
711 | m[i+1,1]=x(i); |
---|
712 | } |
---|
713 | ideal in=invariantRing(m,x(2),x(1),0,""); |
---|
714 | |
---|
715 | in; |
---|
716 | */ |
---|