Changeset 0132b0 in git


Ignore:
Timestamp:
Apr 23, 1998, 3:23:27 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
e36ae54f25a40adf73b0e8d8180c361742db9def
Parents:
e35965573370ae0d1c2c96e458eb1e3bde28c946
Message:
* incoporated new versions from Martin


git-svn-id: file:///usr/local/Singular/svn/trunk@1437 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/hnoether.lib

    re35965 r0132b0  
    1 // $Id: hnoether.lib,v 1.4 1998-04-03 22:47:05 krueger Exp $
     1// $Id: hnoether.lib,v 1.5 1998-04-23 13:23:23 obachman Exp $
    22// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
    3 // last change:           13.03.98
    4 ///////////////////////////////////////////////////////////////////////////////
    5 
    6 version="$Id: hnoether.lib,v 1.4 1998-04-03 22:47:05 krueger Exp $";
     3// last change:           26.03.98
     4///////////////////////////////////////////////////////////////////////////////
     5
     6version="$Id: hnoether.lib,v 1.5 1998-04-23 13:23:23 obachman Exp $";
    77info="
    88LIBRARY:  hnoether.lib   PROCEDURES FOR THE HAMBURGER-NOETHER-DEVELOPMENT
     
    4949";
    5050
     51///////////////////////////////////////////////////////////////////////////////
    5152LIB "primitiv.lib";
    5253///////////////////////////////////////////////////////////////////////////////
     
    8788}
    8889///////////////////////////////////////////////////////////////////////////////
    89 proc T_Transform (poly f, int Q, int N)
     90proc T_Transform (poly f, int Q, int N) 
    9091// returns f(y,xy^Q)/y^NQ
    9192{
     
    9495}
    9596///////////////////////////////////////////////////////////////////////////////
    96 proc T1_Transform (poly f, number d, int M)
     97proc T1_Transform (poly f, number d, int M) 
    9798// returns f(x,y+d*x^M)
    9899{
     
    109110  int ggt=gcd(M,N);
    110111  M=M/ggt; N=N/ggt;
    111   list ts=extgcd(M,N);
     112  list ts=extgcd(M,N); 
    112113  int tau,sigma=ts[2],-ts[3];
    113114  if (sigma<0) { tau=-tau; sigma=-sigma;}
     
    137138  poly hilf;
    138139 // dividiere f so lange durch x, wie die Div. aufgeht:
    139   for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;}
     140  for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;} 
    140141  for (hilf=f/y; hilf*y==f; hilf=f/y) {f=hilf;} // gleiches fuer y
    141142  return(list(T1(f),d));
     
    149150{
    150151  matrix mat = coeffs(coeffs(f,y)[J+1,1],x);
    151   if (size(mat) <= I) { return(0);}
     152  if (size(mat) <= I) { return(0);} 
    152153  else { return(leadcoef(mat[I+1,1]));}
    153154}
     
    191192  poly dif,g,l;
    192193  if (gcd_ok!=0) {
    193  //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------
     194 //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------ 
    194195    dif=diff(f,x);
    195196    if (dif==0) { g=f; }        // zur Beschleunigung
     
    315316  if ((leadcoef(f)<-16001) or (leadcoef(f)>16001)) {verbrecher=lead(f);}
    316317  leitexp=leadexp(f);
    317   if (( ((leitexp[1] % 32003) == 0)   and (leitexp[1]<>0))
     318  if (( ((leitexp[1] % 32003) == 0)   and (leitexp[1]<>0)) 
    318319     or ( ((leitexp[2] % 32003) == 0) and (leitexp[2]<>0)) )
    319320       {verbrecher=lead(f);}
     
    438439 string ringchar=charstr(basering);
    439440 map xytausch = basering,y,x;
    440  if ((p!=0) and (ringchar != string(p))) {
     441 if ((p!=0) and (ringchar != string(p))) { 
    441442                            // coefficient field is extension of Z/pZ
    442    execute "int n_elements="+ringchar[1,size(ringchar)-2]+";";
     443   execute "int n_elements="+ringchar[1,size(ringchar)-2]+";"; 
    443444                            // number of elements of actual ring
    444445   number generat=par(1);   // generator of the coefficient field of the ring
     
    502503    }
    503504    else {
    504       if ((str=="s") and (testerg==1)) {
     505      if ((str=="s") and (testerg==1)) { 
    505506       "(*) attention: it could be that the factor is only one in char 32003!";
    506507        f=polyhinueber(test_sqr);
     
    605606        delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c);
    606607
    607         if ((ringchar != string(p)) and (delta != 0)) {
     608        if ((ringchar != string(p)) and (delta != 0)) { 
    608609 //- coeff. field is not Z/pZ => we`ve to correct delta by taking (p^l)th root-
    609610          if (delta == generat) {exponent=1;}
     
    614615
    615616 //-- an dieser Stelle kann ein Fehler auftreten, wenn wir eine transzendente -
    616  //-- Erweiterung von Z/pZ haben: dann ist das hinzuadjungierte Element nicht -
    617  //-- primitiv, d.h. in Z/pZ (a) gibt es i.A. keinen Exponenten mit           -
    618  //-- z.B. a2+a = a^exp                                                       -
     617 //-- Erweiterung von Z/pZ haben: dann ist das hinzuadjungierte Element kein -
     618 //-- Erzeuger der mult. Gruppe, d.h. in Z/pZ (a) gibt es i.allg. keinen      -
     619 //-- Exponenten mit z.B. a2+a = a^exp                                        -
    619620 //----------------------------------------------------------------------------
    620621          }}
     
    738739        two power series; then param will return a truncation of these series.
    739740EXAMPLE: example param;      shows an example
    740          example developp;   shows another example
     741         example develop;   shows another example
    741742
    742743{
     
    11951196}
    11961197example
    1197 {
     1198{ 
    11981199  if (nameof(basering)=="HNEring") {
    11991200   def rettering=HNEring;
     
    12931294 }
    12941295if (size(#) != 0) {
    1295    "// basering is now 'displayring' containing ideal 'HNE'";
     1296   "// basering is now 'displayring' containing ideal 'HNE'"; 
    12961297   keepring(displayring);
    12971298   export(HNE);
     
    13611362 //- finde alle Monome auf der Geraden durch A und C (unterhalb gibt's keine) -
    13621363   hilf=jet(f,A[2]*C[1]-A[1]*C[2],intvec(A[2]-C[2],C[1]-A[1]));
    1363 
     1364       
    13641365   H=leadexp(xytausch(hilf));
    13651366   D=H[2],H[1];
     
    15441545     }
    15451546     else {
    1546        execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;";
     1547       execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;";     
    15471548     }
    15481549  }
     
    17321733     delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c);
    17331734
    1734      if ((charstr(basering) != string(p)) and (delta != 0)) {
     1735     if ((charstr(basering) != string(p)) and (delta != 0)) { 
    17351736 //------ coefficient field is not Z/pZ => (p^l)th root is not identity -------
    17361737       delta=0;
     
    17601761USAGE:   reddevelop(f); f poly
    17611762RETURN:  Hamburger-Noether development of f :
    1762          A list of lists in the form of develop(f); each entry contains the
     1763         A list of lists in the form of develop(f); each entry contains the 
    17631764         data for one of the branches of f.
    17641765         For more details type 'help develop;'
     
    18881889   }
    18891890   else {
    1890      if ((str=="s") and (testerg==1)) {
     1891     if ((str=="s") and (testerg==1)) { 
    18911892       "(*)attention: it could be that the factor is only one in char 32003!";
    18921893       f=polyhinueber(test_sqr);
     
    19541955 }
    19551956 //---------------------- Test, ob f teilbar durch x oder y -------------------
    1956  if (subst(f,y,0)==0) {
     1957 if (subst(f,y,0)==0) { 
    19571958   f=f/y; NullHNEy=1; }             // y=0 is a solution
    1958  if (subst(f,x,0)==0) {
     1959 if (subst(f,x,0)==0) { 
    19591960   f=f/x; NullHNEx=1; }             // x=0 is a solution
    19601961
     
    20552056}
    20562057example
    2057 {
     2058{ 
    20582059  if (nameof(basering)=="HNEring") {
    20592060   def rettering=HNEring;
     
    22602261        }
    22612262        else {
    2262           " Change of basering necessary!!";
    2263           if (defined(Protokoll)) { teiler,"is not properly factored!"; }
    2264           if (needext==0) { poly zerlege=teiler; }
    2265           needext=1;
     2263          " Change of basering necessary!!";
     2264          if (defined(Protokoll)) { teiler,"is not properly factored!"; }
     2265          if (needext==0) { poly zerlege=teiler; }
     2266          needext=1;
    22662267        }
    22672268      }
     
    22702271    else { deltais=ideal(delta); eis=e;}
    22712272    if (defined(Protokoll)) {"roots of char. poly:";deltais;
    2272                              "with multiplicities:",eis;}
     2273                             "with multiplicities:",eis;}
    22732274    if (needext==1) {
    22742275 //--------------------- fuehre den Ringwechsel aus: --------------------------
    22752276      ringischanged=1;
    22762277      if ((size(parstr(basering))>0) && string(minpoly)=="0") {
    2277         " ** We've had bad luck! The HNE cannot completely be calculated!";
     2278        " ** We've had bad luck! The HNE cannot completely be calculated!";
    22782279                                   // HNE in transzendenter Erw. fehlgeschlagen
    22792280        kill zerlege;
    2280         ringischanged=0; break;    // weiter mit gefundenen Faktoren
     2281        ringischanged=0; break;    // weiter mit gefundenen Faktoren
    22812282      }
    22822283      if (parstr(basering)=="") {
    2283         EXTHNEnumber++;
    2284         splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")");
    2285         poly transf=0;
    2286         poly transfproc=0;
     2284        EXTHNEnumber++;
     2285        splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")");
     2286        poly transf=0;
     2287        poly transfproc=0;
    22872288      }
    22882289      else {
    2289         if (defined(translist)) { kill translist; } // Vermeidung einer Warnung
    2290         if (numberofRingchanges>1) {  // ein Ringwechsel hat nicht gereicht
    2291         list translist=splitring(zerlege,"",list(transf,transfproc));
    2292         poly transf=translist[1]; poly transfproc=translist[2];
     2290        if (defined(translist)) { kill translist; } // Vermeidung einer Warnung
     2291        if (numberofRingchanges>1) {  // ein Ringwechsel hat nicht gereicht
     2292        list translist=splitring(zerlege,"",list(transf,transfproc));
     2293        poly transf=translist[1]; poly transfproc=translist[2];
    22932294        }
    22942295        else {
    2295         if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel
    2296           EXTHNEnumber++;
    2297           list translist=splitring(zerlege,"EXTHNEring("
     2296        if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel
     2297          EXTHNEnumber++;
     2298          list translist=splitring(zerlege,"EXTHNEring("
    22982299               +string(EXTHNEnumber)+")",list(a,transfproc));
    2299           poly transf=translist[1];
     2300          poly transf=translist[1];
    23002301          poly transfproc=translist[2];
    2301         }
    2302         else {
    2303           EXTHNEnumber++;
    2304           list translist=splitring(zerlege,"EXTHNEring("
     2302        }
     2303        else {
     2304          EXTHNEnumber++;
     2305          list translist=splitring(zerlege,"EXTHNEring("
    23052306               +string(EXTHNEnumber)+")",a);
    2306           poly transf=translist[1];
    2307           poly transfproc=transf;
    2308         }}
     2307          poly transf=translist[1];
     2308          poly transfproc=transf;
     2309        }}
    23092310      }
    23102311 //----------------------------------------------------------------------------
     
    23722373                                  // aktualisiere Vektor mit den hqs
    23732374       if (eis[j]>1) {
    2374         transformiert=transformiert/y;
    2375         if (subst(transformiert,y,0)==0) {
     2375        transformiert=transformiert/y;
     2376        if (subst(transformiert,y,0)==0) {
    23762377 "THE TEST FOR SQUAREFREENESS WAS BAD!! The polynomial was NOT squarefree!!!";}
    2377         else {
     2378        else {
    23782379 //------ Spezialfall (###) eingetreten: Noch weitere Zweige vorhanden --------
    23792380          eis[j]=eis[j]-1;
    2380         }
     2381        }
    23812382       }
    23822383      }
     
    24102411 //-------- Bereitstellung von Speicherplatz fuer eine neue Zeile: ------------
    24112412        HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl),ideal(0));
    2412 
     2413               
    24132414        M1=N1; N1=R1; R1=M1%N1; Q1=M1 / N1;
    24142415       }
     
    26282629  if (flag!=0) {factors;}
    26292630}
    2630 
  • Singular/LIB/primitiv.lib

    re35965 r0132b0  
    1 // $Id: primitiv.lib,v 1.3 1998-04-03 22:47:11 krueger Exp $
    2 // This library requires Singular 1.0
    3 
    4 version="$Id: primitiv.lib,v 1.3 1998-04-03 22:47:11 krueger Exp $";
     1// $Id: primitiv.lib,v 1.4 1998-04-23 13:23:27 obachman Exp $
     2// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
     3// last change:           11.3.98
     4///////////////////////////////////////////////////////////////////////////////
     5version="$Id: primitiv.lib,v 1.4 1998-04-23 13:23:27 obachman Exp $";
    56info="
    67LIBRARY:    primitiv.lib    PROCEDURES FOR FINDING A PRIMITIVE ELEMENT
    78
    8  primitivE(ideal i); finds minimal polynomial for a primitive element
    9 
    10  splitring(poly f,string R[,list L]);  define ring extension with name R
    11                                        and switch to it
    12  randomLast(int b);       random transformation of the last variable
     9 primitive(ideal i);   finds minimal polynomial for a primitive element
     10 splitring(f,R[,L]);   define ring extension with name R and switch to it
     11 randomLast(b);        random transformation of the last variable
    1312";
    1413
     14///////////////////////////////////////////////////////////////////////////////
    1515LIB "random.lib";
    1616///////////////////////////////////////////////////////////////////////////////
     
    2121         a sum of it with a linear random combination of the other
    2222         variables
    23 NOTE:   
    2423EXAMPLE: example randomLast; shows an example
    2524{
     
    4039///////////////////////////////////////////////////////////////////////////////
    4140
    42 proc primitivE(ideal i)
    43 USAGE:  primitivE(i); i ideal of the following form:
     41proc primitive(ideal i)
     42USAGE:  primitive(i); i ideal of the following form:
    4443 Let k be the ground field of your basering, a_1,...,a_n algebraic over k,
    4544 m_1(x1), m_2(x_1,x_2),...,m_n(x_1,...,x_n) polynomials in k such that
     
    4847 Then i has to be generated by m_1,...,m_n.
    4948
    50 RETURN: ideal j in k[x_n] such that
     49RETURN:  ideal j in k[x_n] such that
    5150 j[1] is minimal polynomial for a primitive element b of k(a_1,...,a_n)=k(b)
    5251         over k
    5352 j[2],...,j[n+1] polynomials in k[x_n] : j[i+1](b)=a_i for i=1,...,n
    54 NOTE: the number of variables in the basering has to be exactly the number n of
    55       given algebraic elements (and minimal polynomials)
    56 EXAMPLE:    example primitivE;  shows an example
     53NOTE:    the number of variables in the basering has to be exactly the number n
     54         of given algebraic elements (and minimal polynomials)
     55EXAMPLE: example primitive;  shows an example
    5756{
    5857 def altring=basering;
     
    111110 ring exring=0,(x,y),dp;
    112111 ideal i=x2+1,y2-x;                  // compute Q(i,i^(1/2))=:L
    113  ideal j=primitivE(i);               // -> we have L=Q(a):
     112 ideal j=primitive(i);               // -> we have L=Q(a):
    114113 "minimal polynomial of a:",j[1];    // => a=(-1)^(1/4)
    115114 "polynomial for i:       ",j[2];    // => i=a^2
    116115 "polynomial for i^(1/2): ",j[3];    // => i^(1/2)=a
    117116 // ==> the 2nd element was already primitive!
    118  j=primitivE(ideal(x2-2,y2-3));      // compute Q(sqrt(2),sqrt(3))
     117 j=primitive(ideal(x2-2,y2-3));      // compute Q(sqrt(2),sqrt(3))
    119118 "minimal polynomial:",j[1];
    120119 "polynomial p s.t. p(a)=sqrt(2):",j[2];
     
    130129ACTION: defines a ring with name R, in which f is reducible, and changes to it
    131130        If the old ring has no parameter, the name 'a' is chosen for the
    132         parameter of R (if a is no variable; if it is, the proc takes 'b'; if
    133         this is also impossible, then 'c'), otherwise the name of the parameter
    134         is kept and only the minimal polynomial is changed.
     131        parameter of R (if a is no variable; if it is, the proc takes 'b',
     132        etc.; if a,b,c,o are variables of the ring, produce an error message),
     133        otherwise the name of the parameter is kept and only the
     134        minimal polynomial is changed.
    135135        The names of variables and orderings are not affected.
    136136
     
    138138        will be REPLACED by the new ring (with the same name as the old ring).
    139139
    140 RETURNs: list L mapped into the new ring R, if L is given; else nothing
    141 ASSUME : the active ring must be bivariate and allow an algebraic extension
     140RETURN: list L mapped into the new ring R, if L is given; else nothing
     141ASSUME: the active ring must allow an algebraic extension
    142142         (e.g. it cannot be a transcendent ring extension of Q or Z/p)
    143143EXAMPLE: example splitring;  shows an example
     
    162162 string varnames=varstr(altring);
    163163 string algname;
     164 int i;
     165 int anzvar=size(maxideal(1));
    164166 //--------------- Fall 1: Bisheriger Ring hatte kein Minimalpolynom ----------
    165167 if (minp=="0") {
    166168  if (find(varnames,"a")==0)        { algname="a";}
    167169  else { if (find(varnames,"b")==0) { algname="b";}
    168          else                       { algname="c";}
    169  //----------- nur ZWEI Variablen erlaubt ==> c ist kein Variablenname --------
     170         else { if (find(varnames,"c")==0)
     171                                    { algname="c";}
     172         else { if (find(varnames,"o")==0)
     173                                    { algname="o";}
     174         else {
     175           "** Sorry -- could not find a free name for the primitive element.";
     176           "** Try e.g. a ring without 'a' or 'b' as variable.";
     177           return();
     178         }}
     179       }
    170180  }
    171181 //-- erzeuge einen String, der das Minimalpolynom des neuen Rings enthaelt: --
    172182  execute("ring splt1="+charakt+","+algname+",dp;");
    173   map nach_splt1=altring,var(1),var(1);
     183  ideal abbnach=var(1);
     184  for (i=1; i<anzvar; i++) { abbnach=abbnach,var(1); }
     185  map nach_splt1=altring,abbnach;
    174186  execute("poly mipol="+string(nach_splt1(f))+";");
    175187  string Rminp=string(mipol);
     
    198210  execute("ring splt3="+charakt+",("+algname+","+varnames+"),dp;");
    199211  poly f=imap(altring,f);
    200  //-------------- Vorbereitung des Aufrufes von primitivE: --------------------
     212 //-------------- Vorbereitung des Aufrufes von primitive: --------------------
    201213  execute("ring splt1="+charakt+",(x,y),dp;");
    202   map nach_splt1_3=splt3,x,y,y;
     214  ideal abbnach=x;
     215  for (i=1; i<=anzvar; i++) { abbnach=abbnach,y; }
     216  map nach_splt1_3=splt3,abbnach;
    203217  map nach_splt1_2=splt2,x;
    204218  ideal maxid=nach_splt1_2(mipol),nach_splt1_3(f);
    205   ideal primit=primitivE(maxid);
     219  ideal primit=primitive(maxid);
    206220  "new minimal polynomial:",primit[1];
    207221 //-- erzeuge einen String, der das Minimalpolynom des neuen Rings enthaelt: --
     
    210224  minp=string(nach_splt2(primit)[1]);
    211225 //--------------------- definiere den neuen Ring: ----------------------------
    212   execute("ring "+@R+" = ("+charakt+","+algname+"),("+varnames+"),("+ordstr(altring)+");");
     226  execute("ring "+@R+" = ("+charakt+","+algname+"),("+varnames+"),("
     227          +ordstr(altring)+");");
    213228  execute("minpoly="+minp+";");
    214229  execute("export "+@R+";");
     
    225240    map nach_splt3_1=splt1,0,var(1);  // x->0, y->a
    226241 //----- rechne das primitive Element von altring in das von neuring um: ------
    227     map convert=splt3,nach_splt3_1(primit)[2],var(2),var(3);
     242    ideal convid=maxideal(1);
     243    convid[1]=nach_splt3_1(primit)[2];
     244    map convert=splt3,convid;
    228245    zwi=convert(zwi);
    229246    setring neuring;
Note: See TracChangeset for help on using the changeset viewer.