source: git/Singular/LIB/paramet.lib @ aba9c86

spielwiese
Last change on this file since aba9c86 was aba9c86, checked in by Olaf Bachmann <obachman@…>, 25 years ago
*** empty log message *** git-svn-id: file:///usr/local/Singular/svn/trunk@2468 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100755
File size: 8.4 KB
Line 
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
6version="$Id: paramet.lib,v 1.2 1998-08-08 09:47:46 obachman Exp $";
7info="
8LIBRARY:  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///////////////////////////////////////////////////////////////////////////////
19LIB "normal.lib";
20LIB "hnoether.lib";
21///////////////////////////////////////////////////////////////////////////////
22
23
24proc 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 
27RETURN:  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
31NOTE:    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
34EXAMPLE: 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}
79example
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
89proc parametrizepd(ideal I)
90"USAGE:  parametrizepd(); I ideal in a polynomial ring with global ordering
91RETURN:  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
95NOTE:    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
98EXAMPLE: 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}
147example
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
158proc parametrizesing(poly f)
159"USAGE:  parametrizesing(); f a polynomial in two variables with ordering ls or ds
160RETURN:  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 
162NOTE:    if successful, the basering is changed to ring 0,(x,y),ls;
163EXAMPLE: 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}
185example
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
206ring r=0,(x,y),dp;
207ideal i=x^2-y^3;
208parametrize(i);
209
210/// Example 2
211
212ring r=0,(x,y,z),dp;
213ideal i=x2-y2z2-y3;
214parametrize(i);
215
216/// Example 3
217
218ring r=0,(x,y,z),dp;
219ideal i=z2-x2y;
220parametrize(i);
221
222/// Example 4
223
224ring r=0,(x,y,z),dp;
225ideal i=z2-x2y;
226parametrize(i);
227
228/// Example 5
229
230ring r=0,(x,y,z),dp;
231ideal i=x2-y3;
232parametrize(i);
233
234/// Example 6
235
236ring r=0,(x,y,z),dp;
237ideal i=y2-xz,z2-x2y,x3-yz;
238parametrize(i);
239
240/// Example 7 - ideal is not prime
241
242ring r=0,(x,y),dp;
243ideal i=xy;
244parametrize(i);
245
246/// Example 8 - you get a parametrization of the reduced ideal
247
248ring r=0,(x,y),dp;
249ideal i=x2;
250parametrize(i);
251
252/// Example 9 - wrong ordering
253
254ring r=0,(x,y),ls;
255ideal i=x2-y3;
256parametrize(i);
257
258
259
260
261
262/////////////////////////////////////////////////////////////////////
263
264/// Examples for parametrizepd
265
266/// Example 1 
267ring r=0,(x,y,z),dp;
268ideal i=y2z5-x2y2z2+y2z4-z6-z5+x4-x2z2,-y3z3+yz4+x2yz;
269parametrizepd(i);
270
271/// Example 2
272
273ring r=0,(x,y,z),dp;
274ideal i=z^2-x^2*y,y^2-x*z;
275parametrizepd(i);
276
277/// Example 3
278
279ring r=0,(x,y,z),dp;
280ideal 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;
281parametrizepd(i);
282
283/// Example 4
284
285ring r=0,(x,y,z),dp;
286ideal 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;
287parametrizepd(i);
288
289/// Example 5 - gives a parametrization which is not suitable for plotting reasons
290
291ring r=0,(x,y,z,u),dp;
292ideal i=x-zu,y2-zu2;
293parametrizepd(i);
294
295/// Example 6 - one component has no parametrization
296
297ring r=0,(x,y,z),dp;
298ideal i=-x2y3+x3yz+y2z2-xz3,y2z-xz2;
299parametrizepd(i);
300
301/// Example 7 - wrong ordering!
302
303ring r=0,(x,y,z),ls;
304ideal i=x2-y2z2-y3;
305parametrizepd(i);
306
307
308
309///////////////////////////////////////////////////////////////////
310
311/// Examples for parametrizesing
312
313/// Example 1
314
315ring r=0,(x,y),ls;
316poly f=x^2-y^3;
317parametrizesing(f);
318
319/// Example 2
320
321ring r=0,(x,y),ls;
322poly f=x^3+y^3-3*x*y;
323parametrizesing(f);
324
325/// Example 3
326
327ring r=0,(x,y),ls;
328poly f=y*x^2-y^8;
329parametrizesing(f);
330
331/// Example 4
332
333ring r=0,(x,y),ls;
334poly f=-x6-x5+2x3y2+x2y2-y4;
335parametrizesing(f);
336
337/// Example 5
338
339ring r=0,(x,y),ls;
340poly f=x6y4-x8y+x5y4-2x3y6-x7y+2x5y3-x2y6+y8+x4y3-x2y5;
341parametrizesing(f);
342
343/// Example 6 - wrong number of variables
344
345ring r=0,(x,y,z),dp;
346poly f=x2-y2z2-y3;
347parametrizesing(f);
348
349/// Example 7 - wrong ring ordering
350
351ring r=0,(x,y),lp;
352poly f=x2-y3;
353parametrizesing(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*/
Note: See TracBrowser for help on using the repository browser.