source: git/Tst/Buch/Proc_3_7_1.tst @ 2567b5

fieker-DuValspielwiese
Last change on this file since 2567b5 was 891438c, checked in by Gerhard Pfister <pfister@…>, 23 years ago
*GP: initial release git-svn-id: file:///usr/local/Singular/svn/trunk@5579 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.5 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4proc finitenessTest(ideal I)
5"USAGE: finitenessTest(ideal I)
6RETURN: A list l, l[1] is 1 or 0 and l[2] is an ideal gener-   
7        ated by a subset of the variables. l[1]=1 if the map
8        basering/I <-- K[l[2]] is finite and 0 else.
9NOTE:   It is assumed that I is a reduced standard basis
10        with respect to the lexicographical ordering lp,
11        sorted w.r.t. increasing leading terms.
12"
13{
14  intvec w=leadexp(I[1]);
15  int j,t;
16  int s=1;
17  ideal k; 
18  //----------- check leading exponents ----------------------
19  //compute s such that lead(I[1]) depends only on
20  //var(s),...,var(n) by inspection of the leading exponents 
21  while (w[s]==0) {s++;}
22  for (j=1; j<= size(I); j++)
23  {
24    w=leadexp(I[j]);
25    if (size(ideal(w))==1) {t++;}
26  }
27  //----------------check finiteness -------------------------
28  //t is the number of elements of the standard basis which
29  //have pure powers in the variables var(1),...,var(s) as
30  //leading term. The map is finite iff s=t.
31  if(s!=t) {return(list(0,k));}
32  for (j=s+1; j<= nvars(basering);j++)
33  {
34    k[j]=var(j);
35  }
36  return (list(1,k));
37}
38
39
40proc noetherNormal(ideal id)
41"USAGE:  noetherNormal(id);  id ideal
42RETURN:  two ideals i1,i2, where i2 is given by a subset of
43         the variables and i1 defines a map:
44         map phi=basering,i1 such that
45         k[i2] --> k[var(1),...,var(n)]/phi(id)
46         is a Noether normalisation
47"
48{
49   def r=basering;
50   int n=nvars(r);
51//----- change to lexicographical ordering ------------
52   //a procedure from ring.lib changing the order to lp
53   //creating a new basering s
54   changeord("s","lp");
55//----- make a random coordinate change ----------------
56   //creating lower triangular random generators for the
57   //maximal ideal a procedure form random.lib
58   ideal m=
59   ideal(sparsetriag(n,n,0,100)*transpose(maxideal(1)));
60
61   map phi=r,m;
62   ideal i=std(phi(id));
63//---------- check finiteness ---------------------------
64   //from theoretical point of view Noether normalisation
65   //should be o.k. but we need a test whether the
66   //coordinate change was random enough
67   list l=finitenessTest(i);
68
69   setring r;
70   list l=imap(s,l);
71
72   if(l[1]==1)
73   {
74      //the good case, coordinate change was random enough
75      return(list(fetch(s,m),l[2]));
76   }
77   kill s;
78   //-------- the bad case, try again ---------------------
79   return(noetherNormal(i));
80}
81
82LIB"ring.lib";
83LIB"random.lib";
84ring R=0,(x,y,z),dp;
85ideal I = xy,xz;
86noetherNormal(I);
87
88tst_status(1);$
Note: See TracBrowser for help on using the repository browser.