source: git/Tst/BuchDL/Ex_L7.tst @ e29fac

spielwiese
Last change on this file since e29fac was 9558c5f, checked in by Hans Schönemann <hannes@…>, 19 years ago
*hannes/lossen: very long examples from DL-Book git-svn-id: file:///usr/local/Singular/svn/trunk@8762 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 7.7 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4
5//======================  Remark 7.1 =============================
6ring R1 = 0, x, dp;
7poly f1 = 3x7+3x6-18x5-30x4+15x3+63x2+48x+12;
8factorize(f1);
9//->   [1]:
10//->      _[1]=3
11//->      _[2]=x+1
12//->      _[3]=x-2
13//->   [2]:
14//->      1,5,2
15factorize(x4-2,1);
16//->   _[1]=x4-2
17ring R2 = (0,a), x, dp;  minpoly = a4-2;
18factorize(x4-2,1);
19//->   _[1]=x2+(a2)
20//->   _[2]=x+(a)
21//->   _[3]=x+(-a)
22ring R3 = 0, (x,y), dp;
23poly f3 = x2y4+y6+2x3y2+2xy4-7x4+7x2y2+14y4+6x3+6xy2+47x2+47y2;
24
25//fixCL: wieso haengt output von factorize( ,1) von random ab???
26factorize(f3,1);
27//->   _[1]=y4+2xy2-7x2+14y2+6x+47
28//->   _[2]=x2+y2
29
30if (not(defined(absFactorize))){ LIB "absfact.lib"; }
31setring R1;
32def R4 = absFactorize(x4-2);
33setring R4;
34absolute_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
45setring R3;
46def R5 = absFactorize(f3);
47setring R5;
48absolute_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
63kill R1,R2,R3,R4,R5;
64//======================  Example 7.2 (new Session) ==================
65if (not(defined(absFactorize))){ LIB "absfact.lib"; }
66ring R = 0, (x,y,z), dp;
67poly f = y4+z2-y2*(1-x2);
68def S = absFactorize(f);
69setring S;
70absolute_factors[4];  // number of absolutely irreducible factors
71//->   1
72
73
74kill S,R;
75//======================  Example 7.7 (new Session) ==================
76ring R = 0, (a,b,c,d,e,f,g,h), dp;
77ideal 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;
84if (not(defined(primdecGTZ))){ LIB "primdec.lib"; }
85int aa = timer;
86list PD = primdecGTZ(I);
87size(PD);
88//->   9   
89ideal Prime6 = std(PD[6][2]);
90dim(Prime6);
91//->   2
92PD[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
106ideal check = std(radical(PD[6][1]));
107check;
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
114size(reduce(Prime6,check,1));
115//->   0
116size(reduce(check,Prime6,1));
117//->   0
118ideal EI = equidimMax(I);
119dim(std(EI));
120//->   3
121list PDEI = primdecGTZ(EI);
122size(PDEI);
123//->   3
124aa = timer;
125def S = absPrimdecGTZ(I);
126setring S;
127absolute_primes[6];
128//->   [1]:
129//->      _[1]=@c
130//->      _[2]=h+1
131//->           [...]
132//->      _[7]=a+c+2
133//->   [2]:
134//->      1
135absolute_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
148int num_abs_primes;
149for (int j=1; j<=size(absolute_primes); j++)
150  { num_abs_primes = num_abs_primes + absolute_primes[j][2]; }
151num_abs_primes;
152//->   12
153
154
155kill R,aa,S,num_abs_primes,j;
156//======================  Remark 7.8 (new Session) ==================
157if (not(defined(primdecGTZ))){ LIB "primdec.lib"; }
158ring R = 0, (x,y), dp;
159ideal I = xy, y2;        // ideal is mixed
160list LI = equidim(I);
161LI;
162//->   [1]:
163//->      _[1]=y
164//->      _[2]=x
165//->   [2]:
166//->      _[1]=y
167intersect(LI[1],LI[2]);
168//->   _[1]=y
169ideal J = xy, y3-2y2+y;
170list LJ = equidim(J);
171LJ;
172//->   [1]:
173//->      _[1]=x
174//->      _[2]=y2-2y+1
175//->   [2]:
176//->      _[1]=y
177intersect(LJ[1],LJ[2]);
178//->   _[1]=xy
179//->   _[2]=y3-2y2+y
180
181
182kill R;
183//====================  Example 7.10 (new Session) ==================
184if (not(defined(normal))){ LIB "normal.lib"; }
185ring R = 0, (x,y,z), dp;
186ideal I = z-x4, z-y6;
187list nor = normal(I);
188//->   // 'normal' created a list of 1 ring(s)
189def 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
198norid;
199//->   norid[1]=T(2)^2-1
200normap;
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
204setring R;
205primdecGTZ(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
220list NOR = normal(I,1);
221//->   // 'normal' created a list of 2 ring(s).
222R1=NOR[1];        // the 1st ring
223setring R1; R1;
224//->   //   characteristic : 0
225//->   //   number of vars : 1
226//->   //        block   1 : ordering dp
227//->   //                  : names    T(1)
228//->   //        block   2 : ordering C
229norid;
230//->   norid[1]=0
231normap;
232//->   normap[1]=T(1)^3
233//->   normap[2]=-T(1)^2
234//->   normap[3]=T(1)^12
235def R2=NOR[2];    // the 2nd ring
236setring R2; R2;
237//->   //   characteristic : 0
238//->   //   number of vars : 1
239//->   //        block   1 : ordering dp
240//->   //                  : names    T(1)
241//->   //        block   2 : ordering C
242norid;
243//->   norid[1]=0
244normap;
245//->   normap[1]=T(1)^3
246//->   normap[2]=T(1)^2
247//->   normap[3]=T(1)^12
248
249
250kill R,nor,R1,NOR,R2;
251//====================  Example 7.11 (new Session) ==================
252if (not(defined(normal))){ LIB "normal.lib"; }
253ring R = 0, x(1..3), dp;
254poly 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);
258poly 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;
266ideal I = f1, f2; 
267list NOR = normal(I);
268//->   // 'normal' created a list of 3 ring(s).
269def R1 = NOR[1];      // the 1st ring
270setring R1;
271norid;
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)
278normap;
279//->   normap[1]=T(1)
280//->   normap[2]=T(2)
281//->   normap[3]=T(3)
282def R2 = NOR[2];      // the 2nd ring
283setring R2;  norid;
284//->   norid[1]=0
285normap;
286//->   normap[1]=T(1)T(2)
287//->   normap[2]=T(2)2
288//->   normap[3]=T(1)
289def R3 = NOR[3];      // the 3rd ring
290setring R3;  norid;
291//->   norid[1]=0
292normap;
293//->   normap[1]=0
294//->   normap[2]=T(1)3-T(1)
295//->   normap[3]=T(1)2-1
296setring R;
297primdecGTZ(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
316tst_status(1);$
317
Note: See TracBrowser for help on using the repository browser.