1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | |
---|
5 | //====================== Remark 7.1 ============================= |
---|
6 | ring R1 = 0, x, dp; |
---|
7 | poly f1 = 3x7+3x6-18x5-30x4+15x3+63x2+48x+12; |
---|
8 | factorize(f1); |
---|
9 | //-> [1]: |
---|
10 | //-> _[1]=3 |
---|
11 | //-> _[2]=x+1 |
---|
12 | //-> _[3]=x-2 |
---|
13 | //-> [2]: |
---|
14 | //-> 1,5,2 |
---|
15 | factorize(x4-2,1); |
---|
16 | //-> _[1]=x4-2 |
---|
17 | ring R2 = (0,a), x, dp; minpoly = a4-2; |
---|
18 | factorize(x4-2,1); |
---|
19 | //-> _[1]=x2+(a2) |
---|
20 | //-> _[2]=x+(a) |
---|
21 | //-> _[3]=x+(-a) |
---|
22 | ring R3 = 0, (x,y), dp; |
---|
23 | poly f3 = x2y4+y6+2x3y2+2xy4-7x4+7x2y2+14y4+6x3+6xy2+47x2+47y2; |
---|
24 | |
---|
25 | //fixCL: wieso haengt output von factorize( ,1) von random ab??? |
---|
26 | factorize(f3,1); |
---|
27 | //-> _[1]=y4+2xy2-7x2+14y2+6x+47 |
---|
28 | //-> _[2]=x2+y2 |
---|
29 | |
---|
30 | if (not(defined(absFactorize))){ LIB "absfact.lib"; } |
---|
31 | setring R1; |
---|
32 | def R4 = absFactorize(x4-2); |
---|
33 | setring R4; |
---|
34 | absolute_factors; |
---|
35 | //-> [1]: |
---|
36 | //-> _[1]=1 |
---|
37 | //-> _[2]=x+(-a) |
---|
38 | //-> [2]: |
---|
39 | //-> 1,1 |
---|
40 | //-> [3]: |
---|
41 | //-> _[1]=(a) |
---|
42 | //-> _[2]=(a4-2) |
---|
43 | //-> [4]: |
---|
44 | //-> 4 |
---|
45 | setring R3; |
---|
46 | def R5 = absFactorize(f3); |
---|
47 | setring R5; |
---|
48 | absolute_factors; |
---|
49 | //-> [1]: |
---|
50 | //-> _[1]=1/169 |
---|
51 | //-> _[2]=13*y2+(-14a+19)*x+(-7a+94) |
---|
52 | //-> _[3]=x+(a)*y |
---|
53 | //-> [2]: |
---|
54 | //-> 1,1,1 |
---|
55 | //-> [3]: |
---|
56 | //-> _[1]=(a) |
---|
57 | //-> _[2]=(7a2-6a-47) |
---|
58 | //-> _[3]=(a2+1) |
---|
59 | //-> [4]: |
---|
60 | //-> 4 |
---|
61 | |
---|
62 | |
---|
63 | kill R1,R2,R3,R4,R5; |
---|
64 | //====================== Example 7.2 (new Session) ================== |
---|
65 | if (not(defined(absFactorize))){ LIB "absfact.lib"; } |
---|
66 | ring R = 0, (x,y,z), dp; |
---|
67 | poly f = y4+z2-y2*(1-x2); |
---|
68 | def S = absFactorize(f); |
---|
69 | setring S; |
---|
70 | absolute_factors[4]; // number of absolutely irreducible factors |
---|
71 | //-> 1 |
---|
72 | |
---|
73 | |
---|
74 | kill S,R; |
---|
75 | //====================== Example 7.7 (new Session) ================== |
---|
76 | ring R = 0, (a,b,c,d,e,f,g,h), dp; |
---|
77 | ideal I = a+c+d-e-h, 2df+2cg+2eh-2h2-h-1, |
---|
78 | 3df2+3cg2-3eh2+3h3+3h2-e+4h, |
---|
79 | 6bdg-6eh2+6h3-3eh+6h2-e+4h, |
---|
80 | 4df3+4cg3+4eh3-4h4-6h3+4eh-10h2-h-1, |
---|
81 | 8bdfg+8eh3-8h4+4eh2-12h3+4eh-14h2-3h-1, |
---|
82 | 12bdg2+12eh3-12h4+12eh2-18h3+8eh-14h2-h-1, |
---|
83 | -24eh3+24h4-24eh2+36h3-8eh+26h2+7h+1; |
---|
84 | if (not(defined(primdecGTZ))){ LIB "primdec.lib"; } |
---|
85 | int aa = timer; |
---|
86 | list PD = primdecGTZ(I); |
---|
87 | size(PD); |
---|
88 | //-> 9 |
---|
89 | ideal Prime6 = std(PD[6][2]); |
---|
90 | dim(Prime6); |
---|
91 | //-> 2 |
---|
92 | PD[6]; |
---|
93 | //-> [1]: |
---|
94 | //-> _[1]=h2+2h+1 |
---|
95 | //-> _[2]=gh+g |
---|
96 | //-> [...] |
---|
97 | //-> _[15]=-144h5-408h4-384h3-118h2+8e+3h+9 |
---|
98 | //-> _[16]=-144h5-408h4-384h3-118h2+8a+8c+8d-5h+9 |
---|
99 | //-> [2]: |
---|
100 | //-> _[1]=h+1 |
---|
101 | //-> _[2]=g |
---|
102 | //-> _[3]=f |
---|
103 | //-> _[4]=d |
---|
104 | //-> _[5]=-144h5-408h4-384h3-118h2+8e+3h+9 |
---|
105 | //-> _[6]=-144h5-408h4-384h3-118h2+8a+8c+8d-5h+9 |
---|
106 | ideal check = std(radical(PD[6][1])); |
---|
107 | check; |
---|
108 | //-> check[1]=h+1 |
---|
109 | //-> check[2]=g |
---|
110 | //-> check[3]=f |
---|
111 | //-> check[4]=e+1 |
---|
112 | //-> check[5]=d |
---|
113 | //-> check[6]=a+c+2 |
---|
114 | size(reduce(Prime6,check,1)); |
---|
115 | //-> 0 |
---|
116 | size(reduce(check,Prime6,1)); |
---|
117 | //-> 0 |
---|
118 | ideal EI = equidimMax(I); |
---|
119 | dim(std(EI)); |
---|
120 | //-> 3 |
---|
121 | list PDEI = primdecGTZ(EI); |
---|
122 | size(PDEI); |
---|
123 | //-> 3 |
---|
124 | aa = timer; |
---|
125 | def S = absPrimdecGTZ(I); |
---|
126 | setring S; |
---|
127 | absolute_primes[6]; |
---|
128 | //-> [1]: |
---|
129 | //-> _[1]=@c |
---|
130 | //-> _[2]=h+1 |
---|
131 | //-> [...] |
---|
132 | //-> _[7]=a+c+2 |
---|
133 | //-> [2]: |
---|
134 | //-> 1 |
---|
135 | absolute_primes[9]; |
---|
136 | //-> [1]: |
---|
137 | //-> _[1]=12*@c^2+12*@c+1 |
---|
138 | //-> _[2]=h-@c |
---|
139 | //-> _[3]=2*g+2*@c+1 |
---|
140 | //-> _[4]=f+2*@c+1 |
---|
141 | //-> _[5]=e+1 |
---|
142 | //-> _[6]=4*d+@c+1 |
---|
143 | //-> _[7]=2*c+@c+1 |
---|
144 | //-> _[8]=b+2*@c+1 |
---|
145 | //-> _[9]=4*a-7*@c+1 |
---|
146 | //-> [2]: |
---|
147 | //-> 2 |
---|
148 | int num_abs_primes; |
---|
149 | for (int j=1; j<=size(absolute_primes); j++) |
---|
150 | { num_abs_primes = num_abs_primes + absolute_primes[j][2]; } |
---|
151 | num_abs_primes; |
---|
152 | //-> 12 |
---|
153 | |
---|
154 | |
---|
155 | kill R,aa,S,num_abs_primes,j; |
---|
156 | //====================== Remark 7.8 (new Session) ================== |
---|
157 | if (not(defined(primdecGTZ))){ LIB "primdec.lib"; } |
---|
158 | ring R = 0, (x,y), dp; |
---|
159 | ideal I = xy, y2; // ideal is mixed |
---|
160 | list LI = equidim(I); |
---|
161 | LI; |
---|
162 | //-> [1]: |
---|
163 | //-> _[1]=y |
---|
164 | //-> _[2]=x |
---|
165 | //-> [2]: |
---|
166 | //-> _[1]=y |
---|
167 | intersect(LI[1],LI[2]); |
---|
168 | //-> _[1]=y |
---|
169 | ideal J = xy, y3-2y2+y; |
---|
170 | list LJ = equidim(J); |
---|
171 | LJ; |
---|
172 | //-> [1]: |
---|
173 | //-> _[1]=x |
---|
174 | //-> _[2]=y2-2y+1 |
---|
175 | //-> [2]: |
---|
176 | //-> _[1]=y |
---|
177 | intersect(LJ[1],LJ[2]); |
---|
178 | //-> _[1]=xy |
---|
179 | //-> _[2]=y3-2y2+y |
---|
180 | |
---|
181 | |
---|
182 | kill R; |
---|
183 | //==================== Example 7.10 (new Session) ================== |
---|
184 | if (not(defined(normal))){ LIB "normal.lib"; } |
---|
185 | ring R = 0, (x,y,z), dp; |
---|
186 | ideal I = z-x4, z-y6; |
---|
187 | list nor = normal(I); |
---|
188 | //-> // 'normal' created a list of 1 ring(s) |
---|
189 | def R1 = nor[1]; setring R1; R1; |
---|
190 | //-> // characteristic : 0 |
---|
191 | //-> // number of vars : 2 |
---|
192 | //-> // block 1 : ordering a |
---|
193 | //-> // : names T(1) T(2) |
---|
194 | //-> // : weights 1 0 |
---|
195 | //-> // block 2 : ordering dp |
---|
196 | //-> // : names T(1) T(2) |
---|
197 | //-> // block 3 : ordering C |
---|
198 | norid; |
---|
199 | //-> norid[1]=T(2)^2-1 |
---|
200 | normap; |
---|
201 | //-> normap[1]=T(1)^3*T(2)^2 |
---|
202 | //-> normap[2]=T(1)^2*T(2) |
---|
203 | //-> normap[3]=T(1)^12*T(2)^8 |
---|
204 | setring R; |
---|
205 | primdecGTZ(I); |
---|
206 | //-> [1]: |
---|
207 | //-> [1]: |
---|
208 | //-> _[1]=y6-z |
---|
209 | //-> _[2]=-y3+x2 |
---|
210 | //-> [2]: |
---|
211 | //-> _[1]=y6-z |
---|
212 | //-> _[2]=-y3+x2 |
---|
213 | //-> [2]: |
---|
214 | //-> [1]: |
---|
215 | //-> _[1]=y6-z |
---|
216 | //-> _[2]=y3+x2 |
---|
217 | //-> [2]: |
---|
218 | //-> _[1]=y6-z |
---|
219 | //-> _[2]=y3+x2 |
---|
220 | list NOR = normal(I,1); |
---|
221 | //-> // 'normal' created a list of 2 ring(s). |
---|
222 | R1=NOR[1]; // the 1st ring |
---|
223 | setring R1; R1; |
---|
224 | //-> // characteristic : 0 |
---|
225 | //-> // number of vars : 1 |
---|
226 | //-> // block 1 : ordering dp |
---|
227 | //-> // : names T(1) |
---|
228 | //-> // block 2 : ordering C |
---|
229 | norid; |
---|
230 | //-> norid[1]=0 |
---|
231 | normap; |
---|
232 | //-> normap[1]=T(1)^3 |
---|
233 | //-> normap[2]=-T(1)^2 |
---|
234 | //-> normap[3]=T(1)^12 |
---|
235 | def R2=NOR[2]; // the 2nd ring |
---|
236 | setring R2; R2; |
---|
237 | //-> // characteristic : 0 |
---|
238 | //-> // number of vars : 1 |
---|
239 | //-> // block 1 : ordering dp |
---|
240 | //-> // : names T(1) |
---|
241 | //-> // block 2 : ordering C |
---|
242 | norid; |
---|
243 | //-> norid[1]=0 |
---|
244 | normap; |
---|
245 | //-> normap[1]=T(1)^3 |
---|
246 | //-> normap[2]=T(1)^2 |
---|
247 | //-> normap[3]=T(1)^12 |
---|
248 | |
---|
249 | |
---|
250 | kill R,nor,R1,NOR,R2; |
---|
251 | //==================== Example 7.11 (new Session) ================== |
---|
252 | if (not(defined(normal))){ LIB "normal.lib"; } |
---|
253 | ring R = 0, x(1..3), dp; |
---|
254 | poly f1 = -x(1)^3*x(2)^3*x(3)^2-x(1)^3*x(2)*x(3)^4 |
---|
255 | -x(1)*x(2)^3*x(3)^4+x(1)^5*x(2)^2+x(1)^5*x(3)^2 |
---|
256 | +x(1)^3*x(2)^2*x(3)^2+x(1)^2*x(2)^2*x(3)^3 |
---|
257 | -x(1)^4*x(2)*x(3); |
---|
258 | poly f2 = -x(1)^2*x(2)^3*x(3)^5-x(1)^2*x(2)*x(3)^7-x(2)^3*x(3)^7 |
---|
259 | +x(1)^2*x(2)^5*x(3)^2+x(1)^4*x(2)^2*x(3)^3+x(2)^5*x(3)^4 |
---|
260 | +x(1)^4*x(3)^5+x(1)^2*x(2)^2*x(3)^5-x(1)^2*x(2)*x(3)^6 |
---|
261 | +x(1)*x(2)^2*x(3)^6-x(2)^3*x(3)^6-x(1)^4*x(2)^4 |
---|
262 | -x(1)^2*x(2)^4*x(3)^2-x(1)*x(2)^4*x(3)^3+x(1)^4*x(3)^4 |
---|
263 | -x(1)^3*x(2)*x(3)^4+x(1)^2*x(2)^2*x(3)^4 |
---|
264 | +x(1)*x(2)^2*x(3)^5+x(1)^3*x(2)^3*x(3) |
---|
265 | -x(1)^3*x(2)*x(3)^3; |
---|
266 | ideal I = f1, f2; |
---|
267 | list NOR = normal(I); |
---|
268 | //-> // 'normal' created a list of 3 ring(s). |
---|
269 | def R1 = NOR[1]; // the 1st ring |
---|
270 | setring R1; |
---|
271 | norid; |
---|
272 | //-> norid[1]=T(3)2+T(4)2+T(4)T(5)-T(4) |
---|
273 | //-> norid[2]=T(2)T(3)+T(1)T(4)+T(1)T(5)-T(1) |
---|
274 | //-> norid[3]=T(1)T(3)-T(2)T(4) |
---|
275 | //-> norid[4]=T(2)2+T(4)T(5)+T(5)2-T(5) |
---|
276 | //-> norid[5]=T(1)T(2)-T(3)T(5) |
---|
277 | //-> norid[6]=T(1)2-T(4)T(5) |
---|
278 | normap; |
---|
279 | //-> normap[1]=T(1) |
---|
280 | //-> normap[2]=T(2) |
---|
281 | //-> normap[3]=T(3) |
---|
282 | def R2 = NOR[2]; // the 2nd ring |
---|
283 | setring R2; norid; |
---|
284 | //-> norid[1]=0 |
---|
285 | normap; |
---|
286 | //-> normap[1]=T(1)T(2) |
---|
287 | //-> normap[2]=T(2)2 |
---|
288 | //-> normap[3]=T(1) |
---|
289 | def R3 = NOR[3]; // the 3rd ring |
---|
290 | setring R3; norid; |
---|
291 | //-> norid[1]=0 |
---|
292 | normap; |
---|
293 | //-> normap[1]=0 |
---|
294 | //-> normap[2]=T(1)3-T(1) |
---|
295 | //-> normap[3]=T(1)2-1 |
---|
296 | setring R; |
---|
297 | primdecGTZ(I); |
---|
298 | //-> [1]: |
---|
299 | //-> [1]: |
---|
300 | //-> _[1]=-x(2)*x(3)^2+x(1)^2 |
---|
301 | //-> [2]: |
---|
302 | //-> _[1]=-x(2)*x(3)^2+x(1)^2 |
---|
303 | //-> [2]: |
---|
304 | //-> [1]: |
---|
305 | //-> _[1]=x(1)^2*x(2)^2+x(1)^2*x(3)^2+x(2)^2*x(3)^2-x(1)*x(2)*x(3) |
---|
306 | //-> [2]: |
---|
307 | //-> _[1]=x(1)^2*x(2)^2+x(1)^2*x(3)^2+x(2)^2*x(3)^2-x(1)*x(2)*x(3) |
---|
308 | //-> [3]: |
---|
309 | //-> [1]: |
---|
310 | //-> _[1]=-x(3)^3+x(2)^2-x(3)^2 |
---|
311 | //-> _[2]=x(1) |
---|
312 | //-> [2]: |
---|
313 | //-> _[1]=-x(3)^3+x(2)^2-x(3)^2 |
---|
314 | //-> _[2]=x(1) |
---|
315 | |
---|
316 | tst_status(1);$ |
---|
317 | |
---|