[891438c] | 1 | LIB "tst.lib"; |
---|
| 2 | tst_init(); |
---|
| 3 | |
---|
| 4 | proc finitenessTest(ideal I) |
---|
| 5 | "USAGE: finitenessTest(ideal I) |
---|
| 6 | RETURN: 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. |
---|
| 9 | NOTE: 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 | |
---|
| 40 | proc noetherNormal(ideal id) |
---|
| 41 | "USAGE: noetherNormal(id); id ideal |
---|
| 42 | RETURN: 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 |
---|
[bf8015] | 54 | def s=changeord("lp"); |
---|
| 55 | setring s; |
---|
[891438c] | 56 | //----- make a random coordinate change ---------------- |
---|
| 57 | //creating lower triangular random generators for the |
---|
| 58 | //maximal ideal a procedure form random.lib |
---|
| 59 | ideal m= |
---|
| 60 | ideal(sparsetriag(n,n,0,100)*transpose(maxideal(1))); |
---|
| 61 | |
---|
| 62 | map phi=r,m; |
---|
| 63 | ideal i=std(phi(id)); |
---|
| 64 | //---------- check finiteness --------------------------- |
---|
| 65 | //from theoretical point of view Noether normalisation |
---|
| 66 | //should be o.k. but we need a test whether the |
---|
| 67 | //coordinate change was random enough |
---|
| 68 | list l=finitenessTest(i); |
---|
| 69 | |
---|
| 70 | setring r; |
---|
| 71 | list l=imap(s,l); |
---|
| 72 | |
---|
| 73 | if(l[1]==1) |
---|
| 74 | { |
---|
| 75 | //the good case, coordinate change was random enough |
---|
| 76 | return(list(fetch(s,m),l[2])); |
---|
| 77 | } |
---|
| 78 | kill s; |
---|
| 79 | //-------- the bad case, try again --------------------- |
---|
| 80 | return(noetherNormal(i)); |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | LIB"ring.lib"; |
---|
| 84 | LIB"random.lib"; |
---|
| 85 | ring R=0,(x,y,z),dp; |
---|
| 86 | ideal I = xy,xz; |
---|
| 87 | noetherNormal(I); |
---|
| 88 | |
---|
| 89 | tst_status(1);$ |
---|