1 | version="$Id$"; |
---|
2 | category="Singularities"; |
---|
3 | info=" |
---|
4 | LIBRARY: surfacesignature.lib signature of surface singularity |
---|
5 | AUTHORS: Gerhard Pfister, pfister@mathematik.uni-kl.de |
---|
6 | Muhammad Ahsan Banyamin, ahsanbanyamin@gmail.com |
---|
7 | |
---|
8 | OVERVIEW: |
---|
9 | A library for computing the signature of irreducible surface singularity. |
---|
10 | It contains also a procedure for computing the newton pairs of a surface |
---|
11 | singularity. |
---|
12 | |
---|
13 | THEORY: The signature of a surface singularity is defined in |
---|
14 | [Durfee,A.:The Signature of Smoothings of Complex Surface |
---|
15 | Singularities, Math. Ann.,232,85-98 (1978)]. |
---|
16 | The algorithm we use has been proposed in |
---|
17 | [Nemethi,A.:The signature of f(x,y)+z^n, Proceedings of Singularity |
---|
18 | Conference (C.T.C Wall's 60th birthday meeting),Liverpool 1996, |
---|
19 | London Math.Soc. LN 263(1999),131-149]. |
---|
20 | |
---|
21 | PROCEDURES: |
---|
22 | brieskornSign(a,b,c); signature of Brieskorn singularity x^a+y^b+z^c=0 |
---|
23 | newtonpairs(f); newton pairs of surface singularity |
---|
24 | signature(N,f); signature of singularity z^+f(x,y)=0,f irreducible |
---|
25 | "; |
---|
26 | |
---|
27 | LIB "hnoether.lib"; |
---|
28 | /////////////////////////////////////////////////////////////////////////////// |
---|
29 | proc signature(int N,poly f) |
---|
30 | " |
---|
31 | USAGE: signature(N,f); N=integer, f=irreducible poly in 2 variables |
---|
32 | RETURN: signature of surface singularity defined by z^N+f=0 |
---|
33 | EXAMPLE: example signature; shows an example |
---|
34 | " |
---|
35 | { |
---|
36 | def R=basering; |
---|
37 | ring S=0,(x,y),dp; |
---|
38 | poly f = fetch(R,f); |
---|
39 | list L=newtonpairs(f); |
---|
40 | setring R; |
---|
41 | if(size(L)>2) |
---|
42 | { |
---|
43 | return(Generalcase(N,L)); |
---|
44 | } |
---|
45 | if(size(L)==2) |
---|
46 | { |
---|
47 | return(signtwopairs(N,L)); |
---|
48 | } |
---|
49 | return(brieskornSign(L[1][2],L[1][1],N)); |
---|
50 | } |
---|
51 | example |
---|
52 | { "EXAMPLE:"; echo = 2; |
---|
53 | ring r = 0,(x,y),dp; |
---|
54 | int N = 3; |
---|
55 | poly f= x15-21x14+8x13y-6x13-16x12y+20x11y2-x12+8x11y-36x10y2 |
---|
56 | +24x9y3+4x9y2-16x8y3+26x7y4-6x6y4+8x5y5+4x3y6-y8; |
---|
57 | signature(N,f); |
---|
58 | } |
---|
59 | |
---|
60 | /////////////////////////////////////////////////////////////////////////// |
---|
61 | proc newtonpairs(poly f) |
---|
62 | "USAGE: newtonpairs(f); f= irreducible bivariate poly |
---|
63 | RETURN: newton pairs of curve singularity f(x,y)=0 |
---|
64 | EXAMPLE: example newtonpairs; shows an example |
---|
65 | " |
---|
66 | { |
---|
67 | def R=basering; |
---|
68 | ring S=0,(x,y),dp; |
---|
69 | poly f = fetch(R,f); |
---|
70 | list M=invariants(f); |
---|
71 | setring R; |
---|
72 | list L=M[1][3]; |
---|
73 | list K=M[1][4]; |
---|
74 | int i,j; |
---|
75 | intvec v; |
---|
76 | list N1,N2,P,T; |
---|
77 | N1[1]=M[1][4][1]; |
---|
78 | N2[1]=M[1][3][1]; |
---|
79 | for(i=2;i<=size(M[1][3]);i++) |
---|
80 | { |
---|
81 | N1[i]=M[1][4][i]; |
---|
82 | N2[i]=M[1][3][i]-N1[i]*M[1][3][i-1]; |
---|
83 | } |
---|
84 | P[1]=N1; |
---|
85 | P[2]=N2; |
---|
86 | for(j=1;j<=size(P[1]);j++) |
---|
87 | { |
---|
88 | v=P[1][j],P[2][j]; |
---|
89 | T[j]=v; |
---|
90 | } |
---|
91 | return(T); |
---|
92 | } |
---|
93 | example |
---|
94 | { "EXAMPLE:"; echo = 2; |
---|
95 | ring r=0,(x,y),dp; |
---|
96 | newtonpairs(y4+2x3y2+x6+x5y); |
---|
97 | } |
---|
98 | |
---|
99 | /////////////////////////////////////////////////////////////////////////// |
---|
100 | proc brieskornSign(a,b,c) |
---|
101 | "USAGE: brieskornSign(a,b,c);a,b,c=integers |
---|
102 | RETURN: signature of Brieskorn singularity x^a+y^b+z^c |
---|
103 | EXAMPLE: example brieskornSign; shows an example |
---|
104 | " |
---|
105 | { |
---|
106 | int i,j,k,d; |
---|
107 | for(i=1;i<=a-1;i++) |
---|
108 | { |
---|
109 | for(j=1;j<=b-1;j++) |
---|
110 | { |
---|
111 | for(k=1;k<=c-1;k++) |
---|
112 | { |
---|
113 | d=d+signa(number(i)/a+number(j)/b+number(k)/c); |
---|
114 | } |
---|
115 | } |
---|
116 | } |
---|
117 | return(d); |
---|
118 | } |
---|
119 | example |
---|
120 | { "EXAMPLE:"; echo = 2; |
---|
121 | ring R=0,x,dp; |
---|
122 | brieskornSign(11,3,5); |
---|
123 | } |
---|
124 | /////////////////////////////////////////////////////////////////////////// |
---|
125 | static proc signsin(number n) |
---|
126 | "USAGE: signsin(n); n=number |
---|
127 | RETURN: the sign of sin(n) (sin(n) = the value of the sine of n) |
---|
128 | EXAMPLE: example signSin; shows an example |
---|
129 | " |
---|
130 | { |
---|
131 | def r=basering; |
---|
132 | int a; |
---|
133 | int b=10; |
---|
134 | ring s=(real,10),x,dp; |
---|
135 | number m=imap(r,n); |
---|
136 | number pi = number_pi(11); |
---|
137 | number t=m*pi; |
---|
138 | poly f=sin(b); |
---|
139 | poly h=subst(f,x,t); |
---|
140 | if(h>0){a=1;} |
---|
141 | if(h<0){a=-1;} |
---|
142 | setring r; |
---|
143 | return(a); |
---|
144 | } |
---|
145 | example |
---|
146 | { "EXAMPLE:"; echo = 2; |
---|
147 | ring r=0,x,dp; |
---|
148 | signsin(11/3); |
---|
149 | } |
---|
150 | /////////////////////////////////////////////////////////////////////////// |
---|
151 | static proc split1(number n) |
---|
152 | "USAGE: split1(n); n=number |
---|
153 | RETURN: integral and fractional parts of number n |
---|
154 | EXAMPLE: example split1; shows an example |
---|
155 | " |
---|
156 | { |
---|
157 | number a,b; |
---|
158 | int r; |
---|
159 | a=numerator(n); |
---|
160 | b=denominator(n); |
---|
161 | int z=int(number(a)); |
---|
162 | int y=int(number(b)); |
---|
163 | r=z mod y; |
---|
164 | int q=(z-r) div y; |
---|
165 | number n1=q; |
---|
166 | number n2=n-n1; |
---|
167 | list l=n1,n2; |
---|
168 | return(l); |
---|
169 | } |
---|
170 | example |
---|
171 | { "EXAMPLE:"; echo = 2; |
---|
172 | ring r=0,x,dp; |
---|
173 | split1(11/3); |
---|
174 | } |
---|
175 | /////////////////////////////////////////////////////////////////////////// |
---|
176 | static proc sin( int n) |
---|
177 | "USAGE: sin(n); n=integer |
---|
178 | RETURN: approximate value of the sine of n by using maclaurin series |
---|
179 | EXAMPLE: example sin; shows an example |
---|
180 | " |
---|
181 | { |
---|
182 | def R=basering; |
---|
183 | ring S=0,x,dp; |
---|
184 | int i; |
---|
185 | poly f; |
---|
186 | int z; |
---|
187 | for(i=1;i<=n;i=i+2) |
---|
188 | { |
---|
189 | f=f+(-1)^z*x^i/factorial(i) ; |
---|
190 | z++; |
---|
191 | } |
---|
192 | setring R; |
---|
193 | map phi=S,var(1); |
---|
194 | poly f=phi(f); |
---|
195 | return(f); |
---|
196 | } |
---|
197 | example |
---|
198 | { "EXAMPLE:"; echo = 2; |
---|
199 | ring r=0,x,dp; |
---|
200 | sin(10); |
---|
201 | } |
---|
202 | /////////////////////////////////////////////////////////////////////////// |
---|
203 | static proc cos(int n) |
---|
204 | "USAGE: cos(n); n=integer |
---|
205 | RETURN: approximate value of the cosine of n by using maclaurin series |
---|
206 | EXAMPLE: example cos; shows an example |
---|
207 | " |
---|
208 | { |
---|
209 | def R=basering; |
---|
210 | ring S=0,x,dp; |
---|
211 | poly f; |
---|
212 | int i; |
---|
213 | int z; |
---|
214 | for(i=0;i<=n;i=i+2) |
---|
215 | { |
---|
216 | // f=f+(-1)^z*x^i/factorial(i,0); |
---|
217 | f=f+(-1)^z*x^i/factorial(i) ; |
---|
218 | z++; |
---|
219 | } |
---|
220 | setring R; |
---|
221 | map phi=S,var(1); |
---|
222 | poly f=phi(f); |
---|
223 | return(f); |
---|
224 | } |
---|
225 | example |
---|
226 | { "EXAMPLE:"; echo = 2; |
---|
227 | ring r=0,x,dp; |
---|
228 | cos(10); |
---|
229 | } |
---|
230 | /////////////////////////////////////////////////////////////////////////// |
---|
231 | static proc signcos(number n) |
---|
232 | "USAGE: signcos(n); n=number |
---|
233 | RETURN: the sign of cosin(n) (cosin(n) = the value of the cosine of n) |
---|
234 | EXAMPLE: example signcos; shows an example |
---|
235 | " |
---|
236 | { |
---|
237 | def r=basering; |
---|
238 | int a; |
---|
239 | int b=10; |
---|
240 | ring s=(real,10),x,dp; |
---|
241 | number m=imap(r,n); |
---|
242 | number pi = number_pi(11); |
---|
243 | number t=m*pi; |
---|
244 | poly f=cos(b); |
---|
245 | poly h=subst(f,x,t); |
---|
246 | if(h>0){a=1;} |
---|
247 | if(h<0){a=-1;} |
---|
248 | setring r; |
---|
249 | return(a); |
---|
250 | } |
---|
251 | example |
---|
252 | { "EXAMPLE:"; echo = 2; |
---|
253 | ring r=0,x,dp; |
---|
254 | signcos(11/3); |
---|
255 | } |
---|
256 | /////////////////////////////////////////////////////////////////////////// |
---|
257 | static proc signa( number u) |
---|
258 | "USAGE: signa(u); u=number |
---|
259 | RETURN: the signa of a number |
---|
260 | EXAMPLE: example signa; shows an example |
---|
261 | " |
---|
262 | { |
---|
263 | list l=split1(u); |
---|
264 | int z; |
---|
265 | if( l[1] mod 2==0 ) |
---|
266 | { z=signsin(l[2]); } |
---|
267 | else |
---|
268 | { z=signcos(l[1]);} |
---|
269 | return(z); |
---|
270 | } |
---|
271 | example |
---|
272 | { "EXAMPLE:"; echo = 2; |
---|
273 | ring r=0,x,dp; |
---|
274 | signa(11/3); |
---|
275 | } |
---|
276 | /////////////////////////////////////////////////////////////////////////// |
---|
277 | static proc prods(list L) |
---|
278 | "USAGE: product(L); L=list of intvec |
---|
279 | RETURN: product of first components of Newton pairs in L |
---|
280 | EXAMPLE: example product; shows an example |
---|
281 | " |
---|
282 | { |
---|
283 | int a=L[2][1]; |
---|
284 | int i; |
---|
285 | for(i=1;i<=size(L)-2;i++) |
---|
286 | { |
---|
287 | a=a*L[i+2][1]; |
---|
288 | } |
---|
289 | return(a); |
---|
290 | } |
---|
291 | example |
---|
292 | { "EXAMPLE:"; echo = 2; |
---|
293 | list L=intvec(2,3),intvec(2,1); |
---|
294 | prods(L); |
---|
295 | } |
---|
296 | /////////////////////////////////////////////////////////////////////////// |
---|
297 | static proc Generalcase(int N, list L) |
---|
298 | "USAGE: Generalcase(N,f);N=integer,list L of intvec |
---|
299 | RETURN: signature of surface singularity with Newton pairs in L |
---|
300 | ASSUME: number of newton pairs greater than 2 |
---|
301 | EXAMPLE: example Generalcase; shows an example |
---|
302 | " |
---|
303 | { |
---|
304 | int i,j,k,n,m,t,p; |
---|
305 | int a=L[1][2]; |
---|
306 | int b=prods(L); |
---|
307 | int d=gcd(N,b); |
---|
308 | int q=d*brieskornSign(a,L[1][1],N/d); |
---|
309 | list A; |
---|
310 | list B; |
---|
311 | list S; |
---|
312 | for(i=1;i<=size(L)-1;i++) |
---|
313 | { |
---|
314 | a=L[i+1][2]+L[i+1][1]*L[i][1]*a; |
---|
315 | A[i]=a; |
---|
316 | S[i]=L[i+1][1]; |
---|
317 | } |
---|
318 | for(m=1;m<=size(L)-2;m++) |
---|
319 | { |
---|
320 | B[m]=L[m+2][1]; |
---|
321 | } |
---|
322 | list C; |
---|
323 | int c=B[size(B)]; |
---|
324 | C[size(B)]=c; |
---|
325 | for(j=1;j<=size(B)-1;j++) |
---|
326 | { |
---|
327 | c=c*B[size(B)-j]; |
---|
328 | C[size(B)-j]=c; |
---|
329 | } |
---|
330 | list D; |
---|
331 | D[size(L)-1]=1; |
---|
332 | for(k=1;k<=size(L)-2;k++) |
---|
333 | { |
---|
334 | D[k]=gcd(N,C[k]); |
---|
335 | } |
---|
336 | for(n=1;n<=size(L)-1;n++) |
---|
337 | { |
---|
338 | t=t+D[n]*brieskornSign(A[n],S[n],N/D[n]); |
---|
339 | } |
---|
340 | return(q+t); |
---|
341 | } |
---|
342 | example |
---|
343 | { "EXAMPLE:"; echo = 2; |
---|
344 | int N=2; |
---|
345 | list L=intvec(2,3),intvec(2,1),intvec(2,1); |
---|
346 | Generalcase(N,L); |
---|
347 | } |
---|
348 | /////////////////////////////////////////////////////////////////////////// |
---|
349 | static proc signtwopairs(int N,list L) |
---|
350 | "USAGE: signtwopairs(N,f);N=integer,L=list of intvec |
---|
351 | RETURN: signature of surface singularity with Newton pairs in L |
---|
352 | ASSUME: number of newton pairs equal to 2 |
---|
353 | EXAMPLE: example signtwopairs; shows an example |
---|
354 | " |
---|
355 | { |
---|
356 | int a1,a2,b,d1,q,t; |
---|
357 | a1=L[1][2]; |
---|
358 | b=prods(L); |
---|
359 | d1=gcd(N,b); |
---|
360 | q=d1*brieskornSign(a1,L[1][1],N/d1); |
---|
361 | a2=L[2][2]+L[2][1]*L[1][1]*a1; |
---|
362 | t=brieskornSign(a2,L[2][1],N); |
---|
363 | return(q+t); |
---|
364 | } |
---|
365 | example |
---|
366 | { "EXAMPLE:"; echo = 2; |
---|
367 | int N=2; |
---|
368 | list L=intvec(2,3),intvec(2,1); |
---|
369 | signtwopairs(N,L); |
---|
370 | } |
---|
371 | /////////////////////////////////////////////////////////////////////////// |
---|
372 | static proc DedekindSum(number b, number c, int a) |
---|
373 | { |
---|
374 | number s,d,e; |
---|
375 | int k; |
---|
376 | for(k=1;k<=a-1;k++) |
---|
377 | { |
---|
378 | d=k*b mod a; |
---|
379 | e=k*c mod a; |
---|
380 | if(d*e!=0) |
---|
381 | { |
---|
382 | s=s+(d/a-1/2)*(e/a-1/2); |
---|
383 | } |
---|
384 | } |
---|
385 | return(s); |
---|
386 | } |
---|
387 | /////////////////////////////////////////////////////////////////////////// |
---|
388 | |
---|
389 | /* |
---|
390 | Further examples |
---|
391 | |
---|
392 | ring r = 0,(x,y),dp; |
---|
393 | int N; |
---|
394 | poly f; |
---|
395 | |
---|
396 | N = 5; |
---|
397 | poly f= x15-21x14+8x13y-6x13-16x12y+20x11y2-x12+8x11y-36x10y2 //3 characteristic pairs |
---|
398 | +24x9y3+4x9y2-16x8y3+26x7y4-6x6y4+8x5y5+4x3y6-y8; |
---|
399 | |
---|
400 | N=6; |
---|
401 | f= y4+2x3y2+x6+x5y; //2 characteristic pairs |
---|
402 | |
---|
403 | N=7; |
---|
404 | f=x5+y11; //1 characteristc pair |
---|