1 | // $Id: paramet.lib,v 1.2 1998-08-08 09:47:46 obachman Exp $ |
---|
2 | // author : Thomas Keilen email: keilen@mathematik.uni-kl.de |
---|
3 | // last change: 07.08.98 |
---|
4 | /////////////////////////////////////////////////////////////////////////////// |
---|
5 | |
---|
6 | version="$Id: paramet.lib,v 1.2 1998-08-08 09:47:46 obachman Exp $"; |
---|
7 | info=" |
---|
8 | LIBRARY: paramet.lib PROCEDURES FOR PARAMETRIZATION OF PRIMARY |
---|
9 | DECOMPOSITION, ETC. |
---|
10 | |
---|
11 | parametrize(I); parametrizes a prime ideal if possible via the |
---|
12 | normalization |
---|
13 | parametrizepd(I); calculates the primary decomp. and parametrizes |
---|
14 | the components |
---|
15 | parametrizesing(f); parametrize an isolated plane curve singularity |
---|
16 | "; |
---|
17 | |
---|
18 | /////////////////////////////////////////////////////////////////////////////// |
---|
19 | LIB "normal.lib"; |
---|
20 | LIB "hnoether.lib"; |
---|
21 | /////////////////////////////////////////////////////////////////////////////// |
---|
22 | |
---|
23 | |
---|
24 | proc parametrize(ideal I) |
---|
25 | "USAGE: parametrize(); I ideal in an arbitrary number of variables, |
---|
26 | whose radical is prime, in a ring with global ordering |
---|
27 | RETURN: a list containing the parametrization ideal resp. the original ideal, |
---|
28 | the number of variables needed for the parametrization resp. 0, and |
---|
29 | 1 resp. 0 depending on whether the parametrization was successful |
---|
30 | or not |
---|
31 | NOTE: if successful, the basering is changed to the parametrization ring; |
---|
32 | the result will be incorrect, if the parametrization needs more than |
---|
33 | two variables |
---|
34 | EXAMPLE: example parametrize; shows an example |
---|
35 | " |
---|
36 | { |
---|
37 | def BAS=basering; |
---|
38 | ideal newI=radical(std(I)); |
---|
39 | int d=dim(std(newI)); |
---|
40 | if (size(primdecGTZ(newI))==1) |
---|
41 | { |
---|
42 | list nor=normal(newI); |
---|
43 | def N=nor[1]; |
---|
44 | ring PR=0,(s,t),dp; |
---|
45 | setring N; |
---|
46 | // If the ideal is zero dimensional, the procedure works as well in good cases. |
---|
47 | if ((size(KK)==0) or (d==0)) |
---|
48 | { |
---|
49 | // Map the parametrization to the parametrization basering PR. |
---|
50 | setring PR; |
---|
51 | map p=N,(s,t); |
---|
52 | ideal para=p(PP); |
---|
53 | export para; |
---|
54 | // The i-th list component contains the parametrization, the |
---|
55 | // number of necessary variables, and the information, if |
---|
56 | // the parametrization was successful. |
---|
57 | list param=para,d,1; |
---|
58 | // if (d==0) |
---|
59 | // { |
---|
60 | // Include sometime a test, whether the maximal ideal I is of the form |
---|
61 | // (x-a,y-b,z-c), since only then PP=(a,b,c). |
---|
62 | // } |
---|
63 | setring BAS; |
---|
64 | export(PR); |
---|
65 | keepring(PR); |
---|
66 | } |
---|
67 | else |
---|
68 | { |
---|
69 | list param=I,0,0; |
---|
70 | } |
---|
71 | } |
---|
72 | else |
---|
73 | { |
---|
74 | setring BAS; |
---|
75 | list param=I,0,0; |
---|
76 | } |
---|
77 | return(param); |
---|
78 | } |
---|
79 | example |
---|
80 | { "EXAMPLE:";echo = 2; |
---|
81 | ring RING=0,(x,y,z),dp; |
---|
82 | ideal I=z2-y2x2+x3; |
---|
83 | parametrize(I); |
---|
84 | } |
---|
85 | /////////////////////////////////////////////////////////////////////////////// |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | proc parametrizepd(ideal I) |
---|
90 | "USAGE: parametrizepd(); I ideal in a polynomial ring with global ordering |
---|
91 | RETURN: a list of lists, where each entry contains the parametrization |
---|
92 | of a primary component of I resp. 0, the number of variables |
---|
93 | resp. 0, and 1 resp. 0 depending on whether the parametrization |
---|
94 | of the component was successful or not |
---|
95 | NOTE: the basering will be changed to PR=0,(s,t),dp |
---|
96 | the result will be incorrect, if the parametrization needs more than two |
---|
97 | variables |
---|
98 | EXAMPLE: example parametrizepd; shows an example |
---|
99 | " |
---|
100 | { |
---|
101 | list primary,no,nor,para,param; |
---|
102 | def BAS=basering; |
---|
103 | ring PR=0,(s,t),dp; |
---|
104 | ideal max=s,t; |
---|
105 | setring BAS; |
---|
106 | primary=primdecGTZ(I); |
---|
107 | for (int ii=1; ii<=size(primary); ii=ii+1) |
---|
108 | { |
---|
109 | no=normal(std(primary[ii][2])); |
---|
110 | nor[ii]=no[1]; |
---|
111 | def N=nor[ii]; |
---|
112 | setring N; |
---|
113 | int d=dim(std(KK)); |
---|
114 | // Test if the normalization is K, K[s] or K[s,t]. Then give back the parametrization. |
---|
115 | if (size(KK)==0) |
---|
116 | { |
---|
117 | setring PR; |
---|
118 | map p=N,max; |
---|
119 | para[ii]=p(PP); |
---|
120 | // export para[ii]; |
---|
121 | // list inter=para[ii],nvars(N),1; |
---|
122 | list inter=para[ii],d,1; |
---|
123 | // if (d==0) |
---|
124 | // { |
---|
125 | // Include sometime a test, whether the maximal ideal I is of the form |
---|
126 | // (x-a,y-b,z-c), since only then PP=(a,b,c). |
---|
127 | // } |
---|
128 | param[ii]=inter; |
---|
129 | kill inter; |
---|
130 | setring BAS; |
---|
131 | } |
---|
132 | else |
---|
133 | { |
---|
134 | setring PR; |
---|
135 | list inter=0,0,0; |
---|
136 | param[ii]=inter; |
---|
137 | kill inter; |
---|
138 | setring BAS; |
---|
139 | } |
---|
140 | } |
---|
141 | export nor; |
---|
142 | setring PR; |
---|
143 | export PR; |
---|
144 | keepring PR; |
---|
145 | return(param); |
---|
146 | } |
---|
147 | example |
---|
148 | { "EXAMPLE:";echo = 2; |
---|
149 | ring RING=0,(x,y,z),dp; |
---|
150 | ideal I=(x2-y2z2+z3)*(x2-z2-z3),(x2-y2z2+z3)*yz; |
---|
151 | parametrizepd(I); |
---|
152 | } |
---|
153 | ///////////////////////////////////////////////////////////////////////////// |
---|
154 | |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | proc parametrizesing(poly f) |
---|
159 | "USAGE: parametrizesing(); f a polynomial in two variables with ordering ls or ds |
---|
160 | RETURN: a list containing the parametrizations of the different branches of the |
---|
161 | singularity at the origin resp. 0, if f was not of the desired kind |
---|
162 | NOTE: if successful, the basering is changed to ring 0,(x,y),ls; |
---|
163 | EXAMPLE: example parametrizesing; shows an example |
---|
164 | " |
---|
165 | { |
---|
166 | list hn,para; |
---|
167 | if (nvars(basering)==2 and |
---|
168 | (find(ordstr(basering), "ls") > 0 || |
---|
169 | find(ordstr(basering), "ds") > 0 || |
---|
170 | find(ordstr(basering), "lp") > 0)) |
---|
171 | { |
---|
172 | hn = reddevelop(f); |
---|
173 | for (int ii=1; ii<=size(hn); ii++) |
---|
174 | { |
---|
175 | para[ii]=param(hn[ii]); |
---|
176 | } |
---|
177 | } |
---|
178 | else |
---|
179 | { |
---|
180 | para[1]=0; |
---|
181 | } |
---|
182 | keepring basering; |
---|
183 | return(para); |
---|
184 | } |
---|
185 | example |
---|
186 | { "EXAMPLE:";echo = 2; |
---|
187 | ring RING=0,(x,y),ls; |
---|
188 | poly f=(x^2-y^3)*(x^2-y^2-y^3); |
---|
189 | parametrizesing(f); |
---|
190 | } |
---|
191 | /////////////////////////////////////////////////////////////////////////////// |
---|
192 | |
---|
193 | |
---|
194 | |
---|
195 | |
---|
196 | |
---|
197 | /////////////////////////////////////////////////////////////////////////////// |
---|
198 | //////// Examples |
---|
199 | /////////////////////////////////////////////////////////////////////////////// |
---|
200 | /* |
---|
201 | |
---|
202 | /// Examples for parametrize |
---|
203 | |
---|
204 | /// Example 1 |
---|
205 | |
---|
206 | ring r=0,(x,y),dp; |
---|
207 | ideal i=x^2-y^3; |
---|
208 | parametrize(i); |
---|
209 | |
---|
210 | /// Example 2 |
---|
211 | |
---|
212 | ring r=0,(x,y,z),dp; |
---|
213 | ideal i=x2-y2z2-y3; |
---|
214 | parametrize(i); |
---|
215 | |
---|
216 | /// Example 3 |
---|
217 | |
---|
218 | ring r=0,(x,y,z),dp; |
---|
219 | ideal i=z2-x2y; |
---|
220 | parametrize(i); |
---|
221 | |
---|
222 | /// Example 4 |
---|
223 | |
---|
224 | ring r=0,(x,y,z),dp; |
---|
225 | ideal i=z2-x2y; |
---|
226 | parametrize(i); |
---|
227 | |
---|
228 | /// Example 5 |
---|
229 | |
---|
230 | ring r=0,(x,y,z),dp; |
---|
231 | ideal i=x2-y3; |
---|
232 | parametrize(i); |
---|
233 | |
---|
234 | /// Example 6 |
---|
235 | |
---|
236 | ring r=0,(x,y,z),dp; |
---|
237 | ideal i=y2-xz,z2-x2y,x3-yz; |
---|
238 | parametrize(i); |
---|
239 | |
---|
240 | /// Example 7 - ideal is not prime |
---|
241 | |
---|
242 | ring r=0,(x,y),dp; |
---|
243 | ideal i=xy; |
---|
244 | parametrize(i); |
---|
245 | |
---|
246 | /// Example 8 - you get a parametrization of the reduced ideal |
---|
247 | |
---|
248 | ring r=0,(x,y),dp; |
---|
249 | ideal i=x2; |
---|
250 | parametrize(i); |
---|
251 | |
---|
252 | /// Example 9 - wrong ordering |
---|
253 | |
---|
254 | ring r=0,(x,y),ls; |
---|
255 | ideal i=x2-y3; |
---|
256 | parametrize(i); |
---|
257 | |
---|
258 | |
---|
259 | |
---|
260 | |
---|
261 | |
---|
262 | ///////////////////////////////////////////////////////////////////// |
---|
263 | |
---|
264 | /// Examples for parametrizepd |
---|
265 | |
---|
266 | /// Example 1 |
---|
267 | ring r=0,(x,y,z),dp; |
---|
268 | ideal i=y2z5-x2y2z2+y2z4-z6-z5+x4-x2z2,-y3z3+yz4+x2yz; |
---|
269 | parametrizepd(i); |
---|
270 | |
---|
271 | /// Example 2 |
---|
272 | |
---|
273 | ring r=0,(x,y,z),dp; |
---|
274 | ideal i=z^2-x^2*y,y^2-x*z; |
---|
275 | parametrizepd(i); |
---|
276 | |
---|
277 | /// Example 3 |
---|
278 | |
---|
279 | ring r=0,(x,y,z),dp; |
---|
280 | ideal i=y^5*z^2-x^2*y^6-x*y^3*z^3+x^3*y^4*z-x^4*y^2*z^2+x^6*y^3+x^5*z^3-x^7*y*z,y^6*z^2-x^2*y^7-2*x^4*y^3*z^2+2*x^6*y^4+x^8*z^2-x^(10)*y; |
---|
281 | parametrizepd(i); |
---|
282 | |
---|
283 | /// Example 4 |
---|
284 | |
---|
285 | ring r=0,(x,y,z),dp; |
---|
286 | ideal i=y^6*z^2-x^2*y^7-x*y^4*z^3+x^3*y^5*z-x^3*y^2*z^2+x^5*y^3+x^4*z^3-x^6*y*z,y^8*z^2-x^2*y^9-2*x^3*y^4*z^2+2*x^5*y^5+x^6*z^2-x^8*y; |
---|
287 | parametrizepd(i); |
---|
288 | |
---|
289 | /// Example 5 - gives a parametrization which is not suitable for plotting reasons |
---|
290 | |
---|
291 | ring r=0,(x,y,z,u),dp; |
---|
292 | ideal i=x-zu,y2-zu2; |
---|
293 | parametrizepd(i); |
---|
294 | |
---|
295 | /// Example 6 - one component has no parametrization |
---|
296 | |
---|
297 | ring r=0,(x,y,z),dp; |
---|
298 | ideal i=-x2y3+x3yz+y2z2-xz3,y2z-xz2; |
---|
299 | parametrizepd(i); |
---|
300 | |
---|
301 | /// Example 7 - wrong ordering! |
---|
302 | |
---|
303 | ring r=0,(x,y,z),ls; |
---|
304 | ideal i=x2-y2z2-y3; |
---|
305 | parametrizepd(i); |
---|
306 | |
---|
307 | |
---|
308 | |
---|
309 | /////////////////////////////////////////////////////////////////// |
---|
310 | |
---|
311 | /// Examples for parametrizesing |
---|
312 | |
---|
313 | /// Example 1 |
---|
314 | |
---|
315 | ring r=0,(x,y),ls; |
---|
316 | poly f=x^2-y^3; |
---|
317 | parametrizesing(f); |
---|
318 | |
---|
319 | /// Example 2 |
---|
320 | |
---|
321 | ring r=0,(x,y),ls; |
---|
322 | poly f=x^3+y^3-3*x*y; |
---|
323 | parametrizesing(f); |
---|
324 | |
---|
325 | /// Example 3 |
---|
326 | |
---|
327 | ring r=0,(x,y),ls; |
---|
328 | poly f=y*x^2-y^8; |
---|
329 | parametrizesing(f); |
---|
330 | |
---|
331 | /// Example 4 |
---|
332 | |
---|
333 | ring r=0,(x,y),ls; |
---|
334 | poly f=-x6-x5+2x3y2+x2y2-y4; |
---|
335 | parametrizesing(f); |
---|
336 | |
---|
337 | /// Example 5 |
---|
338 | |
---|
339 | ring r=0,(x,y),ls; |
---|
340 | poly f=x6y4-x8y+x5y4-2x3y6-x7y+2x5y3-x2y6+y8+x4y3-x2y5; |
---|
341 | parametrizesing(f); |
---|
342 | |
---|
343 | /// Example 6 - wrong number of variables |
---|
344 | |
---|
345 | ring r=0,(x,y,z),dp; |
---|
346 | poly f=x2-y2z2-y3; |
---|
347 | parametrizesing(f); |
---|
348 | |
---|
349 | /// Example 7 - wrong ring ordering |
---|
350 | |
---|
351 | ring r=0,(x,y),lp; |
---|
352 | poly f=x2-y3; |
---|
353 | parametrizesing(f); |
---|
354 | |
---|
355 | |
---|
356 | /// To do: |
---|
357 | /// 1) Make sure that the result of parametrize/parametrizepd is correct |
---|
358 | /// for any number of variables needed. |
---|
359 | /// 2) Let these two print more detailed failure reasons. |
---|
360 | /// 3) Let these two check, if the input is inside a ring with global ordering. |
---|
361 | /// 4) Include a better check, whether some variable in the normalization can |
---|
362 | /// be dropped. |
---|
363 | |
---|
364 | |
---|
365 | */ |
---|