This file is indexed.

/usr/share/singular/LIB/curveInv.lib is in singular-data 1:4.1.0-p3+ds-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
////////////////////////////////////////////////////////////////////////////////
version="version curveInv.lib 1.0.0.5 Aug_2015 "; // $Id: 7fd1131374a70586a07bcc5622d849fa49109fb8 $
category="Algebraic geometry";
info="
LIBRARY:    curveInv.lib A library for computing invariants of curves
AUTHOR:     Peter Chini, chini@rhrk.uni-kl.de

OVERVIEW:
This library provides a collection of procedures for computing invariants
of curve singularities. Invariants that can be computed are:
    - the delta invariant
    - the multiplicity of the conductor: the length of Normalization(R)/C,
      where C denotes the conductor
    - the Deligne number
    - the colength of derivations along the normalization - the length of
      Der(Normalization(R/I)) / R/I

In addition, it is possible to compute the conductor of a ring S = R/I,
where R is a (localized) polynomial ring.

THEORY: Computing the Deligne number of curve singularities and an algorithmic framework for
        differential algebras in SINGULAR;
        Chapter 5 - Master's Thesis of Peter Chini - August 2015

PROCEDURES:
    curveDeltaInv(ideal);   computes the delta invariant of R/I for a given ideal I
    curveConductorMult(ideal);  returns the multiplicity of the conductor of R/I
    curveDeligneNumber(ideal);          computes the Deligne number of R/I
    curveColengthDerivations(ideal);    returns the colength of derivations,
                                        the length of Der(Normalization(R/I))/Der(R/I)

KEYWORDS:   curve singularity;invariants;deligne number
";

LIB "homolog.lib";
LIB "normal.lib";

////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//                                  Computation of invariants                                 //
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------- Delta invariant -------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////


