source: git/Singular/LIB/curveInv.lib @ 6391eb

fieker-DuValspielwiese
Last change on this file since 6391eb was 6391eb, checked in by Hans Schoenemann <hannes@…>, 5 years ago
version numbers
  • Property mode set to 100644
File size: 19.7 KB
Line 
1////////////////////////////////////////////////////////////////////////////////
2version="version curveInv.lib 4.1.2.0 Feb_2019 "; // $Id$
3category="Algebraic geometry";
4info="
5LIBRARY:    curveInv.lib A library for computing invariants of curves
6AUTHOR:     Peter Chini, chini@rhrk.uni-kl.de
7
8OVERVIEW:
9This library provides a collection of procedures for computing invariants
10of curve singularities. Invariants that can be computed are:
11    - the delta invariant
12    - the multiplicity of the conductor: the length of Normalization(R)/C,
13      where C denotes the conductor
14    - the Deligne number
15    - the colength of derivations along the normalization - the length of
16      Der(Normalization(R/I)) / R/I
17
18In addition, it is possible to compute the conductor of a ring S = R/I,
19where R is a (localized) polynomial ring.
20
21THEORY: Computing the Deligne number of curve singularities and an algorithmic framework for
22        differential algebras in SINGULAR;
23        Chapter 5 - Master's Thesis of Peter Chini - August 2015
24
25PROCEDURES:
26    curveDeltaInv(ideal);   computes the delta invariant of R/I for a given ideal I
27    curveConductorMult(ideal);  returns the multiplicity of the conductor of R/I
28    curveDeligneNumber(ideal);          computes the Deligne number of R/I
29    curveColengthDerivations(ideal);    returns the colength of derivations,
30                                        the length of Der(Normalization(R/I))/Der(R/I)
31
32KEYWORDS:   curve singularity;invariants;deligne number
33";
34
35LIB "homolog.lib";
36LIB "normal.lib";
37
38////////////////////////////////////////////////////////////////////////////////////////////////
39////////////////////////////////////////////////////////////////////////////////////////////////
40//                                  Computation of invariants                                 //
41////////////////////////////////////////////////////////////////////////////////////////////////
42////////////////////////////////////////////////////////////////////////////////////////////////
43
44
45////////////////////////////////////////////////////////////////////////////////////////////////
46//-------------------------------------- Delta invariant -------------------------------------//
47////////////////////////////////////////////////////////////////////////////////////////////////
48
49
50proc curveDeltaInv(ideal I, list #)
51"USAGE:     curveDeltaInv(I); I ideal
52ASSUME:     I is a radical ideal, dim(R/I) = 1
53RETURN:     the delta invariant of R/I
54NOTE:       - output -1 means: delta invariant is infinite
55            - the optional parameter can be used if the normalization has already
56            been computed. If a list L contains the output of the procedure
57            normal (with options prim, wd and usering if the ring has a mixed ordering),
58            apply curveDeltaInv(I,L)
59KEYWORDS:   delta invariant; normalization
60SEE ALSO:   curveConductorMult; curveDeligneNumber
61EXAMPLE:    example curveDeltaInv; shows an example"
62{
63
64    if(size(#) > 0){
65        list norma = #;
66    }else{
67        // Compute the normalization with delta invariants
68        list norma = normal(I,"useRing","prim","wd");
69    }
70
71    // Pick the total delta invariant
72        int delt = norma[3][2];
73    return(delt);
74
75}
76example
77{
78"EXAMPLE:"; echo = 2;
79ring R = 0,(x,y,z),ds;
80
81////////////////////////////
82// Finite delta invariant //
83////////////////////////////
84
85ideal I = x2y-y2z,x2-y2+z2;
86curveDeltaInv(radical(I));
87
88//////////////////////////////
89// Infinite delta invariant //
90//////////////////////////////
91
92ideal J = xyz;
93curveDeltaInv(radical(J));
94}
95
96
97////////////////////////////////////////////////////////////////////////////////////////////////
98//-------------------------------- Conductor and multiplicity --------------------------------//
99////////////////////////////////////////////////////////////////////////////////////////////////
100
101
102
103static proc conductorMinPrime(def S)
104"USAGE:     conductorMinPrime(S); S ring
105ASSUME:     S is a polynomial ring with ideal norid and S/norid is the normalization of R/P,
106            where P is a minimal prime of I
107RETURN:     the ideal P
108REMARKS:    The algorithm computes norid intersect R - it eliminates the new
109            variables that were added by the command normal.
110NOTE:       the algorithm is for interior use only. We apply it to avoid a second computation
111            of the minimal primes
112KEYWORDS:   minimal primes; normalization
113"
114{
115//SEE ALSO:   conductorIdealIntersect
116
117        // Variables of basering as product
118        int n = nvars(basering);
119    int i;
120        poly var_base = 1;
121        for(i = 1; i <= n; i++){
122                var_base = var_base*var(i);
123        }
124
125    // Switch to normalization
126    def savering = basering;
127    setring S;
128        poly var_base = imap(savering,var_base);
129
130        // Variables of S as product
131        poly var_ext = 1;
132        n = nvars(basering);
133        for(i = 1; i <= n ; i++){
134                var_ext = var_ext*var(i);
135        }
136
137        // Variables to eliminate
138        poly var_elim = var_ext/var_base;
139
140        // Compute norid intersect basering = minimal prime
141        ideal min_prime = eliminate(norid,var_elim);
142
143    // Switch to R and return
144    setring savering;
145    ideal min_prime = imap(S,min_prime);
146    return(min_prime);
147
148}
149
150
151////////////////////////////////////////////////////////////////////////////////////////////////
152
153
154static proc conductorIdealIntersect(list id, int miss)
155"USAGE:     conductorIdealIntersect(id,miss); id list, miss int
156ASSUME:     id is a list of ideals
157RETURN:     the intersection of all ideals in id except the one chosen via miss
158NOTE:       - the index can be chosen outside the list
159            - the empty intersection is the whole ring
160KEYWORDS:   intersection"
161{
162
163        int n = size(id);
164        ideal in_sect = 1;
165        int i;
166
167        // Intersect ideals
168        for(i = 1; i <= n; i++){
169                if(i != miss){
170            in_sect = intersect(in_sect,id[i]);
171                }
172        }
173
174        return(in_sect);
175
176}
177
178
179////////////////////////////////////////////////////////////////////////////////////////////////
180
181
182proc curveConductorMult(ideal I, list #)
183"USAGE:     curveConductorMult(I); I ideal
184ASSUME:     I is a radical ideal, dim(R/I) = 1
185RETURN:     the multiplicity of the conductor
186NOTE:       the optional parameter can be used if the normalization has already
187            been computed. If a list L contains the output of the procedure
188            normal (with options prim, wd and usering if the ring has a mixed ordering),
189            apply curveConductorMult(I,L)
190KEYWORDS:   conductor; multiplicity
191SEE ALSO:   normalConductor
192EXAMPLE:    example curveConductorMult; shows an example"
193{
194
195    if(size(#) > 0){
196        list norma = #;
197    }else{
198        // Compute the normalization with delta invariants
199        list norma = normal(I,"useRing","prim","wd");
200    }
201
202    // delta invariant
203    int delta = curveDeltaInv(I,norma);
204        // If the delta invariant is infinite, the conductor multiplicity is as well
205        if(delta == -1){
206                return(-1);
207        }
208
209    // Conductor
210    ideal C = normalConductor(I,norma);
211    int c_dim = vdim(std(C));
212    if(c_dim == -1){
213        return(-1);
214    }
215
216        // Return conductor multiplicity
217        return(vdim(std(C)) + delta);
218
219}
220example
221{
222"EXAMPLE:"; echo = 2;
223
224//////////////////////////////////////////////
225// Mutltiplicity of the conductor of curves //
226//////////////////////////////////////////////
227
228ring R = 0,(x,y,z),ds;
229
230// Example 1:
231ideal I = x2-y4z,z3y2+xy2;
232I = std(radical(I));
233curveConductorMult(I);
234
235// Example 2:
236ideal I = x*(y+z)^3 - y3, x2y2 + z5;
237I = std(radical(I));
238curveConductorMult(I);
239
240kill R;
241
242////////////////////////////////////////////////////////
243// Mutltiplicity of the conductor of Gorenstein curve //
244////////////////////////////////////////////////////////
245
246ring R = 0,(x,y),ds;
247ideal I = xy;
248
249// In such a case, the conductor multiplicity c satisfies: c = 2*delta
250// Delta invariant:
251curveDeltaInv(I);
252// Conductor Multiplicity:
253curveConductorMult(I);
254}
255
256
257////////////////////////////////////////////////////////////////////////////////////////////////
258//-------------------------------------- Deligne number --------------------------------------//
259////////////////////////////////////////////////////////////////////////////////////////////////
260
261
262proc curveDeligneNumber(ideal I, list #)
263"USAGE:     curveDeligneNumber(I); I ideal
264ASSUME:     I is a radical ideal, dim(R/I) = 1
265RETURN:     the Deligne number of R/I
266REMARKS:    The Deligne number e satisfies by definition: e = 3delta - m.
267            So the algorithm splits the computation into two parts: one part computes the delta
268            invariant, the other part the colength of derivations m.
269NOTE:       the optional parameter can be used if the normalization has already
270            been computed. If a list L contains the output of the procedure
271            normal (with options prim, wd and usering if the ring has a mixed ordering),
272            apply curveDeligneNumber(I,L)
273KEYWORDS:   deligne number; invariant
274SEE ALSO:   curveColengthDerivations, curveDeltaInv
275EXAMPLE:    example curveDeligneNumber; shows an example"
276{
277
278    if(size(#) > 0){
279        list norma = #;
280    }else{
281        // Compute the normalization with delta invariants
282        list norma = normal(I,"useRing","prim","wd");
283    }
284
285    int delt = curveDeltaInv(I,norma);
286    int m = curveColengthDerivations(I,norma);
287    return(3*delt - m);
288
289}
290example
291{
292"EXAMPLE:"; echo = 2;
293
294//////////////////////////////
295// Deligne number of curves //
296//////////////////////////////
297
298// Example 1:
299ring R = 0,(x,y,z),ds;
300ideal I = x2-y4z,z3y2+xy2;
301I = std(radical(I));
302curveDeligneNumber(I);
303
304// Example 2:
305ring S = 0,(x,y),ds;
306ideal I = (x+y)*(x2-y3);
307curveDeligneNumber(I);
308
309// Example 3:
310ideal J = (x2-y3)*(x2+y2)*(x-y);
311curveDeligneNumber(J);
312// Let us also compute the milnor number of this complete intersection:
313milnor(J);
314
315// We see that the Milnor number is bigger than the Deligne number. Hence, this
316// curve cannot be quasi homogeneous. This can also be verified by Saitos criterion:
317reduce(J[1],std(jacob(J[1])));
318}
319
320
321////////////////////////////////////////////////////////////////////////////////////////////////
322
323
324proc curveColengthDerivations(ideal I, list #)
325"USAGE:     curveColengthDerivations(I); I ideal
326ASSUME:     I is a radical ideal
327RETURN:     the colength of derivations of R/I
328REMARKS:    The procedure goes through all branches and computes the colength of
329            derivations there. Then the d-dimension of the minimal primes is computed.
330            After that, everything is summed up.
331NOTE:       the optional parameter can be used if the normalization has already
332            been computed. If a list L contains the output of the procedure
333            normal (with options prim, wd and usering if the ring has a mixed ordering),
334            apply curveColengthDerivations(I,L)
335KEYWORDS:   deligne number; invariants; colength of derivations
336EXAMPLE:    example curveColengthDerivations; shows an example"
337{
338//SEE ALSO:   curveColengthDerivationsComp
339
340    if(size(#) > 0){
341        list norma = #;
342    }else{
343        // Compute the normalization with delta invariants
344        list norma = normal(I,"useRing","prim","wd");
345    }
346
347    int r = size(norma[1]);
348    int i,j;
349    ideal U,A,B;
350    module Der_P;
351    def S;
352    def savering = basering;
353
354    // List of minimal primes and their derivation modules
355    list min_prime;
356    list der_mod;
357
358    // Colength of derivations of any branch, m_delta and total colength of derivations
359    int m_i;
360    int m_delta;
361    int ext_number;
362
363    // Go through the irreducible components and compute thecolength of derivations m_i
364    for(i = 1; i <= r; i++){
365        // Derivations preserving the minimal primes
366        S = norma[1][i];
367        U = norma[2][i];
368
369        min_prime[i] = conductorMinPrime(S);
370        der_mod[i] = find_der(min_prime[i]);
371        Der_P = der_mod[i];
372
373        // Switch to normalization of R/P and compute colength of derivations
374        setring S;
375        ideal U = imap(savering,U);
376        module Der_P = imap(savering,Der_P);
377
378        m_i = curveColengthDerivationsComp(Der_P,U,norid);
379
380        // Add colength of derivations of this branch to total colength of derivations
381        ext_number = ext_number + m_i;
382        setring savering;
383    }
384
385    // Now compute m_delta via curveDdim
386    A = min_prime[1];
387    B = std(1);
388
389    for(i = 2; i <= r; i++){
390        A = intersect(A,B);
391        B = min_prime[i];
392        m_delta = m_delta + curveDdim(A,find_der(A),B,find_der(B));
393    }
394
395    // Add this to the colength of derivations
396    ext_number = ext_number + m_delta;
397    return(ext_number);
398
399}
400example
401{
402"EXAMPLE:"; echo = 2;
403
404///////////////////////////////////////
405// colength of derivations of curves //
406///////////////////////////////////////
407
408// Example 1:
409ring R = 0,(x,y,z),ds;
410ideal I = x2-y4z,z3y2+xy2;
411I = std(radical(I));
412curveColengthDerivations(I);
413
414// Example 2:
415ring S = 0,(x,y),ds;
416ideal I = (x+y)*(x2-y3);
417curveColengthDerivations(I);
418
419// Example 3:
420ideal J = (x2-y3)*(x2+y2)*(x-y);
421curveColengthDerivations(J);
422}
423
424
425////////////////////////////////////////////////////////////////////////////////////////////////
426
427
428static proc curveColengthDerivationsComp(module Der_P, ideal U, ideal relid)
429"USAGE:     curveColengthDerivationsComp(Der_P,U,relid); Der_P module, U ideal, relid ideal
430ASSUME:     - the basering is the normalization of R/P, where P is a prime
431            - Der_P is the module of P-preserving derivations
432            - U containts the generators of the normalization of R/P
433            - relid is the ideal of relations that hold in the normalization of R/P
434RETURN:     the colength of derivations of R/P
435NOTE:       the procedure is for interior use only - it is part of the computation of
436            the total colength of derivations
437KEYWORDS:   colength of derivations
438SEE ALSO:   curveAdjustModule, curveExtDerModule"
439{
440
441    int k;
442
443    // Adjust the generators of Der_P to the new variables T(1),...,T(k),x(1),...,x(n)
444    // if there are new variables - check number of blocks
445    if(size(ringlist(basering)[3]) >= 3){
446        k = size(ringlist(basering)[3][1][2]);
447        Der_P = curveAdjustModule(Der_P,k);
448    }
449
450    // Extend the derivation module to the normalization
451    Der_P = curveExtDerModule(Der_P,U,relid);
452
453    // Derivations preserving the relation ideal
454    module Der_relid = find_der(relid);
455
456    // Quotient module with relations given by relid
457    Der_P = Der_P + relid*freemodule(nvars(basering));
458    module quotient_mod = modulo(Der_relid,Der_P);
459    k = vdim(std(quotient_mod));
460
461    if(k == -1){
462        ERROR("Colength of derivations not finite !");
463    }
464
465    return(k);
466
467}
468
469
470////////////////////////////////////////////////////////////////////////////////////////////////
471
472
473static proc curveExtDerModule(module Der_P, ideal U, ideal relid)
474"USAGE:     curveExtDerModule(Der_P,U,relid); Der_P module, U ideal, relid ideal
475ASSUME:     - the basering is the normalization of R/P, where P is prime
476            - Der_P is the module of P-preserving derivations (with adjusted generators)
477            - U containts the generators of the normalization of R/P
478            - relid is the ideal of relations that hold in the normalization of R/P
479RETURN:     The derivation module lifted to the normalization
480REMARKS:    the generators of Der_P are extended via the quotient rule
481NOTE:       the procedure is for interior use only - it is part of the computation of
482            the total colength of derivations
483KEYWORDS:   derivations; extend derivations
484"
485{
486//SEE ALSO:   curveColengthDerivationsComp
487
488    int k = size(Der_P);
489    int n = size(U) - 1;
490    int i,j;
491
492    module M_ext;
493    vector delt;
494    vector delt_ext;
495
496    poly g = (U[n+1])^2;
497    poly f;
498    poly Un = 1;
499    matrix D[k][n];
500    matrix G[k][n];
501    list temp_div;
502
503    for(i = 1; i <= k; i++){
504        delt = Der_P[i];
505
506        // Extend to new variables by quotient rule
507        for(j = 1; j <= n; j++){
508            f = vecDerivationEval(delt,U[j])*U[n+1] - vecDerivationEval(delt,U[n+1])*U[j];
509
510            // Division
511            temp_div = division(f,ideal(g) + relid);
512
513            // Units
514            D[i,j] = temp_div[3][1,1];
515            // Unit Un is product of all D[i][j]
516            Un = Un*D[i,j];
517
518            // Factor of dividing by g
519            G[i,j] = temp_div[1][1,1];
520        }
521    }
522
523    // Extension of the generating derivations
524    for(i = 1; i <= k; i++){
525        delt_ext = Un*Der_P[i];
526
527        // Now add the images of the new variables multiplied by the units
528        for(j = 1; j <= n; j++){
529            delt_ext = delt_ext + (Un / D[i,j])*G[i,j]*gen(j);
530        }
531
532        M_ext[i] = delt_ext;
533    }
534
535    return(M_ext);
536
537}
538
539
540////////////////////////////////////////////////////////////////////////////////////////////////
541
542
543static proc curveAdjustModule(module M, int k)
544"USAGE:     curveAdjustModule(M,k); M module, k int
545RETURN:     the module M with shifted (by k) generators
546NOTE:       the procedure is for interior use only - it is part of the computation of
547            the total colength of derivations
548KEYWORDS:   adjust module
549"
550{
551//SEE ALSO:   curveColengthDerivationsComp"
552
553    module M_copy = M;
554    int n = size(M);
555    int vs,i,j;
556    vector v,w;
557
558    // Adjust dimension of generators
559    for(i = 1; i <= n; i++){
560        v = M_copy[i];
561        vs = nrows(v);
562
563        for(j = 1; j <= vs; j++){
564            w = w + v[j]*gen(j+k);
565        }
566
567        M[i] = w;
568        w = 0;
569    }
570
571    return(M);
572
573}
574
575
576////////////////////////////////////////////////////////////////////////////////////////////////
577
578
579static proc curveDdim(ideal I, module DI, ideal J, module DJ)
580"USAGE:     curveDdim(I,DI,J,DJ); I,J ideal, DI,DJ module
581ASSUME:     DI are the I-preserving derivations and DJ are the J-preserving derivations
582RETURN:     d(I,J) = dim_k (DI + DJ / (I+J)*Der(R))
583NOTE:       the procedure is part of the computations of the colength of derivations.
584            It computes the d-dimension
585KEYWORDS:   derivation module; logarithmic derivations
586SEE ALSO:   curveColengthDerivations"
587{
588
589    module M = DI+DJ;
590    module N = (I+J)*freemodule(nvars(basering));
591    module H = modulo(M,N);
592    int k = vdim(std(H));
593
594    if(k == -1){
595        ERROR("d-dimension not finite !");
596    }
597
598    return(k);
599
600}
601
602
603////////////////////////////////////////////////////////////////////////////////////////////////
604
605
606static proc vecDerivationEval(vector delt, poly f)
607"USAGE:     vecDerivationEval(delt,f); delt vector, f poly
608ASSUME:     delt does not have more rows than the number of variables in the basering
609RETURN:     the image of f under delt, if we consider delt as derivation
610REMARKS:    We identify derivations as vectors
611NOTE:       - the procedure is for interior use only - it is part of the computation of
612            the total colength of derivations
613            - it is used to apply the quotient rule
614KEYWORDS:   derivation
615SEE ALSO:   curveExtDerModule"
616{
617
618    int n = nrows(delt);
619    int i;
620    poly eval_;
621
622    for(i = 1; i <= n; i++){
623        eval_ = eval_ + delt[i]*diff(f,var(i));
624    }
625
626    return(eval_);
627
628}
629
630
631////////////////////////////////////////////////////////////////////////////////////////////////
632
633
634static proc find_der(ideal I)
635"USAGE: find_der(I); I ideal
636RETURN: generators of the module of logarithmic derivations
637REMARK: Algorithm by R. Epure - Homogeneity and Derivations on Analytic Algebras"
638{
639    // Dummy variables and Initialization:
640    int k,i,n,m;
641
642    //generating matrix for syzygie computation:
643    n = nvars(basering);
644    m = size(I);
645    ideal j = jacob(I);
646
647    matrix M=matrix(j,m,n);
648    for (i = 1; i <= m; i++){
649        M = concat(M,diag(I[i],m));
650    }
651    module C = syz(M);
652    module D;
653
654    for(i = 1; i <= size(C); i++){
655        D = D + C[i][1..n];
656    }
657
658    //Clearing memory
659    kill j;
660    kill C;
661    kill M;
662    return(D);
663}
664
665
666////////////////////////////////////////////////////////////////////////////////////////////////
667////////////////////////////////////////////////////////////////////////////////////////////////
Note: See TracBrowser for help on using the repository browser.