Changeset afc171 in git for Singular/LIB


Ignore:
Timestamp:
Sep 7, 2009, 10:26:43 AM (15 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
d317a90d4242efb5169bc024c79fc9c4937bc022
Parents:
d65c0faa4c8fc1d6650f180804a68d2a6a70acac
Message:
new version from Gert-Martin, as of Sept 6, 2009


git-svn-id: file:///usr/local/Singular/svn/trunk@12094 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/normal.lib

    rd65c0fa rafc171  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: normal.lib,v 1.57 2009-09-03 21:20:03 laplagne Exp $";
     2version="$Id: normal.lib,v 1.58 2009-09-07 08:26:43 seelisch Exp $";
    33category="Commutative Algebra";
    44info="
     
    4545         Decomposition:@*
    4646         - \"equidim\" -> computes first an equidimensional decomposition,
    47          and then the normalization of each component. (default)@*
     47         and then the normalization of each component (default).@*
    4848         - \"prim\" -> computes first the minimal associated primes, and then
    4949         the normalization of each prime. @*
    5050         - \"noDeco\" -> no preliminary decomposition is done. If the ideal is
    5151         not equidimensional radical, output might be wrong.@*
    52          - \"isPrim\" -> assumes that the ideal is prime. If assumption does
    53          not hold, output might be wrong.@*
     52         - \"isPrim\" -> assumes that the ideal is prime. If this assumption
     53         does not hold, the output might be wrong.@*
    5454         - \"noFac\" -> factorization is avoided in the computation of the
    5555         minimal associated primes;
    5656         Other:@*
    5757         - \"useRing\" -> uses the original ring ordering.@*
    58          If the ring ordering is not global, it will change to a global
    59          ordering only for computing radicals and prime or equidimensional
    60          decompositions.@*
    61          If this option is not set, it changes to dp ordering and perform all
    62          computation with respect to this ordering.@*
    63          - \"withDelta\" (or \"wd\") -> returns also the delta invariants.
    64          If choose is not given or empty, the default options are used.@*
     58         If this option is set and if the ring ordering is not global, normal
     59         will change to a global ordering only for computing radicals and prime
     60         or equidimensional decompositions.@*
     61         If this option is not set, normal changes to dp ordering and performs
     62         all computations with respect to this ordering.@*
     63         - \"withDelta\" (or \"wd\") -> returns also the delta invariants.@*
     64         If choose is not given or empty, only \"equidim\" but no other option
     65         is used.
    6566ASSUME:  The ideal must be radical, for non-radical ideals the output may
    66          be wrong (id=radical(id); makes id radical). However, when using
     67         be wrong (id=radical(id); makes id radical). However, when using the
    6768         \"prim\" option the minimal associated primes of id are computed first
    6869         and hence normal computes the normalization of the radical of id.@*
    69          \"isPrim\" should only be used if id is known to be prime.
     70NOTE:    \"isPrim\" should only be used if id is known to be prime.
    7071RETURN:  a list, say nor, of size 2 (resp. 3 with option \"withDelta\").
    71 @format
    72          * nor[1], the first element, is a list of r rings, where r is the
    73          number of associated primes P_i with option \"prim\" (resp. >= no
    74          of equidimenensional components P_i with option \"equidim\").@*
    75          Each ring Ri:=nor[1][i], i=1..r, contains two ideals with given
    76          names @code{norid} and @code{normap} such that @*
     72@format  Let R denote the basering and id the input ideal.
     73         * nor[1] is a list of r rings, where r is the number of associated
     74         primes P_i with option \"prim\" (resp. >= no of equidimenensional
     75         components P_i with option \"equidim\").@*
     76         Each ring Ri := nor[1][i], i=1..r, contains two ideals with given
     77         names @code{norid} and @code{normap} such that: @*
    7778         - Ri/norid is the normalization of the i-th component, i.e. the
    78           integral closure in its field of fractions (as affine ring);
    79          - @code{normap} gives the normalization map from basering/id to
     79          integral closure of R/P_i in its field of fractions (as affine ring);
     80         - @code{normap} gives the normalization map from R/id to
    8081           Ri/norid for each i.@*
    8182         - the direct sum of the rings Ri/norid, i=1,..r, is the normalization
    82            of basering/id; @*
     83           of R/id as affine algebra; @*
    8384         * nor[2] is a list of size r with information on the normalization of
    84          the i-th component as module over the basering:@*
    85          nor[2][i] is an ideal, say U, in the basering such that the integral
    86          closure of basering/P_i is generated as module over the basering by
    87          1/c * U, with c the last element U[size(U)] of U.@*
     85         the i-th component as module over the basering R:@*
     86         nor[2][i] is an ideal, say U, in R such that the integral closure
     87         of basering/P_i is generated as module over R by 1/c * U, with c
     88         the last element U[size(U)] of U.@*
    8889         * nor[3] (if option \"withDelta\" is set) is a list of an intvec
    8990         of size r, the delta invariants of the r components, and an integer,
    9091         the total delta invariant of basering/id (-1 means infinite, and 0
    91          that basering/P_i resp. basering/input is normal).
     92         that R/P_i resp. R/id is normal).
    9293@end format
    93 THEORY:  We use a general algorithm described in [G.-M. Greuel, S. Laplagne,
    94          F. Seelisch: Normalization of Rings (2009)].@*
    95          The delta invariant of a reduced ring K[x1,...,xn]/id is
    96              dim_K(normalization(K[x1,...,xn]/id) / K[x1,...,xn]/id)
    97          We call this number also the delta invariant of id.
    98 NOTE:    To use the i-th ring type: @code{def R=nor[1][i]; setring R;}.
     94THEORY:  We use here a general algorithm described in [G.-M.Greuel, S.Laplagne,
     95         F.Seelisch: Normalization of Rings (2009)].@*
     96         The procedure computes the R-module structure, the algebra structure
     97         and the delta invariant of the normalization of R/id:@*
     98         The normalization of R/id is the integral closure of R/id in its total
     99         ring of fractions. It is a finitely generated R-module and nor[2]
     100         computes R-module generators of it. More precisely: If U:=nor[2][i]
     101         and c:=U[size(U)], then c is a non-zero divisor and U/c is an R-module
     102         in the total ring of fractions, the integral closure of R/P_i. Since
     103         U[size(U)]/c is equal to 1, R/P_i resp. R/id is contained in the
     104         integral closure.@*
     105         The normalization is also an affine algebra over the ground field
     106         and nor[1] presents it as such. For geometric considerations nor[1] is
     107         relevant since the variety of the ideal norid in Ri is the
     108         normalization of the variety of the ideal P_i in R.@*
     109         The delta invariant of a reduced ring A is dim_K(normalization(A)/A).
     110         For A=K[x1,...,xn]/id we call this number also the delta invariant of
     111         id. nor[3] returns the delta invariants of the components P_i and of
     112         id.
     113NOTE:    To use the i-th ring type e.g.: @code{def R=nor[1][i]; setring R;}.
    99114@*       Increasing/decreasing printlevel displays more/less comments
    100115         (default: printlevel=0).
     
    102117@*       Not implemented for quotient rings.
    103118@*       If the input ideal id is weighted homogeneous a weighted ordering may
    104          be used (qhweight(id); computes weights).
     119         be used together with the useRing-option (qhweight(id); computes
     120         weights).
    105121KEYWORDS: normalization; integral closure; delta invariant.
     122SEE ALSO: normalC, normalP.
    106123EXAMPLE: example normal; shows an example
    107124"
     
    110127
    111128  int i,j;
    112   int decomp;   // Preliminar decomposition:
     129  int decomp;   // Preliminary decomposition:
    113130                // 0 -> no decomposition (id is assumed to be prime)
    114131                // 1 -> no decomposition
     
    136153//--------------------------- define the method ---------------------------
    137154  string method;                //make all options one string in order to use
    138                                //all combinations of options simultaneously
     155                                //all combinations of options simultaneously
    139156  for ( i=1; i <= size(#); i++ )
    140157  {
     
    171188    }
    172189    else
    173     {
    174       "WARNING: the delta invariants cannot be computed with an equidimensional";
    175       "         decomposition.";
    176       "         Use option \"prim\" to compute first the minimal associated primes.";
    177       "";
     190    { 
     191      decomp = 3;
     192      withDelta = 1;
     193      //Note: the delta invariants cannot be computed with an equidimensional
     194      //decomposition, hence we compute first the minimal primes
    178195    }
    179196  }
     
    426443    resultNew = list(RL, MG);
    427444  }
    428 
     445   
     446  sp = size(RL);              //RL = list of rings
    429447  option(set, opt);
    430448
     
    440458      "// 'normal' created a list, say nor, of three elements.";
    441459    }
    442     "// * nor[1] is a list of", sp, "ring(s). To access the i-th ring nor[1][i], ";
    443     "// give it a name, say Ri, and type e.g. ";
     460    "// To see the list type";
     461    "      nor;";
     462    "";
     463    "// * nor[1] is a list of", sp, "ring(s).";
     464    "// To access the i-th ring nor[1][i], give it a name, say Ri, and type";
    444465    "     def R1 = nor[1][1]; setring R1; norid; normap;";
    445     "// For the other rings type first ";
    446     "     setring r;";
    447     "// (if r is the name of your original basering) and then continue as";
    448     "// for the first ring.";
    449     "// Ri/norid is the affine algebra of the normalization of the i-th ";
    450     "// component r/P_i (where P_i is the i-th component of a decomposition of";
    451     "// the input ideal) and normap the normalization map from r to Ri/norid.";
    452     "// * nor[2] is a list of", sp, "ideal(s) such that the integral";
    453     "// closure of basering/P_i is generated as module over the basering by";
    454     "// 1/ci * Ui, with Ui the i-th ideal of nor[2] and ci the last element";
    455     "// Ui[size(Ui)] of Ui.";
     466    "// For the other rings type first (if R is the name of your base ring)";
     467    "     setring R;";
     468    "// and then continue as for R1.";
     469    "// Ri/norid is the affine algebra of the normalization of R/P_i where";
     470    "// P_i is the i-th component of a decomposition of the input ideal id";
     471    "// and normap the normalization map from R to Ri/norid.";
     472    "";
     473    "// * nor[2] is a list of", sp, "ideal(s). Let ci be the last generator";
     474    "// of the ideal nor[2][i]. Then the integral closure of R/P_i is";
     475    "// generated as R-submodule of the total ring of fractions by";
     476    "// 1/ci * nor[2][i].";
     477
    456478    if(withDelta)
    457     {
    458       "// * nor[3] is a list of an intvec of size r, the delta invariants ";
    459       "// of the r components, and an integer, the total delta invariant ";
    460       "// of basering/id (-1 means infinite, and 0 that basering/P_i resp. ";
    461       "// basering/input is normal).";
     479    { "";
     480      "// * nor[3] is a list of an intvec of size", sp, "the delta invariants ";
     481      "// of the components, and an integer, the total delta invariant ";
     482      "// of R/id (-1 means infinite, and 0 that R/P_i resp. R/id is normal).";
    462483    }
    463484  }
     
    796817    //return(newR);
    797818  }
    798 
    799819
    800820
     
    26752695proc primeClosure (list L, list #)
    26762696"USAGE:    primeClosure(L [,c]); L a list of a ring containing a prime ideal
    2677                                  ker, c an optional integer
     2697          ker, c an optional integer
    26782698RETURN:   a list L (of size n+1) consisting of rings L[1],...,L[n] such that
    26792699          - L[1] is a copy of (not a reference to!) the input ring L[1]
     
    27222742  }
    27232743
    2724 // R0 is the ring to work with, if we are in step one, make a copy of the
     2744// R0 below is the ring to work with, if we are in step one, make a copy of the
    27252745// input ring, so that all objects are created in the copy, not in the original
    27262746// ring (therefore a copy, not a reference is defined).
     
    27442764      setring R0;
    27452765      ideal ker=fetch(R,ker);
    2746 
    27472766      // check whether we compute the normalization of the blow up of
    27482767      // an isolated singularity at the origin (checked in normalI)
     
    27592778      setring R0;
    27602779  }
    2761 
    27622780
    27632781// In order to apply HomJJ from normal.lib, we need the radical of the singular
     
    28772895
    28782896  list RS = HomJJ(RR);
    2879 
     2897  //NOTE: HomJJ creates new ring with variables X(i) and T(j)
    28802898//-------------------------------------------------------------------------
    28812899// If we've reached the integral closure (as determined by the result of
     
    29993017
    30003018  int n=size(L)-1;
    3001   int i,j,k,l;
     3019  int i,j,k,l,n2,n3;
     3020  intvec V;
    30023021  string mapstr;
    30033022  for (i=1; i<=n; i++) { def R(i) = L[i]; }
     
    30393058             //### noch abfragen ob Z(i) definiert ist
    30403059             list gnirlist = ringlist(R(k));
    3041              int n2 = size(gnirlist[2]);
    3042              int n3 = size(gnirlist[3]);
     3060             n2 = size(gnirlist[2]);
     3061             n3 = size(gnirlist[3]);
    30433062             for( i=1; i<=ncols(phi); i++)
    30443063             {
    30453064               gnirlist[2][n2+i] = "Z("+string(i)+")";
    30463065             }
    3047              intvec V;
     3066             V=0;
    30483067             V[ncols(phi)]=0; V=V+1;
    30493068             gnirlist[3] = insert(gnirlist[3],list("dp",V),n3-1);
     
    31683187  int n = size(L);                // the number of rings R(1)-->...-->R(n)
    31693188  int length = nvars(L[n]);       // the number of variables of the last ring
    3170   int j,k,l;
     3189  int j,k,l,n2,n3;
     3190  intvec V;
    31713191  string mapstr;
    31723192  list preimages;
     
    32233243         //### noch abfragen ob Z(i) definiert ist
    32243244         list gnirlist = ringlist(R(k));
    3225          int n2 = size(gnirlist[2]);
    3226          int n3 = size(gnirlist[3]);
     3245         n2 = size(gnirlist[2]);
     3246         n3 = size(gnirlist[3]);
    32273247         for( i=1; i<=ncols(phi); i++)
    32283248         {
    32293249            gnirlist[2][n2+i] = "Z("+string(i)+")";
    32303250         }
    3231          intvec V;
     3251         V=0;
    32323252         V[ncols(phi)]=0;
    32333253         V=V+1;
     
    32943314
    32953315proc normalP(ideal id,list #)
    3296 "USAGE:   normalP(id [,choose]); id a radical ideal, choose a comma separated
     3316"USAGE:   normalP(id [,choose]); id = radical ideal, = optional string.
     3317         Optional parameters in list choose (can be entered in any order):@*
    32973318         list of optional strings \"withRing\", \"isPrim\", \"noFac\",
    32983319         \"noRed\", where@*
    3299          - \"noFac\", factorization is avoided during the computation
     3320         - \"noFac\" -> factorization is avoided during the computation
    33003321         of the minimal associated primes.@*
    3301          - \"isPrim\", disables the computation of the minimal associated
    3302          primes (should only be used if the ideal is known to be prime).@*
    3303          - \"withRing\", the ring structure of the normalization is
     3322         - \"isPrim\" -> assumes that the ideal is prime. If the assumption
     3323         does not hold, output might be wrong.@*
     3324         - \"withRing\" -> the ring structure of the normalization is
    33043325         computed. The number of variables in the new ring is reduced as much
    33053326         as possible.@*
    3306          - \"noRed\", when computing the ring structure no reduction on the
    3307          number of  variables is done, it creates one new variable for each
    3308          of the new generators of the integral closure in the quotient field.@*
    3309 ASSUME:  The characteristic of the ground field must be positive. The ideal
    3310          id is assumed to be radical. However, if choose does not contain
    3311          \"isPrim\" the minimal associated primes of id are computed first
    3312          and hence normal computes the normalization of the radical of id.
    3313          If choose = \"isPrim\" the ideal must be a prime ideal (this is not
    3314          tested) otherwise the result may be wrong.
    3315 RETURN:  a list, say 'nor' of size 2 (default) or, if \"withRing\" is given,
    3316          of size 3. @*
    3317          nor[1] (resp. nor[2] if \"withRing\" is given) is a list of ideals
    3318          Ii, i=1..r, in the basering where r is the number of associated prime
    3319          ideals P_i (irreducible components) of id.@*
    3320          - Ii is an ideal given by polynomials g_1,...,g_k,g_k+1 such that
    3321            g_1/g_k+1,...,g_k/g_k+1 generate the integral closure of
    3322            basering/P_i as module (over the basering) in its quotient field.@*
    3323 
    3324          nor[2] (resp. nor[3] if choose=\"withRing\") is a list of an intvec
     3327         - \"noRed\" -> when computing the ring structure, no reduction on the
     3328         number of variables is done, it creates one new variable for every
     3329         new module generator of the integral closure in the quotient field.@*
     3330ASSUME:  The characteristic of the ground field must be positive. If the
     3331         option \"isPrim\" is not set, the minimal associated primes of id
     3332         are computed first and hence normal computes the normalization of
     3333         the radical of id. If option \"isPrim\" is set, the ideal must be
     3334         a prime ideal otherwise the result may be wrong.
     3335RETURN:  a list, say 'nor' of size 2 (resp. 3 if \"withRing\" is set).@*
     3336         ** If option \"withRing\" is not set: @*
     3337         Only the module structure is computed: @*
     3338         * nor[1] is a list of ideals Ii, i=1..r, in the basering R where r
     3339         is the number of minimal associated prime ideals P_i of the input
     3340         ideal id, describing the module structure:@*
     3341         If Ii is given by polynomials g_1,...,g_k in R, then c:=g_k is
     3342         non-zero in the ring R/P_i and g_1/c,...,g_k/c generate the integral
     3343         closure of R/P_i as R-module in the quotient field of R/P_i.@*
     3344         * nor[2] shows the delta invariants: it is a list of an intvec
    33253345         of size r, the delta invariants of the r components, and an integer,
    3326          the total delta invariant of basering/id (-1 means infinite, and 0
    3327          that basering/P_i resp. basering/input is normal). @*
    3328 
    3329          If the optional string \"withRing\" is given, the ring structure of
    3330          the normalization is computed too and nor[1] is a list of r rings.@*
    3331          Each ring Ri = nor[1][i], i=1..r, contains two ideals with given names
    3332          @code{norid} and @code{normap} such that @*
    3333          - Ri/norid is the normalization of the i-th rime component P_i, i.e.
    3334            isomorphic to the integral closure of basering/P_i in its field
    3335            of fractions; @*
     3346         the total delta invariant of R/id
     3347         (-1 means infinite, and 0 that R/P_i resp. R/id is normal). @*
     3348         ** If option \"withRing\" is set: @*
     3349         The ring structure is also computed, and in this case:@*
     3350         * nor[1] is a list of r rings.@*
     3351         Each ring Ri = nor[1][i], i=1..r, contains two ideals with given
     3352         names @code{norid} and @code{normap} such that @*
     3353         - Ri/norid is the normalization of R/P_i, i.e. isomorphic as
     3354           K-algebra (K the ground field) to the integral closure of R/P_i in
     3355           the field of fractions of R/P_i; @*
    33363356         - the direct sum of the rings Ri/norid is the normalization
    3337            of basering/id; @*
    3338          - @code{normap} gives the normalization map from basering/P_i to
    3339            Ri/norid (for each i).@*
    3340 THEORY:  The delta invariant of a reduced ring K[x1,...,xn]/id is
    3341              dim_K(normalization(K[x1,...,xn]/id) / K[x1,...,xn]/id)
    3342          We call this number also the delta invariant of id. normalP uses
    3343          the qth-power algorithm suggested by Leonard-Pellikaan (using the
    3344          Frobenius) in part similair to an implementation by Singh-Swanson.
     3357           of R/id; @*
     3358         - @code{normap} gives the normalization map from R to Ri/norid.@*
     3359         * nor[2] gives the module generators of the normalization of R/P_i,
     3360         it is the same as nor[1] if \"withRing\" is not set.@*
     3361         * nor[3] shows the delta invariants, it is the same as nor[2] if
     3362         \"withRing\" is not set.
     3363THEORY:  normalP uses the Leonard-Pellikaan-Singh-Swanson algorithm (using the
     3364         Frobenius) cf. [A. K. Singh, I. Swanson: An algorithm for computing
     3365         the integral closure, arXiv:0901.0871].
     3366         The delta invariant of a reduced ring A is dim_K(normalization(A)/A).
     3367         For A=K[x1,...,xn]/id we call this number also the delta invariant of
     3368         id. The procedure returns the delta invariants of the components P_i
     3369         and of id.
    33453370NOTE:    To use the i-th ring type: @code{def R=nor[1][i]; setring R;}.
    33463371@*       Increasing/decreasing printlevel displays more/less comments
    33473372         (default: printlevel = 0).
    33483373@*       Not implemented for local or mixed orderings or quotient rings.
     3374         For local or mixed orderings use proc 'normal'.
    33493375@*       If the input ideal id is weighted homogeneous a weighted ordering may
    33503376         be used (qhweight(id); computes weights).
    3351 @*       works only in characteristic p > 0.
     3377@*       Works only in characteristic p > 0, use proc normal in char 0.
    33523378KEYWORDS: normalization; integral closure; delta invariant.
    3353 SEE ALSO: normal
     3379SEE ALSO: normal, normalC
    33543380EXAMPLE: example normalP; shows an example
    33553381"
     
    35253551     {
    35263552"// 'normalP' created a list, say nor, of three lists:
    3527 // nor[1] resp. nor[2] are lists of",sr,"ring(s) resp. ideal(s)
    3528 // and nor[3] is a list of an intvec and an integer.
    35293553// To see the result, type
    35303554     nor;
     3555
     3556// * nor[1] is a list of",sr,"ring(s):
    35313557// To access the i-th ring nor[1][i] give it a name, say Ri, and type e.g.
    35323558     def R1 = nor[1][1]; setring R1;  norid; normap;
    3533 // for the other rings type first setring r; (if r is the name of your
    3534 // original basering) and then continue as for the first ring;
     3559// for the other rings type first setring R; (if R is the name of your
     3560// original basering) and then continue as for R1;
    35353561// Ri/norid is the affine algebra of the normalization of the i-th
    3536 // component r/P_i (where P_i is an associated prime of the input ideal)
    3537 // and normap the normalization map from r to Ri/norid;
    3538 //    nor[2] is a list of",sr,"ideal(s), each ideal nor[2][i] consists of
     3562// component R/P_i (where P_i is a min. associated prime of the input ideal)
     3563// and normap the normalization map from R to Ri/norid;
     3564
     3565// * nor[2] is a list of",sr,"ideal(s), each ideal nor[2][i] consists of
    35393566// elements g1..gk of r such that the gj/gk generate the integral
    3540 // closure of r/P_i as (r/P_i)-module in the quotient field of r/P_i.
    3541 //    nor[3] shows the delta-invariant of each component and of the input
     3567// closure of R/P_i as R-module in the quotient field of R/P_i.
     3568
     3569// * nor[3] shows the delta-invariant of each component and of the input
    35423570// ideal (-1 means infinite, and 0 that r/P_i is normal).";
    35433571     }
     
    35453573     {
    35463574"// 'normalP' computed a list, say nor, of two lists:
    3547 //    nor[1] is a list of",sr,"ideal(s), where each ideal nor[1][i] consists
    3548 // of elements g1..gk of the basering such that gj/gk generate the integral
    3549 // closure of the i-th component as (basering/P_i)-module in the quotient
    3550 // field of basering/P_i (P_i an associated prime of the input ideal);
    3551 //    nor[2] shows the delta-invariant of each component and of the input ideal
    3552 // (-1 means infinite, and 0 that r/P_i is normal).";
     3575// To see the result, type
     3576     nor;
     3577
     3578// * nor[1] is a list of",sr,"ideal(s), where each ideal nor[1][i] consists
     3579// of elements g1..gk of the basering R such that gj/gk generate the integral
     3580// closure of R/P_i (where P_i is a min. associated prime of the input ideal)
     3581// as R-module in the quotient field of R/P_i;
     3582
     3583// * nor[2] shows the delta-invariant of each component and of the input ideal
     3584// (-1 means infinite, and 0 that R/P_i is normal).";
    35533585     }
    35543586   }
     
    48594891}
    48604892
    4861 //                Up to here: procedures for normal
     4893//                    End procedures for normal
    48624894///////////////////////////////////////////////////////////////////////////////
    48634895
    48644896
    48654897///////////////////////////////////////////////////////////////////////////////
    4866 //                From here: procedures for normalC
     4898//                  Begin procedures for normalC
    48674899
    48684900// We first define resp. copy some attributes to be used in proc normal and
     
    50955127  return(id);
    50965128}
     5129///////////////////////////////////////////////////////////////////////////////
    50975130
    50985131proc normalC(ideal id, list #)
    5099 "USAGE:   normalC(id [,choose]);  id = radical ideal, choose = optional string
    5100          which may be a combination of \"equidim\", \"prim\", \"withGens\",
    5101          \"isPrim\", \"noFac\".@*
    5102          If choose is not given or empty, a default method is choosen@*
    5103          If choose = \"prim\" resp. \"equidim\" normalC computes a prime resp.
    5104          an equidimensional decomposition and then the normalization of each
    5105          component; if choose = \"noFac\" factorization is avoided in the
    5106          computation of the minimal associated primes; @*
    5107          if choose = \"withGens\" the minimal associated primes P_i of id are
     5132"USAGE:   normalC(id [,choose]);  id = radical ideal, choose = optional string.
     5133         Optional parameters in list choose (can be entered in any order):@*
     5134         Decomposition:@*
     5135         - \"equidim\" -> computes first an equidimensional decomposition,
     5136         and then the normalization of each component (default).@*
     5137         - \"prim\" -> computes first the minimal associated primes, and then
     5138         the normalization of each prime. @*
     5139         - \"noDeco\" -> no preliminary decomposition is done. If the ideal is
     5140         not equidimensional radical, output might be wrong.@*
     5141         - \"isPrim\" -> assumes that the ideal is prime. If the assumption does
     5142         not hold, output might be wrong.@*
     5143         - \"noFac\" -> factorization is avoided in the computation of the
     5144         minimal associated primes;
     5145         Other:@*
     5146         - \"withGens\" -> the minimal associated primes P_i of id are
    51085147         computed and for each P_i, algebra generators of the integral closure
    51095148         of basering/P_i are computed as elements of its quotient field;@*
    5110          \"isPrim\" disables \"equidim\" and \"prim\".@*
     5149         If choose is not given or empty, the default options are used.@*
    51115150ASSUME:  The ideal must be radical, for non-radical ideals the output may
    5112          be wrong (id=radical(id); makes id radical). However, if choose =
    5113          \"prim\" the minimal associated primes of id are computed first
     5151         be wrong (id=radical(id); makes id radical). However, if option
     5152         \"prim\" is set the minimal associated primes are computed first
    51145153         and hence normalC computes the normalization of the radical of id.
    51155154         \"isPrim\" should only be used if id is known to be irreducible.
    5116 RETURN:  a list, say nor, of size 2 (resp. 3 if choose=\"withGens\").
    5117          The first list nor[1] consists of r rings, where r is the number
    5118          of irreducible components if choose = \"prim\" (resp. >= no of
    5119          equidimenensional components if choose =  \"equidim\").
    5120 @format
     5155RETURN:  a list, say nor, of size 2 (resp. 3 if option \"withGens\" is set).@*
     5156         * nor[1] is always a of r rings, where r is the number of associated
     5157         primes with option \"prim\" (resp. >= no of equidimenensional
     5158         components with option  \"equidim\").@*
    51215159         Each ring Ri=nor[1][i], i=1..r, contains two ideals with given
    51225160         names @code{norid} and @code{normap} such that @*
    51235161         - Ri/norid is the normalization of the i-th component, i.e. the
    5124           integral closure in its field of fractions (as affine ring);
     5162          integral closure in its field of fractions as affine ring, i.e. Ri is
     5163          given in the form K[X(1..p),T(1..q)], where K is the ground field;
     5164         - normap gives the normalization map from basering/id to
     5165           Ri/norid for each i (the j-th element of normap is mapped to the
     5166           j-th variable of R).@*
    51255167         - the direct sum of the rings Ri/norid is the normalization
    51265168           of basering/id; @*
    5127          - @code{normap} gives the normalization map from basering/id to
    5128            Ri/norid for each j.@*
    5129 
    5130          If choose=\"withGens\", nor[2] is a list of size r of ideals Ii=
    5131          nor[2][i] in the basering, generating the integral closure of
    5132          basering/P_i in its quotient field, i=1..r, in two different ways:
    5133          - Ii is given by polynomials
    5134            g_1,...,g_k,g_k+1 such that the variables T(j) of the ring Ri
    5135            satisfy T(1)=g_1/g_k+1,..,T(k)=g_k/g_k+1. Hence the g_j/g_k+1
    5136            are algebra generators of the integral closure of basering/P_i
    5137            as sub-algebra in the quotient field of basering/P_i.
    5138 
    5139          nor[2] (resp. nor[3] if choose=\"withGens\") is a list of an intvec
    5140          of size r, the delta invariants of the r components, and an integer,
    5141          the total delta invariant of basering/id (-1 means infinite, and 0
    5142          that basering/P_i resp. basering/input is normal).
    5143          Return value -2 means that delta resp. delta of one of the components
    5144          is not computed (which may happen if \"equidim\" is given) .
    5145 @end format
    5146 THEORY:  The delta invariant of a reduced ring K[x1,...,xn]/id is
    5147              dim_K(normalization(K[x1,...,xn]/id) / K[x1,...,xn]/id)
    5148          We call this number also the delta invariant of id.
    5149          We use the algorithm described in [G.-M. Greuel, G. Pfister:
    5150          A SINGULAR Introduction to Commutative Algebra, 2nd Edition.
     5169         ** If option \"withGens\" is not set: @*
     5170         * nor[2] shows the delta invariants: nor[2] is a list of an intvec of
     5171         size r, the delta invariants of the r components, and an integer, the
     5172         delta invariant of basering/id. (-1 means infinite, 0 that basering/P_i
     5173         resp. basering/input is normal, -2 means that delta resp. delta of one
     5174         of the components is not computed (which may happen if \"equidim\" is
     5175         given). @*
     5176         ** If option \"withGens\" is set:
     5177         * nor[2] is a list of ideals Ii=nor[2][i], i=1..r, in the basering,
     5178         generating the integral closure of basering/P_i in its quotient field
     5179         as K-algebra (K the ground field):@*
     5180         If Ii is given by polynomials g_1,...,g_k, then c:=g_k is a non-zero
     5181         divisor and the j-th variables of the ring Ri satisfies var(j)=g_j/c,
     5182         j=1..k-1, as element in the quotient field of basering/P_i. The
     5183         g_j/g_k+1 are K-algebra generators  of the integral closure of
     5184         basering/P_i.@*
     5185         * nor[3] shows the delta invariant as above.
     5186THEORY:  We use the Grauert-Remmert-de Jong algorithm [c.f. G.-M. Greuel,
     5187         G. Pfister: A SINGULAR Introduction to Commutative Algebra, 2nd Edition.
    51515188         Springer Verlag (2007)].
     5189         The procedure computes the algebra structure and the delta invariant of
     5190         the normalization of R/id:@*
     5191         The normalization is an affine algebra over the ground field K
     5192         and nor[1] presents it as such: Ri = K[X(1..p),T(1..q)] and Ri/norid
     5193         is the integral closure of R/P_i; if option \"withGens\" is set the
     5194         X(j) and T(j) are expressed as quotients in the total ring of
     5195         fractions. Note that the X(j) and T(j) generate the integral closure
     5196         as K-algebra, but not necessarily as R-module (since relations of the
     5197         form X(1)=T(1)*T(2) may have been eliminated). Geometrically the   
     5198         algebra structure is relevant since the variety of the ideal norid in 
     5199         Ri is the normalization of the variety of the ideal P_i in R.@*
     5200         The delta invariant of a reduced ring A is dim_K(normalization(A)/A).
     5201         For A=K[x1,...,xn]/id we call this number also the delta invariant of
     5202         id. nor[3] returns the delta invariants of the components P_i and of
     5203         id.
    51525204NOTE:    To use the i-th ring type: @code{def R=nor[1][i]; setring R;}.
    51535205@*       Increasing/decreasing printlevel displays more/less comments
    51545206         (default: printlevel=0).
    5155 @*       Not implemented for local or mixed orderings and for quotient rings.
     5207@*       Not implemented for local or mixed orderings or quotient rings.
     5208         For local or mixed orderings use proc 'normal'.
    51565209@*       If the input ideal id is weighted homogeneous a weighted ordering may
    51575210         be used (qhweight(id); computes weights).
    51585211KEYWORDS: normalization; integral closure; delta invariant.
     5212SEE ALSO: normal, normalP.
    51595213EXAMPLE: example normalC; shows an example
    51605214"
    51615215{
    5162    int i,j, wgens, withEqui, withPrim, isPrim, nfac;
    5163    int y = printlevel-voice+2;
     5216   int i,j;
     5217   int withGens, withEqui, withPrim, isPrim, noFac;
     5218   int dbg = printlevel-voice+2;
    51645219   int nvar = nvars(basering);
    51655220   int chara  = char(basering);
    5166    list result,prim,keepresult;
     5221   list result, prim, keepresult;
     5222
     5223  int decomp;   // Preliminar decomposition:
     5224                // 0 -> no decomposition (id is assumed to be prime)
     5225                // 1 -> no decomposition
     5226                //      (id is assumed to be equidimensional radical)
     5227                // 2 -> equidimensional decomposition
     5228                // 3 -> minimal associated primes
     5229
     5230   // Default methods:
     5231   noFac = 0;         // Use facstd when computing minimal associated primes
     5232   decomp = 2;        // Equidimensional decomposition for nvar > 2
     5233   if (nvar <= 2)
     5234   { decomp = 3; }    // Compute minimal associated primes if nvar <= 2
    51675235
    51685236   if ( ord_test(basering) != 1 )
     
    51705238     "";
    51715239     "// Not implemented for this ordering,";
    5172      "// please change to global ordering!";
     5240     "// please change to global ordering or use proc normal";
    51735241     return(result);
    51745242   }
     
    51865254
    51875255   //--------------------------- choosen methods -----------------------
    5188    //we have the methods
    51895256   // "withGens": computes algebra generators for each irreducible component
    5190    // the general case: either "equidim" or not (then applying minAssGTZ)
     5257   // ### the extra code for withGens should be incorporated in the general case
    51915258
    51925259   if ( find(method,"withgens") or find(method,"withGens"))
    51935260   {
    5194      wgens=1;
    5195    }
     5261     withGens = 1;
     5262   }
     5263
     5264   // the general case: either equidim or minAssGTZ or no decomposition
     5265
     5266   if ( find(method,"isprim") or find(method,"isPrim") )
     5267   {decomp = 0; isPrim=1;}
     5268
     5269   if ( find(method,"nodeco") or find(method,"noDeco") )
     5270   {decomp = 1;}
     5271
    51965272   if ( find(method,"equidim") )
    5197    {
    5198      withEqui=1;
    5199    }
     5273   { decomp = 2; }
     5274
    52005275   if ( find(method,"prim") )
    5201    {
    5202      withPrim=1;
    5203    }
    5204    if ( find(method,"isprim") or find(method,"isPrim") )
    5205    {
    5206      isPrim=1;
    5207    }
    5208    if ( find(method,"noFac") )
    5209    {
    5210      nfac=1;
    5211    }
    5212 
    5213    //------------------ default method, may be changed --------------------
    5214    //Use a prime decomposition only for small no of variables otherwise equidim
    5215    //Compute delta whenever possible.
    5216 
    5217    if ( ((chara==0 || chara>30) && nvar>2 && !withPrim && !isPrim) ||
    5218    ((chara==0 || chara>30) && size(#)  ==  0) )
    5219    {
    5220       withEqui=1;
    5221    }
     5276   { decomp = 3; }
     5277
     5278   if ( find(method,"nofac") or find(method,"noFac") )
     5279   { noFac = 1; }
     5280
    52225281   kill #;
    52235282   list #;
     
    52265285   //--------------------- method "withGens" ----------------------------------
    52275286   //the integral closure is computed in proc primeClosure. In the general case
    5228    //it is computed in normalizationPrimes. The main difference is that  in
    5229    //primeClosure the singular locus is only computed in the first iteration
    5230    //that no attributes are used and that the generators are computed.
     5287   //it is computed in normalizationPrimes. The main difference is that in
     5288   //primeClosure the singular locus is only computed in the first iteration,
     5289   //that no attributes are used, and that the generators are computed.
    52315290   //In primeClosure the (algebra) generators for each irreducible component
    5232    //are computed in static proc closureGenerators
    5233 
    5234    if( wgens )
    5235    {
    5236       if( y >= 1 )
     5291   //are computed in the static proc closureGenerators
     5292
     5293   if( withGens )
     5294   {
     5295      if( dbg >= 1 )
    52375296      {  "";
    52385297         "// We use method 'withGens'";
    52395298      }
    5240       if ( isPrim )
     5299      if ( decomp == 0 or decomp == 1 )
    52415300      {
    52425301         prim[1] = id;
    5243          if( y >= 0 )
     5302         if( dbg >= 0 )
    52445303         {
    52455304           "";
     
    52505309      else
    52515310      {
    5252          if(y>=1)
    5253          {  "// compute minimal associated primes"; }
    5254 
    5255          if( nfac )
     5311         if(dbg >= 1)
     5312         {  "// Computing minimal associated primes..."; }
     5313
     5314         if( noFac )
    52565315         { prim = minAssGTZ(id,1); }
    52575316         else
    52585317         { prim = minAssGTZ(id); }
    52595318
    5260          if(y>=1)
     5319         if(dbg >= 2)
     5320         {  prim;""; }
     5321         if(dbg >= 1)
    52615322         {
    5262             prim;"";
    52635323            "// number of irreducible components is", size(prim);
    52645324         }
     
    52745334      for(i=1; i<=size(prim); i++)
    52755335      {
    5276          if(y>=1)
     5336         if(dbg>=1)
    52775337         {
    52785338            ""; pause(); "";
    5279             "// start computation of component",i;
    5280             "   --------------------------------";
     5339            "// Computing normalization of component",i;
     5340            "   ---------------------------------------";
    52815341         }
    52825342
     
    52855345         export(ker);
    52865346         l = R;
    5287          l = primeClosure(l,1);               //here the work is done
     5347         l = primeClosure(l,1);              //here the work is done
     5348         // primeClosure is called with list l consisting of the basering
    52885349         //### ausprobieren ob primeClosure(l,1) schneller als primeClosure(l)
    52895350         // 1 bedeutet: kŸrzester nzd
     5351         // l[size(l)] is the delta invariant
    52905352
    52915353         if ( l[size(l)] >= 0 && del >= 0 )
     
    53445406      int sr = size(resu);
    53455407
    5346       if ( y >= 0 )
     5408      if ( dbg >= 0 )
    53475409      {"";
    53485410"// 'normalC' created a list, say nor, of three lists:
    5349 // nor[1] resp. nor[2] are lists of",sr,"ring(s) resp. ideal(s)
    5350 // and nor[3] is a list of an intvec and an integer.
    5351 // To see the result, type
    5352      nor;
     5411// To see the list type
     5412      nor;
     5413
     5414// * nor[1] is a list of",sr,"ring(s)
    53535415// To access the i-th ring nor[1][i] give it a name, say Ri, and type e.g.
    53545416     def R1 = nor[1][1]; setring R1;  norid; normap;
    5355 // for the other rings type first setring r; (if r is the name of your
    5356 // original basering) and then continue as for the first ring;
     5417// For the other rings type first (if R is the name of your original basering)
     5418     setring R;
     5419// and then continue as for R1.
    53575420// Ri/norid is the affine algebra of the normalization of the i-th
    5358 // component r/P_i (where P_i is an associated prime of the input ideal)
    5359 // and normap the normalization map from r to Ri/norid;
    5360 //    nor[2] is a list of",sr,"ideal(s), each ideal nor[2][i] consists of
    5361 // elements g1..gk of r such that the gj/gk generate the integral
    5362 // closure of r/P_i as sub-algebra in the quotient field of r/P_i, with
     5421// component R/P_i (where P_i is an associated prime of the input ideal id)
     5422// and normap the normalization map from R to Ri/norid.
     5423
     5424// * nor[2] is a list of",sr,"ideal(s), each ideal nor[2][i] consists of
     5425// elements g1..gk of R such that the gj/gk generate the integral
     5426// closure of R/P_i as sub-algebra in the quotient field of R/P_i, with
    53635427// gj/gk being mapped by normap to the j-th variable of Ri;
    5364 //    nor[3] shows the delta-invariant of each component and of the input
    5365 // ideal (-1 means infinite, and 0 that r/P_i resp. r/input is normal).";
     5428
     5429// * nor[3] shows the delta-invariant of each component and of id
     5430// (-1 means infinite, and 0 that R/P_i resp. R/id is normal).";
    53665431      }
    53675432      return(Resu);
    53685433   }
     5434   //----------------- end method "withGens" --------------------------------
    53695435
    53705436//-------- The general case without computation of the generators -----------
     
    54655531   //Komponenten als niederdim Komponenten, waehrend diese bei primdecGTZ
    54665532   //nicht auftauchen: ideal(x,y)*xy
    5467    //this is default for nvars > 2 and char = 0 or car > 30
    5468 
    5469    if( withEqui )
     5533   //this is default for nvars > 2
     5534
     5535   if( decomp == 2 )
    54705536   {
    54715537      withPrim = 0;                 //this is used to check later that prim
    54725538                                    //contains equidim but not prime components
    5473       if( y >= 1 )
     5539      if( dbg >= 1 )
    54745540      {
    54755541         "// We use method 'equidim'";
     
    54905556         prim = equidim(id);
    54915557      }
    5492       if(y>=1)
     5558      if(dbg>=1)
    54935559      {  "";
    54945560         "// number of equidimensional components:", size(prim);
    54955561      }
    5496       if ( !nfac )
     5562      if ( !noFac )
    54975563      {
    54985564        intvec opt = option(get);
     
    55085574        }
    55095575
    5510         if(y>=1)
     5576        if(dbg>=1)
    55115577        {  "";
    55125578         "// number of components after application of facstd:", size(prim);
     
    55245590    if( isPrim )
    55255591    {
    5526       if( y >= 0 )
     5592      if( dbg >= 0 )
    55275593      {
    55285594         "// ** WARNING: result is correct if ideal is prime";
     
    55315597         "// or equidimensional components";"";
    55325598      }
    5533       if( y >= 1 )
     5599      if( dbg >= 1 )
    55345600      {
    55355601        "// We use method 'isPrim'";"";
     
    55415607      withPrim = 1;                 //this is used to check later that prim
    55425608                                    //contains prime but not equidim components
    5543       if( y >= 1 )
     5609      if( dbg >= 1 )
    55445610      {
    55455611         "// We use method 'prim'";
     
    55545620         else
    55555621         {
    5556             if( nfac )
     5622            if( noFac )
    55575623            { prim=minAssGTZ(id,1); }     //does not use factorizing groebner
    55585624            else
     
    55625628      else
    55635629      {
    5564             if( nfac )
     5630            if( noFac )
    55655631            { prim=minAssGTZ(id,1); }
    55665632            else
    55675633            { prim=minAssGTZ(id); }
    55685634      }
    5569       if(y>=1)
     5635      if(dbg>=1)
    55705636      {  "";
    55715637         "// number of irreducible components:", size(prim);
     
    55815647   for(i=1; i<=sp; i++)
    55825648   {
    5583       if(y>=1)
     5649      if(dbg>=1)
    55845650      {  "";
    55855651         "// computing the normalization of component",i;
     
    56665732      deli = keepresult[skr][2],deli;
    56675733
    5668       if ( y>=1 )
     5734      if ( dbg>=1 )
    56695735      {
    56705736           "// delta of component",i; keepresult[skr][1];
     
    56755741   // -------------- Now compute intersection multiplicities -------------
    56765742   //intersection multiplicities of list prim, sp=size(prim).
    5677       if ( y>=1 )
     5743      if ( dbg>=1 )
    56785744      {
    56795745        "// Sum of delta for all components"; del;
     
    57005766
    57015767//--------------- Finally print comments and return ------------------
    5702    if ( y >= 0)
     5768   if ( dbg >= 0)
    57035769   {"";
    57045770"// 'normalC' created a list, say nor, of two lists:
    5705 // nor[1] is a list of",sr,"ring(s), nor[2] a list of an intvec and an int.
    57065771// To see the result, type
    57075772      nor;
     5773
     5774// * nor[1] is a list of",sr,"ring(s).
    57085775// To access the i-th ring nor[1][i] give it a name, say Ri, and type e.g.
    57095776      def R1 = nor[1][1];  setring R1;  norid;  normap;
    57105777// and similair for the other rings nor[1][i];
    5711 // Ri/norid is the affine algebra of the normalization of the i-th component
    5712 // r/P_i (where P_i is a prime or an equidimensional ideal of the input ideal)
     5778// Ri/norid is the affine algebra of the normalization of r/P_i  (where P_i
     5779// is an associated prime or an equidimensional part of the input ideal id)
    57135780// and normap the normalization map from the basering to Ri/norid;
    5714 //    nor[2] shows the delta-invariant of each component and of the input
    5715 // ideal (-1 means infinite, -2 that delta of a component was not computed).";
     5781
     5782// * nor[2] shows the delta-invariant of each component and of id
     5783// (-1 means infinite, 0 that r/P_i resp. r/id is normal, and -2 that delta
     5784// of a component was not computed).";
    57165785   }
    57175786   return(result);
     
    62636332// char 13 : normal = 1 sec (7 steps) - normalP doesn't finish - normalC = 13 secs
    62646333// char 32003 : normal = 1 secs (7 steps) - normalP doesn't finish - normalC = 10 sec
     6334//Example is reducible in char 5 and 7
    62656335LIB"normal.lib";
    6266 ring r = 13, (x, y), dp;
     6336ring r = 3, (x, y), dp;
    62676337ideal i = 55*x^8+66*y^2*x^9+837*x^2*y^6-75*y^4*x^2-70*y^6-97*y^7*x^2;
    62686338timeNormal(i, "normal", "normalC", "normalP", "p", "isPrim");
     
    62836353// char 32003 : normal = 0 secs (1 step) - normalP doesn't finish - normalC = 0 secs
    62846354LIB"normal.lib";
    6285 ring r=11,(x,y),dp;   // genus 0 4 nodes and 6 cusps im P2
     6355ring r=5,(x,y),dp;   // genus 0 4 nodes and 6 cusps im P2
    62866356ideal i=(x2+y^2-1)^3 +27x2y2;
    62876357timeNormal(i, "normal", "normalC", "normalP", "isPrim");
     
    63796449//icFracP          0.06 0.07 0.09 0.27 1.81 4.89 26 56 225
    63806450//normalP          0     0    0    0    1    2  6  10  27
    6381 //icFractions      0.16 1.49 75.00 4009  *    *   *  *  *
    6382 //normal            0     0    2    836
     6451//icFractions      0.16 1.49 75.00 4009 *    *   *  *  *
     6452//normal            0     0    2   836
     6453//normal(neu)       0     0    1   2    10  155
    63836454//### p=7 normal braucht 807 sec in:
    63846455// ideal endid  = phi1(endid);      //### bottelneck'
     
    63896460int p = 7; ring r=p,(u,v,w,x,y,z),dp; ideal i=u2x4+uvy4+v2z4;
    63906461//3.
    6391 int p=23; ring r=p,(u,v,w,x,y,z),dp; ideal i=u2*x^p+uv*y^p+v2*z^p;
     6462int p=11; ring r=p,(u,v,w,x,y,z),dp; ideal i=u2*x^p+uv*y^p+v2*z^p;
    63926463
    63936464//IRREDUCIBLE EXAMPLES:
     
    64936564//ideal in der Mitte zu gross
    64946565//i = Ideal (size 118, 13 var) fuer die neue Normalisierung
     6566//normal(neu) haengt bei return(std(i)) (offensichtlich in eineranderen lib)
    64956567
    64966568REDUCIBLE EXAMPLES:
Note: See TracChangeset for help on using the changeset viewer.