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