1 | ////////////////////////////////////////////////////////////////////////////// |
---|
2 | version="version primdecint.lib 4.0.0.0 Jun_2013 "; // $Id$ |
---|
3 | category = "Commutative Algebra"; |
---|
4 | info=" |
---|
5 | LIBRARY: primdecint.lib primary decomposition of an ideal in the polynomial |
---|
6 | ring over the integers |
---|
7 | |
---|
8 | AUTHORS: G. Pfister pfister@mathematik.uni-kl.de |
---|
9 | @* A. Sadiq afshanatiq@gmail.com |
---|
10 | @* S. Steidel steidel@mathematik.uni-kl.de |
---|
11 | |
---|
12 | OVERVIEW: |
---|
13 | |
---|
14 | A library for computing the primary decomposition of an ideal in the |
---|
15 | polynomial ring over the integers, Z[x_1,...,x_n]. |
---|
16 | The first procedure 'primdecZ' can be used in parallel. |
---|
17 | |
---|
18 | PROCEDURES: |
---|
19 | primdecZ(I); compute the primary decomposition of ideal I |
---|
20 | primdecZM(I); compute the primary decomposition of module I |
---|
21 | minAssZ(I); compute the minimal associated primes of I |
---|
22 | radicalZ(I); compute the radical of I |
---|
23 | heightZ(I); compute the height of I |
---|
24 | equidimZ(I); compute the equidimensional part of I |
---|
25 | intersectZ(I,J) compute the intersection of I and J |
---|
26 | "; |
---|
27 | |
---|
28 | LIB "primdec.lib"; |
---|
29 | |
---|
30 | //////////////////////////////////////////////////////////////////////////////// |
---|
31 | |
---|
32 | proc primdecZ(ideal I, list #) |
---|
33 | "USAGE: primdecZ(I[, n]); I ideal, n integer (number of processors) |
---|
34 | NOTE: If size(#) > 0, then #[1] is the number of available processors for |
---|
35 | the computation. |
---|
36 | RETURN: a list pr of primary ideals and their associated primes: |
---|
37 | @format |
---|
38 | pr[i][1] the i-th primary component, |
---|
39 | pr[i][2] the i-th prime component. |
---|
40 | @end format |
---|
41 | EXAMPLE: example primdecZ; shows an example |
---|
42 | " |
---|
43 | { |
---|
44 | if(size(I)==0){return(list(list(ideal(0),ideal(0))));} |
---|
45 | |
---|
46 | //-------------------- Initialize optional parameters ------------------------ |
---|
47 | if(size(#) > 0) |
---|
48 | { |
---|
49 | if(size(#) == 1) |
---|
50 | { |
---|
51 | int n = #[1]; |
---|
52 | ideal TES = 1; |
---|
53 | } |
---|
54 | if(size(#) == 2) |
---|
55 | { |
---|
56 | int n = #[1]; |
---|
57 | ideal TES = #[2]; |
---|
58 | } |
---|
59 | } |
---|
60 | else |
---|
61 | { |
---|
62 | int n = 1; |
---|
63 | ideal TES = 1; |
---|
64 | } |
---|
65 | |
---|
66 | |
---|
67 | if(deg(I[1]) == 0) |
---|
68 | { |
---|
69 | ideal J = I; |
---|
70 | } |
---|
71 | else |
---|
72 | { |
---|
73 | ideal J = stdZ(I); |
---|
74 | } |
---|
75 | |
---|
76 | ideal K,N; |
---|
77 | def R=basering; |
---|
78 | number s; |
---|
79 | list rl=ringlist(R); |
---|
80 | int i,j,p,m,ex,nu,k_link; |
---|
81 | list P,B,IS; |
---|
82 | ideal Q,JJ; |
---|
83 | ideal TQ=1; |
---|
84 | if(deg(J[1])==0) |
---|
85 | { |
---|
86 | //=== I intersected with Z is not zero |
---|
87 | list rp=rl; |
---|
88 | rp[1]=0; |
---|
89 | //=== q is generator of I intersect Z |
---|
90 | number q=leadcoef(J[1]); |
---|
91 | def Rhelp=ring(rp); |
---|
92 | setring Rhelp; |
---|
93 | number q=imap(R,q); |
---|
94 | //=== computes the primes occuring in a generator of I intersect Z |
---|
95 | |
---|
96 | list L = primefactors(q); |
---|
97 | |
---|
98 | list A; |
---|
99 | A[1]= ideal(0); |
---|
100 | ideal J = imap(R,J); |
---|
101 | |
---|
102 | for(j=1;j<=size(L[2]);j++) |
---|
103 | { |
---|
104 | if(L[2][j] > 1){ ex = 1; break; } |
---|
105 | } |
---|
106 | |
---|
107 | if(printlevel >= 10) |
---|
108 | { |
---|
109 | "n = "+string(n); |
---|
110 | "size(L[2]) = "+string(size(L[2])); |
---|
111 | } |
---|
112 | |
---|
113 | int RT = rtimer; |
---|
114 | if((n > 1) && (n < size(L[2]))) |
---|
115 | { |
---|
116 | |
---|
117 | //----- Create n1 links l(1),...,l(n1), open all of them and compute --------- |
---|
118 | //----- standard basis for the primes L[1][2],...,L[1][n + 1]. --------- |
---|
119 | |
---|
120 | for(i = 1; i <= n; i++) |
---|
121 | { |
---|
122 | p=int(L[1][i + 1]); |
---|
123 | nu=int(L[2][i + 1]); |
---|
124 | //link l(i) = "MPtcp:fork"; |
---|
125 | link l(i) = "ssi:fork"; |
---|
126 | open(l(i)); |
---|
127 | write(l(i), quote(modp(eval(J), eval(p), eval(nu)))); |
---|
128 | } |
---|
129 | |
---|
130 | p = int(L[1][1]); |
---|
131 | nu = int(L[2][1]); |
---|
132 | int t = timer; |
---|
133 | A[size(A)+1] = modp(J, p, nu); |
---|
134 | t = timer - t; |
---|
135 | if(t > 60) { t = 60; } |
---|
136 | int i_sleep = system("sh", "sleep "+string(t)); |
---|
137 | |
---|
138 | j = n + 2; |
---|
139 | |
---|
140 | while(j <= size(L[2]) + 1) |
---|
141 | { |
---|
142 | for(i = 1; i <= n; i++) |
---|
143 | { |
---|
144 | //=== ask if link l(i) is ready otherwise sleep for t seconds |
---|
145 | if(status(l(i), "read", "ready")) |
---|
146 | { |
---|
147 | //=== read the result from l(i) |
---|
148 | A[size(A)+1] = read(l(i)); |
---|
149 | |
---|
150 | if(j <= size(L[2])) |
---|
151 | { |
---|
152 | p=int(L[1][j]); |
---|
153 | nu=int(L[2][j]); |
---|
154 | write(l(i), quote(modp(eval(J), eval(p), eval(nu)))); |
---|
155 | j++; |
---|
156 | } |
---|
157 | else |
---|
158 | { |
---|
159 | k_link++; |
---|
160 | close(l(i)); |
---|
161 | } |
---|
162 | } |
---|
163 | } |
---|
164 | //=== k_link describes the number of closed links |
---|
165 | if(k_link == n) |
---|
166 | { |
---|
167 | j++; |
---|
168 | } |
---|
169 | i_sleep = system("sh", "sleep "+string(t)); |
---|
170 | } |
---|
171 | |
---|
172 | } |
---|
173 | else |
---|
174 | { |
---|
175 | for(j=1;j<=size(L[2]);j++) |
---|
176 | { |
---|
177 | A[size(A)+1] = modp(J, L[1][j], L[2][j]); |
---|
178 | } |
---|
179 | } |
---|
180 | |
---|
181 | setring R; |
---|
182 | list A = imap(Rhelp,A); |
---|
183 | if(printlevel >= 10) |
---|
184 | { |
---|
185 | "A is computed in "+string(rtimer - RT)+" seconds."; |
---|
186 | } |
---|
187 | for(i=2;i<=size(A);i++) |
---|
188 | { |
---|
189 | //=== computes for all p in L the minimal associated primes of |
---|
190 | //=== IZ/p[variables] |
---|
191 | p = int(A[i][2]); |
---|
192 | if(printlevel >= 10) |
---|
193 | { |
---|
194 | "p = "+string(p); |
---|
195 | RT = rtimer; |
---|
196 | } |
---|
197 | nu = int(A[i][3]); |
---|
198 | //=== maximal power of p dividing q, generator of I intersect Z |
---|
199 | s = p^nu; |
---|
200 | |
---|
201 | rp[1] = p; |
---|
202 | def S = ring(rp); |
---|
203 | setring S; |
---|
204 | ideal J = imap(R,J); |
---|
205 | setring R; |
---|
206 | |
---|
207 | if(nu>1) |
---|
208 | { |
---|
209 | //=== p is of multiplicity > 1 in q |
---|
210 | |
---|
211 | B = A[i][1]; |
---|
212 | for(j=1;j<=size(B);j++) |
---|
213 | { |
---|
214 | //=== the minimal associated primes of I |
---|
215 | K=B[j],p; |
---|
216 | K=stdZ(K); |
---|
217 | B[j]=K; |
---|
218 | } |
---|
219 | for(j=1;j<=size(B);j++) |
---|
220 | { |
---|
221 | K=B[j]; |
---|
222 | //=== compute maximal independent set for KZ/p[variables] |
---|
223 | |
---|
224 | setring S; |
---|
225 | J=imap(R,K); |
---|
226 | J=simplify(J,2); |
---|
227 | attrib(J,"isSB",1); |
---|
228 | IS=Primdec::maxIndependSet(J); |
---|
229 | setring R; |
---|
230 | //=== computing the pseudo primary and extract it |
---|
231 | N=J,s; |
---|
232 | N=stdZ(N); |
---|
233 | Q=extractZ(N,j,IS,B); |
---|
234 | //=== test for useless primaries |
---|
235 | if(size(reduce(TES,Q))>0) |
---|
236 | { |
---|
237 | TQ=intersectZ(TQ,Q); |
---|
238 | //TQ=intersect(TQ,Q); |
---|
239 | P[size(P)+1]=list(Q,K); |
---|
240 | } |
---|
241 | } |
---|
242 | } |
---|
243 | else |
---|
244 | { |
---|
245 | //=== p is of multiplicity 1 in q we can compute the |
---|
246 | //=== primary decomposition directly |
---|
247 | |
---|
248 | B = A[i][1]; |
---|
249 | for(j=1;j<=size(B);j++) |
---|
250 | { |
---|
251 | K=B[j][2],p; |
---|
252 | K=stdZ(K); |
---|
253 | Q=B[j][1],p; |
---|
254 | Q=stdZ(Q); |
---|
255 | if(size(reduce(TES,Q))>0) |
---|
256 | { |
---|
257 | //TQ=intersectZ(TQ,Q); |
---|
258 | P[size(P)+1]=list(Q,K); |
---|
259 | } |
---|
260 | } |
---|
261 | if(ex) |
---|
262 | { |
---|
263 | JJ=imap(S,J); |
---|
264 | JJ=JJ,p; |
---|
265 | JJ=stdZ(JJ); |
---|
266 | TQ=intersectZ(TQ,JJ); |
---|
267 | //TQ=intersect(TQ,JJ); |
---|
268 | } |
---|
269 | } |
---|
270 | kill S; |
---|
271 | if(printlevel >= 10) |
---|
272 | { |
---|
273 | string(p)+" done in "+string(rtimer - RT)+" seconds."; |
---|
274 | } |
---|
275 | } |
---|
276 | |
---|
277 | setring R; |
---|
278 | if(!ex){return(P);} |
---|
279 | J=stdZ(J); |
---|
280 | TQ=intersectZ(TQ,TES); |
---|
281 | //TQ=intersect(TQ,TES); |
---|
282 | if(size(reduce(TQ,J))!=0) |
---|
283 | { |
---|
284 | //=== taking care about embedded components |
---|
285 | K=stdZ(quotientZ(J,TQ)); |
---|
286 | ideal W=K; |
---|
287 | m++; |
---|
288 | while(size(reduce(intersectZ(W,TQ),J))!=0) |
---|
289 | //while(size(reduce(intersect(W,TQ),J))!=0) |
---|
290 | { |
---|
291 | //W=stdZ(addIdealZ(I,K^m)); |
---|
292 | W=stdZ(addIdealZ(I,specialPowerZ(K,m))); |
---|
293 | m++; |
---|
294 | } |
---|
295 | list E=primdecZ(W,n,TQ); |
---|
296 | for(i=1;i<=size(E);i++) |
---|
297 | { |
---|
298 | P[size(P)+1]=E[i]; |
---|
299 | } |
---|
300 | } |
---|
301 | return(P); |
---|
302 | } |
---|
303 | |
---|
304 | //==== the ideal intersected with Z is zero |
---|
305 | rl[1]=0; |
---|
306 | def Rhelp=ring(rl); |
---|
307 | setring Rhelp; |
---|
308 | ideal J=imap(R,J); |
---|
309 | J=std(J); |
---|
310 | //=== the primary decomposition over Q which gives the primary |
---|
311 | //=== decomposition of I:h for a suitable integer h |
---|
312 | list pr=primdecGTZ(J); |
---|
313 | for(i=1;i<=size(pr);i++) |
---|
314 | { |
---|
315 | pr[i]=list(std(pr[i][1]),std(pr[i][2])); |
---|
316 | } |
---|
317 | setring R; |
---|
318 | list pr=imap(Rhelp,pr); |
---|
319 | //=== intersection with Z[variables] |
---|
320 | for(i=1;i<=size(pr);i++) |
---|
321 | { |
---|
322 | pr[i]=list(coefZ(pr[i][1])[1],coefZ(pr[i][2])[1]); |
---|
323 | } |
---|
324 | //=== find h in Z such that I is the intersection of I:h and <I,h> |
---|
325 | //=== and I:h = IQ[variables] intersected with Z[varables] |
---|
326 | list H =coefZ(J); |
---|
327 | ideal Y=H[1]; |
---|
328 | int h=H[2]; |
---|
329 | J=J,h; |
---|
330 | //=== call primary decomposition over Z for <I,h> |
---|
331 | list M; |
---|
332 | if(h!=1) |
---|
333 | { |
---|
334 | M=primdecZ(J,n,Y); |
---|
335 | j=0; |
---|
336 | //=== remove useless primary ideals |
---|
337 | while(j<size(M)) |
---|
338 | { |
---|
339 | j++; |
---|
340 | M[j][1]=stdZ(M[j][1]); |
---|
341 | for(i=1;i<=size(pr);i++) |
---|
342 | { |
---|
343 | if(size(reduce(pr[i][1],M[j][1]))==0) |
---|
344 | { |
---|
345 | M=delete(M,j); |
---|
346 | j--; |
---|
347 | break; |
---|
348 | } |
---|
349 | } |
---|
350 | } |
---|
351 | for(i=1;i<=size(M);i++) |
---|
352 | { |
---|
353 | pr[size(pr)+1]=M[i]; |
---|
354 | } |
---|
355 | } |
---|
356 | return(pr); |
---|
357 | } |
---|
358 | example |
---|
359 | { "EXAMPLE:"; echo = 2; |
---|
360 | ring R=integer,(a,b,c,d),dp; |
---|
361 | ideal I1=9,a,b; |
---|
362 | ideal I2=3,c; |
---|
363 | ideal I3=11,2a,7b; |
---|
364 | ideal I4=13a2,17b4; |
---|
365 | ideal I5=9c5,6d5; |
---|
366 | ideal I6=17,a15,b15,c15,d15; |
---|
367 | ideal I=intersectZ(I1,I2); |
---|
368 | I=intersectZ(I,I3); |
---|
369 | I=intersectZ(I,I4); |
---|
370 | I=intersectZ(I,I5); |
---|
371 | I=intersectZ(I,I6); |
---|
372 | primdecZ(I); |
---|
373 | ideal J=intersectZ(ideal(17,a),ideal(17,a2,b)); |
---|
374 | primdecZ(J); |
---|
375 | ideal K=intersectZ(ideal(9,a+3),ideal(9,b+3)); |
---|
376 | primdecZ(K); |
---|
377 | } |
---|
378 | |
---|
379 | //////////////////////////////////////////////////////////////////////////////// |
---|
380 | |
---|
381 | proc minAssZ(ideal I) |
---|
382 | "USAGE: minAssZ(I); I ideal |
---|
383 | RETURN: a list pr of associated primes: |
---|
384 | EXAMPLE: example minAssZ; shows an example |
---|
385 | " |
---|
386 | { |
---|
387 | if(size(I)==0){return(list(ideal(0)));} |
---|
388 | if(deg(I[1])==0) |
---|
389 | { |
---|
390 | ideal J=I; |
---|
391 | } |
---|
392 | else |
---|
393 | { |
---|
394 | ideal J=stdZ(I); |
---|
395 | } |
---|
396 | ideal K; |
---|
397 | def R=basering; |
---|
398 | list rl=ringlist(R); |
---|
399 | int i,j,p,m; |
---|
400 | list P,B; |
---|
401 | if(deg(J[1])==0) |
---|
402 | { |
---|
403 | //=== I intersected with Z is not zero |
---|
404 | list rp=rl; |
---|
405 | rp[1]=0; |
---|
406 | number q=leadcoef(J[1]); |
---|
407 | def Rhelp=ring(rp); |
---|
408 | setring Rhelp; |
---|
409 | number q=imap(R,q); |
---|
410 | //=== computes the primes occuring in a generator of I intersect Z |
---|
411 | //list L=PollardRho(q,5000,1); |
---|
412 | list L=primefactors(q)[1]; |
---|
413 | for(i=1;i<=size(L);i++) |
---|
414 | { |
---|
415 | //=== computes for all p in L the minimal associated primes of |
---|
416 | //=== IZ/p[variables] |
---|
417 | p=int(L[i]); |
---|
418 | setring R; |
---|
419 | rp[1]=p; |
---|
420 | def S=ring(rp); |
---|
421 | setring S; |
---|
422 | ideal J=imap(R,J); |
---|
423 | list A=minAssGTZ(J); |
---|
424 | setring R; |
---|
425 | B=imap(S,A); |
---|
426 | kill S; |
---|
427 | for(j=1;j<=size(B);j++) |
---|
428 | { |
---|
429 | //=== the minimal associated primes of I |
---|
430 | if(B[j][1]!=1) |
---|
431 | { |
---|
432 | K=B[j],p; |
---|
433 | K=stdZ(K); |
---|
434 | P[size(P)+1]=K; |
---|
435 | } |
---|
436 | } |
---|
437 | setring Rhelp; |
---|
438 | } |
---|
439 | setring R; |
---|
440 | return(P); |
---|
441 | } |
---|
442 | //==== the ideal intersected with Z is zero |
---|
443 | rl[1]=0; |
---|
444 | def Rhelp=ring(rl); |
---|
445 | setring Rhelp; |
---|
446 | ideal J=imap(R,J); |
---|
447 | J=std(J); |
---|
448 | //=== the primary decomposition over Q which gives the primary |
---|
449 | //=== decomposition of I:h for a suitable integer h |
---|
450 | list pr=minAssGTZ(J); |
---|
451 | for(i=1;i<=size(pr);i++) |
---|
452 | { |
---|
453 | pr[i]=std(pr[i]); |
---|
454 | } |
---|
455 | setring R; |
---|
456 | list pr=imap(Rhelp,pr); |
---|
457 | //=== intersection with Z[variables] |
---|
458 | for(i=1;i<=size(pr);i++) |
---|
459 | { |
---|
460 | pr[i]=coefZ(pr[i])[1]; |
---|
461 | } |
---|
462 | //=== find h in Z such that I is the intersection of I:h and I,h |
---|
463 | //=== and I:h =IQ[variables] intersected with Z[varables] |
---|
464 | list H=coefZ(J); |
---|
465 | int h=H[2]; |
---|
466 | J=J,h; |
---|
467 | //=== call associated primes over Z for I,h |
---|
468 | list M; |
---|
469 | if(h!=1) |
---|
470 | { |
---|
471 | M=minAssZ(J); |
---|
472 | //=== remove non-minimal primes |
---|
473 | j=0; |
---|
474 | while(j<size(M)) |
---|
475 | { |
---|
476 | j++; |
---|
477 | M[j]=stdZ(M[j]); |
---|
478 | for(i=1;i<=size(pr);i++) |
---|
479 | { |
---|
480 | if(size(reduce(pr[i],M[j]))==0) |
---|
481 | { |
---|
482 | M=delete(M,j); |
---|
483 | j--; |
---|
484 | break; |
---|
485 | } |
---|
486 | } |
---|
487 | } |
---|
488 | for(i=1;i<=size(M);i++) |
---|
489 | { |
---|
490 | pr[size(pr)+1]=M[i]; |
---|
491 | } |
---|
492 | } |
---|
493 | return(pr); |
---|
494 | } |
---|
495 | example |
---|
496 | { "EXAMPLE:"; echo = 2; |
---|
497 | ring R=integer,(a,b,c,d),dp; |
---|
498 | ideal I1=9,a,b; |
---|
499 | ideal I2=3,c; |
---|
500 | ideal I3=11,2a,7b; |
---|
501 | ideal I4=13a2,17b4; |
---|
502 | ideal I5=9c5,6d5; |
---|
503 | ideal I6=17,a15,b15,c15,d15; |
---|
504 | ideal I=intersectZ(I1,I2); |
---|
505 | I=intersectZ(I,I3); |
---|
506 | I=intersectZ(I,I4); |
---|
507 | I=intersectZ(I,I5); |
---|
508 | I=intersectZ(I,I6); |
---|
509 | minAssZ(I); |
---|
510 | ideal J=intersectZ(ideal(17,a),ideal(17,a2,b)); |
---|
511 | minAssZ(J); |
---|
512 | ideal K=intersectZ(ideal(9,a+3),ideal(9,b+3)); |
---|
513 | minAssZ(K); |
---|
514 | } |
---|
515 | |
---|
516 | //////////////////////////////////////////////////////////////////////////////// |
---|
517 | |
---|
518 | proc heightZ(ideal I) |
---|
519 | "USAGE: heightZ(I); I ideal |
---|
520 | RETURN: the height of the input ideal |
---|
521 | EXAMPLE: example heightZ; shows an example |
---|
522 | " |
---|
523 | { |
---|
524 | if(size(I)==0){return(0);} |
---|
525 | if(deg(I[1])==0) |
---|
526 | { |
---|
527 | ideal J=I; |
---|
528 | } |
---|
529 | else |
---|
530 | { |
---|
531 | ideal J=stdZ(I); |
---|
532 | } |
---|
533 | ideal K=1; |
---|
534 | def R=basering; |
---|
535 | list rl=ringlist(R); |
---|
536 | int i,j,p,m; |
---|
537 | list P; |
---|
538 | ideal B; |
---|
539 | if(deg(J[1])==0) |
---|
540 | { |
---|
541 | //=== I intersected with Z is not zero |
---|
542 | m=nvars(R); |
---|
543 | list rp=rl; |
---|
544 | rp[1]=0; |
---|
545 | number q=leadcoef(J[1]); |
---|
546 | def Rhelp=ring(rp); |
---|
547 | setring Rhelp; |
---|
548 | number q=imap(R,q); |
---|
549 | //=== computes the primes occuring in a generator of I intersect Z |
---|
550 | //list L=PollardRho(q,5000,1); |
---|
551 | list L=primefactors(q)[1]; |
---|
552 | for(i=1;i<=size(L);i++) |
---|
553 | { |
---|
554 | //=== computes for all p in L the std of IZ/p[variables] |
---|
555 | p=int(L[i]); |
---|
556 | setring R; |
---|
557 | rp[1]=p; |
---|
558 | def S=ring(rp); |
---|
559 | setring S; |
---|
560 | ideal J=imap(R,J); |
---|
561 | j=nvars(R)-dim(std(J)); |
---|
562 | if(j<m){m=j;} |
---|
563 | setring Rhelp; |
---|
564 | kill S; |
---|
565 | } |
---|
566 | setring R; |
---|
567 | return(m+1); |
---|
568 | } |
---|
569 | //==== the ideal intersected with Z is zero |
---|
570 | rl[1]=0; |
---|
571 | def Rhelp=ring(rl); |
---|
572 | setring Rhelp; |
---|
573 | ideal J=imap(R,J); |
---|
574 | J=std(J); |
---|
575 | m=nvars(R)-dim(J); |
---|
576 | //=== the height over Q |
---|
577 | //=== of I:h for a suitable integer h |
---|
578 | setring R; |
---|
579 | //=== find h in Z such that I is the intersection of I:h and I,h |
---|
580 | //=== and I:h =IQ[variables] intersected with Z[varables] |
---|
581 | list H=coefZ(J); |
---|
582 | int h=H[2]; |
---|
583 | J=J,h; |
---|
584 | //=== call height over Z for I,h |
---|
585 | if(h!=1) |
---|
586 | { |
---|
587 | j=heightZ(J); |
---|
588 | if(j<m){m=j;} |
---|
589 | } |
---|
590 | return(m); |
---|
591 | } |
---|
592 | example |
---|
593 | { "EXAMPLE:"; echo = 2; |
---|
594 | ring R=integer,(a,b,c,d),dp; |
---|
595 | ideal I1=9,a,b; |
---|
596 | ideal I2=3,c; |
---|
597 | ideal I3=11,2a,7b; |
---|
598 | ideal I4=13a2,17b4; |
---|
599 | ideal I5=9c5,6d5; |
---|
600 | ideal I6=17,a15,b15,c15,d15; |
---|
601 | ideal I=intersectZ(I1,I2); |
---|
602 | I=intersectZ(I,I3); |
---|
603 | I=intersectZ(I,I4); |
---|
604 | I=intersectZ(I,I5); |
---|
605 | I=intersectZ(I,I6); |
---|
606 | heightZ(I); |
---|
607 | } |
---|
608 | |
---|
609 | //////////////////////////////////////////////////////////////////////////////// |
---|
610 | |
---|
611 | proc radicalZ(ideal I) |
---|
612 | "USAGE: radicalZ(I); I ideal |
---|
613 | RETURN: the radcal of the input ideal |
---|
614 | EXAMPLE: example radicalZ; shows an example |
---|
615 | " |
---|
616 | { |
---|
617 | if(size(I)==0){return(ideal(0));} |
---|
618 | if(deg(I[1])==0) |
---|
619 | { |
---|
620 | ideal J=I; |
---|
621 | } |
---|
622 | else |
---|
623 | { |
---|
624 | ideal J=stdZ(I); |
---|
625 | } |
---|
626 | ideal K=1; |
---|
627 | def R=basering; |
---|
628 | list rl=ringlist(R); |
---|
629 | int i,j,p,m; |
---|
630 | list P; |
---|
631 | ideal B; |
---|
632 | if(deg(J[1])==0) |
---|
633 | { |
---|
634 | //=== I intersected with Z is not zero |
---|
635 | list rp=rl; |
---|
636 | rp[1]=0; |
---|
637 | number q=leadcoef(J[1]); |
---|
638 | def Rhelp=ring(rp); |
---|
639 | setring Rhelp; |
---|
640 | number q=imap(R,q); |
---|
641 | //=== computes the primes occuring in a generator of I intersect Z |
---|
642 | //list L=PollardRho(q,5000,1); |
---|
643 | list L=primefactors(q)[1]; |
---|
644 | for(i=1;i<=size(L);i++) |
---|
645 | { |
---|
646 | //=== computes for all p in L the radical of IZ/p[variables] |
---|
647 | p=int(L[i]); |
---|
648 | setring R; |
---|
649 | rp[1]=p; |
---|
650 | def S=ring(rp); |
---|
651 | setring S; |
---|
652 | ideal J=imap(R,J); |
---|
653 | ideal A=radical(J); |
---|
654 | setring R; |
---|
655 | B=imap(S,A); |
---|
656 | kill S; |
---|
657 | B=B,p; |
---|
658 | B=stdZ(B); |
---|
659 | K=stdZ(intersectZ(K,B)); |
---|
660 | //K=stdZ(intersect(K,B)); |
---|
661 | setring Rhelp; |
---|
662 | } |
---|
663 | setring R; |
---|
664 | return(K); |
---|
665 | } |
---|
666 | //==== the ideal intersected with Z is zero |
---|
667 | rl[1]=0; |
---|
668 | def Rhelp=ring(rl); |
---|
669 | setring Rhelp; |
---|
670 | ideal J=imap(R,J); |
---|
671 | J=std(J); |
---|
672 | //=== the radical over Q which gives the radical |
---|
673 | //=== of I:h for a suitable integer h |
---|
674 | ideal K=std(radical(J)); |
---|
675 | setring R; |
---|
676 | K=imap(Rhelp,K); |
---|
677 | //=== intersection with Z[variables] |
---|
678 | K=coefZ(K)[1]; |
---|
679 | //=== find h in Z such that I is the intersection of I:h and I,h |
---|
680 | //=== and I:h =IQ[variables] intersected with Z[varables] |
---|
681 | list H=coefZ(J); |
---|
682 | int h=H[2]; |
---|
683 | J=J,h; |
---|
684 | //=== call radical over Z for I,h |
---|
685 | if(h!=1) |
---|
686 | { |
---|
687 | ideal M=radicalZ(J); |
---|
688 | K=intersectZ(K,M); |
---|
689 | //K=intersect(K,M); |
---|
690 | } |
---|
691 | return(K); |
---|
692 | } |
---|
693 | example |
---|
694 | { "EXAMPLE:"; echo = 2; |
---|
695 | ring R=integer,(a,b,c,d),dp; |
---|
696 | ideal I1=9,a,b; |
---|
697 | ideal I2=3,c; |
---|
698 | ideal I3=11,2a,7b; |
---|
699 | ideal I4=13a2,17b4; |
---|
700 | ideal I5=9c5,6d5; |
---|
701 | ideal I6=17,a15,b15,c15,d15; |
---|
702 | ideal I=intersectZ(I1,I2); |
---|
703 | I=intersectZ(I,I3); |
---|
704 | I=intersectZ(I,I4); |
---|
705 | I=intersectZ(I,I5); |
---|
706 | I=intersectZ(I,I6); |
---|
707 | radicalZ(I); |
---|
708 | ideal J=intersectZ(ideal(17,a),ideal(17,a2,b)); |
---|
709 | radicalZ(J); |
---|
710 | } |
---|
711 | |
---|
712 | //////////////////////////////////////////////////////////////////////////////// |
---|
713 | |
---|
714 | proc equidimZ(ideal I) |
---|
715 | "USAGE: equidimZ(I); I ideal |
---|
716 | RETURN: the part of minimal height |
---|
717 | EXAMPLE: example equidimZ; shows an example |
---|
718 | " |
---|
719 | { |
---|
720 | if(size(I)==0){return(ideal(0));} |
---|
721 | if(deg(I[1])==0) |
---|
722 | { |
---|
723 | ideal J=I; |
---|
724 | } |
---|
725 | else |
---|
726 | { |
---|
727 | ideal J=stdZ(I); |
---|
728 | } |
---|
729 | int he=heightZ(J); |
---|
730 | ideal K,N; |
---|
731 | def R=basering; |
---|
732 | number s; |
---|
733 | list rl=ringlist(R); |
---|
734 | int i,j,p,m,ex; |
---|
735 | list P,IS,B; |
---|
736 | ideal Q,JJ,E; |
---|
737 | ideal TQ=1; |
---|
738 | if(deg(J[1])==0) |
---|
739 | { |
---|
740 | //=== I intersected with Z is not zero |
---|
741 | list rp=rl; |
---|
742 | rp[1]=0; |
---|
743 | //=== generator of I intersect Z |
---|
744 | number q=leadcoef(J[1]); |
---|
745 | def Rhelp=ring(rp); |
---|
746 | setring Rhelp; |
---|
747 | number q=imap(R,q); |
---|
748 | number s; |
---|
749 | //=== computes the primes occuring in a generator of I intersect Z |
---|
750 | //list L=PollardRho(q,5000,1); |
---|
751 | list L=primefactors(q)[1]; |
---|
752 | list Le; |
---|
753 | for(i=1;i<=size(L);i++) |
---|
754 | { |
---|
755 | L[i]=int(L[i]); |
---|
756 | p=int(L[i]); |
---|
757 | j=0; |
---|
758 | s=q; |
---|
759 | while((s mod p)==0) |
---|
760 | { |
---|
761 | j++; |
---|
762 | s=s/p; |
---|
763 | } |
---|
764 | Le[i]=j; |
---|
765 | } |
---|
766 | for(i=1;i<=size(L);i++) |
---|
767 | { |
---|
768 | //=== computes for all p in L the minimal associated primes of |
---|
769 | //=== IZ/p[variables] |
---|
770 | p=int(L[i]); |
---|
771 | j=Le[i]; |
---|
772 | setring R; |
---|
773 | //=== maximal power of p dividing q, generator of I intersect Z |
---|
774 | s=p^j; |
---|
775 | rp[1]=p; |
---|
776 | def S=ring(rp); |
---|
777 | setring S; |
---|
778 | ideal J=imap(R,J); |
---|
779 | J=std(J); |
---|
780 | if(nvars(R)-dim(J)+1==he) |
---|
781 | { |
---|
782 | if(j>1) |
---|
783 | { |
---|
784 | //=== p is of multiplicity >1 in q |
---|
785 | list A=minAssGTZ(J); |
---|
786 | j=0; |
---|
787 | while(j<size(A)) |
---|
788 | { |
---|
789 | j++; |
---|
790 | if(dim(std(A[j]))!=nvars(R)-he+1) |
---|
791 | { |
---|
792 | A=delete(A,j); |
---|
793 | j--; |
---|
794 | } |
---|
795 | } |
---|
796 | setring R; |
---|
797 | B=imap(S,A); |
---|
798 | for(j=1;j<=size(B);j++) |
---|
799 | { |
---|
800 | //=== the minimal associated primes of I |
---|
801 | K=B[j],p; |
---|
802 | K=stdZ(K); |
---|
803 | B[j]=K; |
---|
804 | } |
---|
805 | for(j=1;j<=size(B);j++) |
---|
806 | { |
---|
807 | K=B[j]; |
---|
808 | //=== compute maximal independent set for KZ/p[variables] |
---|
809 | setring S; |
---|
810 | J=imap(R,K); |
---|
811 | J=simplify(J,2); |
---|
812 | attrib(J,"isSB",1); |
---|
813 | IS=Primdec::maxIndependSet(J); |
---|
814 | setring R; |
---|
815 | //=== computing the pseudo primary and extract it |
---|
816 | N=J,s; |
---|
817 | N=stdZ(N); |
---|
818 | Q=extractZ(N,j,IS,B); |
---|
819 | TQ=intersectZ(TQ,Q); |
---|
820 | //TQ=intersect(TQ,Q); |
---|
821 | } |
---|
822 | setring Rhelp; |
---|
823 | } |
---|
824 | else |
---|
825 | { |
---|
826 | //=== p is of multiplicity 1 in q we can compute the |
---|
827 | //=== equidimensional part directly |
---|
828 | ideal E=equidimMax(J); |
---|
829 | setring R; |
---|
830 | E=imap(S,E); |
---|
831 | E=E,p; |
---|
832 | E=stdZ(E); |
---|
833 | TQ=intersectZ(TQ,E); |
---|
834 | //TQ=intersect(TQ,E); |
---|
835 | } |
---|
836 | } |
---|
837 | kill S; |
---|
838 | setring Rhelp; |
---|
839 | } |
---|
840 | setring R; |
---|
841 | return(TQ); |
---|
842 | } |
---|
843 | //==== the ideal intersected with Z is zero |
---|
844 | rl[1]=0; |
---|
845 | def Rhelp=ring(rl); |
---|
846 | setring Rhelp; |
---|
847 | ideal J=imap(R,J); |
---|
848 | J=std(J); |
---|
849 | //=== the equidimensional part over Q which gives the equdimensional |
---|
850 | //=== part of I:h for a suitable integer h |
---|
851 | ideal E=1; |
---|
852 | if(nvars(R)-he==dim(J)) |
---|
853 | { |
---|
854 | E=std(equidimMax(J)); |
---|
855 | } |
---|
856 | setring R; |
---|
857 | E =imap(Rhelp,E); |
---|
858 | //=== intersection with Z[variables] |
---|
859 | E=coefZ(E)[1]; |
---|
860 | //=== find h in Z such that I is the intersection of I:h and I,h |
---|
861 | //=== and I:h =IQ[variables] intersected with Z[varables] |
---|
862 | int h =coefZ(J)[2]; |
---|
863 | J=J,h; |
---|
864 | //=== call equidimensional part over Z for I,h |
---|
865 | ideal M; |
---|
866 | if(h!=1) |
---|
867 | { |
---|
868 | M=equidimZ(J); |
---|
869 | if(he==heightZ(M)) |
---|
870 | { |
---|
871 | E=intersectZ(M,E); |
---|
872 | //E=intersect(M,E); |
---|
873 | } |
---|
874 | } |
---|
875 | return(E); |
---|
876 | } |
---|
877 | example |
---|
878 | { "EXAMPLE:"; echo = 2; |
---|
879 | ring R=integer,(a,b,c,d),dp; |
---|
880 | ideal I1=9,a,b; |
---|
881 | ideal I2=3,c; |
---|
882 | ideal I3=11,2a,7b; |
---|
883 | ideal I4=13a2,17b4; |
---|
884 | ideal I5=9c5,6d5; |
---|
885 | ideal I6=17,a15,b15,c15,d15; |
---|
886 | ideal I=intersectZ(I1,I2); |
---|
887 | I=intersectZ(I,I3); |
---|
888 | I=intersectZ(I,I4); |
---|
889 | I=intersectZ(I,I5); |
---|
890 | I=intersectZ(I,I6); |
---|
891 | equidimZ(I); |
---|
892 | } |
---|
893 | |
---|
894 | //////////////////////////////////////////////////////////////////////////////// |
---|
895 | |
---|
896 | proc intersectZ(ideal I, ideal J) |
---|
897 | "USAGE: intersectZ(I,J); I,J ideals |
---|
898 | RETURN: the intersection of the input ideals |
---|
899 | NOTE: this is needed because intersect(I,J) does not work, should be replaced |
---|
900 | by intersect later |
---|
901 | EXAMPLE: example intersectZ; shows an example |
---|
902 | { |
---|
903 | def R = basering; |
---|
904 | execute("ring S=integer,(t,"+varstr(R)+"),(dp(1),dp(nvars(R)));"); |
---|
905 | ideal I=imap(R,I); |
---|
906 | ideal J=imap(R,J); |
---|
907 | ideal K=addIdealZ(t*I,(1-t)*J); |
---|
908 | K=stdZ(K); |
---|
909 | int i; |
---|
910 | ideal L; |
---|
911 | for(i=1;i<=size(K);i++) |
---|
912 | { |
---|
913 | if(lead(K[i])/t==0){L[size(L)+1]=K[i];} |
---|
914 | } |
---|
915 | setring R; |
---|
916 | ideal L=imap(S,L); |
---|
917 | return(L); |
---|
918 | } |
---|
919 | example |
---|
920 | { "EXAMPLE:"; echo = 2; |
---|
921 | ring R=integer,(a,b,c,d),dp; |
---|
922 | ideal I1=9,a,b; |
---|
923 | ideal I2=3,c; |
---|
924 | ideal I3=11,2a,7b; |
---|
925 | ideal I4=13a2,17b4; |
---|
926 | ideal I5=9c5,6d5; |
---|
927 | ideal I6=17,a15,b15,c15,d15; |
---|
928 | ideal I=intersectZ(I1,I2); I; |
---|
929 | I=intersectZ(I,I3); I; |
---|
930 | I=intersectZ(I,I4); I; |
---|
931 | I=intersectZ(I,I5); I; |
---|
932 | I=intersectZ(I,I6); I; |
---|
933 | } |
---|
934 | |
---|
935 | //////////////////////////////////////////////////////////////////////////////// |
---|
936 | |
---|
937 | static proc modp(ideal J, int p, int nu) |
---|
938 | { |
---|
939 | //=== computes the minimal associated primes (if nu > 1) resp. the primary |
---|
940 | //=== decomposition (else) of J in Z/p and maps the result back to the basering |
---|
941 | def R = basering; |
---|
942 | list rp = ringlist(R); |
---|
943 | rp[1] = p; |
---|
944 | def Rp = ring(rp); |
---|
945 | setring Rp; |
---|
946 | ideal J = imap(R,J); |
---|
947 | int sizeA; |
---|
948 | if(nu > 1) |
---|
949 | { |
---|
950 | //=== p is of multiplicity > 1 in q |
---|
951 | list A = minAssGTZ(J); |
---|
952 | } |
---|
953 | else |
---|
954 | { |
---|
955 | list A = primdecGTZ(J); |
---|
956 | } |
---|
957 | sizeA = size(A); |
---|
958 | setring R; |
---|
959 | list A; |
---|
960 | if (sizeA>0) { A = imap(Rp,A); } |
---|
961 | return(list(A,p,nu)); |
---|
962 | } |
---|
963 | |
---|
964 | //////////////////////////////////////////////////////////////////////////////// |
---|
965 | |
---|
966 | static proc coefPrimeZ(ideal I) |
---|
967 | { |
---|
968 | //=== computes the primes occuring in the product of the leading coefficients |
---|
969 | //=== of I |
---|
970 | number h=1; |
---|
971 | int i; |
---|
972 | for(i=1;i<=size(I);i++) |
---|
973 | { |
---|
974 | h=h*leadcoef(I[i]); // besser machen (gleich zerlegen, |
---|
975 | // nicht ausmultiplizieren) |
---|
976 | } |
---|
977 | def R=basering; |
---|
978 | ring Rhelp=0,x,dp; |
---|
979 | number h=imap(R,h); |
---|
980 | //list L=PollardRho(h,5000,1); |
---|
981 | list L=primefactors(h)[1]; |
---|
982 | for(i=1;i<=size(L);i++){L[i]=int(L[i]);} |
---|
983 | setring R; |
---|
984 | return(L); |
---|
985 | } |
---|
986 | |
---|
987 | //////////////////////////////////////////////////////////////////////////////// |
---|
988 | |
---|
989 | static proc coefZ(ideal I) |
---|
990 | { |
---|
991 | //=== assume IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables] |
---|
992 | //=== computes an integer h such that |
---|
993 | //=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected |
---|
994 | //=== with Z[variables] |
---|
995 | //=== returns a list with IQ[variables] intersected with Z[variables] and h |
---|
996 | int h=1; |
---|
997 | int i,e; |
---|
998 | ideal K=1; |
---|
999 | attrib(I,"isSB",1); |
---|
1000 | list L=coefPrimeZ(I); |
---|
1001 | if(size(L)==0){return(list(I,1));} |
---|
1002 | int d=1; |
---|
1003 | while(d!=0) |
---|
1004 | { |
---|
1005 | i++; |
---|
1006 | K=quotientOneZ(I,L[i]); |
---|
1007 | if(size(reduce(K,I))!=0) |
---|
1008 | { |
---|
1009 | h=h*L[i]; |
---|
1010 | I=stdZ(K); |
---|
1011 | e=1; |
---|
1012 | } |
---|
1013 | if(i==size(L)) |
---|
1014 | { |
---|
1015 | i=0; |
---|
1016 | if(e) |
---|
1017 | { |
---|
1018 | e=0; |
---|
1019 | } |
---|
1020 | else |
---|
1021 | { |
---|
1022 | d=0; |
---|
1023 | } |
---|
1024 | } |
---|
1025 | } |
---|
1026 | if(h<0){h=-h;} |
---|
1027 | return(list(K,h)); |
---|
1028 | } |
---|
1029 | |
---|
1030 | //////////////////////////////////////////////////////////////////////////////// |
---|
1031 | |
---|
1032 | static proc specialPowerZ(ideal I, int m) |
---|
1033 | { |
---|
1034 | //=== computes the ideal generated by the m-th power of the generators of I |
---|
1035 | int i; |
---|
1036 | for(i=1;i<=size(I);i++) |
---|
1037 | { |
---|
1038 | I[i]=I[i]^m; |
---|
1039 | } |
---|
1040 | return(I); |
---|
1041 | } |
---|
1042 | |
---|
1043 | //////////////////////////////////////////////////////////////////////////////// |
---|
1044 | |
---|
1045 | static proc separatorsZ(int j, list B) |
---|
1046 | { |
---|
1047 | //=== computes s such that s is not in B[j] but s is in B[i] for all i!=j |
---|
1048 | int i,k; |
---|
1049 | poly s=1; |
---|
1050 | for(i=1;i<=size(B);i++) |
---|
1051 | { |
---|
1052 | if(i!=j) |
---|
1053 | { |
---|
1054 | for(k=1;k<=size(B[i]);k++) |
---|
1055 | { |
---|
1056 | if(reduce(B[i][k],B[j])!=0) |
---|
1057 | { |
---|
1058 | s=s*B[i][k]; |
---|
1059 | break; |
---|
1060 | } |
---|
1061 | } |
---|
1062 | } |
---|
1063 | } |
---|
1064 | return(s); |
---|
1065 | } |
---|
1066 | |
---|
1067 | ////////////////////////////////////////////////////////////////////////////// |
---|
1068 | static proc extractZ(ideal J, int j, list L, list B) |
---|
1069 | { |
---|
1070 | //=== P is an associated prime of J, the corresponding primary ideal is |
---|
1071 | //=== computed, |
---|
1072 | //=== L is a list of maximal independent sets for P in Z/p[variables] |
---|
1073 | def R=basering; |
---|
1074 | ideal P=B[j]; |
---|
1075 | |
---|
1076 | //=== first compute a pseudo primary ideal I, radical of I is P |
---|
1077 | //=== method of Eisenbud |
---|
1078 | //ideal I=addIdealZ(J,specialPowerZ(P,20)); |
---|
1079 | |
---|
1080 | //=== method of Shimoyama-Yokoyama |
---|
1081 | poly s=separatorsZ(j,B); |
---|
1082 | ideal I=satZ(J,s); |
---|
1083 | //=== size(L)=0 means P is maximal ideal and I is primary |
---|
1084 | if(size(L)>0) |
---|
1085 | { |
---|
1086 | if(L[1][3]!=0) |
---|
1087 | { |
---|
1088 | //=== if u in x is an independent set of L then we compute a Groebner |
---|
1089 | //=== Basis in Z[u][x-u] |
---|
1090 | execute("ring S=integer,("+L[1][1]+"),lp;"); |
---|
1091 | ideal I=imap(R,I); |
---|
1092 | I=stdZ(I); |
---|
1093 | list rl=ringlist(S); |
---|
1094 | rl[1]=0; |
---|
1095 | def Shelp =ring(rl); |
---|
1096 | setring Shelp; |
---|
1097 | ideal I=imap(S,I); |
---|
1098 | I[1]=0; |
---|
1099 | I=simplify(I,2); |
---|
1100 | if(L[1][3]==nvars(basering)) |
---|
1101 | { |
---|
1102 | list C; |
---|
1103 | C[1]= ideal(0); //add dummy entry to tie C to current ring |
---|
1104 | int i; |
---|
1105 | for(i=1;i<=size(I);i++) |
---|
1106 | { |
---|
1107 | C[i+1]=I[i]; |
---|
1108 | } |
---|
1109 | } |
---|
1110 | else |
---|
1111 | { |
---|
1112 | //=== this is our way to obtain the coefficients in Z[u] of the |
---|
1113 | //=== leading terms of the Groebner basis above |
---|
1114 | string quotring=Primdec::prepareQuotientring(nvars(basering)-L[1][3]); |
---|
1115 | execute(quotring); |
---|
1116 | ideal I=imap(Shelp,I); |
---|
1117 | list C; |
---|
1118 | C[1]= ideal(0); //add dummy entry to tie C to current ring |
---|
1119 | int i; |
---|
1120 | for(i=1;i<=size(I);i++) |
---|
1121 | { |
---|
1122 | C[i+1]=leadcoef(I[i]); |
---|
1123 | } |
---|
1124 | setring Shelp; |
---|
1125 | list C=imap(quring,C); |
---|
1126 | } |
---|
1127 | setring R; |
---|
1128 | list C=imap(Shelp,C); |
---|
1129 | } |
---|
1130 | else |
---|
1131 | { |
---|
1132 | I=stdZ(I); |
---|
1133 | list C; |
---|
1134 | C[1]= ideal(0); //add dummy entry to tie C to current ring |
---|
1135 | int i; |
---|
1136 | for(i=1;i<=size(I);i++) |
---|
1137 | { |
---|
1138 | C[i+1]=I[i]; |
---|
1139 | } |
---|
1140 | list rl=ringlist(R); |
---|
1141 | rl[1]=0; |
---|
1142 | def Shelp =ring(rl); |
---|
1143 | } |
---|
1144 | poly h=1; |
---|
1145 | for(i=2;i<=size(C);i++) // leave out first dummy entry in C. |
---|
1146 | { |
---|
1147 | if(deg(C[i])>0){h=h*C[i];} // das muss noch besser gemacht werden, |
---|
1148 | // nicht ausmultiplizieren! |
---|
1149 | } |
---|
1150 | setring Shelp; |
---|
1151 | poly h=imap(R,h); |
---|
1152 | ideal fac=factorize(h,1); |
---|
1153 | setring R; |
---|
1154 | ideal fac=imap(Shelp,fac); |
---|
1155 | for(i=1;i<=size(fac);i++) |
---|
1156 | { |
---|
1157 | I=satZ(I,fac[i]); |
---|
1158 | } |
---|
1159 | } |
---|
1160 | I=stdZ(I); |
---|
1161 | return(I); |
---|
1162 | } |
---|
1163 | //////////////////////////////////////////////////////////////////////////////// |
---|
1164 | |
---|
1165 | static proc normalizeZ(ideal I) |
---|
1166 | { |
---|
1167 | //=== if I[1]=q in Z, it replaces all other coeffs of polys in I by there value |
---|
1168 | //=== mod q, std should do this automatically and then this procedure should be |
---|
1169 | //=== removed |
---|
1170 | if(deg(I[1])>0){return(I);} |
---|
1171 | int i,j; |
---|
1172 | number n; |
---|
1173 | poly p; |
---|
1174 | for(i=2;i<=size(I);i++) |
---|
1175 | { |
---|
1176 | j=1; |
---|
1177 | while(j<=size(I[i])) |
---|
1178 | { |
---|
1179 | n=leadcoef(I[i][j]) mod leadcoef(I[1]); |
---|
1180 | p=n*leadmonom(I[i][j]); |
---|
1181 | I[i]=I[i]-I[i][j]+p; |
---|
1182 | if(p!=0){j++;} |
---|
1183 | } |
---|
1184 | } |
---|
1185 | return(I); |
---|
1186 | } |
---|
1187 | |
---|
1188 | //////////////////////////////////////////////////////////////////////////////// |
---|
1189 | |
---|
1190 | static proc satZ(ideal I,poly h) |
---|
1191 | { |
---|
1192 | //=== saturates I by h |
---|
1193 | ideal J=quotientOneZ(I,h); |
---|
1194 | while(size(reduce(J,stdZ(I)))!=0) |
---|
1195 | { |
---|
1196 | I=J; |
---|
1197 | J=quotientOneZ(I,h); |
---|
1198 | J=normalizeZ(J); |
---|
1199 | } |
---|
1200 | return(J); |
---|
1201 | } |
---|
1202 | |
---|
1203 | //////////////////////////////////////////////////////////////////////////////// |
---|
1204 | |
---|
1205 | static proc quotientOneZ(ideal I, poly f) |
---|
1206 | { |
---|
1207 | //=== this is needed because quotient(I,f) does not work properly, should be |
---|
1208 | //=== replaced by quotient later |
---|
1209 | if ( f==0 ) { return( ideal(1) ); } |
---|
1210 | def R=basering; |
---|
1211 | int i; |
---|
1212 | ideal K=intersectZ(I,ideal(f)); |
---|
1213 | //ideal K=intersect(I,ideal(f)); |
---|
1214 | //=== K[i]/f; does not work in rings with integer! This should be replaced |
---|
1215 | //=== later |
---|
1216 | execute("ring Rhelp=0,("+varstr(R)+"),dp;"); |
---|
1217 | ideal K=imap(R,K); |
---|
1218 | poly f=imap(R,f); |
---|
1219 | for(i=1;i<=size(K);i++) |
---|
1220 | { |
---|
1221 | K[i]=K[i]/f; |
---|
1222 | } |
---|
1223 | setring R; |
---|
1224 | K=imap(Rhelp,K); |
---|
1225 | return(K); |
---|
1226 | } |
---|
1227 | |
---|
1228 | //////////////////////////////////////////////////////////////////////////////// |
---|
1229 | |
---|
1230 | static proc quotientZ(ideal I, ideal J) |
---|
1231 | { |
---|
1232 | //=== this is needed because quotient(I,J) does not work properly, should be |
---|
1233 | //=== replaced by quotient later |
---|
1234 | if ( size(J)==0 ) { return( ideal(1) ); } |
---|
1235 | int i; |
---|
1236 | ideal K=quotientOneZ(I,J[1]); |
---|
1237 | for(i=2;i<=size(J);i++) |
---|
1238 | { |
---|
1239 | K=intersectZ(K,quotientOneZ(I,J[i])); |
---|
1240 | //K=intersect(K,quotientOneZ(I,J[i])); |
---|
1241 | } |
---|
1242 | return(K); |
---|
1243 | } |
---|
1244 | |
---|
1245 | //////////////////////////////////////////////////////////////////////////////// |
---|
1246 | |
---|
1247 | static proc reduceZ(poly f, ideal I) |
---|
1248 | { |
---|
1249 | //=== this is needed because reduce(f,I) does not work properly, should be |
---|
1250 | //=== replaced by reduce later |
---|
1251 | if(f==0){return(f);} |
---|
1252 | def R=basering; |
---|
1253 | execute("ring Rhelp=0,("+varstr(R)+"),dp;"); |
---|
1254 | ideal I=imap(R,I); |
---|
1255 | poly f=imap(R,f); |
---|
1256 | int i,j; |
---|
1257 | poly m; |
---|
1258 | number n; |
---|
1259 | while(!i) |
---|
1260 | { |
---|
1261 | i=1; |
---|
1262 | j=0; |
---|
1263 | while(j<size(I)) |
---|
1264 | { |
---|
1265 | j++; |
---|
1266 | m=leadmonom(f)/leadmonom(I[j]); |
---|
1267 | if(m!=0) |
---|
1268 | { |
---|
1269 | n=leadcoef(f) mod leadcoef(I[j]); |
---|
1270 | if(n==0) |
---|
1271 | { |
---|
1272 | f=f-leadcoef(f)/leadcoef(I[j])*m*I[j]; |
---|
1273 | if(f==0){setring R;return(0);} |
---|
1274 | i=0; |
---|
1275 | break; |
---|
1276 | } |
---|
1277 | if(n!=leadcoef(f)) |
---|
1278 | { |
---|
1279 | f=f+(n-leadcoef(f))/leadcoef(I[j])*m*I[j]; |
---|
1280 | i=0; |
---|
1281 | break; |
---|
1282 | } |
---|
1283 | } |
---|
1284 | } |
---|
1285 | } |
---|
1286 | setring R; |
---|
1287 | f=imap(Rhelp,f); |
---|
1288 | return(lead(f)+reduceZ(f-lead(f),I)); |
---|
1289 | } |
---|
1290 | |
---|
1291 | //////////////////////////////////////////////////////////////////////////////// |
---|
1292 | |
---|
1293 | static proc stdZ(ideal I) |
---|
1294 | { |
---|
1295 | //=== this is needed because we want the leading coefficients to be positive |
---|
1296 | //=== otherwhise reduce gives wrong results! should be replaced later by std |
---|
1297 | I=simplify(I,2); |
---|
1298 | I=normalizeZ(I); |
---|
1299 | ideal J=std(I); |
---|
1300 | int i; |
---|
1301 | for(i=1;i<=size(J);i++) |
---|
1302 | { |
---|
1303 | if(leadcoef(J[i])<0){J[i]=-J[i];} |
---|
1304 | } |
---|
1305 | J=normalizeZ(J); |
---|
1306 | attrib(J,"isSB",1); |
---|
1307 | return(J); |
---|
1308 | } |
---|
1309 | |
---|
1310 | //////////////////////////////////////////////////////////////////////////////// |
---|
1311 | |
---|
1312 | static proc addIdealZ(ideal I,ideal J) |
---|
1313 | { |
---|
1314 | //=== this is needed because I+J does not work, should be replaced by + later |
---|
1315 | int i; |
---|
1316 | for(i=1;i<=size(J);i++) |
---|
1317 | { |
---|
1318 | I[size(I)+1]=J[i]; |
---|
1319 | } |
---|
1320 | return(I); |
---|
1321 | } |
---|
1322 | |
---|
1323 | //////////////////////////////////////////////////////////////////////////////// |
---|
1324 | |
---|
1325 | static proc testPrimaryZ(ideal I, list L) |
---|
1326 | { |
---|
1327 | //=== test whether I is the intersection of the primary ideals in L |
---|
1328 | int i; |
---|
1329 | ideal K=L[1][1]; |
---|
1330 | for(i=2;i<=size(L);i++) |
---|
1331 | { |
---|
1332 | K=intersectZ(K,L[i][1]); |
---|
1333 | //K=intersect(K,L[i][1]); |
---|
1334 | } |
---|
1335 | i=size(reduce(K,stdZ(I)))+size(reduce(I,stdZ(K))); |
---|
1336 | if(!i){return(1);} |
---|
1337 | return(0); |
---|
1338 | } |
---|
1339 | |
---|
1340 | //////////////////////////////////////////////////////////////////////////////// |
---|
1341 | |
---|
1342 | static proc pseudo_primdecZM(module N) |
---|
1343 | { |
---|
1344 | ideal I=quotient(N,freemodule(nrows(N))); |
---|
1345 | if(size(I)==0){return(list(list(N,I)));} |
---|
1346 | |
---|
1347 | list B=minAssZ(I); |
---|
1348 | list S,R,L; |
---|
1349 | ideal K; |
---|
1350 | if(size(B)==0){return(S);} |
---|
1351 | for(int i=1;i<=size(B);i++) |
---|
1352 | { |
---|
1353 | S[i]=separatorsZ(i,B); |
---|
1354 | } |
---|
1355 | for(i=1;i<=size(B);i++) |
---|
1356 | { |
---|
1357 | L=sat(N,S[i]); |
---|
1358 | K[i]=S[i]^L[2]; |
---|
1359 | R[i]=list(L[1],B[i]); |
---|
1360 | } |
---|
1361 | L=pseudo_primdecZM(N+K*freemodule(nrows(N))); |
---|
1362 | for(i=1;i<=size(L);i++) |
---|
1363 | { |
---|
1364 | R[size(R)+1]=L[i]; |
---|
1365 | } |
---|
1366 | return(R); |
---|
1367 | } |
---|
1368 | |
---|
1369 | |
---|
1370 | |
---|
1371 | static proc prepare_extractZM(list L) |
---|
1372 | { |
---|
1373 | def R=basering; |
---|
1374 | module N=L[1]; |
---|
1375 | ideal I=quotient(N,freemodule(nrows(N))); |
---|
1376 | list B=primdecZ(I); |
---|
1377 | list M; |
---|
1378 | if(size(B)==1){return(M);} |
---|
1379 | I=std(I); |
---|
1380 | list rl=ringlist(R); |
---|
1381 | if(deg(I[1])==0) |
---|
1382 | { |
---|
1383 | execute("int p="+string(I[1])+";"); |
---|
1384 | rl[1]=p; |
---|
1385 | } |
---|
1386 | else |
---|
1387 | { |
---|
1388 | rl[1]=0; |
---|
1389 | } |
---|
1390 | def Shelp =ring(rl); |
---|
1391 | setring Shelp; |
---|
1392 | ideal I=imap(R,I); |
---|
1393 | I=std(I); |
---|
1394 | M=Primdec::maxIndependSet(I); |
---|
1395 | setring R; |
---|
1396 | return(M); |
---|
1397 | } |
---|
1398 | |
---|
1399 | |
---|
1400 | static proc extractZM(list M, list L) |
---|
1401 | { |
---|
1402 | //=== M is a list of a pseudo primary module and the corresponding prime |
---|
1403 | //=== L is a list of maximal independent sets for P |
---|
1404 | def R=basering; |
---|
1405 | ideal P=M[2]; |
---|
1406 | module I=M[1]; |
---|
1407 | poly h=1; |
---|
1408 | |
---|
1409 | //=== size(L)=0 means P is maximal ideal and I is primary |
---|
1410 | if(size(L)>0) |
---|
1411 | { |
---|
1412 | if(L[1][3]!=0) |
---|
1413 | { |
---|
1414 | //=== if u in x is an independent set of L then we compute a Groebner |
---|
1415 | //=== Basis in Z[u][x-u] |
---|
1416 | execute("ring S=integer,("+L[1][1]+"),lp;"); |
---|
1417 | module I=imap(R,I); |
---|
1418 | I=std(I); |
---|
1419 | list rl=ringlist(S); |
---|
1420 | rl[1]=0; |
---|
1421 | def Shelp =ring(rl); |
---|
1422 | setring Shelp; |
---|
1423 | module I=imap(S,I); |
---|
1424 | //=== this is our way to obtain the coefficients in Z[u] of the |
---|
1425 | //=== leading terms of the Groebner basis above |
---|
1426 | string quotring=Primdec::prepareQuotientring(nvars(basering)-L[1][3]); |
---|
1427 | execute(quotring); |
---|
1428 | module I=imap(Shelp,I); |
---|
1429 | list C; |
---|
1430 | int i; |
---|
1431 | for(i=1;i<=size(I);i++) |
---|
1432 | { |
---|
1433 | C[i]=leadcoef(I[i]); |
---|
1434 | } |
---|
1435 | setring Shelp; |
---|
1436 | list C=imap(quring,C); |
---|
1437 | setring R; |
---|
1438 | list C=imap(Shelp,C); |
---|
1439 | } |
---|
1440 | else |
---|
1441 | { |
---|
1442 | // this is the case that P=<p>, p prime |
---|
1443 | I=std(I); |
---|
1444 | ideal IC=simplify(flatten(lead(I)),2); |
---|
1445 | list C; |
---|
1446 | int i; |
---|
1447 | for(i=1;i<=size(IC);i++) |
---|
1448 | { |
---|
1449 | C[i]=I[i]; |
---|
1450 | } |
---|
1451 | list rl=ringlist(R); |
---|
1452 | rl[1]=0; |
---|
1453 | def Shelp =ring(rl); |
---|
1454 | } |
---|
1455 | for(i=1;i<=size(C);i++) |
---|
1456 | { |
---|
1457 | if(deg(C[i])>0){h=h*C[i];} // das muss noch besser gemacht werden, |
---|
1458 | // nicht ausmultiplizieren! |
---|
1459 | } |
---|
1460 | setring Shelp; |
---|
1461 | poly h=imap(R,h); |
---|
1462 | ideal fac=factorize(h,1); |
---|
1463 | setring R; |
---|
1464 | list II; |
---|
1465 | h=1; |
---|
1466 | ideal fac=imap(Shelp,fac); |
---|
1467 | for(i=1;i<=size(fac);i++) |
---|
1468 | { |
---|
1469 | II=sat(I,fac[i]); |
---|
1470 | I=II[1]; |
---|
1471 | h=h*fac[i]^II[2]; |
---|
1472 | } |
---|
1473 | } |
---|
1474 | I=std(I); |
---|
1475 | return(list(I,h)); |
---|
1476 | } |
---|
1477 | |
---|
1478 | |
---|
1479 | proc primdecZM(module N) |
---|
1480 | "USAGE: primdecZM(N); N module |
---|
1481 | RETURN: a list pr of primary modules and their associated primes: |
---|
1482 | @format |
---|
1483 | pr[i][1] the i-th primary component, |
---|
1484 | pr[i][2] the i-th prime component. |
---|
1485 | @end format |
---|
1486 | EXAMPLE: example primdecZM; shows an example |
---|
1487 | " |
---|
1488 | { |
---|
1489 | list P,K,S; |
---|
1490 | int i,j; |
---|
1491 | list L=pseudo_primdecZM(N); |
---|
1492 | list M,O; |
---|
1493 | for(i=1;i<=size(L);i++) |
---|
1494 | { |
---|
1495 | if(size(L[i][2])!=0) |
---|
1496 | { |
---|
1497 | M=prepare_extractZM(L[i]); |
---|
1498 | O=extractZM(L[i],M); |
---|
1499 | P[size(P)+1]=list(O[1],L[i][2]); |
---|
1500 | K[size(K)+1]=L[i][1]+O[2]*freemodule(nrows(L[i][1])); |
---|
1501 | } |
---|
1502 | else |
---|
1503 | { |
---|
1504 | P[size(P)+1]=L[i]; |
---|
1505 | } |
---|
1506 | } |
---|
1507 | for(j=1;j<=size(K);j++) |
---|
1508 | { |
---|
1509 | S=primdecZM(K[j]); |
---|
1510 | for(i=1;i<=size(S);i++) |
---|
1511 | { |
---|
1512 | P[size(P)+1]=S[i]; |
---|
1513 | } |
---|
1514 | } |
---|
1515 | return(P); |
---|
1516 | } |
---|
1517 | example |
---|
1518 | { "EXAMPLE:"; echo = 2; |
---|
1519 | ring R=integer,(x,y),(c,lp); |
---|
1520 | module N=[0,0,xy2-x2-xy],[0,y,x],[0,x,2xy-x],[x,0,-xy],[0,0,18x]; |
---|
1521 | primdecZM(N); |
---|
1522 | } |
---|
1523 | |
---|
1524 | |
---|
1525 | //////////////////////////////////////////////////////////////////////////////// |
---|
1526 | |
---|
1527 | /* |
---|
1528 | Examples: |
---|
1529 | |
---|
1530 | //=== IQ[a,b,c,d,e,f,g] intersect Z[a,b,c,d,e,f,g] = I (takes some time) |
---|
1531 | ring R1=integer,(a,b,c,d,e,f,g),dp; |
---|
1532 | ideal I=a2+2de+2cf+2bg+a, |
---|
1533 | 2ab+e2+2df+2cg+b, |
---|
1534 | b2+2ac+2ef+2dg+c, |
---|
1535 | 2bc+2ad+f2+2eg+d, |
---|
1536 | c2+2bd+2ae+2fg+e, |
---|
1537 | 2cd+2be+2af+g2+f, |
---|
1538 | d2+2ce+2bf+2ag+g; |
---|
1539 | |
---|
1540 | ring R2=integer,(a,b,c,d,e,f,g),dp; |
---|
1541 | ideal I=181*32003, |
---|
1542 | a2+2de+2cf+2bg+a, |
---|
1543 | 2ab+e2+2df+2cg+b, |
---|
1544 | b2+2ac+2ef+2dg+c, |
---|
1545 | 2bc+2ad+f2+2eg+d, |
---|
1546 | c2+2bd+2ae+2fg+e, |
---|
1547 | 2cd+2be+2af+g2+f, |
---|
1548 | d2+2ce+2bf+2ag+g; |
---|
1549 | |
---|
1550 | ring R3=integer,(w,z,y,x),dp; |
---|
1551 | ideal I=xzw+(-y^2+y)*z^2, |
---|
1552 | (-x^2+x)*w^2+yzw, |
---|
1553 | ((y^4-2*y^3+y^2)*x-y^4+y^3)*z^3, |
---|
1554 | y2z2w+(-y*4+2*y^3-y^2)*z3; |
---|
1555 | |
---|
1556 | ring R4=integer,(w,z,y,x),dp; |
---|
1557 | ideal I=-2*yxzw+(-yx-y^2+y)*z^2, |
---|
1558 | xw^2-yz^2, |
---|
1559 | (yx^2-(2*y^2+2*y)*x+y^3-2*y^2+y)*z^3, |
---|
1560 | (-2*y^2+2*y)*z^2*w+(yx-3*y^2-y)*z^3; |
---|
1561 | |
---|
1562 | ring R5=integer,(x,y,z),dp; |
---|
1563 | ideal I=x2-y2-z2, |
---|
1564 | xy-z2, |
---|
1565 | y3+xz2-yz2+2z3+xy-z2, |
---|
1566 | -y2z2+2z4+x2-y2+z2, |
---|
1567 | y3z9+3y2z10+3yz11+z12-y2z2+2z4; |
---|
1568 | |
---|
1569 | ring R6=integer,(h, l, s, x, y, z),dp; //takes some time |
---|
1570 | ideal I=hl-l2-4ls+hy, |
---|
1571 | h2s-6ls3+h2z, |
---|
1572 | xh2-l2s-h3; |
---|
1573 | |
---|
1574 | ring R7=integer,(x,y,z),dp; |
---|
1575 | ideal I=x2-y2-(z+2)^2, |
---|
1576 | xy-(z+2)^2, |
---|
1577 | y3+x*(z+2)^2-y*(z+2)^2+2*(z+2)^3+xy-(z+2)^2, |
---|
1578 | -y^2*(z+2)^2+2*(z+2)^4+x2-y2+(z+2)^2, |
---|
1579 | y3z9+3y2z10+3yz11+z12-y2z2+2z4; |
---|
1580 | |
---|
1581 | ring R8=integer,(x,y,z),dp; |
---|
1582 | ideal I=x2-y2-(z+2)^2, |
---|
1583 | xy-(z+2)^2, |
---|
1584 | y3+x*(z+2)^2-y*(z+2)^2+2*(z+2)^3+xy-(z+2)^2, |
---|
1585 | -y^2*(z+2)^2+2*(z+2)^4+x2-y2+(z+2)^2, |
---|
1586 | y3z9+3y2z10+3yz11+z12-y2z2+2z4; |
---|
1587 | |
---|
1588 | ring R9=integer,(w,z,y,x),dp; |
---|
1589 | ideal I=630, |
---|
1590 | ((y^2-y)*x-y^3+y^2)*z^2, |
---|
1591 | (x-y)*zw, |
---|
1592 | (x-y^2)*zw+(-y^2+y)*z^2, |
---|
1593 | (-x^2+x)*w^2+(-yx+y)*zw; |
---|
1594 | |
---|
1595 | ring R10=integer,(w,z,y,x),dp; |
---|
1596 | ideal I=1260, |
---|
1597 | -yxzw+(-y^2+y)*z^2, |
---|
1598 | (-x^2+x)*w^2-yxzw, |
---|
1599 | ((-y^2+y)*x-y^3+2*y^2-y)*z^3, |
---|
1600 | (y^2-y)*z^2*w+(-y^2+y)*z^2*w+(-y^2+y)*z^3; |
---|
1601 | |
---|
1602 | ring R11=integer,(w,z,y,x),dp; |
---|
1603 | ideal I=(4*y^2*x^2+(4*y^3+4*y^2-y)*x-y^2-y)*z^2, |
---|
1604 | (x+y+1)*zw+(-4*y^2*x-4*y^3-4*y^2)*z^2, |
---|
1605 | (-x-2*y^2 - 2*y - 1)*zw + (8*y^3*x + 8*y^4 + 8*y^3 + 2*y^2+y)*z^2, |
---|
1606 | ((y^3 + y^2)*x - y^2 - y)*z^2, |
---|
1607 | (y +1)*zw + (-y^3 -y^2)*z^2, |
---|
1608 | (x + 1)*zw +(- y^2 -y)*z^2, |
---|
1609 | (x^2 +x)*w^2 + (-yx - y)*zw; |
---|
1610 | |
---|
1611 | ring R12=integer,(w,z,y,x),dp; |
---|
1612 | ideal I=72, |
---|
1613 | ((y^3 + y^2)*x - y^2 - y)*z^2, |
---|
1614 | (y + 1)*zw + (-y^3 -y^2)*z^2, |
---|
1615 | (x + 1)*zw + (-y^2 -y)*z^2, (x^2 + x)*w^2 + (-yx - y)*zw; |
---|
1616 | |
---|
1617 | ring R13=integer,(w,z,y,x),dp; |
---|
1618 | ideal I=(((12*y+8)*x^2 +(2*y+2)*x)*zw +((-15*y^2 -4*y)*x-4*y^2 -y)*z^2, |
---|
1619 | -x*w^2 +((-12*y -8)*x+2*y)*zw +(15*y^2+4*y)*z^2, |
---|
1620 | (81*y^4*x^2 +(-54*y^3 -12*y^2)*x-12*y^3 -3*y^2)*z^3, |
---|
1621 | (-24*yx+6*y^2-6*y)*z^2*w + (-81*y^4*x + 81*y^3 + 24*y^2)*z^3, |
---|
1622 | (48*x^2 + (-30*y + 12)*x - 6*y)*z^2*w + ((81*y^3 -54*y^2 -24*y)*x |
---|
1623 | -21*y^2 -6*y)*z^3, |
---|
1624 | (-96*yx-18*y^3 +18*y^2-24*y)*z^2*w +(243*y^5*x-243*y^4 +72*y^3 |
---|
1625 | +48*y^2)*z^3, |
---|
1626 | 6*y*z^2*w^2 +((576*y+384)*x^2 + (-81*y^3 -306*y^2 -168*y+96)*x+81*y^2 |
---|
1627 | -18*y)*z^3*w +((-720*y^2 - 192*y)*x + 450*y^3 - 60*y^2 - 48*y)*z^4); |
---|
1628 | |
---|
1629 | ring R14=integer,(x(1),x(2),x(3),x(4)),dp; |
---|
1630 | ideal I=181*49^2, |
---|
1631 | x(4)^4, |
---|
1632 | x(1)*x(4)^3, |
---|
1633 | x(1)*x(2)*x(4)^2, |
---|
1634 | x(2)^2*x(4)^2, |
---|
1635 | x(2)^2*x(3)*x(4), |
---|
1636 | x(1)*x(2)*x(3)*x(4), |
---|
1637 | x(1)*x(3)^2*x(4), |
---|
1638 | x(3)^3*x(4); |
---|
1639 | |
---|
1640 | |
---|
1641 | ring R15=integer,(x,y,z),dp; |
---|
1642 | ideal I=32003*181*64, |
---|
1643 | ((z^2-z)*y^2 + (z^2 -z)*y)*x; (z*y^3 + z*y^2)*x, |
---|
1644 | (y^4 - y^2)*x, (z^2 - z)*y*x^2, (y^3 - y^2)*x^2, |
---|
1645 | (z^3 - z^2)*x^4 + (2*z^3 -2*z^2)*x^3 + (z^3 -z^2)*x^2, |
---|
1646 | z*y^2*x^2, z*y*x^4 +z*y*x^3, |
---|
1647 | 2*y^2*x^4 +6*y^2*x^3 +6*y^2*x^2 + (y^3 +y^2)*x, z*x^5 + (z^2 +z)*x^4 |
---|
1648 | + (2*z^2 -z)*x^3 + (z^2 -z)*x^2, |
---|
1649 | y*x^6 + 3*y*x^5 + 3*y*x^4 + y*x^3; |
---|
1650 | |
---|
1651 | |
---|
1652 | ring R16=integer,(x(1),x(2),x(3),x(4),x(5)),dp; |
---|
1653 | ideal I=x(5)^5, |
---|
1654 | x(1)*x(5)^4, |
---|
1655 | x(1)*x(2)*x(5)^3, |
---|
1656 | x(2)^2*x(5)^3, |
---|
1657 | x(2)^2*x(3)*x(5)^2, |
---|
1658 | x(1)*x(2)*x(3)*x(5)^2, |
---|
1659 | x(1)*x(3)^2*x(5)^2, |
---|
1660 | x(3)^3*x(5)^2, |
---|
1661 | x(3)^3*x(4)*x(5), |
---|
1662 | x(1)*x(3)^2*x(4)*x(5), |
---|
1663 | x(1)*x(2)*x(3)*x(4)*x(5), |
---|
1664 | x(2)^2*x(3)*x(4)*x(5), |
---|
1665 | x(2)^2*x(4)^2*x(5), |
---|
1666 | x(1)*x(2)*x(4)^2*x(5), |
---|
1667 | x(1)*x(4)^3*x(5), |
---|
1668 | x(4)^4*x(5); |
---|
1669 | I=intersectZ(I,ideal(64*181,x(1)^2)); |
---|
1670 | |
---|
1671 | ring R17=integer,(x,y,z),dp; |
---|
1672 | ideal I=374, |
---|
1673 | (z+2)^8-140z6+2622*(z+2)^4-1820*(z+2)^2+169, |
---|
1674 | 17y*(z+2)^4-374*y*(z+2)^2+221y+2z7-281z5+5240z3-3081z, |
---|
1675 | 204y2+136yz3-3128yz+z6-149z4+2739z2+117, |
---|
1676 | 17xz4-374xz2+221x+2z7-281z5+5240z3-3081z, |
---|
1677 | 136xy-136xz-136yz+2z6-281z4+5376z2-3081, |
---|
1678 | 204x2+136xz3-3128xz+z6-149z4+2739z2+117; |
---|
1679 | |
---|
1680 | ring R18=integer,(B,D,F,b,d,f),dp; |
---|
1681 | ideal I=6, |
---|
1682 | (b-d)*(B-D)-2*F+2, |
---|
1683 | (b-d)*(B+D-2*F)+2*(B-D), |
---|
1684 | (b-d)^2-2*(b+d)+f+1, |
---|
1685 | B^2*b^3-1, |
---|
1686 | D^2*d^3-1, |
---|
1687 | F^2*f^3-1; |
---|
1688 | |
---|
1689 | ring R19=integer,(a,b,c,d,e,f),dp; |
---|
1690 | ideal I=24, |
---|
1691 | 2*(f+2)*b+2ec+d2+a2+a, |
---|
1692 | 2*(f+2)*c+2ed+2ba+b, |
---|
1693 | 2*(f+2)*d+e2+2ca+c+b2, |
---|
1694 | 2*(f+2)*e+2da+d+2cb, |
---|
1695 | (f+2)^2+2ea+e+2db+c2, |
---|
1696 | 2*(f+2)*a+f+2eb+2dc; |
---|
1697 | |
---|
1698 | ring R20=integer,(x,y,z,w,u),dp; |
---|
1699 | ideal I=24, |
---|
1700 | 2x2-2y2+2z2-2w2+2u2-1, |
---|
1701 | 2x3-2y3+2z3-2w3+2u3-1, |
---|
1702 | 2x4-2y4+2z4-2w4+2u4-1, |
---|
1703 | 2x5-2y5+2z5-2w5+2u5-1, |
---|
1704 | 2x6-2y6+2z6-2w6+2u6-1; |
---|
1705 | |
---|
1706 | ring R21=integer,(x,y,z,t,u,v,h),dp; |
---|
1707 | ideal I=66, |
---|
1708 | 2x2+2y2+2z2+2t2+2u2+v2-vh, |
---|
1709 | xy+yz+2zt+2tu+2uv-uh, |
---|
1710 | 2xz+2yt+2zu+u2+2tv-th, |
---|
1711 | 2xt+2yu+2tu+2zv-zh, |
---|
1712 | t2+2xv+2yv+2zv-yh, |
---|
1713 | 2x+2y+2z+2t+2u+v-h, |
---|
1714 | x3+y3+z3+t3+u3+v3; |
---|
1715 | |
---|
1716 | ring R22=integer,(s,p,S,P,T,F,f),dp; |
---|
1717 | ideal I=35, |
---|
1718 | 2*T-S*s-2*F+2, |
---|
1719 | 8*F*p-4*p*S-2*F*s^2+S*s^2+4*T-2*S*s, |
---|
1720 | -2*s-4*p+s^2+f+1, |
---|
1721 | s*T^2-p*s*P-p*S*T-2, |
---|
1722 | p^3*P^2-1, |
---|
1723 | F^2*f^3-1; |
---|
1724 | |
---|
1725 | ring R=integer,(x,y),(c,lp); |
---|
1726 | module N=[0,0,xy2-x2-xy],[0,y,x],[0,x,2xy-x],[x,0,-xy],[0,0,18x]; |
---|
1727 | |
---|
1728 | ring R=integer,(x,y),(c,lp); |
---|
1729 | module N=[0,0,xy2-x2-xy],[0,y,x],[0,x,2xy-x],[x,0,-xy],[0,0,18]; |
---|
1730 | |
---|
1731 | ring R=integer,(x,y),(c,lp); |
---|
1732 | module N=[-y,7,0],[2y3-y2],[3x,y2],[2y-y2,x],[4,5x3]; |
---|
1733 | |
---|
1734 | ring r=integer,(x,y),(c,lp); |
---|
1735 | module N=[0,0,xy2-x2-xy],[0,y,x],[0,x,xy-x],[x,0,-xy],[5x,0,0]; |
---|
1736 | |
---|
1737 | ring R2=integer,(a(1),a(2),a(3),b(1),b(2),b(3)),(c,lp); |
---|
1738 | module N=[a(1)*b(1),a(2)*b(1),a(3)*b(1)],[a(1)*b(2),a(2)*b(2),a(3)*b(2)],[a(1)*b(3),a(2)*b(3),a(3)*b(3)]; |
---|
1739 | |
---|
1740 | ring R3=integer,(x,y,z),(c,lp); |
---|
1741 | module N=[y2+z2,xy,xz],[xy,x2+z2,yz],[xz,yz,x2+y2]; |
---|
1742 | |
---|
1743 | ring R4=integer,(x,y,z,a,b,c),(c,lp); |
---|
1744 | module N=[x3y2z2c,x2y3z2c,x2y2z3c],[x3y2z2b,x2y3z2b,x2y2z3b],[x3y2z2a,x2y3z2a,x2y2z3a]; |
---|
1745 | |
---|
1746 | */ |
---|