source: git/Singular/LIB/ncdecomp.lib @ 4c20ee

spielwiese
Last change on this file since 4c20ee was 4c20ee, checked in by Hans Schoenemann <hannes@…>, 11 years ago
fix: new version numbers for libs
  • Property mode set to 100644
File size: 12.6 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2version="version ncdecomp.lib 4.0.0.0 Jun_2013 ";
3category="Noncommutative";
4info="
5LIBRARY:  ncdecomp.lib     Decomposition of a module into its central characters
6AUTHORS:  Viktor Levandovskyy,     levandov@mathematik.uni-kl.de.
7
8OVERVIEW:
9@* This library presents algorithms for the central character decomposition of a module,
10@* i.e. a decomposition into generalized weight modules with respect to the center.
11@* Based on ideas of O. Khomenko and V. Levandovskyy (see the article [L2] in the
12@* References for details).
13
14PROCEDURES:
15CentralQuot(M,G);       central quotient M:G,
16CentralSaturation(M,T); central saturation ((M:T):...):T) ( = M:T^infinity),
17CenCharDec(I,C);        decomposition of I into central characters w.r.t. C
18IntersectWithSub(M,Z);  intersection of M with the subalgebra, generated by pairwise commutative elements of Z.
19";
20
21  LIB "ncalg.lib";
22  LIB "primdec.lib";
23  LIB "central.lib";
24
25///////////////////////////////////////////////////////////////////////////////
26
27proc testncdecomplib()
28{
29  example CentralQuot;
30  example CentralSaturation;
31  example CenCharDec;
32  example IntersectWithSub;
33}
34
35static proc CharKernel(list L, int i)
36{
37 // todo: think on more effective way of doing it...
38// compute \cup L[j], j!=i
39  int sL = size(L);
40  if ( (i<=0) || (i>sL))  { return(0); }
41  int j;
42  list Li;
43  if (i ==1 )
44  {
45    Li = L[2..sL];
46  }
47  if (i ==sL )
48  {
49    Li = L[1..sL-1];
50  }
51  if ( (i>1) && (i < sL))
52  {
53    Li = L[1..i-1];
54    for (j=i+1; j<=sL; j++)
55    {
56      Li[j-1] = L[j];
57    }
58  }
59//  print("intersecting kernels...");
60  module Cres = intersect(Li[1..size(Li)]); // uses std, try modulo!
61  return(Cres);
62}
63///////////////////////////////////////////////////////////////////////////////
64static proc CentralQuotPoly(module M, poly g)
65{
66// here an elimination of components should be used !
67  int N=nrows(M); // M = A^N /I_M
68  module @M;
69  int i,j;
70  for(i=1; i<=N; i++)
71  {
72   @M=@M,g*gen(i);
73  }
74  @M = simplify(@M,2);
75  @M = @M,M;
76  module S = syz(@M);
77  matrix s = S;
78  module T;
79  vector t;
80  for(i=1; i<=ncols(s); i++)
81  {
82    t = 0*gen(N);
83    for(j=1; j<=N; j++)
84    {
85      t = t + s[j,i]*gen(j);
86    }
87    T[i] = t;
88  }
89  T = simplify(T,2);
90  return(T);
91}
92///////////////////////////////////////////////////////////////////////////////
93static proc MyIsEqual(module A, module B)
94{
95// both A and B are submodules of free module
96  option(redSB);
97  option(redTail);
98  if (attrib(A,"isSB")!=1)
99  {
100    A = slimgb(A);
101  }
102  if (attrib(B,"isSB")!=1)
103  {
104    B = slimgb(B);
105  }
106  int ANSWER = 1;
107  if ( ( ncols(A) == ncols(B) ) && ( nrows(A) == nrows(B) ) )
108  {
109    module @AB = module(matrix(A)-matrix(B));
110    @AB = simplify(@AB,2);
111    if (@AB[1]!=0) { ANSWER = 0; }
112  }
113  else { ANSWER = 0; }
114  return(ANSWER);
115}
116///////////////////////////////////////////////////////////////////////////////
117proc CentralQuot(module I, ideal G)
118"USAGE:  CentralQuot(M, G), M a module, G an ideal
119ASSUME: G is an ideal in the center of the base ring
120RETURN:  module
121PURPOSE: compute the central quotient M:G
122THEORY:  for an ideal G of the center of an algebra and a submodule M of A^n,
123@* the central quotient of M by G is defined to be
124@* M:G  :=  { v in A^n | z*v in M, for all z in G }.
125NOTE:    the output module is not necessarily given in a Groebner basis
126SEE ALSO: CentralSaturation, CenCharDec
127EXAMPLE: example CentralQuot; shows examples
128"{
129/* check assupmtion. Elt's of G must be central */
130  if (! inCenter(G) )
131  {
132    ERROR("ideal in the 2nd argument is not in the center of the base ring!");
133  }
134  int i;
135  list @L;
136  for(i=1; i<=size(G); i++)
137  {
138    @L[i] = CentralQuotPoly(I,G[i]);
139  }
140  module @I = intersect(@L[1..size(G)]);
141  if (nrows(@I)==1)
142  {
143    @I = ideal(@I);
144  }
145  return(@I);
146}
147example
148{ "EXAMPLE:"; echo = 2;
149   option(returnSB);
150   def a = makeUsl2();
151   setring a;
152   ideal I = e3,f3,h3-4*h;
153   I = std(I);
154   poly C=4*e*f+h^2-2*h;  // C in Z(U(sl2)), the central element
155   ideal G = (C-8)*(C-24);  // G normal factor in Z(U(sl2)) as an ideal in the center
156   ideal R = CentralQuot(I,G);  // same as I:G
157   R;
158}
159///////////////////////////////////////////////////////////////////////////////
160proc CentralSaturation(module M, ideal T)
161"USAGE:  CentralSaturation(M, T), for a module M and an ideal T
162ASSUME: T is an ideal in the center of the base ring
163RETURN:  module
164PURPOSE: compute the central saturation of M by T, that is M:T^{\infty}, by repititive application of @code{CentralQuot}
165NOTE:    the output module is not necessarily a Groebner basis
166SEE ALSO: CentralQuot, CenCharDec
167EXAMPLE: example CentralSaturation; shows examples
168"{
169/* check assupmtion. Elt's of T must be central */
170  if (! inCenter(T) )
171  {
172    ERROR("ideal in the 2nd argument is not in the center of the base ring!");
173  }
174  option(redSB);
175  option(redTail);
176  option(returnSB);
177  module Q=0;
178  module S=M;
179  while ( !MyIsEqual(Q,S) )
180  {
181    Q = CentralQuot(S, T);
182    S = CentralQuot(Q, T);
183  }
184  if (nrows(Q)==1)
185  {
186    Q = ideal(Q);
187  }
188//  Q = std(Q);
189  return(Q);
190}
191example
192{ "EXAMPLE:"; echo = 2;
193   option(returnSB);
194   def a = makeUsl2();
195   setring a;
196   ideal I = e3,f3,h3-4*h;
197   I = std(I);
198   poly C=4*e*f+h^2-2*h;
199   ideal G = C*(C-8);
200   ideal R = CentralSaturation(I,G);
201   R=std(R);
202   vdim(R);
203   R;
204}
205///////////////////////////////////////////////////////////////////////////////
206proc CenCharDec(module I, def #)
207"USAGE:  CenCharDec(I, C);  I a module, C an ideal
208ASSUME: C consists of generators of the center of the base ring
209RETURN:  a list L, where each entry consists of three records (if a finite decomposition exists)
210@*       L[*][1] ('ideal' type), the central character as a maximal ideal in the center,
211@*       L[*][2] ('module' type), the Groebner basis of the weight module, corresponding to the character in  L[*][1],
212@*       L[*][3] ('int' type) is the vector space dimension of the weight module (-1 in case of infinite dimension);
213PURPOSE: compute a finite decomposition of C into central characters or determine that there is no finite decomposition
214NOTE:     actual decomposition is the sum of L[i][2] above;
215@*        some modules have no finite decomposition (in such case one gets warning message)
216@*        The function @code{central} in @code{central.lib} may be used to obtain C, when needed.
217SEE ALSO: CentralQuot, CentralSaturation
218EXAMPLE: example CenCharDec; shows examples
219"
220{
221  list Center;
222  if (typeof(#) == "ideal")
223  {
224    int cc;
225    ideal tmp = ideal(#);
226    for (cc=1; cc<=size(tmp); cc++)
227    {
228      Center[cc] = tmp[cc];
229    }
230    kill tmp;
231  }
232  if (typeof(#) == "list")
233  {
234    Center = #;
235  }
236
237/* check assupmtion. Elt's of G must be central */
238  if (! inCenter(Center) )
239  {
240    ERROR("ideal in the 2nd argument is not in the center of the base ring!");
241  }
242  int ppl = printlevel-voice+2;
243// M = A/I
244//1. Find the Zariski closure of Supp_Z M
245// J = Ann_M 1 == I
246// J \cap Z:
247  option(redSB);
248  option(redTail);
249  option(returnSB);
250  def @A = basering;
251  setring @A;
252  int sZ=size(Center);
253  int i,j;
254  poly t=1;
255  for(i=1; i<=nvars(@A); i++)
256  {
257    t=t*var(i);
258  }
259  ring @Z=0,(@z(1..sZ)),dp;
260//  @Z;
261  def @ZplusA = @A+@Z;
262  setring @ZplusA;
263//  @ZplusA;
264  ideal I     = imap(@A,I);
265  list Center = imap(@A,Center);
266  poly t      = imap(@A,t);
267  ideal @Ker;
268  for(i=1; i<=sZ; i++)
269  {
270    @Ker[i]=@z(i) - Center[i];
271  }
272  @Ker = @Ker,I;
273  //  ideal @JcapZ = eliminate(@Ker,t);
274  dbprint(ppl,"// -1-1- starting the computation of preimage in Z");
275  dbprint(ppl-1, @Ker);
276  ideal @JcapZ = slimgb(@Ker);
277  @JcapZ = nselect(@JcapZ,intvec(1..nvars(@A)));
278  dbprint(ppl,"// -1-2- finished the computation of preimage in Z");
279  dbprint(ppl-1, @JcapZ);
280// do not forget parameters of a basering!
281// hmmm: todo ringlist
282  string strZ="ring @@Z=("+charstr(@A)+"),(@z(1.."+string(sZ)+")),dp;";
283//  print(strZ);
284  execute(strZ);
285  setring @@Z;
286  ideal @JcapZ = imap(@ZplusA,@JcapZ);
287  dbprint(ppl,"// -1-3- starting the cosmetic Groebner basis in Z");
288  @JcapZ = slimgb(@JcapZ); // evtl. groebner?
289//  @JcapZ;
290  dbprint(ppl,"// -1-4- finished the cosmetic Groebner basis in Z");
291  dbprint(ppl-1, @JcapZ);
292  int sJ = vdim(@JcapZ);
293  dbprint(ppl,"// -1-5- the K-dimension of support is "+string(sJ));
294  if (sJ==-1)
295  {
296    "There is no finite decomposition";
297    return(0);
298  }
299//  print(@JcapZ);
300// 2. compute the min.ass.primes of the ideal in the center
301  dbprint(ppl,"// -2-1- starting the computation of minimal primes in Z");
302  list @L = minAssGTZ(@JcapZ);
303  int sL = size(@L);
304  dbprint(ppl,"// -2-2- finished the computation of " + string(sL)+ " minimal primes in Z");
305//  print("etL:");
306//  @L;
307// exception: is sL==1, the whole ideal has unique cen.char
308  if (sL ==1)
309  {
310    dbprint(ppl-1,"// -2-3- the whole module is gen. weight module itself");
311    setring @A;
312    map @M = @@Z,Center[1..size(Center)];
313    list L = @M(@L);
314    list @R;
315    @R[1] = L[1];
316    if (nrows(@R[1])==1)
317    {
318      @R[1] = ideal(@R[1]);
319    }
320    @R[2] = I;
321    if (nrows(@R[2])==1)
322    {
323      @R[2] = ideal(@R[2]);
324    }
325    dbprint(ppl-1,"// -2-4- final cosmetic Groebner basis");
326    @R[2] = slimgb(@R[2]);
327    @R[3] = vdim(@R[2]);
328    return(list(@R)); // for compliance with output a list
329  }
330  dbprint(ppl-1,"// -2-3- there are several characters");
331  dbprint(ppl,"// -*- computing Groebner bases of components (commutative)");
332  list @CharKer;
333  for(i=1; i<=sL; i++)
334  {
335    @L[i] = slimgb(@L[i]);
336  }
337  dbprint(ppl,"// -*- finished computing Groebner bases of components");
338// 3. compute the intersections of characters
339  dbprint(ppl,"// -3- compute the intersections of characters");
340  for(i=1; i<=sL; i++)
341  {
342    @CharKer[i] = CharKernel(@L,i);
343  }
344  dbprint(ppl,"// -3- the intersections of characters is done");
345  //  dbprint(ppl-1,@CharKer);
346// 4. Go back to the algebra and compute central saturations
347  setring @A;
348  map @M = @@Z,Center[1..size(Center)];
349  list L = @M(@CharKer);
350  list R,@R;
351  dbprint(ppl,"// -4- compute the central saturations");
352  dbprint(ppl-1,L);
353  for(i=1; i<=sL; i++)
354  {
355    @R[1] = L[i];
356    if (nrows(@R[1])==1)
357    {
358      @R[1] = ideal(@R[1]);
359    }
360    @R[2] = CentralSaturation(I,L[i]);
361    if (nrows(@R[2])==1)
362    {
363      @R[2] = ideal(@R[2]);
364    }
365    @R[2] = slimgb(@R[2]);
366    @R[3] = vdim(@R[2]);
367     R[i] = @R;
368  }
369  dbprint(ppl,"// -4- central saturations are done");
370  return(R);
371}
372example
373{ "EXAMPLE:"; echo = 2; printlevel=0;
374   option(returnSB);
375   def a = makeUsl2(); // U(sl_2) in characteristic 0
376   setring a;
377   ideal I = e3,f3,h3-4*h;
378   I = twostd(I);           // two-sided ideal generated by I
379   vdim(I);                 // it is finite-dimensional
380   ideal Cn = 4*e*f+h^2-2*h; // the only central element
381   list T = CenCharDec(I,Cn);
382   T;
383   // consider another example
384   ideal J = e*f*h;
385   CenCharDec(J,Cn);
386}
387///////////////////////////////////////////////////////////////////////////////
388proc IntersectWithSub (ideal M, def #)
389"USAGE:  IntersectWithSub(M,Z),  M an ideal, Z an ideal
390ASSUME: Z consists of pairwise commutative elements
391RETURN:  ideal of two-sided generators, not a Groebner basis
392PURPOSE: computes the intersection of M with the subalgebra, generated by Z
393NOTE:    usually Z consists of generators of the center
394@* The function @code{central} from @code{central.lib} may be used to obtain the center Z, if needed.
395EXAMPLE: example IntersectWithSub; shows an example
396"
397{
398  ideal Z;
399  if (typeof(#) == "list")
400  {
401    int cc;
402    list tmp = #;
403    for (cc=1; cc<=size(tmp); cc++)
404    {
405      Z[cc] = tmp[cc];
406    }
407    kill tmp;
408  }
409  if (typeof(#) == "ideal")
410  {
411    Z = #;
412  }
413  // returns a submodule of M, equal to M \cap Z
414  // assume/correctness: Z should consists of pairwise
415  // commutative elements
416  int nz = size(Z);
417  int i,j;
418  poly p;
419  for (i=1; i<nz; i++)
420  {
421    for (j=i+1; j<=nz; j++)
422    {
423      p = bracket(Z[i],Z[j]);
424      if (p!=0)
425      {
426        ERROR("generators of the subalgebra do not commute.");
427        //        return(ideal(0));
428      }
429    }
430  }
431  // main action
432  def B = basering;
433  setring B;
434  string s1,s2;
435  // todo: make ringlist from it!
436  s1 = "ring @Z = (";
437  s2 = s1 + charstr(basering) + "),(z(1.." + string(nz)+")),Dp";
438  //  s2;
439  execute(s2);
440  setring B;
441  map F = @Z,Z;
442  setring @Z;
443  ideal PreM = preimage(B,F,M); // reformulate using gb engine? todo?
444  PreM = slimgb(PreM);
445  setring B;
446  ideal T = F(PreM);
447  return(T);
448}
449example
450{
451  "EXAMPLE:"; echo = 2;
452  ring R=(0,a),(e,f,h),Dp;
453  matrix @d[3][3];
454  @d[1,2]=-h;   @d[1,3]=2e;   @d[2,3]=-2f;
455  def r = nc_algebra(1,@d); setring r; // parametric U(sl_2)
456  ideal I = e,h-a;
457  ideal C;
458  C[1] = h^2-2*h+4*e*f; // the center of U(sl_2)
459  ideal X = IntersectWithSub(I,C);
460  X;
461  ideal G = e*f, h; // the biggest comm. subalgebra of U(sl_2)
462  ideal Y = IntersectWithSub(I,G);
463  Y;
464}
Note: See TracBrowser for help on using the repository browser.