source: git/Singular/LIB/classify.lib @ b3ce75

fieker-DuValspielwiese
Last change on this file since b3ce75 was f34c37c, checked in by Olaf Bachmann <obachman@…>, 25 years ago
* cosmetic changes to enable parsing of help git-svn-id: file:///usr/local/Singular/svn/trunk@3233 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 89.0 KB
Line 
1// $Id: classify.lib,v 1.33 1999-07-06 11:32:45 obachman Exp $
2// KK, last modified: 04.04.1998
3///////////////////////////////////////////////////////////////////////////////
4
5version  = "$Id: classify.lib,v 1.33 1999-07-06 11:32:45 obachman Exp $";
6info="
7LIBRARY:  classify.lib  PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES
8
9OVERVIEW:
10   A library for classifying isolated hypersurface singularities w.r.t. right
11   equivalence, based on the determinator of singularities by V.I. Arnold.
12
13AUTHOR:
14   Kai Krueger, krueger@mathematik.uni-kl.de
15
16PROCEDURES:
17basicinvariants(f);  computes Milnor number, determinacy-bound and corank of f
18classify(f);         normal form of poly f determined with Arnold's method
19corank(f);           computes the corank of f (i.e. of the Hessian of f)
20Hcode(v);            coding of intvec v acoording to the number repetitions
21init_debug([n]);     print trace and debugging information depending on int n
22internalfunctions(); display names of internal procedures of this library
23milnorcode(f[,e]);   Hilbert poly of [e-th] Milnor algebra coded with Hcode
24morsesplit(f);       residual part of f after applying the splitting lemma
25quickclass(f)        normal form of f determined by invariants (milnorcode)
26singularity(s,[]);   normal form of singularity given by its name s and index
27swap (a,b);          returns b,a
28tschirnhaus(f,v);    Tschirnhaus transformation of f w.r.t. variable v
29A_L(s/f)              shortcut for quickclass(f) or normalform(s)
30normalform(s);       normal form of singularity given by its name s
31debug_log (lev,[])   print trace and debugging information w.r.t level>@DeBug
32           (parameters in square brackets [] are optional)
33";
34
35LIB "inout.lib";
36LIB "elim.lib";
37LIB "sing.lib";
38
39///////////////////////////////////////////////////////////////////////////////
40proc classify_init
41{
42  string s;
43  link l="DBM:r NFlist";
44  s = read(l,"VERSION");
45  if (s == "" ) {
46    "(classify.lib): Need to create database...";
47    LIB"makedbm.lib";
48    create_sing_dbm();
49  }
50  close(l);
51  l="DBM:r NFlist";
52  s = read(l,"VERSION");
53  //"(classify.lib): Creation done. Current version:", s;
54}
55///////////////////////////////////////////////////////////////////////////////
56
57proc classify (poly f_in)
58"USAGE:    classify(f);  f=poly
59COMPUTE:  normal form and singularity type of f with respect to right
60          equivalence, as given in the book \"Singularities of
61          differentiables maps, Volume I\" by V.I. Arnold, S.M. Gusein-Zade,
62          A.N. Varchenko
63RETURN:   normal form of f, of type poly
64REMARK:   This version of classify is only alpha. Please send bugs and
65          comments to: \"Kai Krueger\" <krueger@mathematik.uni-kl.de>
66          Be sure to have at least Singular version 0.9.3, better 1.0.1
67          Updates can be found under:
68          URL=http://www.mathematik.uni-kl.de/~krueger/Singular/
69NOTE:     type init_debug(n); (0 <= n <= 10) in order to get intermediate
70          information, higher values of n give more information.
71          The proc creates several global objects with names all starting
72          with @, hence there should be no name conflicts
73EXAMPLE:  example classify; shows an example"
74{
75//---------------------------- initialisation ---------------------------------
76  poly   f_out;
77  int    n, i, corank, show_nf;
78  string s2;
79  list   v;
80  def ring_ext = basering;
81
82  if(system("with","Namespaces")) {
83    if(defined(A_Z)==0) { proc A_Z = general_lib::A_Z; export A_Z; }
84  }
85  init_debug();                    // initialize trace/debug mode
86  if(checkring()) { return(f_in); }
87  n = nvars(basering);
88  show_nf  = 1;                // return normal form if set to '1'
89
90  // define new ring
91  ring ring_top=char(basering),(x(1..n)),(c,ds);
92
93  map conv_ext2top=ring_ext,maxideal(1);
94
95  if(defined(@ringdisplay)!=0) { kill @ringdisplay; }
96  string @ringdisplay = "ring_ext";
97  export @ringdisplay;
98
99  v = Klassifiziere(conv_ext2top(f_in));
100  poly f_out = v[1];
101  s2 = v[2];          // s2: Typ des Polynoms f z.b: E[18]
102  corank = v[3];
103
104//---------------- collect results and create return-value --------------------
105  if( s2=="error!" || s2=="NoClass") {
106      setring ring_ext;
107      return(f_in);
108  }
109
110  if(show_nf==1) {
111    poly f_nf = normalform(s2);
112    for(i=corank+1;i<=n;i=i+1) { f_nf = f_nf + x(i)^2; }
113    debug_log(2, "Normal form NF(f)=", f_nf);
114  }
115  if(corank>1) { for(i=corank+1;i<=n;i=i+1) { f_out = f_out + x(i)^2; } }
116  setring ring_ext;
117  map conv_top2ext=ring_top,maxideal(1);
118
119  if(show_nf == 1) { return(conv_top2ext(f_nf)); }
120  else { return(conv_top2ext(f_out)); }
121}
122example
123{"EXAMPLE"; echo=2;
124   ring r=0,(x,y,z),ds;
125   poly f=(x2+3y-2z)^2+xyz-(x-y3+x2*z3)^3;
126   classify(f);
127   init_debug(3);
128   classify(f);
129}
130
131///////////////////////////////////////////////////////////////////////////////
132static
133proc Klassifiziere (poly f)
134{
135//--------------------------- initialisation ----------------------------------
136    string s1;
137    int    n, cnt, corank_f, K, Mu;
138    list   v, cstn;
139    map    PhiG;
140    def ring_top = basering;
141
142    n = nvars(basering);    // Zahl der Variablen des aktuellen Rings.
143    PhiG = ring_top, maxideal(1);
144    cstn[4] = PhiG;
145    if( defined(@ringdisplay) == 0) {
146      string @ringdisplay;               // Define always 'ringdisplay' to be
147      export @ringdisplay;               // able to run 'Show(f)'
148    }
149    @ringdisplay = "setring RingB;";
150    if(defined(RingB)!=0) { kill RingB; }
151    execute ("ring RingB="+charstr(basering)+",("+A_Z("x", n)+"),(c,ds);");
152    export RingB;
153    setring ring_top;
154
155//---------------------- compute basciinvariants ------------------------------
156    if(jet(f,0) != 0 ) {
157      cstn[1] = corank(f); cstn[2]=-1; cstn[3]=1;
158      return(printresult(1, f, "a unit", cstn, -1));
159    }
160
161    debug_log(1, "Computing Basicinvariants of f ...");
162    K, Mu, corank_f = basicinvariants(f);
163    debug_log(0, "About the singularity :");
164    debug_log(0, "          Milnor number(f)   = "+string(Mu));
165    debug_log(0, "          Corank(f)          = "+string(corank_f));
166    debug_log(0, "          Determinacy       <= "+string(K));
167    cstn[1] = corank_f;
168    cstn[2] = Mu;
169    cstn[3] = K;
170
171    if( Mu == 0) {
172      cstn[1]=1; cstn[3]=1;
173      return(printresult(1, f, "A[0]", cstn, 0)); }
174
175    if(Mu<0) {
176      debug_log(0, "The Milnor number of the function is infinite.");
177      debug_log(0, "The singularity is not in Arnolds list.");
178      return(printresult(1, 1, "error!", cstn, -1));
179    }
180
181    f = jet(f, K);
182    v = HKclass(milnorcode(f));
183    if(v[2]>0) { debug_log(0, "Guessing type via Milnorcode: ", v[1]);}
184    else {
185      debug_log(0, "Hilbert polynomial not recognised. Milnor code = ",
186                milnorcode(f));
187    }
188    debug_log(0, "");
189    debug_log(0, "Computing normal form ...");
190
191//------------ step 1, classification according to corank(f) ------------------
192    if(corank_f == 0) {
193       return(printresult(2, f, "A["+string(Mu)+"]", cstn, 0)); }
194    if(corank_f == 1) {
195       return(printresult(2, f, "A["+string(Mu)+"]", cstn, 0)); }
196    cstn[4] = 0;
197    if(corank_f == 2) { return(Funktion1bis(f, cstn)); }
198    if(corank_f == 3) { return(Funktion1bis(f, cstn)); }
199    return(printresult(105, f, "NoClass", cstn, -1));
200}
201
202///////////////////////////////////////////////////////////////////////////////
203static
204proc Funktion1bis (poly f, list cstn)
205{
206//---------------------------- initialisation ---------------------------------
207   def ring_top=basering;
208   poly   g;
209   int    n, corank, K;
210   map    conv, PhiG;
211   string s1;
212   list   v_res, v_class, v, iv;
213
214   corank = cstn[1];
215   K = cstn[3];
216   n = nvars(basering);
217
218//-------------------- apply morsesplit if n>corank ---------------------------
219   if( n > corank) {
220     debug_log(0,
221      "I have to apply the splitting lemma. This will take some time....:-)");
222     v_res = Morse(f, K, corank, 0);
223     g = v_res[1];
224     PhiG = v_res[2];
225
226     conv = ReOrder(g);
227     g = conv(g);
228     PhiG = conv(PhiG);
229
230     if(defined(RingB) != 0 ) { kill RingB; }
231     ring ring_rest=char(basering),(x(1..corank)),(c,ds);
232
233     map MapReduce=ring_top,maxideal(1);
234     poly G = MapReduce(g);
235     map PhiG=ring_top,maxideal(1);// Konstruiere Id auf r
236     PhiG = MapReduce(PhiG);
237
238     execute("ring RingB="+charstr(basering)+",("+A_Z("x",corank)+"),(c,ds);");
239     export RingB;
240     setring ring_rest;
241   }
242   else {
243     ring ring_rest=char(basering),(x(1..corank)),(c,ds);
244     map  PhiG=ring_top,maxideal(1);
245     poly G = PhiG(f);
246   }
247
248//--------------------- step 1 of Arnold now finished -------------------------
249    map phi = ring_rest,maxideal(1);
250    cstn[4] = phi;
251    if(corank == 2) { v_class = Funktion3(G, cstn); }
252    else {
253      if(corank == 3) { v_class = Funktion50(G, cstn); }
254      else { v_class = printresult(1, f, "error!", cstn, -1); }
255    }
256//-------------------------- classification done ------------------------------
257    poly f_result = v_class[1];
258    v[2] = v_class[2];
259    v[3] = v_class[3];
260    map Phi = v_class[4];
261    PhiG = Phi(PhiG);
262    setring ring_top;
263    if(defined(conv)!=0) { kill conv; }
264    map conv=ring_rest,maxideal(1);
265    v[1] = conv(f_result);
266    return(v);
267}
268
269///////////////////////////////////////////////////////////////////////////////
270static
271proc Funktion3 (poly f, list cstn)
272{
273//---------------------------- initialisation ---------------------------------
274    poly f3 = jet(f, 3);
275    ideal Jf;
276    int Dim, Mult, Mu;
277    debug_log(1, "Step 3");
278
279    if( f3 == 0 ) { return(Funktion13(f, cstn)); }
280
281    // f3 ~ x3 , x2y+y3 , x2y
282    Jf = std(jacob(f3));
283    Dim = dim(Jf);
284    if(Dim == 0) { return(printresult(4, f, "D[4]", cstn, 0)); }
285
286    Mult = mult(Jf);
287    Mu = cstn[2];
288    if(Dim == 1) {
289      if( Mult == 1) { return(printresult(5,f,"D["+string(Mu)+"]", cstn, 0)); }
290      if( Mult == 2) { return(Funktion6(f, cstn));}         // series E,J
291      debug_log(0, "dimension 1 und deg != 1, 2 => error, ",
292                        "this should never occur");
293      return(printresult(3, f, "error!", cstn, -1));
294      // Should never reach this line
295    }
296    // Should never reach this line
297    return(printresult(3, f, "error!", cstn, -1));
298}
299
300///////////////////////////////////////////////////////////////////////////////
301static
302proc Funktion6 (poly f, list cstn)
303{ // Arnold's steps 6-12
304//---------------------------- initialisation ---------------------------------
305    poly   f3, fk;
306    ideal  JetId, Jf;
307    int    k, Dim, Mult, n, Mu;
308    map    PhiG, Phi;
309    intvec RFlg;
310    list   v;
311
312    def ring_top=basering;
313    f3   = jet(f, 3);            // 3-Jet von f
314    n    = nvars(basering);
315    Mu   = cstn[2];
316    PhiG = cstn[4];
317    k    = 1;
318    debug_log(1, "   Step 6");
319
320    RFlg = GetRf(f, n);
321    v    = Faktorisiere(f, f3, 3, 1, RFlg);
322    f    = v[1];
323    Phi  = v[2];
324    PhiG = Phi(PhiG);
325    cstn[4] = PhiG;
326
327//---------------------------- begin of loop ----------------------------------
328    while( (6*k) <= Mu ) {
329      JetId = x(1)^3+x(2)^(3*k);
330      fk    = jet(f, 3*k, weight(JetId));
331      //--------------------------- step 6(k) ---------------------------------
332      if( fk == Coeff(fk,x(1), x(1)^3)*x(1)^3 ) {
333        JetId = x(1)^3+x(2)^(3*k+1);           // check jet x3,y3k+1  : E[6k]
334        fk    = jet(f, 3*(3*k+1), weight(JetId));
335        if( Coeff(fk,x(2),x(2)^(3*k+1)) != 0 ) {
336          return(printresult(7, f, "E["+string(6*k)+"]", cstn, k-1));
337        }
338
339        JetId = x(1)^3+x(1)*x(2)^(2*k+1);      // check jet x3,xy2k+1 : E[6k+1]
340        fk    = jet(f, 3*(2*k+1), weight(JetId));
341        if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(2*k+1)) != 0 ) {
342          return(printresult(8, f,"E["+string(6*k+1)+"]", cstn, k-1));
343        }
344
345        JetId = x(1)^3+x(2)^(3*k+2);           // check jet x3,y3k+1  : E[6k+2]
346        fk    = jet(f, 3*(3*k+2), weight(JetId));
347        if( Coeff(fk,x(2),x(2)^(3*k+2)) != 0 ) {
348          return(printresult(9, f,"E["+string(6*k+2)+"]", cstn, k-1));
349        }
350
351        //------------------------- step 10(k) --------------------------------
352        k++;
353        JetId = x(1)^3+x(2)^(3*k);
354        fk    = jet(f, 3*k, weight(JetId));
355        Jf    = std(jacob(fk));
356        Dim   = dim(Jf);
357
358        if(Dim==0) { return(printresult(11,f,"J["+string(k)+",0]",cstn,k-1)); }
359        Mult = mult(Jf);
360        if( Dim ==1  && Mult==1) {
361          return(printresult(12,f,"J["+string(k)+","+string(Mu - 6*k +2)+"]",
362                 cstn, k-1));
363        }
364        if( Dim == 1  && Mult == 2) {
365          if(Coeff(fk, x(2), x(2)^(3*k)) != 0) {
366            v    = Faktorisiere(f, fk, 3, k, RFlg);
367            f    = v[1];
368            Phi  = v[2];
369            PhiG = Phi(PhiG);
370            cstn[4] = PhiG;
371          }
372        }
373      }
374    }
375    // Should never reach this line
376    return(printresult(6, f, "error!", cstn, -1));
377}
378
379///////////////////////////////////////////////////////////////////////////////
380static
381proc Funktion13 (poly f, list cstn)
382{
383//---------------------------- initialisation ---------------------------------
384    poly f4;
385    ideal Jf;
386    int Dim, Mult, Mu;
387
388    debug_log(1, "   Step 13");
389    Mu = cstn[2];
390    f4 = jet(f, 4);
391    if( f4 == 0 ) { return(Funktion47(f, cstn)); }
392
393    // f4 ~ x4+ax2y2+y4, x4+x2y2, x2y2, x3y, x4
394    Jf  = std(jacob(f4));
395    Dim = dim(Jf);
396
397    if(Dim==0) { return(printresult(14,f,"X[9] = X[1,0] = T[2,4,4]",cstn,1)); }
398    Mult = mult(Jf);
399    if( Dim == 1) {
400      if( Mult == 1 ) {
401        return(printresult(15, f,
402              "X[1,"+string(Mu-9)+"] = T[2,4,"+string(Mu-5)+"]", cstn, 1));
403      }
404      if( Mult == 2 ) {
405        Jf = Jf, jacob(Jf);
406        Jf = std(Jf);
407        Dim = dim(Jf);
408        if(Dim==0){return(printresult(16,f,"Y[1,p,q] = T[2,4+p,4+q]",cstn,1));}
409        if( Dim == 1 ) { return(Funktion17(f, cstn)); }
410      }
411      if( Mult == 3 ) { return(Funktion25(f, cstn)); }
412    }
413    // Should never reach this line
414    return(printresult(13, f, "error!", cstn, -1));
415}
416
417///////////////////////////////////////////////////////////////////////////////
418static
419proc Funktion17 (poly f, list cstn)
420{ // Analog zu Fumktion 6, Kombination 17-24
421//---------------------------- initialisation ---------------------------------
422    poly  fk, ft;
423    ideal JetId, Jf;
424    int   p, Dim, Mult, Mu;
425    list  v;
426    map   PhiG, Phi;
427
428    def ring_top=basering;
429    debug_log(1, "      Step 17");
430    Mu   = cstn[2];
431    PhiG = cstn[4];
432    fk   = jet(f, 4);
433    p    = 1;
434
435//---------------------------- begin of loop ----------------------------------
436    while( 3*p<= Mu) {
437      debug_log(1, "         Step 18("+string(p)+")");
438      v   = Isomorphie_s17(f, fk, p, 1);
439      f, Phi  = v[1..2];
440      PhiG    = Phi(PhiG);
441      cstn[4] = PhiG;
442
443      if ( p>1) {
444        JetId = x(1)^3*x(2) + x(2)^(3*p);
445        fk = jet(f, 3*p, weight(JetId));
446      }
447      //--------------------------- step 18(p) --------------------------------
448      JetId = x(1)^3*x(2) + x(2)^(3*p+2);     // check jet x3y,y3k+2  : Z[6p+5]
449      fk = jet(f, 3*(3*p+2), weight(JetId));
450      if( Coeff(fk, x(2), x(2)^(3*p+2)) != 0) {
451        return(printresult(19,f, "Z["+string(6*p+5)+"]", cstn, p));
452      }
453
454      JetId = x(1)^3*x(2)+x(1)*x(2)^(2*p+2);  // check jet x3y,xy2k+2 : Z[6p+6]
455      fk = jet(f, 2*(3*p+2)+1, weight(JetId));
456      if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(2*p+2)) != 0) {
457        return(printresult(20, f, "Z["+string(6*p+6)+"]", cstn, p));
458      }
459
460      JetId = x(1)^3*x(2) + x(2)^(3*p+3);     // check jet x3y,y3k+3  : Z[6p+7]
461      fk = jet(f, 3*(3*p+3), weight(JetId));
462      if( Coeff(fk, x(2), x(2)^(3*p+3)) != 0) {
463        return(printresult(21, f, "Z["+string(6*p+7)+"]", cstn, p));
464      }
465
466      //---------------------------- step 22 ----------------------------------
467      p = p+1;
468      JetId = x(1)^3*x(2) + x(2)^(3*p+1);
469      fk   = jet(f, 3*p+1, weight(JetId));
470      ft   = Teile(fk, x(2));
471      Jf   = std(jacob(ft));
472      Dim  = dim(Jf);
473      Mult = mult(Jf);
474      if(Dim==0) { return(printresult(23,f,"Z["+string(p-1)+",0]", cstn, p)); }
475      if( Mult == 1 ) {
476         return(printresult(24, f, "Z["+string(p-1)+","+string(Mu-3-6*p)+"]",
477                cstn, p));
478      }
479    }
480    // Should never reach this line
481    return(printresult(17, f, "error!", cstn, -1));
482}
483
484///////////////////////////////////////////////////////////////////////////////
485static
486proc Funktion25 (poly f, list cstn)
487{ // Analog zu Fumktion 6, Kombination 25-46
488//---------------------------- initialisation ---------------------------------
489    poly   fk, ft;
490    ideal  JetId, Jf;
491    int    k, Dim, Mult, Mu;
492    map    PhiG, Phi;
493    intvec RFlg;
494    list   v;
495    def ring_top=basering;
496
497    debug_log(1, "      Step 25");
498    Mu   = cstn[2];
499    PhiG = cstn[4];
500    fk   = jet(f, 4);
501    k    = 1;
502    RFlg = GetRf(f, 2);
503
504//---------------------------- begin of loop ----------------------------------
505    while (k<Mu) {
506      v    =  Faktorisiere(f, fk, 4 , k, RFlg);
507      f, Phi  = v[1..2];
508      PhiG    = Phi(PhiG);
509      cstn[4] = PhiG;
510
511      //--------------------------- step 26(k) --------------------------------
512      JetId = x(1)^4 + x(2)^(4*k+1);          // check jet x4,y4k+1  : W[12k]
513      fk    = jet(f, 4*(4*k+1), weight(JetId));
514      if( Coeff(fk, x(2), x(2)^(4*k+1)) != 0) {
515        return(printresult(27, f, "W["+string(12*k)+"]", cstn, 3*k-2));
516      }
517
518      JetId = x(1)^4 + x(1)*x(2)^(3*k+1);     // check jet x4,xy3k+1 : W[12k+1]
519      fk    = jet(f, 4*(3*k+1), weight(JetId));
520      if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(3*k+1)) != 0) {
521        return(printresult(28, f, "W["+string(12*k+1)+"]", cstn, 3*k-2));
522      }
523
524      //--------------------------- step 29(k) --------------------------------
525      JetId = x(1)^4 + x(2)^(4*k+2);
526      fk    = jet(f, 2*(4*k+2), weight(JetId));
527      if( Coeff(fk, x(2), x(2)^(4*k+2)) != 0) {
528        Jf  = std(jacob(fk));
529        Dim = dim(Jf);
530        if(Dim==0) {return(printresult(30,f,"W["+string(k)+",0]",cstn,3*k-1));}
531        if(Dim==1) {
532           return(printresult(32, f,
533                  "W#["+string(k)+","+string(Mu-12*k-2)+"]", cstn, 3*k-1));
534        }
535        return(printresult(29, f, "error!", cstn, -1));
536      }
537      else {
538        // x^4 oder x^2(x^2+x(2)^2k+1)
539        ft  = Teile(fk, x(1)^2);
540        Jf  = std(jacob(ft));
541        Dim = dim(Jf);
542        if( Dim == 0 ) {
543           return(printresult(31, f, "W["+string(k)+","+string(Mu-12*k-3)+"]",
544                  cstn, 3*k-1));
545        }
546        if( Dim != 1 ) { return(printresult(29, f, "error!", cstn, -1)); }
547
548        //-------------------------- step 33(k) -------------------------------
549        JetId = x(1)^4 + x(1)*x(2)^(3*k+2);   // check jet x4,xy3k+2 : W[12k+5]
550        fk    = jet(f, 4*(3*k+2), weight(JetId));
551        if( Coeff(fk, x(1)*x(2), x(1)*x(2)^(3*k+2)) != 0) {
552          return(printresult(34, f,"W["+string(12*k+5)+"]", cstn, 3*k-1));
553        }
554
555        JetId = x(1)^4 + x(2)^(4*k+3);        // check jet x4,y4k+3  : W[12k+6]
556        fk    = jet(f, 4*(4*k+3), weight(JetId));
557        if( Coeff(fk, x(2), x(2)^(4*k+3)) != 0){
558          return(printresult(35, f,"W["+string(12*k+6)+"]", cstn, 3*k-1));
559        }
560
561        //-------------------------- step 36(k) -------------------------------
562        k = k+1;
563        JetId = x(1)^4 + x(2)^(4*k);
564        fk    = jet(f, (4*k), weight(JetId));
565        Jf    = std(jacob(fk));
566        Dim   = dim(Jf);
567        Mult  = mult(Jf);
568        if(Dim==0) {return(printresult(37,f,"X["+string(k)+",0]",cstn,3*k-1));}
569        if(Dim==1) {
570          if(Mult==1) {
571             return(printresult(38, f,"X["+string(k)+","+string(Mu-12*k+3)+"]",
572                    cstn, 3*k-1));
573          }
574          if(Mult==2) {
575            ft  = Teile(fk, x(1)^2);
576            Jf  = std(jacob(ft));
577            Dim = dim(Jf);
578            if( Dim == 0) { return(Funktion40(f, cstn, k)); }
579            if( Dim == 1) {
580               return(printresult(39, f, "Y["+string(k)+",r,s]", cstn,3*k-1));
581            }
582          }
583          if(Mult!=3) {
584            return(printresult(36, f, "error!", cstn, -1)); }
585        }
586        else { return(printresult(36, f, "error!", cstn, -1)); }
587      }
588    }  // Ende der While-Schleife
589    // Should never reach this line
590    return(printresult(25, f, "error!", cstn, -1));
591}
592
593///////////////////////////////////////////////////////////////////////////////
594static
595proc Funktion40 (poly f, list cstn, int k)
596{
597//---------------------------- initialisation ---------------------------------
598    int    r, kr, rr, sr, oldDebug;
599    poly   fk, f2, a, b, c;
600    ideal  JetId, Jfsyz;
601    string Typ, RestRing, s1;
602    list   v1, v2;
603    def ring_top=basering;
604
605    debug_log(1, "         Step 40" );
606
607//------------------------------ compute f2 -----------------------------------
608    JetId = x(1)^4 + x(2)^(4*k);
609    fk  = jet(f, (4*k), weight(JetId));
610    f2  = -fk / x(1)^3;
611    Jfsyz = f - fk, x(1)^3, f2;
612    matrix Mat = matrix(syz(Jfsyz));
613    a = Mat[2,1] / Mat[1,1] - Mat[2,2];
614    b = - Mat[3,1] / Mat[1,1] + Mat[3,2];
615    ring tmp_ring=char(basering), (x(1),x(2)),(c,ds);
616    map map_top2tmp=ring_top,maxideal(1);
617    oldDebug = @DeBug;
618    init_debug(-1);
619//------------------------------ classify f2 ----------------------------------
620    v1=Klassifiziere(map_top2tmp(b));
621    init_debug(oldDebug);
622    Typ = v1[2];
623    v2 = DecodeNormalFormString(Typ);
624    Typ, kr, rr, sr = v2[1..4];
625    r   = kr-k;
626    setring ring_top;
627    if( Typ == "E[6k]" ) {
628       return(printresult(42, f, "Z["+string(k)+","+string(12*k+6*r-1)+"]",
629              cstn, 3*k+r-2));
630    }
631    if( Typ == "E[6k+1]" ) {
632       return(printresult(43, f, "Z["+string(k)+","+string(12*k+6*r)+"]",
633              cstn, 3*k+r-2));
634    }
635    if( Typ == "E[6k+2]" ) {
636       return(printresult(44, f, "Z["+string(k)+","+string(12*k+6*r+1)+"]",
637              cstn, 3*k+r-2));
638    }
639    if( Typ == "J[k,0]" ) {
640       return(printresult(45, f, "Z["+string(k)+","+string(r)+",0]",
641              cstn, 3*k+r-2));
642    }
643    if( Typ == "J[k,r]" ) {
644       return(printresult(46,f,"Z["+string(k)+","+string(r)+","+string(rr)+"]",
645              cstn, 3*k+r-2));
646    }
647    // Should never reach this line
648    return(printresult(40, f, "error!", cstn, -1));
649}
650
651///////////////////////////////////////////////////////////////////////////////
652static
653proc Funktion50 (poly f, list cstn)
654{
655//---------------------------- initialisation ---------------------------------
656    poly  f3;
657    ideal Jf, Jf1, Jf2;
658    int   Dim, Mult, Mu;
659    debug_log(1, "Step 50");
660
661    f3 = jet(f, 3);
662    if( f3 == 0 ) { return(printresult(104, f, "NoClass", cstn, -1)); }
663
664    // f3 ~
665    Jf1  = jacob(f3);
666    Jf   = std(Jf1);
667    Dim  = dim(Jf);
668    Mult = mult(Jf);
669    Mu   = cstn[2];
670
671    if(Dim == 0) {
672       return(printresult(51, f, "P[8] = T[3,3,3]", cstn, 1));
673    } // x3 + y3 + z3 + axyz
674    if(Dim == 1) {
675      if (Mult == 1) {
676        return(printresult(52, f,"P["+string(Mu)+"] = T[3,3,"+string(Mu-5)+"]",
677               cstn, 1));
678      } // x3 + y3 + xyz
679      if(Mult == 2) {
680        Jf2 = wedge(jacob(Jf1),3-Dim), Jf1;
681        Jf2 = std(Jf2);
682        Dim = dim(Jf2);
683        if (Dim==0) { return(printresult(54,f,"R[p,q] = T[3,p,q]", cstn, 1)); }
684        if (Dim==1) { return(Funktion58(f, cstn)); }  // x3 + yz2
685      }
686      if(Mult == 3) {
687        Jf2 = wedge(jacob(Jf1),3-Dim), Jf1;
688        Jf2 = std(Jf2);
689        Dim = dim(Jf2);
690        if(Dim == 0) { return(printresult(56, f, "T[p,q,r]", cstn, 1)); }
691        if(Dim == 1) { return(Funktion66(f, cstn)); }   // x2z + yz2
692      }
693      if(Mult == 4) { return(Funktion82(f, cstn)); }    // x3 + xz2
694    }
695    if(Dim == 2) {
696      if(Mult == 1) { return(Funktion97(f, cstn)); }    // x2y
697      if(Mult == 2) { return(printresult(103,f,"NoClass", cstn, -1));}
698    }
699
700    // Should never reach this line
701    return(printresult(50, f, "error!", cstn, -1));
702}
703
704///////////////////////////////////////////////////////////////////////////////
705static
706proc Funktion58 (poly fin, list cstn)
707{
708//---------------------------- initialisation ---------------------------------
709    poly  f, f3, a, b, phi, b1, b2, b3, fa, fb, fc;
710    ideal B, Jf3, J1, J2, S, Jfsyz;
711    int   kx, ky, kz;
712    string tp;
713    matrix M[2][3];
714    matrix C[2][3], D;
715    list v;
716    map  PhiG, VERT;
717    def ring_top=basering;
718    debug_log(1, "   Step 58");
719
720    f    = fin;
721    f3   = jet(f, 3);
722    PhiG = cstn[4];
723    tp   = "Nix";
724    kx   = 1;     // Koordinate x
725    ky   = 2;     // Koordinate y
726    kz   = 3;     // Koordinate z
727    B    = maxideal(1);     // ideal fuer Abbildungen
728    Jf3  = jacob(f3);
729    S    = sat(Jf3, maxideal(1))[1];
730    J1   = diff(S[1], x(kx)), diff(S[1], x(ky)), diff(S[1], x(kz)),
731           diff(S[2], x(kx)), diff(S[2], x(ky)), diff(S[2], x(kz));
732    M    = J1;
733    J2   = minor(M, 2), S;
734
735    //------------------ determine coordinate named 'x' -----------------------
736    S  = sat(J2, maxideal(1))[1];
737    J1 = Coeff(S[1], x(1), x(1)), Coeff(S[1], x(2), x(2)),
738          Coeff(S[1], x(3), x(3)), Coeff(S[2], x(1), x(1)),
739          Coeff(S[2], x(2), x(2)), Coeff(S[2], x(3), x(3));
740    C  = J1;
741    D  = syz(C);
742    kill C;
743
744    b1 = D[1,1];
745    b2 = D[2,1];
746    b3 = D[3,1];
747
748    debug_log(6, "f3,s1=", Show(f3));
749    if( b1 != 0) {
750      VERT=ring_top,-1*b1*x(1), -1*b2*x(1)+x(2), -1*b3*x(1) + x(3);
751      kx=1; ky=2; kz=3;
752    }
753    else {
754      if( b2 != 0) {
755        VERT=ring_top, x(1) + -1*b1*x(2), -1*b2*x(2), -1*b3*x(2) + x(3);
756        kx=2; ky=1; kz=3;
757      }
758      else {
759        if( b3 != 0) {
760          VERT=ring_top,x(1) + -1*b1*x(3), x(2) + -1*b2*x(3), -1*b3*x(3);
761          kx=3; ky=1; kz=2;
762        }
763      }
764    }
765    f       = VERT(f);
766    PhiG    = VERT(PhiG);
767    cstn[4] = PhiG;
768    debug_log(6, VERT);
769    f3 = jet(f,3);
770    debug_log(6, "f3,s2=", Show(f3));
771
772    //---------------- compute f_2 such that j3f = xf_2+f_3 -------------------
773    debug_log(6, "1) x=", kx, "  y=", ky, "  z=", kz );
774    matrix C = Coeffs(f3, x(kx));
775    fb=C[2,1];  // Coeff von x^1
776    fc=C[1,1];  // Coeff von x^0
777    if(diff(fb, x(ky)) != 0) {
778      Jfsyz = fb, diff(fb, x(ky));
779      matrix Mat = matrix(syz(Jfsyz));
780      B = maxideal(1);     // setze Abbildungs-ideal
781      if( nrows(Mat) == 2) {
782        poly Relation = -2 * Mat[2,1] / Mat[1,1];
783        b = Coeff(Relation, x(kz), x(kz));
784        B[rvar(x(ky))] = x(ky)-b*x(kz);
785      }
786      else {
787        Jfsyz = fb, diff(fb, x(kz));
788        Mat = matrix(syz(Jfsyz));
789        poly Relation = -2 * Mat[2,1];
790        a = Coeff(Relation, x(ky), x(ky));
791        B[rvar(x(kz))] = x(kz)-a*x(kz);
792        ky, kz = swap(ky, kz);
793      }
794      VERT = ring_top, B;
795      f    = VERT(f);
796      PhiG = VERT(PhiG);
797      cstn[4] = PhiG;
798      f3 = jet(f,3);
799      kill Mat;
800    }
801    else { ky,kz = swap(ky,kz); }
802
803    //------- compute tschirnhaus for 'z' and get f3=f_1(x,y,z)y^2+z^3 --------
804    C    = Coeffs(f3, x(kx));
805    fb   = C[2,1];  // Coeff von x^1
806    fc   = C[1,1];  // Coeff von x^0
807    v    = tschirnhaus(fc, x(kz));
808    fc, VERT = v[1..2];
809    f    = VERT(f);
810    PhiG = VERT(PhiG);
811    cstn[4] = PhiG;
812    f3 = jet(f,3);
813
814    //------------------- compute f_1 and get f3=xy^2+z^3 ---------------------
815    fb = (f3 - 1*(Coeffs(f3, x(kz))[4,1])*x(kz)^3)/(x(ky)^2);
816    fc=(x(kx)-1*(Coeffs(fb,x(ky))[2,1])*x(ky)-1*(Coeffs(fb,x(kz))[2,1])*x(kz));
817    fa = Coeffs(fb, x(kx))[2,1];
818    if ( fa != 0 ) {
819      B = maxideal(1);
820      B[rvar(x(kx))] = fc / fa;
821      VERT = ring_top, B;
822      f    = VERT(f);
823      PhiG = VERT(PhiG);
824      cstn[4] = PhiG;
825      f3   = jet(f,3);
826    }
827
828    //--------------------- permutation of x,y,z  -----------------------------
829    if(Coeffs(f3, x(1))[4,1]!=0) {
830      kx=1;
831      if(Coeffs(f3, x(2))[3,1]==0) { ky=2; kz=3; }
832      else { ky=3; kz=2; }
833    }
834    else {
835      if(Coeffs(f3, x(2))[4,1]!=0) {
836        kx=2;
837        if(Coeffs(f3, x(3))[3,1]==0) { ky=3; kz=1; }
838        else { ky=1; kz=3; }
839      }
840      else {
841        kx=3;
842        if(Coeffs(f3, x(1))[3,1]==0) { ky=1; kz=2; }
843        else { ky=2; kz=1; }
844      }
845    }
846    VERT = ring_top, x(kx), x(ky), x(kz);
847    f    = VERT(f);
848    PhiG = VERT(PhiG);
849    cstn[4] = PhiG;
850    f3   = jet(f,3);
851    return(Funktion59(f, cstn));
852}
853
854///////////////////////////////////////////////////////////////////////////////
855static
856proc Funktion59 (poly f, list cstn)
857{
858//---------------------------- initialisation ---------------------------------
859    poly   phi, fr, fk, alpha, beta, f_tmp;
860    ideal JetId;
861    int    p, Dim, Mult, Mu;
862    string tp;
863    list   v;
864    map    PhiG, Phi;
865    intvec w, RFlg;
866    def ring_top=basering;
867    debug_log(1, "      Step 59");
868
869    Mu   = cstn[2];
870    PhiG = cstn[4];
871    tp   = "Nix";
872    p    = 1;
873    phi  = jet(f,3);
874    fr   = f - phi;
875    RFlg = 1,2,3;
876    alpha = coeffs(fr, x(1))[1,1];
877    beta = (fr - alpha) / x(1);
878    debug_log(3, "f    = ", Show(f));
879    debug_log(3, "fr   = ", Show(fr));
880    debug_log(3, "alpha= ", Show(alpha));
881    debug_log(3, "beta = ", Show(beta));
882
883//---------------------------- begin of loop ----------------------------------
884    while(6*p<Mu) {
885      JetId = x(2)^(3*p+1);
886      JetId = phi + x(2)^(3*p+1);
887      //--------------------------- step 59(k) --------------------------------
888      w     = weight(JetId);
889      fk    = jet(fr, 3*w[1], w);
890      if(fk!=0) { return(printresult(60,f, "Q["+string(6*p+4)+"]", cstn, p)); }
891
892      JetId = phi + x(1)*x(2)^(2*p+1);
893      w     = weight(JetId);
894      fk    = jet(fr, 3*w[1], w);
895      if(fk!=0) { return(printresult(61,f, "Q["+string(6*p+5)+"]", cstn, p)); }
896
897      JetId = phi + x(2)^(3*p+2);
898      w     = weight(JetId);
899      fk    = jet(fr, 3*w[1], w);
900      if(fk!=0) { return(printresult(62,f, "Q["+string(6*p+6)+"]", cstn, p)); }
901
902      //--------------------------- step 63(k) --------------------------------
903      p++;
904      JetId = phi + x(2)^(3*p);
905      w     = weight(JetId);
906      fk    = jet(f, 3*w[1], w);
907      JetId = std(jacob(fk));
908      Dim   = dim(JetId);
909      Mult  = mult(JetId);
910      if(Dim==0) { return(printresult(64, f, "Q["+string(p)+",0]", cstn, p)); }
911      if(Dim==1) {
912        if(Mult == 1) {
913           return(printresult(65, f, "Q["+string(p)+","+string(Mu-(6*p+2))+"]",
914                  cstn, p));
915        }
916        if(Mult == 2) {
917          fk    = jet(fr, 3*w[1], w);
918          f_tmp = Coeffs(phi, x(1))[4,1] *x(1)^3+fk;
919          v    = Faktorisiere(f, f_tmp, 3 , p, RFlg);
920          f    = v[1];
921          Phi  = v[2];
922          PhiG = Phi(PhiG);
923          cstn[4] = PhiG;
924          fr = f - phi;
925        }
926      }
927    }
928    // Should never reach this line
929    return(printresult(59, f, "error!", cstn, -1));
930}
931
932///////////////////////////////////////////////////////////////////////////////
933static
934proc Funktion66 (poly f, list cstn)
935{
936//---------------------------- initialisation ---------------------------------
937    int kx = 1; // Koordinate x
938    int ky = 2; // Koordinate y
939    int kz = 3; // Koordinate z
940    poly f3 = jet(f, 3);
941    ideal JetId;
942
943    debug_log(1, "   Step 66");
944    debug_log(2, "F3=", Show(f3));
945    poly fx = diff(f3, x(kx));
946    JetId = jacob(fx);
947    JetId = std(JetId);
948    "nach x:",Show(fx), "  Id=", JetId, "  Dim=", dim(JetId);
949
950    poly fy = diff(f3, x(ky));
951    JetId = jacob(fx);
952    JetId = std(JetId);
953    "nach y:",Show(fy), "  Id=", JetId, "  Dim=", dim(JetId);
954
955    poly fz = diff(f3, x(kz));
956    JetId = jacob(fx);
957    JetId = std(JetId);
958    "nach z:",Show(fz), "  Id=", JetId, "  Dim=", dim(JetId);
959    return(printresult(1, 66, "error!", cstn, -1));
960}
961
962///////////////////////////////////////////////////////////////////////////////
963static
964proc Funktion82 (poly f, list cstn)
965{
966//---------------------------- initialisation ---------------------------------
967    poly   f3, b1, b2, b3;
968    int    i, kx, ky, kz, Fall;
969    ideal  Jfsyz, B;
970    intvec kv = 1,2,3;
971    matrix Mat;
972    map    PhiG, VERT;
973    list   v;
974    def ring_top=basering;
975    debug_log(1, "   Step 82");
976
977    f3 = jet(f,3);
978    kx = 1;     // Koordinate x
979    ky = 2;     // Koordinate y
980    kz = 3;     // Koordinate z
981    B  = maxideal(1);
982    Jfsyz = jacob(f3);
983    PhiG  = cstn[4];
984    Fall  = 2;
985
986//------------------ find coordinatechange that f3 ~ g(x,z) -------------------
987    if (diff(f3, x(1)) == 0) { kx, ky = swap(kx, ky); }
988    if (diff(f3, x(2)) == 0) {  }
989    if (diff(f3, x(3)) == 0) { kz, ky = swap(kz, ky); }
990    if ( (diff(f3, x(1)) != 0) && (diff(f3, x(2)) != 0) &&
991          (diff(f3, x(3)) != 0) ) {
992      Mat = matrix(syz(Jfsyz));
993      b1  = Mat[1,1];
994      b2  = Mat[2,1];
995      b3  = Mat[3,1];
996
997      if( b1 != 0) {
998        VERT = ring_top,b1*x(kx), b2*x(kx)+x(ky), b3*x(kx) + x(kz);
999        kx, ky = swap(kx, ky);
1000      }
1001      else {
1002        if(b2!=0) { VERT = ring_top,x(kx)+b1*x(ky),b2*x(ky),b3*x(ky)+x(kz); }
1003        else {
1004          if(b3!=0) { VERT = ring_top,x(kx)+b1*x(kz),x(ky)+b2*x(kz),b3*x(kz); }
1005          else { VERT = ring_top,B; }
1006        }
1007      }
1008      f    = VERT(f);
1009      PhiG = VERT(PhiG);
1010      cstn[4] = PhiG;
1011    }
1012    VERT = ring_top,x(kx),x(ky),x(kz);
1013    f    = VERT(f);
1014    PhiG = VERT(PhiG);
1015    cstn[4] = PhiG;
1016    f3   = jet(f,3);
1017
1018    if( (f3-subst(f3, x(kx), 0)) == 0) { kx, ky = swap(kx, ky); }
1019    if( (f3-subst(f3, x(kz), 0)) == 0) { kz, ky = swap(kz, ky); }
1020
1021//------------ find coordinatechange for f3 ~ x3+xz2, if possible  ------------
1022    matrix C = coeffs(f3, x(kx));
1023    if(size(C) == 3) { C = coeffs(f3, x(kz)); kx,kz=swap(kx, kz); }
1024    if(C[1,1] == 0 && C[3,1] == 0) { Fall = 1; }
1025    if(C[1,1] != 0 && C[3,1] != 0 ) { Fall = 3; }
1026    if(C[1,1] == 0 && C[3,1] != 0 ) { Fall = 2; }
1027    if(C[1,1] != 0 && C[3,1] == 0 ) { Fall = 2; kx,kz=swap(kx, kz); }
1028
1029    if(Fall == 1) {
1030      VERT=ring_top,x(kx),x(ky),x(kz);
1031    }
1032    if(Fall == 2) {
1033       v = tschirnhaus(f3/x(kz), x(kx));
1034       b1, VERT = v[1..2];
1035    }
1036    if(Fall == 3) {
1037      v = tschirnhaus(f3/x(kx), x(kx));
1038      b1, VERT = [1..2];
1039      debug_log(2, "B1=", Show(jet(VERT(f),3)));
1040      v = tschirnhaus(f3/x(kz), x(kz));
1041      b2, VERT = [1..2];
1042      debug_log(2, "B2=", Show(jet(VERT(f),3)));
1043    }
1044    f    = VERT(f);
1045    PhiG = VERT(PhiG);
1046    cstn[4] = PhiG;
1047    f3   = jet(f,3);
1048
1049//------------- if f3 ~ x3+xz2 then continue with classification  -------------
1050    C = coeffs(f3, x(1));
1051    if( C[1,1] == 0 && C[2,1] != 0 && C[3,1] == 0 && C[4,1] != 0 ) {
1052      return(Funktion83(f, cstn));
1053    }
1054    return(printresult(82, f, "error!", cstn, -1));
1055}
1056
1057///////////////////////////////////////////////////////////////////////////////
1058static
1059proc Isomorphie_s82_z (poly f, poly fk, int p)
1060{
1061//---------------------------- initialisation ---------------------------------
1062    poly   Relation, a, b;
1063    ideal  Jfsyz, B;
1064    matrix Mat;
1065    map    VERT;
1066    list   v;
1067    def ring_top=basering;
1068
1069    debug_log(1, "      Isomorphie 82/90 z");
1070    debug_log(2, "tt=", Show(fk));
1071    Jfsyz = fk, diff(fk, x(3));
1072    Mat   = matrix(syz(Jfsyz));
1073    Relation = -2 * Mat[2,1] / Mat[1,1];
1074    a = Coeff(Relation, x(3), x(3));
1075    b = Coeff(Relation, x(2), x(2)^p);
1076    B = maxideal(1);
1077    B[rvar(x(3))] = x(3)-b*x(2)^p;
1078    VERT = ring_top,B;
1079    v    = VERT(f), VERT;
1080    debug_log(2, VERT);
1081    debug_log(2, "      z res=", Show(VERT(fk)));
1082    return(v);
1083}
1084
1085///////////////////////////////////////////////////////////////////////////////
1086static
1087proc Isomorphie_s82_x (poly f, poly fk, int p)
1088{
1089//---------------------------- initialisation ---------------------------------
1090    matrix Mat;
1091    poly   Relation, a, b;
1092    ideal  Jfsyz, B;
1093    map    VERT;
1094    list   v;
1095    def ring_top=basering;
1096
1097    debug_log(1, "      Isomorphie 82/90 x");
1098    debug_log(2, "tt=", Show(fk));
1099    Jfsyz = fk, diff(fk, x(1));
1100    Mat   = matrix(syz(Jfsyz));
1101    Relation = -3 * Mat[2,1] / Mat[1,1];
1102    a = Coeff(Relation, x(1), x(1));
1103    b = Coeff(Relation, x(2), x(2)^p);
1104    B = maxideal(1);
1105    B[rvar(x(1))] = x(1)-b*x(2)^p;
1106    VERT = ring_top,B;
1107    v    = VERT(f), VERT;
1108    debug_log(2, VERT);
1109    debug_log(2, "      x res=", Show(VERT(fk)));
1110
1111    return(v);
1112}
1113
1114///////////////////////////////////////////////////////////////////////////////
1115static
1116proc Funktion83 (poly f, list cstn)
1117{
1118//---------------------------- initialisation ---------------------------------
1119    poly   fk, phi, a, b;
1120    ideal  JetId, Jf, B;
1121    int    k, Dim, Mult;
1122    intvec w;
1123    map    PhiG, Phi;
1124    list   v;
1125    matrix Mat;
1126    def ring_top=basering;
1127    debug_log(1, "      Step 83");
1128
1129    k    = 1;
1130    PhiG = cstn[4];
1131//---------------------------- begin of loop ----------------------------------
1132    while(k<10) {
1133      phi   = jet(f, 3);
1134      //--------------------------- step 83(k) --------------------------------
1135      JetId = x(1)^3 + x(3)^3 + x(2)^(3*k+1);
1136      fk    = jet(f- phi, 3*w[1], weight(JetId)) ;
1137      if(fk!=0) { return(printresult(84,f,"U["+string(12*k)+"]",cstn,4*k-3)); }
1138
1139      JetId = x(1)^3 + x(3)^3 + x(1)*x(2)^(2*k+1);
1140      fk    = jet(f, 3*w[1], weight(JetId)) ;
1141      //--------------------------- step 85(k) --------------------------------
1142      if ( fk != phi ) {
1143        Jf   = std(jacob(fk));
1144        Dim  = dim(Jf);
1145        if(Dim==0) {return(printresult(86,f,"U["+string(k)+",0]",cstn,4*k-2));}
1146        if(Dim==1) {return(printresult(87,f,"U["+string(k)+",p]",cstn,4*k-2));}
1147      }
1148
1149      //--------------------------- step 88(k) --------------------------------
1150      JetId = x(1)^3 + x(3)^3 + x(2)^(3*k+2);
1151      fk    = jet(f- phi, 3*w[1], weight(JetId)) ;
1152      if(fk!=0) {return(printresult(89,f,"U["+string(12*k+4)+"]",cstn,4*k-2));}
1153
1154      //--------------------------- step 90(k) --------------------------------
1155      k++;
1156      JetId = x(1)^3 + x(3)^3 + x(2)^(3*k);
1157      fk    = jet(f, 3*w[1], weight(JetId)) ;
1158      Jf    = std(jacob(fk));
1159      Dim   = dim(Jf);
1160      Mult  = mult(Jf);
1161      if ( Dim == 0 ) { return(printresult(83, f, "NoClass", cstn, -1)); }
1162      if ( Dim == 1 ) {
1163        if ( Mult == 4 ) {
1164          if( fk - phi != 0) { // b!=0  und/oder b'!=0
1165            if( Coeff(fk,x(1)*x(2), x(1)^2*x(2)^k) == 0 ) { // b=0 und b'!=0
1166              a    = (fk - Coeff(fk, x(1), x(1)^3)*x(1)^3) / x(1);
1167              v    = Isomorphie_s82_z(f, a, k);
1168            }
1169            else {
1170              if( Coeff(fk,x(1)*x(2)*x(3), x(1)*x(2)^k*x(3)) == 0 ){
1171                        // b!=0 und b'=0
1172                a    = subst(fk, x(3), 0);
1173                v    = Isomorphie_s82_x(f, a, k);
1174              }
1175              else {
1176                a = Coeff(fk,x(1)*x(2)*x(3), x(1)*x(2)^k*x(3));
1177                b = Coeff(fk,x(2)*x(3), x(2)^(2*k)*x(3));
1178                B = maxideal(1);
1179                B[rvar(x(1))] = x(1)-b/a*x(2)^k;
1180                Phi  = ring_top,B;
1181                f    = Phi(f);
1182                PhiG = Phi(PhiG);
1183                cstn[4] = PhiG;
1184                fk   = jet(f, 3*w[1], w) ;
1185                a    = (fk - Coeff(fk, x(1), x(1)^3)*x(1)^3) / x(1);
1186                v    = Isomorphie_s82_z(f, a, k);
1187              } // ende else b!=0 und b'=0
1188            } // ende else b=0 und b'!=0
1189            f, Phi  = v[1..2];
1190            PhiG    = Phi(PhiG);
1191            cstn[4] = PhiG;
1192          } //ende fk-phi!=0
1193        } // ende mult=4
1194        else { return(printresult(83, f, "NoClass", cstn, -1)); }
1195      } // ende dim=1
1196      else { return(printresult(83, f, "NoClass", cstn, -1)); }
1197    } // ENDE While
1198    return(printresult(83, f, "error!", cstn, -1));
1199}
1200
1201///////////////////////////////////////////////////////////////////////////////
1202static
1203proc Funktion97 (poly f, list cstn)
1204{
1205//---------------------------- initialisation ---------------------------------
1206    poly   f3, l1, l2, a, b, c, prod;
1207    ideal  Jfsyz, Jf, B;
1208    int    k, i, pt, kx, ky, kz, Dim, Mult, Mu;
1209    matrix Mat;
1210    map    PhiG, VERT;
1211    def ring_top=basering;
1212    debug_log(1, "   Step 97");
1213
1214    Mu   = cstn[2];
1215    PhiG = cstn[4];
1216    kx   = 1;   // Koordinate x
1217    ky   = 2;   // Koordinate y
1218    kz   = 3;   // Koordinate z
1219    B    = maxideal(1); // Abbildungs-ideal
1220    pt   = 2;
1221    f3   = jet(f, 3);
1222    k    = 1;
1223
1224//--------------------------- compute f3 ~ x2y --------------------------------
1225    // vertausche 2 Koordinaten sodass d2f/dx2 <>0 ist.
1226    for(i=1;i<4;i=i+1) {
1227      if(diff(diff(f3, x(i)), x(i)) != 0) { kx = i; i=4; }
1228    }
1229    if(kx == 2) { ky = 1; kz = 3; }
1230    if(kx == 3) { ky = 2; kz = 1; }
1231    //-------------------------- compute -l1*l2 -------------------------------
1232    f3    = jet(f, 3);
1233    Jfsyz = f3, diff(f3, x(kx));
1234    Mat   = matrix(syz(Jfsyz));
1235    if(deg(Mat[2,1])>1) {
1236      Jfsyz = f3, Mat[2,1];
1237      Mat   = matrix(syz(Jfsyz));
1238
1239      // berechen Abb. sodass f=x2*l2
1240      l1 = Mat[2,1];
1241      a  = Coeff(l1, x(kx), x(kx));
1242      l1 =  l1 / number(a);
1243      b  = Coeff(l1, x(ky), x(ky));
1244      c  = Coeff(l1, x(kz), x(kz));
1245      B[rvar(x(kx))] = x(kx) - b * x(ky) - c * x(kz);
1246      VERT = ring_top, B;
1247      f    = VERT(f);
1248      PhiG = VERT(PhiG);
1249      cstn[4] = PhiG;
1250
1251      f3 = jet(f, 3);
1252      l2 = f3 / x(kx)^2;
1253
1254      // sorge dafuer, dass b<>0 ist.
1255      b = Coeff(l2, x(ky), x(ky));
1256      if( b== 0) { ky, kz = swap(ky, kz); }
1257
1258      // Koordinaten-Transf. s.d. f=x2y
1259      b  = Coeff(l2, x(ky), x(ky));
1260      l2 =  l2 / number(b);
1261      a  = Coeff(l2, x(kx), x(kx));
1262      c  = Coeff(l2, x(kz), x(kz));
1263      B  = maxideal(1);
1264      B[rvar(x(ky))] = -a * x(kx) + x(ky) - c * x(kz);
1265      VERT = ring_top, B;
1266      f    = VERT(f);
1267      PhiG = VERT(PhiG);
1268      cstn[4] = PhiG;
1269    }
1270
1271//------------------------------- step 98 ---------------------------------
1272    Jfsyz = x(kx)^2*x(ky) + x(ky)^4 + x(kz)^4;
1273    a     = jet(f, 8, weight(Jfsyz));
1274    Jf    = std(jacob(a));
1275    Dim   = dim(Jf);
1276    Mult  = mult(Jf);
1277    if( Dim == 0) { return(printresult(99, f, "V[1,0]", cstn, 3)); }
1278    if( Dim == 1) {
1279      if(Mult==1) {return(printresult(100,f,"V[1,"+string(Mu-15)+"]",cstn,3));}
1280      if(Mult==2){return(printresult(101,f,"V#[1,"+string(Mu-15)+"]",cstn,3));}
1281    }
1282    " Dim=",Dim," Mult=",Mult;
1283    return(printresult(102, f, "NoClass", cstn, -1));
1284}
1285
1286///////////////////////////////////////////////////////////////////////////////
1287proc tschirnhaus (poly f, poly x)
1288"USAGE:    tschirnhaus();"
1289{
1290//---------------------------- initialisation ---------------------------------
1291    poly   b;
1292    ideal  B;
1293    int    n, j, hc;
1294    matrix cf;
1295    intvec z;
1296    string s;
1297    list   v;
1298    map    Phi, EH;
1299    def ring_top=basering;
1300
1301    n    = nvars(basering);
1302    cf   = coeffs(f, x);
1303    hc   = nrows(cf) - 1; // hoechster exponent von x_i
1304    b    = cf[hc+1,1];    // koeffizient von x_i^hc
1305    B    = maxideal(1);
1306    z[n] = 0;
1307    EH   = ring_top, z;
1308    Phi  = ring_top, B;
1309    v[1] = f;
1310    if ( EH(b) != 0)    // pruefe ob der Koeff von x_i^hc
1311    { B[rvar(x)] = x -1*(cf[hc,1]/(hc*b));
1312      v[1] = Phi(f);
1313    }
1314    v[2] = Phi;
1315    return(v);
1316}
1317
1318///////////////////////////////////////////////////////////////////////////////
1319static
1320proc Isomorphie_s17 (poly f, poly fk, int k, int ct, list #)
1321{
1322//---------------------------- initialisation ---------------------------------
1323    ideal  Jfsyz, JetId, bb;
1324    poly   a, b, c, d, Relation, an, bn;
1325    int    B,C, alpha, beta, gamma, g;
1326    matrix Matx, Maty;
1327    map    PhiG, VERT;
1328    list   v;
1329    def ring_top=basering;
1330
1331    if(size(#)==1) { PhiG = #[1]; }
1332    else { PhiG = ring_top,maxideal(1); }
1333    bb = maxideal(1);
1334
1335    // Ziel: bestimme a,b,c,d sodass  fk = (ax+by^k)^3(cx+dy) gilt.
1336    debug_log(2, "Isomorphie_s17:");
1337    debug_log(2, "Faktor: f=",Show(f)," Jet=",Show(fk)," k=",k, "cnt=", ct);
1338
1339    if( k == 1) {
1340      Jfsyz = fk, diff(fk, x(1));
1341      Matx  = matrix(syz(Jfsyz));
1342      Jfsyz = fk, diff(fk, x(2));
1343      Maty  = matrix(syz(Jfsyz));
1344
1345      a = Coeff(fk, x(1), x(1)^4);
1346      b = Coeff(fk, x(2), x(2)^4);
1347      c = Coeff(fk, x(1)*x(2), x(1)^3*x(2));
1348      d = Coeff(fk, x(1)*x(2), x(1)*x(2)^3);
1349
1350      if( (a != 0) && (b != 0) ) {
1351        B = -int(Coeff(Matx[1,1], x(2), x(2)));
1352        C = -int(Coeff(Maty[1,1], x(1), x(1)));
1353        alpha = int(Coeff(Matx[2,1], x(1), x(1)^2));
1354        beta  = int(Coeff(Matx[2,1], x(1)*x(2), x(1)*x(2)));
1355        gamma = int(Coeff(Matx[2,1], x(2), x(2)^2));
1356
1357        bb[rvar(x(1))] = x(1) - (2*gamma / (B - beta))*x(2);
1358        bb[rvar(x(2))] = x(2) - ((C - beta) / (2*gamma))*x(1);
1359        VERT     = ring_top,bb;
1360        Relation = VERT(f);
1361        fk       = jet(Relation, 4);
1362
1363        an = Coeff(fk, x(1), x(1)^4);
1364        bn = Coeff(fk, x(2), x(2)^4);
1365        if( (an != 0) & (bn != 0) ) { VERT=ring_top,x(1),(x(2) + a*x(1))/ b; }
1366        f    = VERT(f);
1367        fk   = jet(f, 4);
1368        PhiG = VERT(PhiG);
1369
1370        a = Coeff(fk, x(1), x(1)^4);
1371        b = Coeff(fk, x(2), x(2)^4);
1372        c = Coeff(fk, x(1)*x(2), x(1)^3*x(2));
1373        d = Coeff(fk, x(1)*x(2), x(1)*x(2)^3);
1374        Jfsyz = fk, diff(fk, x(1));
1375        Matx  = matrix(syz(Jfsyz));
1376        Jfsyz = fk, diff(fk, x(2));
1377        Maty  = matrix(syz(Jfsyz));
1378      }
1379
1380      if( (a == 0) || (b == 0) ) {
1381        if( a == 0) {
1382          if( c == 0) { // y3(ax+by)
1383            Relation = - Matx[2,1] / Matx[1,1];
1384            a = Coeff(Relation, x(1), x(1));
1385            b = Coeff(Relation, x(2), x(2));
1386            VERT=ring_top,a*x(2)^k - b*x(1), x(1);
1387          }
1388          else { // (ax+by)^3y
1389            Relation = - 3*Matx[2,1] / Matx[1,1];
1390            a = Coeff(Relation, x(1), x(1));
1391            b = Coeff(Relation, x(2), x(2));
1392            VERT=ring_top,a*x(1) - b*x(2), x(2);
1393          }
1394        }
1395        else {
1396          if( d == 0) { // x3(ax+by)
1397            Relation = - Maty[2,1] / Maty[1,1];
1398            a = Coeff(Relation, x(1), x(1));
1399            b = Coeff(Relation, x(2), x(2));
1400            VERT=ring_top,x(1), b*x(2)^k - a*x(1);
1401          }
1402          else { // x(ax+by)^3
1403            Relation = - 3*Maty[2,1] / Maty[1,1];
1404            a = Coeff(Relation, x(1), x(1));
1405            b = Coeff(Relation, x(2), x(2));
1406            VERT=ring_top,x(2), b*x(1) - a*x(2);
1407          }
1408        }
1409        f    = VERT(f);
1410        PhiG = VERT(PhiG);
1411      }
1412      else {  //      "Weder b noch a sind 0";
1413        if(ct > 5) { v[1]=f; v[2]=PhiG; return(v); }
1414        fk = jet(f, 4);
1415        return(Isomorphie_s17(f, fk, k, ct+1, PhiG));
1416      }
1417    }
1418    else {  // k >1
1419      a     = fk/x(2);
1420      Jfsyz = a, diff(a, x(1));
1421      Matx  = matrix(syz(Jfsyz));
1422      Relation = -3 * Matx[2,1] / Matx[1,1];
1423      a    = Coeff(Relation, x(1), x(1));
1424      b    = Coeff(Relation, x(2), x(2)^k);
1425      VERT = basering,x(1)-b*x(2)^k,x(2);
1426      f    = VERT(f);
1427      PhiG = VERT(PhiG);
1428      JetId = x(1)^3*x(2) + x(2)^(3*k+1);
1429      fk = jet(f, 3*k+1, weight(JetId));
1430    }
1431    v = f, PhiG;
1432    debug_log(2, "Isomorphie_s17: done");
1433    debug_log(2, "Faktor: f=",Show(f)," Jet=",Show(fk)," k=",k);
1434
1435    return(v);
1436}
1437
1438///////////////////////////////////////////////////////////////////////////////
1439static
1440proc printresult (int step, poly f, string typ, list cstn, int m)
1441{
1442//---------------------------- initialisation ---------------------------------
1443  int corank, Mu, K;
1444  list v;
1445
1446  corank, Mu, K = cstn[1..3];
1447  debug_log(0,"   Arnold step number "+string(step));
1448  if( @DeBug >= 0 ) {
1449    "The singularity";
1450    "   `"+Show(jet(f, K))+"'";
1451    if( typ != "error!" && typ != "NoClass" ) {
1452      "is R-equivalent to "+typ+".";
1453    }
1454    if ( typ == "NoClass" ) {
1455      "is not in Arnolds list.";
1456    }
1457//    if(K>=0)  { "  det = "+string(K); }
1458    if(Mu>=0) { "   Milnor number = "+string(Mu); }
1459    if(m>=0)  { "   modality      = "+string(m); }
1460  }
1461  v = f, typ, corank, cstn[4];
1462  return(v);
1463}
1464
1465///////////////////////////////////////////////////////////////////////////////
1466static
1467proc Funktion47 (poly f, list cstn)
1468{
1469    int corank = cstn[1];
1470    int Mu = cstn[2];
1471    int K  = cstn[3];
1472    string s = "The Singularity '";+Show(jet(f, K), corank, K);
1473    string tp="";
1474//    return(printresult(47, f, tp, cstn, -1));
1475
1476    s = s +"' has 4-jet equal to zero. (F47), mu="+string(Mu);
1477
1478    s; // +"  ("+SG_Typ+")";
1479    return(Show(f), tp, corank);
1480}
1481
1482///////////////////////////////////////////////////////////////////////////////
1483static
1484proc Funktion91 (poly f, list cstn, int k)
1485{
1486    string tp  = "U*[k,0]";
1487    return(printresult(91, f, tp, cstn, -1));
1488}
1489
1490///////////////////////////////////////////////////////////////////////////////
1491static
1492proc Funktion92 (poly f, list cstn, int k)
1493{
1494    string tp  = "UP[k]";
1495    return(printresult(92, f, tp, cstn, -1));
1496}
1497
1498///////////////////////////////////////////////////////////////////////////////
1499static
1500proc Funktion93 (poly f, list cstn, int k)
1501{
1502    string tp  = "UQ[k]";
1503    return(printresult(93, f, tp, cstn, -1));
1504}
1505
1506///////////////////////////////////////////////////////////////////////////////
1507static
1508proc Funktion94 (poly f, list cstn, int k)
1509{
1510    string tp  = "UR[k]";
1511    return(printresult(94, f, tp, cstn, -1));
1512}
1513
1514///////////////////////////////////////////////////////////////////////////////
1515static
1516proc Funktion95 (poly f, list cstn, int k)
1517{
1518    string tp  = "US[k]";
1519    return(printresult(95, f, tp, cstn, -1));
1520}
1521
1522///////////////////////////////////////////////////////////////////////////////
1523static
1524proc Funktion96 (poly f, list cstn, int k)
1525{
1526    string tp  = "UT[k]";
1527    return(printresult(96, f, tp, cstn, -1));
1528}
1529
1530///////////////////////////////////////////////////////////////////////////////
1531proc morsesplit(poly f)
1532"
1533USAGE:    morsesplit(f);        f=poly
1534RETURN:   Normal form of f in M^3 after application of the splitting lemma
1535COMPUTE:  apply the splitting lemma (generalized Morse lemma) to f
1536EXAMPLE:  example morsesplit; shows an example"
1537{
1538//---------------------------- initialisation ---------------------------------
1539  poly f_out;
1540  int  n, K, Mu, corank;
1541  list v;
1542
1543  if(defined(@ringdisplay) != 0 ) { kill @ringdisplay; }
1544  string @ringdisplay = "setring "+nameof(basering);
1545  export @ringdisplay;
1546
1547  def ring_ext=basering;
1548
1549  n = nvars(basering);
1550
1551  // if trace/debug mode not set, do it!
1552  init_debug();
1553  K, Mu, corank = basicinvariants(f);
1554  ring ring_top=char(basering),(x(1..n)),(c,ds);
1555
1556  map Conv=ring_ext,maxideal(1);
1557  setring ring_top;
1558  v = Morse(jet(Conv(f),K), K, corank, 0);
1559  poly f_out = v[1];
1560  setring ring_ext;
1561  map ConvUp = ring_top, maxideal(1);
1562  return(ConvUp(f_out));
1563}
1564example
1565{ "EXAMPLE"; echo=2;
1566   ring r=0,(x,y,z),ds;
1567   export r;
1568   init_debug(1);
1569   poly f=(x2+3y-2z)^2+xyz-(x-y3+x2*z3)^3;
1570   poly g=morsesplit(f);
1571   g;
1572}
1573
1574///////////////////////////////////////////////////////////////////////////////
1575static
1576proc Coeffs (list #)
1577{
1578  matrix m=matrix(coeffs(#[1],#[2]), deg(#[1])+1, 1);
1579  return(m);
1580}
1581
1582///////////////////////////////////////////////////////////////////////////////
1583static
1584proc Morse(poly f, int K, int corank, int ShowPhi)
1585{
1586//---------------------------- initialisation ---------------------------------
1587    poly   fc, f2, a, P, Beta, fi;
1588    ideal  Jfx, B;
1589    int    n, i, j, k, Rang, Done;
1590    matrix Mat;
1591    map    Id, Psi, Phi, PhiG;
1592    intvec Abb, RFlg;
1593    list   v;
1594
1595    fi = f;
1596    n = nvars(basering);
1597    init_debug();
1598
1599    def ring_top=basering;
1600
1601    debug_log(3, "Spalte folgendes Polynom mit Bestimmtheit: ", string(K));
1602    debug_log(3, Show(fi));
1603
1604    for( j=1; j<=n ; j++) { Abb[j] = 0; }
1605
1606    RFlg = GetRf(fi, n);
1607    debug_log(2, "Reihenfolge fuer Vertauschungen:", RFlg );
1608    PhiG=ring_top,maxideal(1);
1609
1610//----------------- find quadratic term, if there is only one -----------------
1611    B = maxideal(1);
1612    if(corank == (n-1)) {
1613      Done = 0;
1614      f2   = jet(fi, 2);
1615      j    = 1;
1616      Jfx  = f2, diff(f2, x(j));
1617      while(j<=n && (diff(f2, x(j))==0)) {
1618        j   = j+1;
1619        Jfx = f2, diff(f2, x(j));
1620      }
1621      Mat  = matrix(syz(Jfx));
1622      Beta = 2*Mat[2,1]/Mat[1,1];
1623      for( j=1; j<=n ; j=j+1) {
1624        f2 = Coeff(Beta, x(RFlg[j]), x(RFlg[j]));
1625        if(f2!=0) {
1626          k = RFlg[j];
1627          break;
1628        }
1629      }
1630      for( j=1; j<=n ; j=j+1) {
1631        f2 = Coeff(Beta, x(j), x(j));
1632        if(j == k) { B[rvar(x(j))] = (2*f2*x(j)-Beta) / number(f2); }
1633      }
1634      Phi  =ring_top,B;
1635      fi   = Phi(fi);
1636      PhiG = Phi(PhiG);
1637    }
1638    if( ShowPhi > 1) { PhiG; }
1639
1640//------------------------ compute spliting lemma -----------------------------
1641    fc = fi;
1642    i  = 1;              // Index fuer Variablen wird bearbeitet
1643    while( i <= n) {
1644      Phi=ring_top,maxideal(1);
1645      debug_log(6, "Pruefe Variable x(" +string(RFlg[i]) + ")");
1646      debug_log(6, "--------------------");
1647      j  = i + 1;        // setze j fuer evtle Verschiebung
1648      f2 = jet(fc,2);
1649      debug_log(6, "Rechne 2-Jet =" , string(f2));
1650      if( (f2 - subst(f2, x(RFlg[i]), 0)) == 0 ) { Abb[RFlg[i]] = 1; }
1651      if( (f2 - subst(f2, x(RFlg[i]), 0)) != 0 ) {
1652        while( (j<=n) || (i==n) ) {
1653          debug_log(6, "Pruefe 2-Jet mit Wert : " + string(jet(fc,2)));
1654          a = Coeff(jet(fc,2), x(RFlg[i]), x(RFlg[i])^2);
1655          debug_log(6,"Koeffizient von x(" + string(RFlg[i]) + ")^2 ist:", a);
1656          if( (a != 0) || (i==n) ) {
1657            debug_log(6, "BREAK!!!!!!!!!!!!!!");
1658            break;
1659          }
1660          debug_log(6,"Verschiebe evtl Variable x(",string(RFlg[j]),") um x(",
1661                       string(RFlg[i]), ")");
1662          B = maxideal(1);
1663          for( k=1; k<=n ; k=k+1) {
1664            if(k==RFlg[j]) { B[rvar(x(k))] = x(k) + x(RFlg[i]); }
1665          }
1666          Phi = ring_top,B;
1667          fc  = Phi(fi);
1668          j   = j + 1;
1669        }               // Ende while( (j<=n) || (i==n) )
1670
1671        debug_log(6, "Moegliche Verschiebung fertig!");
1672        PhiG = Phi(PhiG);
1673        if( ShowPhi > 1) { "NachVersch.:"; Phi; }
1674
1675        if( (j<=n) || (i==n)) {
1676          P = Coeff(fc, x(RFlg[i]), x(RFlg[i]));
1677          debug_log(6, "Koeffizient von x("+string(RFlg[i])+") ist: ",
1678                        string(P));
1679          if(P != 0) {
1680            debug_log(6, "1 Koeffizient von x("+string(RFlg[i])+") ist: ",
1681                         string(P));
1682            debug_log(6, "a=" + string(a));
1683            P = P / number (2 * a);
1684            debug_log(6, "2 Koeffizient von x("+string(RFlg[i])+") ist: ",
1685                         string(P));
1686            B = maxideal(1);
1687            for( k=1; k<=n ; k=k+1) {if(k==RFlg[i]) {B[rvar(x(k))]=x(k)-P;}}
1688            Phi =ring_top,B;
1689            debug_log(6, "Quadratische-Ergaenzung durch:", Phi);
1690            fi   = Phi(fc);
1691            PhiG = Phi(PhiG);
1692            fc   = jet(fi,K);
1693            P    = Coeff(fc, x(RFlg[i]), x(RFlg[i]));
1694            if( P != 0) {
1695              fi = fc;
1696              continue;
1697            }
1698          }     // Ende if(P != 0)
1699                // Fertig mit Quadratischer-Ergaenzung
1700        }               // Ende if( (j<=n) || (i==n))
1701      }                 // Ende if( (f2 - subst(f2, x(RFlg[i]), 0)) != 0 )
1702
1703      fi = fc;
1704      i  = i + 1;
1705      debug_log(6, "++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
1706    }
1707    debug_log(6, "Ende  ---------------------------------------------------");
1708
1709//--------------------------- collect results ---------------------------------
1710    if( ShowPhi > 0 ) {
1711      "Abbildung innerhalb des Morse-Lemmas:";
1712      PhiG;
1713      "Vergleich:";
1714      "PhiG(f)= " + Show(jet(PhiG(f), K));
1715      "fi     = " + Show(fi);
1716    }
1717
1718    Rang = 0;
1719    B    = maxideal(1);
1720    for( i=1; i<=n ; i++) { if(Abb[i] != 1) { Rang ++; B[rvar(x(i))] = 0; } }
1721    Phi  = ring_top,B;
1722    PhiG = Phi(PhiG);
1723    fi   = Phi(fi);
1724    v    = fi, PhiG;
1725    debug_log(2, "rank determined with Morse rg=", Rang);
1726    debug_log(1, "Rest singularity f=",Show(fi));
1727    return(v);
1728}
1729
1730///////////////////////////////////////////////////////////////////////////////
1731static
1732proc Coeff(poly f, list #)
1733{
1734//---------------------------- initialisation ---------------------------------
1735  poly   a, term;
1736  int    n, i;
1737  matrix K;
1738
1739  n     = nvars(basering);
1740  i     = 1;
1741  term  = #[2];
1742  K     = coef(f, #[1]);
1743
1744  while( (i<=ncols(K)) && (K[1,i] != term) )
1745  { i++;
1746    if(i>ncols(K)) { break; }
1747  }
1748  if(i<=ncols(K)) { a = K[2,i]; }
1749  if(i>ncols(K)) { a = 0; }
1750
1751  return(a);
1752}
1753
1754///////////////////////////////////////////////////////////////////////////////
1755static
1756proc ReOrder(poly f)
1757{
1758//---------------------------- initialisation ---------------------------------
1759  poly  result;
1760  ideal B = maxideal(1);
1761  int   i, n, Ctn, Ctv;
1762  map   conv;
1763
1764  n = nvars(basering);
1765  Ctv = 1;              // Zahl der Vorhandenen Variablen
1766  Ctn = n;              // Zahl der Nicht-Vorhandenen Variablen
1767  def ring_top=basering;
1768
1769  for( i=1; i<=n; i=i+1)
1770  { result = subst(f,x(i), 0) - f;
1771    if( result != 0 ) { B[rvar(x(i))] = x(Ctv); Ctv++; }
1772    else { B[rvar(x(i))] = x(Ctn); Ctn--; }
1773  }
1774
1775  conv = ring_top,B;
1776  return(conv);
1777}
1778
1779///////////////////////////////////////////////////////////////////////////////
1780proc quickclass(poly f)
1781"
1782USAGE:    quickclass(f);         f=poly
1783RETURN:   Normal form of f in Arnold's list
1784REMARK:   try to determine the normal form of f by invariants, mainly by
1785          computing the Hilbert function of the Milnor albegra,
1786          no coordinate change is needed (see also proc 'milnorcode').
1787EXAMPLE:  example quickclass; shows an example"
1788{
1789//---------------------------- initialisation ---------------------------------
1790  string Typ;
1791  int    cnt, K, Mu, corank;
1792  list   v;
1793  def ring_top=basering;
1794  // check basic condition on the basering.
1795  if(checkring()) { return(f); }
1796  if( f==0 ) {
1797    "Normal form : 0";
1798    return(f);
1799  }
1800  if( jet(f,0)!=0 ) {
1801    "Normal form : 1";
1802    return(f);
1803  }
1804  K, Mu, corank = basicinvariants(f);
1805  if(Mu<0) {
1806    debug_log(0, "The Milnor number of the function is infinite.");
1807    return(f);
1808  }
1809
1810  // Do the classification of f
1811  // typ: list of types matching the milnorcode
1812  // cnt: number of matches found
1813  v = HKclass(milnorcode(f));
1814  Typ, cnt = v[1..2];
1815  "Singularity R-equivalent to :",Typ;
1816  if(cnt==0) {
1817    "Hilbert polynomial not recognised. Milnor code = ", milnorcode(f);
1818    return();
1819  }
1820  if(cnt==1) {
1821    debug_log(1,"Getting normal form from database.");
1822    "normal form :",A_L(Typ);
1823    return(A_L(Typ));
1824  }
1825  // Hier nun der Fall cnt>1
1826  "Hilbert-Code of Jf^2";
1827  "We have ", cnt, "cases to test";
1828  Cubic(f);
1829  return(v);
1830}
1831example
1832{ "EXAMPLE:"; echo=2;
1833   ring r=0,(x,y,z),ds;
1834   poly f=(x2+3y-2z)^2+xyz-(x-y3+x2*z3)^3;
1835   quickclass(f);
1836}
1837
1838///////////////////////////////////////////////////////////////////////////////
1839proc milnorcode (poly f, list #)
1840"USAGE:    milnorcode(f[,e]); f=poly, e=int
1841RETURN:   intvec, coding the Hilbert function of the e-th Milnor algebra
1842          of f, i.e. of basering/(jacob(f)^e) (default e=1), according
1843          to proc Hcode
1844EXAMPLE:  example milnorcode; shows an example"
1845{
1846  int  e=1;
1847  if(size(#)==1) { e=#[1]; }
1848  ideal jf=std(jacob(f)^e);
1849  intvec v=hilb(jf,2);
1850
1851  return(Hcode(v));
1852}
1853example
1854{ "EXAMPLE:"; echo=2;
1855  ring r=0,(x,y,z),ds;
1856  poly f=x2y+y3+z2;
1857  milnorcode(f);
1858  milnorcode(f,2);  // a big second argument may result in memory overflow
1859}
1860
1861///////////////////////////////////////////////////////////////////////////////
1862proc Hcode (intvec v)
1863"USAGE:    Hcode(v); v=intvec
1864RETURN:   intvec, coding v according to the number of successive
1865          repetitions of an entry
1866EXAMPLE:  example Hcode; shows an example."
1867{
1868  int    col, len, i, cur, cnt, maxcoef, nlen;
1869  intvec hil1, hil2;
1870
1871  col      = 1;
1872  len      = size(v);
1873  v[len+1] = 0;
1874
1875  init_debug();
1876  debug_log(1, "Hcode:", v );
1877
1878  for(i=1; i<=len; i++) { if( v[i] > maxcoef) { maxcoef = v[i]; } }
1879
1880  nlen       = 2*maxcoef - 1;
1881  hil1[nlen] = 0;
1882  hil2[nlen] = 0;
1883
1884  for(i=1; i<=nlen; i++)
1885  { if( i > maxcoef) { hil2[i] = 2*maxcoef-i; }
1886    else { hil2[i] = i; }
1887  }
1888
1889  for(i=1; i<=nlen; i++)
1890  { cnt=0;
1891    while( (col<=len) && (v[col] == hil2[i]) )
1892    { cnt++; col++; }
1893    hil1[i] = cnt;
1894  }
1895  return(hil1);
1896}
1897example
1898{ "EXAMPLE:"; echo=2;
1899  intvec v1 = 1,3,5,5,2;
1900  Hcode(v1);
1901  intvec v2 = 1,2,3,4,4,4,4,4,4,4,3,2,1;
1902  Hcode(v2);
1903}
1904
1905///////////////////////////////////////////////////////////////////////////////
1906static
1907proc Cubic (poly f)
1908{
1909//---------------------------- initialisation ---------------------------------
1910  poly  f3;
1911  ideal Jf, Jf1, Jf2;
1912  int   Dim, Mult;
1913
1914  f3 = jet(f, 3);
1915  if( jet(f,2) != 0) { return("2-jet non zero"); }
1916  if( f3 == 0 ) { return("null form"); }
1917
1918  Jf1  = jacob(f3);
1919  Jf   = std(Jf1);
1920  Dim  = dim(Jf);
1921  Mult = mult(Jf);
1922
1923  if(Dim == 0) { return("P[8]:smooth cubic"); } // x3 + y3 + z3 + axyz
1924  if(Dim == 1) {
1925    if(Mult == 2) {
1926      Jf2  = wedge(jacob(Jf1),3-Dim), Jf1;
1927      Jf2  = std(Jf2);
1928      Dim  = dim(Jf2);
1929      if (Dim == 0) { return("R:conic + line"); }       // x3 + xyz
1930      if (Dim == 1) { return("Q:cuspidal cubic"); }  // x3 + yz2
1931    }
1932    if(Mult == 3) {
1933      Jf2 = wedge(jacob(Jf1),3-Dim), Jf1;
1934      Jf2 = std(Jf2);
1935      Dim = dim(Jf2);
1936      if(Dim == 0) { return("T:three lines"); } // xyz
1937      if(Dim == 1) { return("S:conic + tangent"); }     // x2z + yz2
1938    }
1939    if(Mult == 4) { return("U:three concurrent lines"); }       // x3 + xz2
1940  }
1941  if(Dim == 2) {
1942    if(Mult == 1) { return("V:doubleline + line"); }    // x2y
1943    if(Mult == 2) { return("V': tripple line"); }       // x3
1944  }
1945  if(Dim == 3) { return("P[9]:nodal cubic"); }  // x3 + y3 + xyz
1946
1947  return("");
1948}
1949
1950///////////////////////////////////////////////////////////////////////////////
1951static
1952proc parity  (int e)
1953"USAGE:    parity()"
1954{
1955  int r = e/2;
1956  if( 2*r == e ) { return(0); }
1957  return(1);
1958}
1959
1960///////////////////////////////////////////////////////////////////////////////
1961static
1962proc HKclass (intvec sg)
1963{
1964//---------------------------- initialisation ---------------------------------
1965  int    cnt = 0;
1966  string SG_Typ = "";
1967  list   v;
1968
1969  // if trace/debug mode not set, do it!
1970  init_debug();
1971  debug_log(1, "Milnor code : ", sg );
1972  if(size(sg) == 1) { v ="A["+string(sg[1])+"]", 1; return(v); }
1973  if(size(sg) == 3) { return(HKclass3(sg, SG_Typ, cnt)); }
1974  if(size(sg) == 5) { return(HKclass5(sg, SG_Typ, cnt)); }
1975  if(size(sg) == 7) { return(HKclass7(sg, SG_Typ, cnt)); }
1976  debug_log(1, "No solution found." );
1977  v = "", 0;
1978  return(v);
1979}
1980
1981///////////////////////////////////////////////////////////////////////////////
1982static
1983proc HKclass3 (intvec sg, string SG_Typ, int cnt)
1984{
1985  list v;
1986
1987  if(sg[1] == 1) { v = HKclass3_teil_1(sg, SG_Typ, cnt); }
1988  debug_log(6, "HKclass3: ", v[1], " cnt=", v[2]);
1989  return(v);
1990}
1991
1992///////////////////////////////////////////////////////////////////////////////
1993static
1994proc HKclass3_teil_1 (intvec sg, string SG_Typ, int cnt)
1995{
1996  int  k, r, s;
1997  list v;
1998
1999  debug_log(2, "entering HKclass3_teil_1", sg);
2000  if(sg[2]==1) { SG_Typ=SG_Typ+" D[k]=D["+string(sg[3]+3)+"]";cnt++;} // D[k]
2001  if(sg[2]>=1) {
2002    if( parity(sg[2])) { // sg[2] ist ungerade
2003      if(sg[2]<=sg[3]) {
2004        k = (sg[2]+1)/2;
2005        if(k>1) {
2006          cnt++;
2007          SG_Typ=SG_Typ+" J[k,r]=J["+string(k)+","+string(sg[3]+1-2*k)+"]";
2008        }// J[k,r]
2009      }
2010      if(sg[2]==sg[3]+2) {                              // E[6k+2]
2011        k = (sg[2]-1)/2;
2012        if(k>0) {cnt++; SG_Typ=SG_Typ+" E[6k+2]=E[" + string(6*k+2) + "]"; }
2013      }
2014    }
2015    else {              // sg[2] ist gerade
2016      if( sg[2] == sg[3]+1) {                           // E[6k]
2017        k = sg[2]/2; cnt++; SG_Typ=SG_Typ + " E[6k]=E[" + string(6*k) + "]"; }
2018      if( sg[2] == sg[3]) {                             // E[6k+1]
2019        k=sg[2]/2; cnt++; SG_Typ=SG_Typ+" E[6k+1]=E["+string(6*k+1)+"]"; }
2020    }
2021  }
2022
2023  debug_log(2, "finishing HKclass3_teil_1");
2024  debug_log(6, "HKclass3: ", SG_Typ, " cnt=", cnt);
2025  v = SG_Typ, cnt;
2026  return(v);
2027}
2028
2029///////////////////////////////////////////////////////////////////////////////
2030static
2031proc HKclass5 (intvec sg, string SG_Typ, int cnt)
2032{
2033  list v;
2034
2035  if(sg[1] == 1 && sg[2] == 1) { v = HKclass5_teil_1(sg, SG_Typ,cnt); }
2036  if(sg[1] == 1 && sg[2] == 0) { v = HKclass5_teil_2(sg, SG_Typ,cnt); }
2037  debug_log(6, "HKclass5: ", v[1], " cnt=", v[2]);
2038  return(v);
2039}
2040
2041///////////////////////////////////////////////////////////////////////////////
2042static
2043proc HKclass5_teil_1 (intvec sg, string SG_Typ, int cnt)
2044{
2045  int  k, r, s;
2046  list v;
2047
2048  debug_log(2, "entering HKclass5_teil_1", sg);
2049  if(parity(sg[3])) {  // Dritte Stelle soll ungerade sein
2050    k = (sg[3]+1)/2;
2051    if(sg[3] > sg[4]) {
2052      k--;
2053      if( (sg[4]==sg[5]) && (sg[3] == sg[4]+1) && k>0 ) { // W[12k+6]
2054        SG_Typ = SG_Typ + " W[12k+6]=W["+string(12*k+6)+"]"; cnt++;
2055      }
2056      if( (sg[3]==sg[5]) && (sg[3] == sg[4]+2) && k>0 ) { // W[12k+5]
2057        SG_Typ = SG_Typ + " W[12k+5]=W["+string(12*k+5)+"]"; cnt++;
2058      }
2059    }
2060    else {  // sg[3] <= sg[4]
2061      if( (sg[3]==sg[4]) && (sg[5] >= sg[3]) ) {
2062        r = sg[5] - sg[4];
2063        SG_Typ=SG_Typ +" X[k,r]=X["+string(k)+","+string(r)+"]"; cnt++;
2064      }
2065      if( (sg[3]==1) && (sg[4]==3) && (sg[5]>=sg[4])){    // Z[1,r]
2066        r = sg[5] - sg[4];
2067        SG_Typ = SG_Typ + " Z[1,r]=Z[1,"+string(r)+"]"; cnt++;
2068      }
2069
2070      if( sg[4] == sg[5]) {
2071        if(parity(sg[4])) {                                  // Z[k,r,0]
2072          r = (sg[4] - sg[3])/2;
2073          if( r>0 ) { cnt++;
2074            SG_Typ = SG_Typ + " Z[k,r,0]=Z["+string(k)+","+string(r)+",0]";
2075          }
2076        }
2077        else {                                                // Z[k,12k+6r]
2078          r = (sg[4] - 2*k)/2; cnt++;
2079          SG_Typ = SG_Typ+" Z[k,12k+6r]=Z["+string(k)+","+string(12*k+6*r)+"]";
2080        }
2081      }
2082
2083      if( parity(sg[4]) ) {  // 4. Stelle ist ungerade
2084        if(sg[4] == sg[5]+2) {                              // Z[k,12k+6r+1]
2085          r = (sg[4]-2*k-1)/2; cnt++;
2086          SG_Typ=SG_Typ+" Z[k,12k+6r+1]=Z["+string(k)+",";
2087          SG_Typ=SG_Typ+string(12*k+6*r+1)+"]";
2088       }
2089       if( (sg[5]>sg[4]) && (sg[4]>sg[3]) ) {           // Z[k,r,s]
2090          r = (sg[4] - sg[3])/2; cnt++;
2091          s = sg[5] - sg[4];
2092          SG_Typ = SG_Typ + " Z[k,r,s]=";
2093          SG_Typ = SG_Typ + "Z["+string(k)+","+string(r)+","+string(s)+"]";
2094        }
2095      }
2096      else {  // 4. Stelle ist gerade
2097        if( sg[4] == sg[5]+1) {                             // Z[k,12k+6r-1]
2098          r = (sg[4] - 2*k)/2; cnt++;
2099          SG_Typ=SG_Typ+" Z[k,12k+6r-1]=Z["+string(k)+",";
2100          SG_Typ=SG_Typ+string(12*k+6*r-1)+"]";
2101        }
2102      }
2103
2104      if(sg[4]>sg[3]) {                                     // Y[k,r,s]
2105        r = sg[4] - sg[3];
2106        s = sg[5] - sg[3] + r;
2107        if( s<0 ) { s = -s; }
2108        SG_Typ = SG_Typ + " Y[k,r,s]="; cnt++;
2109        SG_Typ = SG_Typ + "Y["+string(k)+","+string(r)+","+string(s)+"]";
2110      }
2111    }
2112  }
2113  else {  // Dritte Stelle soll gerade sein
2114    k = sg[3]/2;
2115    // sortiere verschiedene W's
2116    if(k>0) {
2117      if( (sg[4]==2*k-1) && (sg[4]==sg[5]) ) {  // W[12k]
2118        SG_Typ = SG_Typ + " W[12k]=W["+string(12*k)+"]"; cnt++;
2119      }
2120      if( (sg[4]==2*k-1) && (sg[3]==sg[5]) ) {  // W[12k+1]
2121        SG_Typ = SG_Typ + " W[12k+1]=W["+string(12*k+1)+"]"; cnt++;
2122      }
2123      if( (sg[4]==2*k) && (sg[5]>=sg[4]) ) {    // W[k,r]
2124        r = sg[5] - sg[4];
2125        SG_Typ=SG_Typ+" W[k,r]=W["+string(k)+","+string(r)+"]"; cnt++;
2126      }
2127      if( (sg[5]==2*k-1) && (sg[4]>sg[3]) ) {  // W#[k,2r-1]
2128        r = sg[4] - sg[3]; cnt++;
2129        SG_Typ = SG_Typ + " W#[k,2r-1]=W["+string(k)+","+string(2*r-1)+"]";
2130      }
2131      if( (sg[5]==2*k) && (sg[4]>sg[3]) ) {  // W#[k,2r]
2132        r = sg[4] - sg[3]; cnt++;
2133        SG_Typ = SG_Typ + " W#[k,2r]=W["+string(k)+","+string(2*r)+"]";
2134      }
2135    }   // ENDIF k>0
2136  }
2137  debug_log(2, "finishing HKclass5_teil_1");
2138  debug_log(6, "HKclass5_teil_1: ", SG_Typ, " cnt=", cnt);
2139  v = SG_Typ, cnt;
2140  return(v);
2141}
2142
2143///////////////////////////////////////////////////////////////////////////////
2144static
2145proc HKclass5_teil_2 (intvec sg, string SG_Typ, int cnt)
2146{
2147  int k, r, s;
2148  list v;
2149
2150  debug_log(2, "entering HKclass5_teil_2", sg);
2151  // finde T[p,q,r]
2152  k = sg[3] + 1;
2153  r = sg[4] + k;
2154  s = sg[5] + r - 1;
2155  if(k>2 && r>2 && s>2) {                               // T[k,r,s]
2156    cnt++;
2157    SG_Typ = SG_Typ + " T[k,r,s]=T["+string(k)+","+string(r)+","+string(s)+"]";
2158  }
2159
2160  // finde weitere Moeglicjkeiten.
2161  if(sg[3]==2) {  // Q[...]
2162    if(parity(sg[4])) { // 4. Stelle ist ungerade.
2163      if(sg[4]==sg[5]) {                                // Q[6k+4]
2164        k=(sg[4]+1)/2; cnt++; SG_Typ=SG_Typ+" Q[6k+4]=Q["+string(6*k+4)+"]";
2165      }
2166      if(sg[4]+1==sg[5]) {                      // Q[6k+5]
2167        k=sg[5]/2; cnt++; SG_Typ=SG_Typ+" Q[6k+5]=Q["+string(6*k+5)+"]";
2168      }
2169    }
2170    else { // 4. Stelle ist gerade.
2171      if(sg[4]==sg[5]+1) {                      // Q[6k+6]
2172        k=sg[4]/2; cnt++; SG_Typ=SG_Typ+" Q[6k+6]=Q["+string(6*k+6)+"]";
2173      }
2174      if(sg[4]<sg[5]) {                 // Q[k,r]
2175        k = (sg[4]+2)/2;
2176        if(k>=2) {
2177          r=sg[5]+1-2*k; cnt++;
2178          SG_Typ=SG_Typ+" Q[k,r]=Q["+string(k)+","+string(r)+"]";
2179        }
2180      }
2181    }
2182  }
2183  else {           // S[...]
2184    if(parity(sg[3])) {  // 3. Stelle ist ungerade.
2185      k = (sg[3]-1)/2;
2186      if(sg[3]==sg[4]+3 && sg[3]==sg[5]+2) {    // S[12k-1]
2187        cnt++; SG_Typ = SG_Typ + " S[12k-1]=S["+string(12*k-1)+"]";
2188      }
2189      if(sg[3]==sg[4]+3 && sg[3]==sg[5]+1) {    // s[12k]
2190        cnt++; SG_Typ = SG_Typ + " S[12k]=S["+string(12*k)+"]";
2191      }
2192      if(sg[3]==sg[4]+2 && sg[5]>=sg[4]+1) {    // S[k,r]
2193        r = sg[5] - 2*k; cnt++;
2194        SG_Typ = SG_Typ + " S[k,r]=S["+string(k)+","+string(r)+"]";
2195      }
2196      if(sg[3]==sg[5]+2 && sg[4]>=sg[5]) {              // S#[k,2r-1]
2197        r = sg[4] - 2*k + 1; cnt++;
2198        SG_Typ = SG_Typ + " S#[k,2r-1]=S#["+string(k)+","+string(2*r-1)+"]";
2199      }
2200      if(sg[3]==sg[5]+1 && sg[4]>=sg[5]) {              // S#[k,2r]
2201        r = sg[4] - 2*k + 1; cnt++;
2202        SG_Typ = SG_Typ + " S#[k,2r]=S#["+string(k)+","+string(2*r)+"]";
2203      }
2204    }
2205    else { // 3. Stelle ist gerade.
2206      if(sg[3]==sg[5]+1 && sg[5]==sg[4]+3) {    // S[12k+4]
2207        k = (sg[3]-2)/2; cnt++;
2208        SG_Typ = SG_Typ + " S[12k+4]=S["+string(12*k+4)+"]";
2209      }
2210      if(sg[3]==sg[5]+2 && sg[5]==sg[4]+1) {    // S[12k+5]
2211        k = (sg[3]-2)/2; cnt++;
2212        SG_Typ = SG_Typ + " S[12k+5]=S["+string(12*k+5)+"]";
2213      }
2214    }
2215  }
2216  debug_log(2, "finishing HKclass5_teil_2");
2217  debug_log(6, "HKclass5_teil_2: ", SG_Typ, " cnt=", cnt);
2218  v = SG_Typ, cnt;
2219  return(v);
2220}
2221
2222///////////////////////////////////////////////////////////////////////////////
2223static
2224proc HKclass7 (intvec sg, string SG_Typ, int cnt)
2225{
2226  list v;
2227
2228  if(sg[1]==1 && sg[2]==0 && sg[3]==1) { v=HKclass7_teil_1(sg, SG_Typ, cnt); }
2229  debug_log(6, "HKclass7: ", v[1], " cnt=", v[2]);
2230  return(v);
2231}
2232
2233///////////////////////////////////////////////////////////////////////////////
2234static
2235proc HKclass7_teil_1 (intvec sg, string SG_Typ, int cnt)
2236{
2237  int k, r, s;
2238  list v;
2239
2240  debug_log(2, "entering HKclass7_teil_1", sg);
2241  if(sg[4] == 2) {                                      // V[...]
2242    if(sg[5] == 0 && sg[6] == 1 && sg[7]>0) {   // V[1,r]
2243      r = sg[7] - 1; cnt++; SG_Typ = SG_Typ + " V[1,r]=V[1,"+string(r)+"]";
2244    }
2245    if(sg[5] == 1 && sg[7] == 1) {                      // V#[1,2r-1]
2246      r=sg[6]+1; cnt++; SG_Typ=SG_Typ+" V#[1,2r-1]=V#[1,"+string(2*r-1)+"]";
2247    }
2248    if(sg[5] == 1 && sg[7] == 2) {                      // V#[1,2r]
2249      r=sg[6]+1; cnt++; SG_Typ=SG_Typ+" V#[1,2r]=V#[1,"+string(2*r)+"]";
2250    }
2251  }
2252  //            Moegliche U[...]'s
2253  k = sg[4];
2254  if(sg[5]==2*k-1 && sg[6]==0 && sg[7]==sg[5]) {        // U[12k]
2255    cnt++;SG_Typ = SG_Typ + " U[12k]=U["+string(12*k)+"]";
2256  }
2257  if(sg[5]==2*k && sg[6]==0 && sg[7]==sg[5]) {  // U[12k+4]
2258    cnt++;SG_Typ = SG_Typ + " U[12k+4]=U["+string(12*k+4)+"]";
2259  }
2260  if(sg[5]==2*k-1 && sg[6]>0 && sg[7]==sg[5]) { // U[k,2r-1]
2261    r=sg[6]-1; cnt++;
2262    SG_Typ=SG_Typ+" U[k,2r-1]=U["+string(k)+","+string(2*r-1)+"]";
2263  }
2264  if(sg[5]==2*k-1 && sg[6]>0 && sg[7]==2*k) {   // U[k,2r]
2265    r = sg[6]; cnt++;
2266    SG_Typ = SG_Typ + " U[k,2r]=U["+string(k)+","+string(2*r)+"]";
2267  }
2268  debug_log(2, "finishing HKclass7_teil_1");
2269  debug_log(6, "HKclass7_teil_1: ", SG_Typ, " cnt=", cnt);
2270  v = SG_Typ, cnt;
2271  return(v);
2272}
2273
2274///////////////////////////////////////////////////////////////////////////////
2275proc singularity(string typ, list #)
2276"USAGE:    singularity(t, l); t=string (name of singularity),
2277          l=list of integers (index/indices of singularity)
2278COMPUTE:  get the Singularity named by type t from the database.
2279          list l is as follows:
2280          l= k [,r [,s [,a [,b [,c [,d]]]]]] k,r,s=int   a,b,c,d=poly
2281          The name of the dbm-databasefile is: NFlist.[dir,pag]
2282          The file is found in the current directory. If it does not
2283          exists, please run the script MakeDBM first.
2284RETURN:   Normal form and corank of the singularity named by type t and its
2285          index (indices) l
2286EXAMPLE:  example singularity; shows an example"
2287{
2288  poly a1, a2, a3, a4, f;
2289  int k, r, s;
2290  int len = size(#);
2291  list v, ret;
2292
2293  classify_init();
2294  ret = 0, 0;
2295  k = #[1];
2296  if(len>=2) { r = #[2]; }
2297  else { r = 0; }
2298  if(len>=3) { s = #[3]; }
2299  else { s = 0; }
2300  if( k<0 || r<0 || s<0) {
2301    "Initial condition failed: k>=0; r>=0; s>=0";
2302    "k="+string(k)+" r="+string(r)+"   s="+string(s);
2303    return(ret);
2304  }
2305  int crk;
2306
2307  init_debug();
2308  def ring_top=basering;
2309
2310  if(len>=4) { a1 = #[4]; }
2311  else { a1=1; }
2312  if(len>=5) { a2 = #[5]; }
2313  else { a2=1; }
2314  if(len>=6) { a3 = #[6]; }
2315  else { a3=1; }
2316  if(len>=7) { a4 = #[7]; }
2317  else { a4=1; }
2318
2319  debug_log(4, "Values: len=", string(len), " k=", string(k), " r=",
2320        string(r));
2321  if(defined(RingNF) != 0 ) { kill RingNF; }
2322  ring RingNF=char(basering),(x,y,z),(c,ds);
2323  poly f;
2324  map Conv=ring_top,maxideal(1);
2325  v = Singularitaet(typ, k, r, s, Conv(a1), Conv(a2), Conv(a4), Conv(a4));
2326  f, crk = v[1..2];
2327  debug_log(2, "Info=", f );
2328  setring ring_top;
2329  if(defined(Phi) != 0 ) { kill Phi; }
2330  map Phi=RingNF,maxideal(1);
2331
2332  ret = Phi(f), crk;
2333  return(ret);
2334}
2335example
2336{ "EXAMPLE"; echo=2;
2337  ring r=0,(x,y,z),(c,ds);
2338  init_debug(0);
2339  singularity("E[6k]",6);
2340  singularity("T[k,r,s]", 3, 7, 5);
2341  poly f=y;
2342  singularity("J[k,r]", 4, 0, 0, f);
2343}
2344
2345///////////////////////////////////////////////////////////////////////////////
2346static
2347proc Singularitaet (string typ,int k,int r,int s,poly a,poly b,poly c,poly d)
2348{
2349  list   v;
2350  string DBMPATH=system("getenv","DBMPATH");
2351  string DatabasePath, Database, S, Text, Tp;
2352  poly   f, f1;
2353  int    crk, Mu, ret;
2354  intvec MlnCd;
2355
2356  if( DBMPATH != "" ) { DatabasePath = DBMPATH+"/NFlist"; }
2357  else { DatabasePath = "NFlist"; }
2358  Database="DBM: ",DatabasePath;
2359
2360  link dbmLink=Database;
2361  debug_log(2, "Opening Singalarity-database: ", newline, Database);
2362  Tp = read(dbmLink, typ);
2363  debug_log(2,"DBMread(", typ, ")=", Tp, ".");
2364  if( Tp != "(null)" && Tp !="" ) {
2365    string Key = "I_", typ;
2366    S = "f = ", Tp, ";";
2367    debug_log(2,"S=", S, " Tp=", Tp, "Key=", Key);
2368    execute S;
2369    execute read(dbmLink, Key)+";";
2370    debug_log(1, "Polynom f=", f,  "  crk=", crk, "  Mu=", Mu,
2371                " MlnCd=", MlnCd);
2372    v = f, crk, Mu, MlnCd;
2373  }
2374  else {
2375    v = 0, 0, 0, 0;
2376  }
2377  close(dbmLink);
2378  return(v);
2379}
2380
2381///////////////////////////////////////////////////////////////////////////////
2382proc RandomPolyK (int M, string Typ)
2383"USAGE:    RandomPolyK(M, Typ)"
2384{
2385//---------------------------- initialisation ---------------------------------
2386  int    n, b, i, k, r, s, crk;
2387  ideal  B;
2388  map    Phi;
2389  string txt, Tp;
2390  list   v;
2391
2392  def ring_ext=basering;
2393  n=4;
2394  if(M<5) { M = 5; }
2395
2396  k = random(1, M);
2397  r = random(-5, 2*M);
2398  s = random(-5, 2*M);
2399  if(r<0) { r = 0; }
2400  if(s<0) { s = 0; }
2401
2402  ring RgAnf=char(basering),(x,y,z,t),(c,ds);
2403  poly f;
2404
2405  v = singularity(Typ, k, r, s);
2406  f, crk = v[1..2];
2407//  f = f +t2;
2408  if(crk==1) { f = f + y2 + z2; }
2409  if(crk==2) { f = f + z2; }
2410  txt="RandomPoly-Series: gewaehlt fall `"+Typ+"' mit";
2411  txt=txt+" f="+string(f);
2412  txt;
2413  setring ring_ext;
2414  B = maxideal(1);
2415
2416  r=1;
2417  for(i=n; i>0; i--,r++) {
2418//  for(i=1; i<=n; i=i+1)
2419    B[rvar(x(r))] = x(i);
2420    if(i>2 && random(1,10)<3) { B[rvar(x(r))] = B[rvar(x(r))] + x(i-1); }
2421//    if(i==1 && random(1,10)<4) { B[rvar(x(r))] = B[rvar(x(r))]- x(n); }
2422    if(i>0) {
2423      for(b=3; b<5; b=b+1) {
2424        // B[rvar(x(r))] = B[rvar(x(r))] + random(0,9) * x(i)^(b+2);
2425        if(random(1,20)<3) {
2426          B[rvar(x(r))] = B[rvar(x(r))] - random(-2,2)*x(b)^2;
2427        }
2428      }
2429    }
2430  }
2431  Phi=RgAnf, B;
2432  Phi;
2433  poly fr=Phi(f);
2434  fr = fr+(x(1)+x(2))^2;
2435//  return(Phi(f));
2436  return(fr);
2437}
2438
2439///////////////////////////////////////////////////////////////////////////////
2440proc debug_log (int level, list #)
2441"USAGE:    debug_log(level,li); level=int, li=comma separated \"message\" list
2442COMPUTE:  print \"messages\" if level>=@DeBug.
2443          useful for user-defined trace messages.
2444EXAMPLE:  example debug_log; shows an example
2445SEE ALSO: init_debug();"
2446{
2447   int len = size(#);
2448//   int printresult = printlevel - level +1;
2449//   if(level>1) {
2450//     dbprint(printresult, "Debug:("+ string(level)+ "): ", #[2..len]);
2451//   }
2452//   else { dbprint(printresult, #[1..len]); }
2453   if( defined(@DeBug) == 0 ) { init_debug(); }
2454   if(@DeBug>=level) {
2455      if(level>1) { "Debug:("+ string(level)+ "): ", #[1..len]; }
2456      else { #[1..len]; }
2457   }
2458}
2459example
2460{ "EXAMPLE:"; echo=2;
2461  example init_debug;
2462}
2463
2464///////////////////////////////////////////////////////////////////////////////
2465proc init_debug(list #)
2466"USAGE:    init_debug([level]);  level=int
2467COMPUTE:  Set the global variable @DeBug to level. The variable @DeBug is
2468          used by the function debug_log(level, list of strings) to know
2469          when to print the list of strings. init_debug() reports only
2470          changes of @DeBug.
2471NOTE:     The procedure init_debug(n); is usefull as trace-mode. n may
2472          range from 0 to 10, higher values of n give more information.
2473EXAMPLE:  example init_debug; shows an example"
2474{
2475  int newDebug=0;
2476  if( defined(@DeBug) != 0 ) { newDebug = @DeBug; }
2477
2478  if( size(#) > 0 ) {
2479    newDebug=#[1];
2480  }
2481  else {
2482    string s=system("getenv", "SG_DEBUG");
2483    if( s != "" && defined(@DeBug)==0) {
2484      s="newDebug="+s;
2485      execute s;
2486    }
2487  }
2488  if( defined(@DeBug) == 0) {
2489    int @DeBug = newDebug;
2490    export @DeBug;
2491    if(@DeBug>0) { "Debugging level is set to ", @DeBug; }
2492  }
2493  else {
2494    if( (size(#) == 0) && (newDebug < @DeBug) ) { return(); }
2495    if( @DeBug != newDebug) {
2496      int oldDebug = @DeBug;
2497      @DeBug = newDebug;
2498      if(@DeBug>0) { "Debugging level change from ", oldDebug, " to ",@DeBug; }
2499      else {
2500        if( @DeBug==0 && oldDebug>0 ) { "Debugging switched off."; }
2501      }
2502    }
2503  }
2504  printlevel = @DeBug;
2505}
2506example
2507{ "EXAMPLE:"; echo=2;
2508  init_debug();
2509  debug_log(1,"no trace information printed");
2510  init_debug(1);
2511  debug_log(1,"some trace information");
2512  init_debug(2);
2513  debug_log(2,"nice for debugging scripts");
2514  init_debug(0);
2515}
2516
2517///////////////////////////////////////////////////////////////////////////////
2518proc basicinvariants(poly f)
2519"USAGE:    basicinvariants(f);   f = poly
2520COMPUTE:  Compute basic invariants of f: an upper bound d for the
2521          determinacy, the milnor number mu and the corank c of f
2522RETURN:   intvec: d, mu, c
2523EXAMPLE:  example basicinvariants; shows an example"
2524{
2525  intvec v;
2526  ideal Jfs = std(jacob(f));
2527  v[1] = system("HC")+1;
2528  v[2] = vdim(Jfs);
2529  v[3] = corank(f);
2530  if( v[2]<v[1] ) { v[1] = v[2]+1; }
2531  return(v);
2532}
2533example
2534{ "EXAMPLE:"; echo=2;
2535   ring r=0,(x,y,z),ds;
2536   basicinvariants((x2+3y-2z)^2+xyz-(x-y3+x2*z3)^3);
2537}
2538
2539///////////////////////////////////////////////////////////////////////////////
2540proc corank(poly f)
2541"USAGE:    corank(f);   f=poly
2542RETURN:   the corank of the Hessian matrix of f, of type int
2543REMARK:   corank(f) is the number of variables occuring in the residual
2544          singulartity after applying 'morsesplit' to f
2545EXAMPLE:  example corank; shows an example"
2546{
2547  matrix M = jacob(jacob(jet(f,2)));
2548  list lba = bareiss(M);
2549  int cr = nvars(basering) - size(module(lba[1]));
2550  return(cr);
2551}
2552example
2553{ "EXAMPLE:"; echo=2;
2554  ring r=0,(x,y,z),ds;
2555  poly f=(x2+3y-2z)^2+xyz-(x-y3+x2*z3)^3;
2556  corank(f);
2557}
2558///////////////////////////////////////////////////////////////////////////////
2559static
2560proc Faktorisiere(poly f, poly fk, int pt, int k, intvec RFlg)
2561{
2562//---------------------------- initialisation ---------------------------------
2563  poly   a, b, Relation;
2564  ideal  B, Jfsyz;
2565  map    PhiG, VERT;
2566  matrix Mat;
2567  list   v;
2568  def    ring_top=basering;
2569
2570  // Ziel: bestimme a,b sodass  fk = (ax+by^k)^pt gilt.
2571  B    = maxideal(1);
2572  PhiG = ring_top,B;
2573  debug_log(2, "Faktor: f=",Show(f)," Jet=",Show(fk)," k=",k," exp=",pt);
2574
2575//----------------------- compute role of x and y -----------------------------
2576  Jfsyz = fk, diff(fk, x(1));
2577  Mat   = matrix(syz(Jfsyz));
2578  if( (fk-subst(fk,x(1),0)) != 0  &&  (fk-subst(fk,x(2),0)) != 0 ) {
2579    // Wenn k>0 ist die Wahl fuer x & y bereits getroffen
2580    // sonst bestimmen x und y
2581    Jfsyz    = fk, diff(fk, x(1));
2582    Mat      = matrix(syz(Jfsyz));
2583    Relation = -pt * Mat[2,1] / Mat[1,1];
2584    a = Coeff(Relation, x(1), x(1));
2585    b = Coeff(Relation, x(2), x(2)^k);
2586    B = maxideal(1);
2587    if( (RFlg[1]==1 && k==1) || k>1) { B[rvar(x(1))] = x(1)-b*x(2)^k; }
2588    else { B[rvar(x(2))] = x(2)-b*x(1)^k; }
2589    VERT = basering,B;
2590    f    = VERT(f);
2591    PhiG = VERT(PhiG);
2592  }
2593
2594//------------------- permutation of x and y, if needed -----------------------
2595  if( k==1 ) {
2596    debug_log(2, "Fak-7:",Show(f)," jet=",Show(fk));
2597    if(Coeff(jet(f, pt), x(1), x(1)^pt) == 0) {
2598      VERT = basering,x(2),x(1);
2599      f    = VERT(f);
2600      PhiG = VERT(PhiG);
2601    }
2602  }
2603  debug_log(2, "Fak-8:",Show(f)," jet=",Show(fk));
2604  debug_log(6, "Faktorisiere liefert: f=", Show(f));
2605  v[1] = f;
2606  v[2] = PhiG;
2607  return(v);
2608}
2609
2610///////////////////////////////////////////////////////////////////////////////
2611static
2612proc Teile(poly f, poly fk)
2613{
2614  ideal  Jfsyz = f, fk;
2615  poly   Relation;
2616  matrix Mat = matrix(syz(Jfsyz));
2617  Relation   = -1 * Mat[2,1]/Mat[1,1];
2618  return(Relation);
2619}
2620
2621///////////////////////////////////////////////////////////////////////////////
2622static
2623proc GetRf (poly fi, int n)
2624"USAGE:    GetRf();"
2625{
2626//---------------------------- initialisation ---------------------------------
2627  int    j, k, l1, l1w;
2628  matrix Koef;
2629  intvec RFlg;
2630
2631  RFlg[n] = 0;
2632  intvec Haeufigkeit = RFlg;
2633
2634  for( j=1; j<=n ; j=j+1) {
2635    Koef = coef(fi, x(j));
2636    Haeufigkeit[j] = ncols(Koef);
2637    if(Coeff(fi, x(j),0) == 0) { Haeufigkeit[j] = Haeufigkeit[j] + 1;}
2638  }
2639  for( j=n; j>0 ; j=j-1) {
2640    l1  = 0;
2641    l1w = 0;
2642    for(k=1;k<=n;k=k+1) { if(Haeufigkeit[k]>l1w) { l1=k; l1w=Haeufigkeit[k];}}
2643    RFlg[j]        = l1;
2644    Haeufigkeit[l1] = 0;
2645  }
2646  debug_log(2, "Reihenfolge fuer Vertauschungen:", RFlg);
2647  return(RFlg);
2648}
2649
2650///////////////////////////////////////////////////////////////////////////////
2651static
2652proc Show(poly g)
2653{
2654  string s;
2655  def ring_save=basering;
2656
2657  execute @ringdisplay;
2658  map showpoly=ring_save,maxideal(1);
2659  s = string(showpoly(g));
2660  setring ring_save;
2661  return (s);
2662}
2663
2664///////////////////////////////////////////////////////////////////////////////
2665static
2666proc checkring
2667{
2668  int CH = char(basering);
2669  if(CH >= 2 && CH<=13) {
2670    "Ring has characteristic ",CH;
2671    "Characteristic other than 0 or 0<char<13 is not yet implemented";
2672    return(1);
2673  }
2674  return(0);  // characteristic of ring is OK, return (0)
2675}
2676
2677///////////////////////////////////////////////////////////////////////////////
2678static
2679proc DecodeNormalFormString (string S_in)
2680"USAGE:    DecodeNormalFormString"
2681{
2682//---------------------------- initialisation ---------------------------------
2683  int    C_eq, a, b, i, t, k, r, s;
2684  string s1, s2, s3, s4, s_in, Typ;
2685  list v = "Error", 0, 0, 0;
2686
2687  C_eq = find(S_in, "=")+1;
2688  s_in = S_in[C_eq,30];
2689  debug_log(2, "Decode:");
2690
2691  debug_log(2, "S_in=", S_in,"  s_in=",s_in );
2692  a = find(s_in, "[")+1;
2693  b = find(s_in, "]")-1;
2694  t = 1;
2695  k = 0;
2696  r = 0;
2697  s = 0;
2698
2699  if(a<0 || b<0) { return(v); }
2700  Typ = s_in[1..a-1];
2701  s1  = s_in[a..b];
2702  debug_log(6, "Suche Type:", Typ);
2703  //---------------------- decode between brackets ----------------------------
2704  if( find(s1, ",") == 0) {
2705    debug_log(8, "  Number of columns: 0");
2706    s2 = "k = "+s1+";";
2707    execute s2;
2708    if( (Typ=="A[") || (Typ=="D[") ) { s3 = "k"; }
2709    if( Typ == "E[") { t = 6; }
2710    if( Typ == "W[") { t = 12; }
2711    if( Typ == "Q[") { t = 6; }
2712    if( Typ == "Z[") { t = 6; }
2713    if( Typ == "U[") { t = 12; }
2714    if( t > 1 ) {
2715      i = k;
2716      k = k/t;
2717      b = i - t*k;
2718      if( (s1 == "Q[") && (b==0) ) { k=k-1; b=6; }
2719      if(Typ == "Z[") {
2720        if(b==0) { k=k-1; b=6; }
2721        if(b==1) { k=k-1; b=7; }
2722      }
2723      if( b == 0 ) { s3 = string(t)+"k"; }
2724      else { s3 = string(t)+"k+"+string(b); }
2725    }
2726    if( Typ == "S[") {
2727      i = k+1;
2728      k = i/12;
2729      b = i - 12*k;
2730      if( b == 1 ) { s3 = "k"; }
2731      else {
2732        if(b==0) { s3 = "12k"+string(b-1); }
2733        else { s3 = "12k+"+string(b-1); }
2734      }
2735    }
2736    s2 = Typ + s3 +"]";
2737  }  // es kommt mindestens ein komma vor...
2738  //----------------------- more than 1 paramater -----------------------------
2739  else {
2740    b  = find(s1, ",");
2741    s2 = "k = ",s1[1..b-1],";";
2742    execute s2;
2743    s1 = s1[b+1..size(s1)];
2744    if(find(s1, ",") == 0) {
2745      debug_log(8, "  Number of columns 1");
2746      s2 = "r = "+s1+";";
2747      execute s2;
2748      s4 = "r";
2749      s3 = "k";
2750      if(r==0) { s4 = string(0); }
2751      if(k==0 && Typ=="Z[") { s3 = string(1); }
2752      if(Typ[2] == "#") {
2753        i = r+1;
2754        r = i/2;
2755        b = i - 2*r;
2756        if( b == 1 ) { s4 = "2r"; }
2757        else { s4 = "2r-1"; }
2758      }
2759      s2 = Typ + s3 + "," + s4 +"]";
2760    }  // es kommt mindestens zwei komma vor...
2761    //----------------------- get third parameter -----------------------------
2762    else {
2763      debug_log(8, "  Number of columns >=2");
2764      debug_log(2, "Y[k,r,s] / Z[k,r,s] / T[k,r,s]");
2765      b  = find(s1, ",");
2766      s2 = "r = ",s1[1..b-1],";";
2767      execute s2;
2768      s2 = "s = ",s1[b+1..size(s1)],";";
2769      execute s2;
2770      if(Typ=="Y[") { s2 = "Y[k,r,s]"; }
2771      if(Typ=="Z[") { s2 = "Z[k,r,s]"; }
2772      if(Typ=="T[") { s2 = "T[k,r,s]"; }
2773    }
2774  }
2775  debug_log(2, "Looking for Normalform of ",s2,"with (k,r,s) = (",
2776        k,",",r,",", s, ")" );
2777  v = s2, k, r, s;
2778  return(v);
2779}
2780
2781///////////////////////////////////////////////////////////////////////////////
2782proc A_L
2783"USAGE:    A_L(f);         f=poly
2784          A_L(\"name\");    type=string
2785COMPUTE:  the normal form in Arnold's list of the singularity given either
2786          by a polynomial f or by its name.
2787RETURN:   A_L(f): compute via 'milnorcode' the class of f and
2788          return the normal form of f found in the database.
2789          A_L(\"name\"): Get the normal form from the database for
2790          the singularity given by its name.
2791EXAMPLE:  example A_L; shows an example"
2792{
2793  // if trace/debug mode not set, do it!
2794  init_debug();
2795
2796  if( typeof(#[1]) == "string" ) {
2797    if(checkring()) { return(#[1]); }
2798    return(normalform(#[1]));
2799  }
2800  if( typeof(#[1]) == "poly" ) {
2801    if(checkring()) { return(#[1]); }
2802    return(quickclass(#[1]));
2803  }
2804
2805}
2806example
2807{ "EXAMPLE:"; echo=2;
2808  ring r=0,(a,b,c),ds;
2809  poly f=A_L("E[13]");
2810  f;
2811  A_L(f);
2812}
2813
2814///////////////////////////////////////////////////////////////////////////////
2815proc normalform(string s_in)
2816"USAGE:    normalform(s);  s=string
2817RETURN:   Arnold's normal form of singularity with name s
2818EXAMPLE:  example normalform; shows an example."
2819{
2820  string Typ;
2821  int    k, r, s, crk;
2822  poly   f;
2823  list   v;
2824
2825  if(checkring()) { return(s_in); }
2826  if(nvars(basering)<=1) {
2827    "We need at least 2 variables in basering, you have",nvars(basering),".";
2828    return();
2829  }
2830  // if trace/debug mode not set, do it!
2831  init_debug();
2832
2833  v = DecodeNormalFormString(s_in);
2834  Typ, k, r, s = v[1..4];
2835  if(Typ=="Error") { return(0); }
2836  v = singularity(Typ, k, r, s);
2837  f, crk = v[1..2];
2838  return(f);
2839}
2840example
2841{ "EXAMPLE:"; echo=2;
2842  ring r=0,(a,b,c),ds;
2843  normalform("E[13]");
2844}
2845
2846///////////////////////////////////////////////////////////////////////////////
2847proc swap
2848"USAGE:    swap(a,b);
2849RETURN:   b,a if b,a is the input (any type)"
2850{
2851  return(#[2],#[1]);
2852}
2853example
2854{ "EXAMPLE:"; echo=2;
2855  swap("variable1","variable2");
2856}
2857
2858///////////////////////////////////////////////////////////////////////////////
2859proc Setring(int c, string name)
2860"USAGE:    "
2861{
2862  string s="ring "+name+"=0,(x(1.."+ string(c) +")),(c,ds);";
2863  return(s);
2864}
2865
2866///////////////////////////////////////////////////////////////////////////////
2867proc internalfunctions
2868"USAGE:   internalfunctions();
2869RETURN:  nothing, display names of internal procedures of classify.lib
2870EXAMPLE: no example"
2871{ "   Internal functions for the classification using Arnold's method,";
2872 "   the function numbers correspond to numbers in Arnold's classifier:";
2873 "Klassifiziere(poly f);             determine the type of the singularity f
2874  Funktion1bis (poly f, list cstn)
2875  Funktion3 (poly f, list cstn)
2876  Funktion6 (poly f, list cstn)
2877  Funktion13 (poly f, list cstn)
2878  Funktion17 (poly f, list cstn)
2879  Funktion25 (poly f, list cstn)
2880  Funktion40 (poly f, list cstn, int k)
2881  Funktion47 (poly f, list cstn)
2882  Funktion50 (poly f, list cstn)
2883  Funktion58 (poly fin, list cstn)
2884  Funktion59 (poly f, list cstn)
2885  Funktion66 (poly f, list cstn)
2886  Funktion82 (poly f, list cstn)
2887  Funktion83 (poly f, list cstn)
2888  Funktion91 (poly f, list cstn, int k)
2889  Funktion92 (poly f, list cstn, int k)
2890  Funktion93 (poly f, list cstn, int k)
2891  Funktion94 (poly f, list cstn, int k)
2892  Funktion95 (poly f, list cstn, int k)
2893  Funktion96 (poly f, list cstn, int k)
2894  Funktion97 (poly f, list cstn)
2895  Isomorphie_s82_x (poly f, poly fk, int k)
2896  Isomorphie_s82_z (poly f, poly fk, int k)
2897  Isomorphie_s17 (poly f, poly fk, int k, int ct)
2898  printresult (string f, string typ, int Mu, int m, int corank, int K)
2899  ";
2900  "   Internal functions for the classifcation by invariants:
2901  Cubic (poly f)
2902  parity (int e)               return the parity of e
2903  HKclass (intvec i)
2904  HKclass3( intvec i, string SG_Typ, int cnt)
2905  HKclass3_teil_1 (intvec i, string SG_Typ, int cnt)
2906  HKclass5 (intvec i, string SG_Typ, int cnt)
2907  HKclass5_teil_1 (intvec i, string SG_Typ, int cnt)
2908  HKclass5_teil_2 (intvec i, string SG_Typ, int cnt)
2909  HKclass7 (intvec i, string SG_Typ, int cnt)
2910  HKclass7_teil_1 (intvec i, string SG_Typ, int cnt)
2911  ";
2912  "   Internal functions for the Morse-splitting lemma:
2913  Morse(poly fi, int K, int corank)          Splittinglemma itself
2914  Coeffs (list #)
2915  Coeff
2916  ";
2917  "   Internal functions providing tools:
2918  ReOrder(poly f)
2919  Singularitaet (string typ,int k,int r,int s,poly a,poly b,poly c,poly d)
2920  RandomPolyK
2921  Faktorisiere(poly f, poly g, int p, int k)     compute g = (ax+by^k)^p
2922  Teile(poly f, poly g);                  Teilt f durch g.
2923  GetRf(poly f, int n);
2924  Show(poly f);
2925  checkring();
2926  DecodeNormalFormString(string s);
2927  Setring(int n, string ringname);
2928  ";
2929}
2930///////////////////////////////////////////////////////////////////////////////
2931// E n d   O f   F i l e
2932
Note: See TracBrowser for help on using the repository browser.