proc curveDeltaInv(ideal I, list #)
"USAGE:     curveDeltaInv(I); I ideal
ASSUME:     I is a radical ideal, dim(R/I) = 1
RETURN:     the delta invariant of R/I
NOTE:       - output -1 means: delta invariant is infinite
            - the optional parameter can be used if the normalization has already
            been computed. If a list L contains the output of the procedure
            normal (with options prim, wd and usering if the ring has a mixed ordering),
            apply curveDeltaInv(I,L)
KEYWORDS:   delta invariant; normalization
SEE ALSO:   curveConductorMult; curveDeligneNumber
EXAMPLE:    example curveDeltaInv; shows an example"
{

    if(size(#) > 0){
        list norma = #;
    }else{
        // Compute the normalization with delta invariants
        list norma = normal(I,"useRing","prim","wd");
    }

    // Pick the total delta invariant
        int delt = norma[3][2];
    return(delt);

}
example
{
"EXAMPLE:"; echo = 2;
ring R = 0,(x,y,z),ds;

////////////////////////////
// Finite delta invariant //
////////////////////////////

ideal I = x2y-y2z,x2-y2+z2;
curveDeltaInv(radical(I));

//////////////////////////////
// Infinite delta invariant //
//////////////////////////////

ideal J = xyz;
curveDeltaInv(radical(J));
}


////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------- Conductor and multiplicity --------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////



static proc conductorMinPrime(def S)
"USAGE:     conductorMinPrime(S); S ring
ASSUME:     S is a polynomial ring with ideal norid and S/norid is the normalization of R/P,
            where P is a minimal prime of I
RETURN:     the ideal P
REMARKS:    The algorithm computes norid intersect R - it eliminates the new
            variables that were added by the command normal.
NOTE:       the algorithm is for interior use only. We apply it to avoid a second computation
            of the minimal primes
KEYWORDS:   minimal primes; normalization
"
{
//SEE ALSO:   conductorIdealIntersect

        // Variables of basering as product
        int n = nvars(basering);
    int i;
        poly var_base = 1;
        for(i = 1; i <= n; i++){
                var_base = var_base*var(i);
        }

    // Switch to normalization
    def savering = basering;
    setring S;
        poly var_base = imap(savering,var_base);

        // Variables of S as product
        poly var_ext = 1;
        n = nvars(basering);
        for(i = 1; i <= n ; i++){
                var_ext = var_ext*var(i);
        }

        // Variables to eliminate
        poly var_elim = var_ext/var_base;

        // Compute norid intersect basering = minimal prime
        ideal min_prime = eliminate(norid,var_elim);

    // Switch to R and return
    setring savering;
    ideal min_prime = imap(S,min_prime);
    return(min_prime);

}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc conductorIdealIntersect(list id, int miss)
"USAGE:     conductorIdealIntersect(id,miss); id list, miss int
ASSUME:     id is a list of ideals
RETURN:     the intersection of all ideals in id except the one chosen via miss
NOTE:       - the index can be chosen outside the list
            - the empty intersection is the whole ring
KEYWORDS:   intersection"
{

        int n = size(id);
        ideal in_sect = 1;
        int i;

        // Intersect ideals
        for(i = 1; i <= n; i++){
                if(i != miss){
            in_sect = intersect(in_sect,id[i]);
                }
        }

        return(in_sect);

}


////////////////////////////////////////////////////////////////////////////////////////////////


proc curveConductorMult(ideal I, list #)
"USAGE:     curveConductorMult(I); I ideal
ASSUME:     I is a radical ideal, dim(R/I) = 1
RETURN:     the multiplicity of the conductor
NOTE:       the optional parameter can be used if the normalization has already
            been computed. If a list L contains the output of the procedure
            normal (with options prim, wd and usering if the ring has a mixed ordering),
            apply curveConductorMult(I,L)
KEYWORDS:   conductor; multiplicity
SEE ALSO:   normalConductor
EXAMPLE:    example curveConductorMult; shows an example"
{

    if(size(#) > 0){
        list norma = #;
    }else{
        // Compute the normalization with delta invariants
        list norma = normal(I,"useRing","prim","wd");
    }

    // delta invariant
    int delta = curveDeltaInv(I,norma);
        // If the delta invariant is infinite, the conductor multiplicity is as well
        if(delta == -1){
                return(-1);
        }

    // Conductor
    ideal C = normalConductor(I,norma);
    int c_dim = vdim(std(C));
    if(c_dim == -1){
        return(-1);
    }

        // Return conductor multiplicity
        return(vdim(std(C)) + delta);

}
example
{
"EXAMPLE:"; echo = 2;

//////////////////////////////////////////////
// Mutltiplicity of the conductor of curves //
//////////////////////////////////////////////

ring R = 0,(x,y,z),ds;

// Example 1:
ideal I = x2-y4z,z3y2+xy2;
I = std(radical(I));
curveConductorMult(I);

// Example 2:
ideal I = x*(y+z)^3 - y3, x2y2 + z5;
I = std(radical(I));
curveConductorMult(I);

kill R;

////////////////////////////////////////////////////////
// Mutltiplicity of the conductor of Gorenstein curve //
////////////////////////////////////////////////////////

ring R = 0,(x,y),ds;
ideal I = xy;

// In such a case, the conductor multiplicity c satisfies: c = 2*delta
// Delta invariant:
curveDeltaInv(I);
// Conductor Multiplicity:
curveConductorMult(I);
}


////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------- Deligne number --------------------------------------//
////////////////////////////////////////////////////////////////////////////////////////////////


proc curveDeligneNumber(ideal I, list #)
"USAGE:     curveDeligneNumber(I); I ideal
ASSUME:     I is a radical ideal, dim(R/I) = 1
RETURN:     the Deligne number of R/I
REMARKS:    The Deligne number e satisfies by definition: e = 3delta - m.
            So the algorithm splits the computation into two parts: one part computes the delta
            invariant, the other part the colength of derivations m.
NOTE:       the optional parameter can be used if the normalization has already
            been computed. If a list L contains the output of the procedure
            normal (with options prim, wd and usering if the ring has a mixed ordering),
            apply curveDeligneNumber(I,L)
KEYWORDS:   deligne number; invariant
SEE ALSO:   curveColengthDerivations, curveDeltaInv
EXAMPLE:    example curveDeligneNumber; shows an example"
{

    if(size(#) > 0){
        list norma = #;
    }else{
        // Compute the normalization with delta invariants
        list norma = normal(I,"useRing","prim","wd");
    }

    int delt = curveDeltaInv(I,norma);
    int m = curveColengthDerivations(I,norma);
    return(3*delt - m);

}
example
{
"EXAMPLE:"; echo = 2;

//////////////////////////////
// Deligne number of curves //
//////////////////////////////

// Example 1:
ring R = 0,(x,y,z),ds;
ideal I = x2-y4z,z3y2+xy2;
I = std(radical(I));
curveDeligneNumber(I);

// Example 2:
ring S = 0,(x,y),ds;
ideal I = (x+y)*(x2-y3);
curveDeligneNumber(I);

// Example 3:
ideal J = (x2-y3)*(x2+y2)*(x-y);
curveDeligneNumber(J);
// Let us also compute the milnor number of this complete intersection:
milnor(J);

// We see that the Milnor number is bigger than the Deligne number. Hence, this
// curve cannot be quasi homogeneous. This can also be verified by Saitos criterion:
reduce(J[1],std(jacob(J[1])));
}


////////////////////////////////////////////////////////////////////////////////////////////////


proc curveColengthDerivations(ideal I, list #)
"USAGE:     curveColengthDerivations(I); I ideal
ASSUME:     I is a radical ideal
RETURN:     the colength of derivations of R/I
REMARKS:    The procedure goes through all branches and computes the colength of
            derivations there. Then the d-dimension of the minimal primes is computed.
            After that, everything is summed up.
NOTE:       the optional parameter can be used if the normalization has already
            been computed. If a list L contains the output of the procedure
            normal (with options prim, wd and usering if the ring has a mixed ordering),
            apply curveColengthDerivations(I,L)
KEYWORDS:   deligne number; invariants; colength of derivations
EXAMPLE:    example curveColengthDerivations; shows an example"
{
//SEE ALSO:   curveColengthDerivationsComp

    if(size(#) > 0){
        list norma = #;
    }else{
        // Compute the normalization with delta invariants
        list norma = normal(I,"useRing","prim","wd");
    }

    int r = size(norma[1]);
    int i,j;
    ideal U,A,B;
    module Der_P;
    def S;
    def savering = basering;

    // List of minimal primes and their derivation modules
    list min_prime;
    list der_mod;

    // Colength of derivations of any branch, m_delta and total colength of derivations
    int m_i;
    int m_delta;
    int ext_number;

    // Go through the irreducible components and compute thecolength of derivations m_i
    for(i = 1; i <= r; i++){
        // Derivations preserving the minimal primes
        S = norma[1][i];
        U = norma[2][i];

        min_prime[i] = conductorMinPrime(S);
        der_mod[i] = find_der(min_prime[i]);
        Der_P = der_mod[i];

        // Switch to normalization of R/P and compute colength of derivations
        setring S;
        ideal U = imap(savering,U);
        module Der_P = imap(savering,Der_P);

        m_i = curveColengthDerivationsComp(Der_P,U,norid);

        // Add colength of derivations of this branch to total colength of derivations
        ext_number = ext_number + m_i;
        setring savering;
    }

    // Now compute m_delta via curveDdim
    A = min_prime[1];
    B = std(1);

    for(i = 2; i <= r; i++){
        A = intersect(A,B);
        B = min_prime[i];
        m_delta = m_delta + curveDdim(A,find_der(A),B,find_der(B));
    }

    // Add this to the colength of derivations
    ext_number = ext_number + m_delta;
    return(ext_number);

}
example
{
"EXAMPLE:"; echo = 2;

///////////////////////////////////////
// colength of derivations of curves //
///////////////////////////////////////

// Example 1:
ring R = 0,(x,y,z),ds;
ideal I = x2-y4z,z3y2+xy2;
I = std(radical(I));
curveColengthDerivations(I);

// Example 2:
ring S = 0,(x,y),ds;
ideal I = (x+y)*(x2-y3);
curveColengthDerivations(I);

// Example 3:
ideal J = (x2-y3)*(x2+y2)*(x-y);
curveColengthDerivations(J);
}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc curveColengthDerivationsComp(module Der_P, ideal U, ideal relid)
"USAGE:     curveColengthDerivationsComp(Der_P,U,relid); Der_P module, U ideal, relid ideal
ASSUME:     - the basering is the normalization of R/P, where P is a prime
            - Der_P is the module of P-preserving derivations
            - U containts the generators of the normalization of R/P
            - relid is the ideal of relations that hold in the normalization of R/P
RETURN:     the colength of derivations of R/P
NOTE:       the procedure is for interior use only - it is part of the computation of
            the total colength of derivations
KEYWORDS:   colength of derivations
SEE ALSO:   curveAdjustModule, curveExtDerModule"
{

    int k;

    // Adjust the generators of Der_P to the new variables T(1),...,T(k),x(1),...,x(n)
    // if there are new variables - check number of blocks
    if(size(ringlist(basering)[3]) >= 3){
        k = size(ringlist(basering)[3][1][2]);
        Der_P = curveAdjustModule(Der_P,k);
    }

    // Extend the derivation module to the normalization
    Der_P = curveExtDerModule(Der_P,U,relid);

    // Derivations preserving the relation ideal
    module Der_relid = find_der(relid);

    // Quotient module with relations given by relid
    Der_P = Der_P + relid*freemodule(nvars(basering));
    module quotient_mod = modulo(Der_relid,Der_P);
    k = vdim(std(quotient_mod));

    if(k == -1){
        ERROR("Colength of derivations not finite !");
    }

    return(k);

}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc curveExtDerModule(module Der_P, ideal U, ideal relid)
"USAGE:     curveExtDerModule(Der_P,U,relid); Der_P module, U ideal, relid ideal
ASSUME:     - the basering is the normalization of R/P, where P is prime
            - Der_P is the module of P-preserving derivations (with adjusted generators)
            - U containts the generators of the normalization of R/P
            - relid is the ideal of relations that hold in the normalization of R/P
RETURN:     The derivation module lifted to the normalization
REMARKS:    the generators of Der_P are extended via the quotient rule
NOTE:       the procedure is for interior use only - it is part of the computation of
            the total colength of derivations
KEYWORDS:   derivations; extend derivations
"
{
//SEE ALSO:   curveColengthDerivationsComp

    int k = size(Der_P);
    int n = size(U) - 1;
    int i,j;

    module M_ext;
    vector delt;
    vector delt_ext;

    poly g = (U[n+1])^2;
    poly f;
    poly Un = 1;
    matrix D[k][n];
    matrix G[k][n];
    list temp_div;

    for(i = 1; i <= k; i++){
        delt = Der_P[i];

        // Extend to new variables by quotient rule
        for(j = 1; j <= n; j++){
            f = vecDerivationEval(delt,U[j])*U[n+1] - vecDerivationEval(delt,U[n+1])*U[j];

            // Division
            temp_div = division(f,ideal(g) + relid);

            // Units
            D[i,j] = temp_div[3][1,1];
            // Unit Un is product of all D[i][j]
            Un = Un*D[i,j];

            // Factor of dividing by g
            G[i,j] = temp_div[1][1,1];
        }
    }

    // Extension of the generating derivations
    for(i = 1; i <= k; i++){
        delt_ext = Un*Der_P[i];

        // Now add the images of the new variables multiplied by the units
        for(j = 1; j <= n; j++){
            delt_ext = delt_ext + (Un / D[i,j])*G[i,j]*gen(j);
        }

        M_ext[i] = delt_ext;
    }

    return(M_ext);

}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc curveAdjustModule(module M, int k)
"USAGE:     curveAdjustModule(M,k); M module, k int
RETURN:     the module M with shifted (by k) generators
NOTE:       the procedure is for interior use only - it is part of the computation of
            the total colength of derivations
KEYWORDS:   adjust module
"
{
//SEE ALSO:   curveColengthDerivationsComp"

    module M_copy = M;
    int n = size(M);
    int vs,i,j;
    vector v,w;

    // Adjust dimension of generators
    for(i = 1; i <= n; i++){
        v = M_copy[i];
        vs = nrows(v);

        for(j = 1; j <= vs; j++){
            w = w + v[j]*gen(j+k);
        }

        M[i] = w;
        w = 0;
    }

    return(M);

}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc curveDdim(ideal I, module DI, ideal J, module DJ)
"USAGE:     curveDdim(I,DI,J,DJ); I,J ideal, DI,DJ module
ASSUME:     DI are the I-preserving derivations and DJ are the J-preserving derivations
RETURN:     d(I,J) = dim_k (DI + DJ / (I+J)*Der(R))
NOTE:       the procedure is part of the computations of the colength of derivations.
            It computes the d-dimension
KEYWORDS:   derivation module; logarithmic derivations
SEE ALSO:   curveColengthDerivations"
{

    module M = DI+DJ;
    module N = (I+J)*freemodule(nvars(basering));
    module H = modulo(M,N);
    int k = vdim(std(H));

    if(k == -1){
        ERROR("d-dimension not finite !");
    }

    return(k);

}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc vecDerivationEval(vector delt, poly f)
"USAGE:     vecDerivationEval(delt,f); delt vector, f poly
ASSUME:     delt does not have more rows than the number of variables in the basering
RETURN:     the image of f under delt, if we consider delt as derivation
REMARKS:    We identify derivations as vectors
NOTE:       - the procedure is for interior use only - it is part of the computation of
            the total colength of derivations
            - it is used to apply the quotient rule
KEYWORDS:   derivation
SEE ALSO:   curveExtDerModule"
{

    int n = nrows(delt);
    int i;
    poly eval_;

    for(i = 1; i <= n; i++){
        eval_ = eval_ + delt[i]*diff(f,var(i));
    }

    return(eval_);

}


////////////////////////////////////////////////////////////////////////////////////////////////


static proc find_der(ideal I)
"USAGE: find_der(I); I ideal
RETURN: generators of the module of logarithmic derivations
REMARK: Algorithm by R. Epure - Homogeneity and Derivations on Analytic Algebras"
{
    // Dummy variables and Initialization:
    int k,i,n,m;

    //generating matrix for syzygie computation:
    n = nvars(basering);
    m = size(I);
    ideal j = jacob(I);

    matrix M=matrix(j,m,n);
    for (i = 1; i <= m; i++){
        M = concat(M,diag(I[i],m));
    }
    module C = syz(M);
    module D;

    for(i = 1; i <= size(C); i++){
        D = D + C[i][1..n];
    }

    //Clearing memory
    kill j;
    kill C;
    kill M;
    return(D);
}


////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////