code:
@c ---content LibInfo---
@comment This file was generated by doc2tex.pl from d2t_singular/homolog_lib.doc
@comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/homolog_lib.doc INSTEAD
@c library version: (1.15.2.2,2002/10/07)
@c library file: ../Singular/LIB/homolog.lib
@cindex homolog.lib
@cindex homolog_lib
@table @asis
@item @strong{Library:}
homolog.lib
@item @strong{Purpose:}
   Procedures for Homological Algebra
@item @strong{Authors:}
Gert-Martin Greuel, greuel@@mathematik.uni-kl.de,
@* Bernd Martin, martin@@math.tu-cottbus.de
@* Christoph Lossen, lossen@@mathematik.uni-kl.de

@end table

@strong{Procedures:}
@menu
* cup:: cup: Ext^1(M',M') x Ext^1() --> Ext^2()
* cupproduct:: cup: Ext^p(M',N') x Ext^q(N',P') --> Ext^p+q(M',P')
* depth:: depth(I,M'), I ideal, M module, M'=coker(M)
* Ext_R:: Ext^k(M',R), M module, R basering, M'=coker(M)
* Ext:: Ext^k(M',N'), M,N modules, M'=coker(M), N'=coker(N)
* fitting:: n-th Fitting ideal of M'=coker(M), M module, n int
* flatteningStrat:: Flattening stratification of M'=coker(M), M module
* Hom:: Hom(M',N'), M,N modules, M'=coker(M), N'=coker(N)
* homology:: ker(B)/im(A), homology of complex R^k--A->M'--B->N'
* isCM:: test if coker(M) is Cohen-Macaulay, M module
* isFlat:: test if coker(M) is flat, M module
* isLocallyFree:: test if coker(M) is locally free of constant rank r
* isReg:: test if I is coker(M)-sequence, I ideal, M module
* kernel:: ker(M'--A->N') M,N modules, A matrix
* kohom:: Hom(R^k,A), A matrix over basering R
* kontrahom:: Hom(A,R^k), A matrix over basering R
* KoszulHomology:: n-th Koszul homology H_n(I,coker(M)), I=ideal
* tensorMod:: Tensor product of modules M'=coker(M), N'=coker(N)
* Tor:: Tor_k(M',N'), M,N modules, M'=coker(M), N'=coker(N)
@end menu
@c ---end content LibInfo---

@c ------------------- cup -------------
@node cup, cupproduct,, homolog_lib
@subsubsection cup
@cindex cup
@c ---content cup---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
cup(M,[,any,any]); M=module

@item @strong{Compute:}
cup-product Ext^1(M',M') x Ext^1(M',M') ---> Ext^2(M',M'), where
M':=R^m/M, if M in R^m, R basering (i.e. M':=coker(matrix(M))).
@* If called with >= 2 arguments: compute symmetrized cup-product

@item @strong{Assume:}
all Ext's are finite dimensional

@item @strong{Return:}
- if called with 1 argument: matrix, the columns of the output present
the coordinates of b_i&b_j with respect to a kbase of Ext^2, where
b_1,b_2,... is a kbase of Ext^1 and & denotes cup product;@*
- if called with 2 arguments: matrix, the columns of the output
present the coordinates of (1/2)(b_i&b_j + b_j&b_i) with respect to
a kbase of Ext^2;
@*- if called with 3 arguments: list,
@format
      L[1] = matrix see above (symmetric case, for >=2 arguments)
      L[2] = matrix of kbase of Ext^1
      L[3] = matrix of kbase of Ext^2
@end format

@item @strong{Note:}
printlevel >=1; shows what is going on.
@*printlevel >=2; shows result in another representation.
@* For computing cupproduct of M itself, apply proc to syz(M)!

@end table
@strong{Example:}
@smallexample
@c computed example cup d2t_singular/homolog_lib.doc:83
LIB "homolog.lib";
int p      = printlevel;
ring  rr   = 32003,(x,y,z),(dp,C);
ideal  I   = x4+y3+z2;
qring  o   = std(I);
module M   = [x,y,0,z],[y2,-x3,z,0],[z,0,-y,-x3],[0,z,x,-y2];
print(cup(M));
@expansion{} 0,1,0, 0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,
@expansion{} 0,0,-1,0, 0,1,0,0,0,0,0, 0,0,0,0,0,0,
@expansion{} 0,0,0, -1,0,0,0,0,0,1,0, 0,0,0,0,0,0,
@expansion{} 0,0,0, 0, 1,0,0,1,0,0,-1,0,0,1,0,0,0
print(cup(M,1));
@expansion{} 0,1,0,0,0,0,0,0,0,0,0,
@expansion{} 0,0,0,0,0,0,0,0,0,0,0,
@expansion{} 0,0,0,0,0,0,0,0,0,0,0,
@expansion{} 0,0,0,0,1,0,0,0,0,0,0
// 2nd EXAMPLE  (shows what is going on)
printlevel = 3;
ring   r   = 0,(x,y),(dp,C);
ideal  i   = x2-y3;
qring  q   = std(i);
module M   = [-x,y],[-y2,x];
print(cup(M));
@expansion{} // vdim (Ext^1) = 2
@expansion{} // kbase of Ext^1(M,M)
@expansion{} //  - the columns present the kbase elements in Hom(F(1),F(0))
@expansion{} //  - F(*) a free resolution of M
@expansion{} -1,0,
@expansion{} 0, y,
@expansion{} 0, 1,
@expansion{} -1,0
@expansion{} // lift kbase of Ext^1:
@expansion{} //  - the columns present liftings of kbase elements into Hom(F(2),F(1))
@expansion{} //  - F(*) a free resolution of M
@expansion{} 1,0,
@expansion{} 0,y,
@expansion{} 0,1,
@expansion{} 1,0
@expansion{} // vdim (Ext^2) = 2
@expansion{} // kbase of Ext^2(M,M)
@expansion{} //  - the columns present the kbase elements in Hom(F(2),F(0))
@expansion{} //  - F(*) is a a free resolution of M
@expansion{} -1,0,
@expansion{} 0, y,
@expansion{} 0, 1,
@expansion{} -1,0
@expansion{} // matrix of cup-products (in Ext^2)
@expansion{} 0,-1,0, 0,y,
@expansion{} 0,0, -y,y,0,
@expansion{} 0,0, -1,1,0,
@expansion{} 0,-1,0, 0,y
@expansion{} ////// end level 2 //////
@expansion{} // the associated matrices of the bilinear mapping 'cup'
@expansion{} // corresponding to the kbase elements of Ext^2(M,M) are shown,
@expansion{} //  i.e. the rows of the final matrix are written as matrix of
@expansion{} //  a bilinear form on Ext^1 x Ext^1
@expansion{} //-----component 1:
@expansion{} 0,1,
@expansion{} 0,0
@expansion{} //-----component 2:
@expansion{} 0, 0,
@expansion{} -1,1
@expansion{} ////// end level 3 //////
@expansion{} 0,1,0, 0,0,
@expansion{} 0,0,-1,1,0
printlevel = p;
@c end example cup d2t_singular/homolog_lib.doc:83
@end smallexample
@c ---end content cup---

@c ------------------- cupproduct -------------
@node cupproduct, depth, cup, homolog_lib
@subsubsection cupproduct
@cindex cupproduct
@c ---content cupproduct---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
cupproduct(M,N,P,p,q[,any]); M,N,P modules, p,q integers

@item @strong{Compute:}
cup-product Ext^p(M',N') x Ext^q(N',P') ---> Ext^p+q(M',P'),
where M':=R^m/M, if M in R^m, R basering (i.e. M':=coker(matrix(M)))

@item @strong{Assume:}
all Ext's are of finite dimension

@item @strong{Return:}
- if called with 5 arguments: matrix of the associated linear map
Ext^p (tensor) Ext^q --> Ext^p+q, i.e. the columns of <matrix>
present the coordinates of the cup products (b_i & c_j) with respect
to a kbase of Ext^p+q (b_i resp. c_j are the choosen bases of Ext^p,
resp. Ext^q).@*
- if called with 6 arguments: list L,
@format
      L[1] = matrix (see above)
      L[2] = matrix of kbase of Ext^p(M',N')
      L[3] = matrix of kbase of Ext^q(N',P')
      L[4] = matrix of kbase of Ext^p+q(N',P')
@end format

@item @strong{Note:}
printlevel >=1; shows what is going on.
@*printlevel >=2; shows the result in another representation.@*
For computing the cupproduct of M,N itself, apply proc to syz(M),
syz(N)!

@end table
@strong{Example:}
@smallexample
@c computed example cupproduct d2t_singular/homolog_lib.doc:145
LIB "homolog.lib";
int p      = printlevel;
ring  rr   = 32003,(x,y,z),(dp,C);
ideal  I   = x4+y3+z2;
qring  o   = std(I);
module M   = [x,y,0,z],[y2,-x3,z,0],[z,0,-y,-x3],[0,z,x,-y2];
print(cupproduct(M,M,M,1,3));
@expansion{} 0,1,0, 0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,
@expansion{} 0,0,-1,0, 0,1,0,0,0,0,0, 0,0,0,0,0,0,
@expansion{} 0,0,0, -1,0,0,0,0,0,1,0, 0,0,0,0,0,0,
@expansion{} 0,0,0, 0, 1,0,0,1,0,0,-1,0,0,1,0,0,0
printlevel = 3;
list l     = (cupproduct(M,M,M,1,3,"any"));
@expansion{} // vdim Ext(M,N) = 4
@expansion{} // kbase of Ext^p(M,N)
@expansion{} //  - the columns present the kbase elements in Hom(F(p),G(0))
@expansion{} //  - F(*),G(*) are free resolutions of M and N
@expansion{} 0, 0, 1, 0,
@expansion{} 0, y, 0, 0,
@expansion{} 1, 0, 0, 0,
@expansion{} 0, 0, 0, y,
@expansion{} 0, -1,0, 0,
@expansion{} 0, 0, x2,0,
@expansion{} 0, 0, 0, -x2,
@expansion{} 1, 0, 0, 0,
@expansion{} 0, 0, 0, -1,
@expansion{} -1,0, 0, 0,
@expansion{} 0, 1, 0, 0,
@expansion{} 0, 0, 1, 0,
@expansion{} -1,0, 0, 0,
@expansion{} 0, 0, 0, x2y,
@expansion{} 0, 0, x2,0,
@expansion{} 0, -y,0, 0
@expansion{} // vdim Ext(N,P) = 4
@expansion{} // kbase of Ext(N,P):
@expansion{} 0, 0, 1,  0,
@expansion{} 0, 0, 0,  y,
@expansion{} 1, 0, 0,  0,
@expansion{} 0, -y,0,  0,
@expansion{} 0, -1,0,  0,
@expansion{} 1, 0, 0,  0,
@expansion{} 0, 0, 0,  -x2,
@expansion{} 0, 0, -x2,0,
@expansion{} 0, 0, 0,  -1,
@expansion{} 0, 0, 1,  0,
@expansion{} 0, 1, 0,  0,
@expansion{} 1, 0, 0,  0,
@expansion{} -1,0, 0,  0,
@expansion{} 0, -y,0,  0,
@expansion{} 0, 0, x2, 0,
@expansion{} 0, 0, 0,  -x2y
@expansion{} // kbase of Ext^q(N,P)
@expansion{} //  - the columns present the kbase elements in Hom(G(q),H(0))
@expansion{} //  - G(*),H(*) are free resolutions of N and P
@expansion{} 0, 0, 1,  0,
@expansion{} 0, 0, 0,  y,
@expansion{} 1, 0, 0,  0,
@expansion{} 0, -y,0,  0,
@expansion{} 0, -1,0,  0,
@expansion{} 1, 0, 0,  0,
@expansion{} 0, 0, 0,  -x2,
@expansion{} 0, 0, -x2,0,
@expansion{} 0, 0, 0,  -1,
@expansion{} 0, 0, 1,  0,
@expansion{} 0, 1, 0,  0,
@expansion{} 1, 0, 0,  0,
@expansion{} -1,0, 0,  0,
@expansion{} 0, -y,0,  0,
@expansion{} 0, 0, x2, 0,
@expansion{} 0, 0, 0,  -x2y
@expansion{} // vdim Ext(M,P) = 4
@expansion{} // kbase of Ext^p+q(M,P)
@expansion{} //  - the columns present the kbase elements in Hom(F(p+q),H(0))
@expansion{} //  - F(*),H(*) are free resolutions of M and P
@expansion{} 0, 0, 1,  0,
@expansion{} 0, 0, 0,  y,
@expansion{} 1, 0, 0,  0,
@expansion{} 0, -y,0,  0,
@expansion{} 0, -1,0,  0,
@expansion{} 1, 0, 0,  0,
@expansion{} 0, 0, 0,  -x2,
@expansion{} 0, 0, -x2,0,
@expansion{} 0, 0, 0,  -1,
@expansion{} 0, 0, 1,  0,
@expansion{} 0, 1, 0,  0,
@expansion{} 1, 0, 0,  0,
@expansion{} -1,0, 0,  0,
@expansion{} 0, -y,0,  0,
@expansion{} 0, 0, x2, 0,
@expansion{} 0, 0, 0,  -x2y
@expansion{} // lifting of kbase of Ext^p(M,N)
@expansion{} //  - the columns present liftings of kbase elements in Hom(F(p+q),G(q))
@expansion{} 1,0, 0, 0,
@expansion{} 0,-y,0, 0,
@expansion{} 0,0, x2,0,
@expansion{} 0,0, 0, x2y,
@expansion{} 0,1, 0, 0,
@expansion{} 1,0, 0, 0,
@expansion{} 0,0, 0, -x2,
@expansion{} 0,0, x2,0,
@expansion{} 0,0, -1,0,
@expansion{} 0,0, 0, y,
@expansion{} 1,0, 0, 0,
@expansion{} 0,y, 0, 0,
@expansion{} 0,0, 0, -1,
@expansion{} 0,0, -1,0,
@expansion{} 0,-1,0, 0,
@expansion{} 1,0, 0, 0
@expansion{} // matrix of cup-products (in Ext^p+q)
@expansion{} 0,0, 0, -1, 0,   0, 0, 0,   y,   1,  0,  0,  0,  0,   y,   0,  0,
@expansion{} 0,0, 0, 0,  y,   0, 0, y,   0,   0,  -y, 0,  0,  y,   0,   0,  0,
@expansion{} 0,1, 0, 0,  0,   0, y, 0,   0,   0,  0,  x2, 0,  0,   0,   0,  -x2y,
@expansion{} 0,0, y, 0,  0,   -y,0, 0,   0,   0,  0,  0,  x2y,0,   0,   x2y,0,
@expansion{} 0,0, 1, 0,  0,   -1,0, 0,   0,   0,  0,  0,  x2, 0,   0,   x2, 0,
@expansion{} 0,1, 0, 0,  0,   0, y, 0,   0,   0,  0,  x2, 0,  0,   0,   0,  -x2y,
@expansion{} 0,0, 0, 0,  -x2, 0, 0, -x2, 0,   0,  x2, 0,  0,  -x2, 0,   0,  0,
@expansion{} 0,0, 0, x2, 0,   0, 0, 0,   -x2y,-x2,0,  0,  0,  0,   -x2y,0,  0,
@expansion{} 0,0, 0, 0,  -1,  0, 0, -1,  0,   0,  1,  0,  0,  -1,  0,   0,  0,
@expansion{} 0,0, 0, -1, 0,   0, 0, 0,   y,   1,  0,  0,  0,  0,   y,   0,  0,
@expansion{} 0,0, -1,0,  0,   1, 0, 0,   0,   0,  0,  0,  -x2,0,   0,   -x2,0,
@expansion{} 0,1, 0, 0,  0,   0, y, 0,   0,   0,  0,  x2, 0,  0,   0,   0,  -x2y,
@expansion{} 0,-1,0, 0,  0,   0, -y,0,   0,   0,  0,  -x2,0,  0,   0,   0,  x2y,
@expansion{} 0,0, y, 0,  0,   -y,0, 0,   0,   0,  0,  0,  x2y,0,   0,   x2y,0,
@expansion{} 0,0, 0, -x2,0,   0, 0, 0,   x2y, x2, 0,  0,  0,  0,   x2y, 0,  0,
@expansion{} 0,0, 0, 0,  -x2y,0, 0, -x2y,0,   0,  x2y,0,  0,  -x2y,0,   0,  0
@expansion{} ////// end level 2 //////
@expansion{} // the associated matrices of the bilinear mapping 'cup'
@expansion{} // corresponding to the kbase elements of Ext^p+q(M,P) are shown,
@expansion{} //  i.e. the rows of the final matrix are written as matrix of
@expansion{} //  a bilinear form on Ext^p x Ext^q
@expansion{} //----component 1:
@expansion{} 0,1,0,0,
@expansion{} 0,0,0,0,
@expansion{} 0,0,0,0,
@expansion{} 0,0,0,0
@expansion{} //----component 2:
@expansion{} 0,0,-1,0,
@expansion{} 0,1,0, 0,
@expansion{} 0,0,0, 0,
@expansion{} 0,0,0, 0
@expansion{} //----component 3:
@expansion{} 0,0,0,-1,
@expansion{} 0,0,0,0,
@expansion{} 0,1,0,0,
@expansion{} 0,0,0,0
@expansion{} //----component 4:
@expansion{} 0,0,0, 0,
@expansion{} 1,0,0, 1,
@expansion{} 0,0,-1,0,
@expansion{} 0,1,0, 0
@expansion{} ////// end level 3 //////
show(l[1]);show(l[2]);
@expansion{} // matrix, 4x17
@expansion{} 0,1,0, 0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,
@expansion{} 0,0,-1,0, 0,1,0,0,0,0,0, 0,0,0,0,0,0,
@expansion{} 0,0,0, -1,0,0,0,0,0,1,0, 0,0,0,0,0,0,
@expansion{} 0,0,0, 0, 1,0,0,1,0,0,-1,0,0,1,0,0,0
@expansion{} // matrix, 16x4
@expansion{} 0, 0, 1, 0,
@expansion{} 0, y, 0, 0,
@expansion{} 1, 0, 0, 0,
@expansion{} 0, 0, 0, y,
@expansion{} 0, -1,0, 0,
@expansion{} 0, 0, x2,0,
@expansion{} 0, 0, 0, -x2,
@expansion{} 1, 0, 0, 0,
@expansion{} 0, 0, 0, -1,
@expansion{} -1,0, 0, 0,
@expansion{} 0, 1, 0, 0,
@expansion{} 0, 0, 1, 0,
@expansion{} -1,0, 0, 0,
@expansion{} 0, 0, 0, x2y,
@expansion{} 0, 0, x2,0,
@expansion{} 0, -y,0, 0
printlevel = p;
@c end example cupproduct d2t_singular/homolog_lib.doc:145
@end smallexample
@c ---end content cupproduct---

@c ------------------- depth -------------
@node depth, Ext_R, cupproduct, homolog_lib
@subsubsection depth
@cindex depth
@c ---content depth---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
depth(M,[I]); M module, I ideal

@item @strong{Return:}
int,
@*- if called with 1 argument: the depth of M'=coker(M) w.r.t. the
maxideal in the basering (which is then assumed to be local)@*
- if called with 2 arguments: the depth of M'=coker(M) w.r.t. the
ideal I.

@item @strong{Note:}
procedure makes use of KoszulHomology.

@end table
@strong{Example:}
@smallexample
@c computed example depth d2t_singular/homolog_lib.doc:185
LIB "homolog.lib";
ring R=0,(x,y,z),dp;
ideal I=x2,xy,yz;
module M=0;
depth(M,I);   // depth(<x2,xy,yz>,Q[x,y,z])
@expansion{} 2
ring r=0,(x,y,z),ds;  // local ring
matrix M[2][2]=x,xy,1+yz,0;
print(M);
@expansion{} x,   xy,
@expansion{} 1+yz,0
depth(M);     // depth(maxideal,coker(M))
@expansion{} 2
ideal I=x;
depth(M,I);   // depth(<x>,coker(M))
@expansion{} 0
I=x+z;
depth(M,I);   // depth(<x+z>,coker(M))
@expansion{} 1
@c end example depth d2t_singular/homolog_lib.doc:185
@end smallexample
@c ---end content depth---

@c ------------------- Ext_R -------------
@node Ext_R, Ext, depth, homolog_lib
@subsubsection Ext_R
@cindex Ext_R
@c ---content Ext_R---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
Ext_R(v,M[,p]); v int resp. intvec , M module, p int

@item @strong{Compute:}
A presentation of Ext^k(M',R); for k=v[1],v[2],..., M'=coker(M).
Let
@smallexample
  0 <-- M' <-- F0 <-M-- F1 <-- F2 <-- ...
@end smallexample
be a free resolution of M'. If
@smallexample
        0 --> F0* -A1-> F1* -A2-> F2* -A3-> ...
@end smallexample
is the dual sequence, Fi*=Hom(Fi,R), then Ext^k = ker(Ak+1)/im(Ak)
is presented as in the following exact sequences:
@smallexample
    R^p --syz(Ak+1)-> Fk* ---Ak+1---->  Fk+1* ,
    R^q ----Ext^k---> R^p --syz(Ak+1)-> Fk*/im(Ak).
@end smallexample
Hence, Ext^k=modulo(syz(Ak+1),Ak) presents Ext^k(M',R).

@item @strong{Return:}
- module Ext, a presentation of Ext^k(M',R) if v is of type int@*
- a list of Ext^k (k=v[1],v[2],...) if v is of type intvec.@*
- In case of a third argument of type int return a list l:
@format
     l[1] = module Ext^k resp. list of Ext^k
     l[2] = SB of Ext^k resp. list of SB of Ext^k
     l[3] = matrix resp. list of matrices, each representing a kbase of Ext^k
              (if finite dimensional)
@end format

@item @strong{Display:}
printlevel >=0: (affine) dimension of Ext^k for each k (default)
printlevel >=1: Ak, Ak+1 and kbase of Ext^k in Fk*

@item @strong{Note:}
In order to compute Ext^k(M,R) use the command Ext_R(k,syz(M));
or the 2 commands: list L=mres(M,2); Ext_R(k,L[2]);

@end table
@strong{Example:}
@smallexample
@c computed example Ext_R d2t_singular/homolog_lib.doc:254
LIB "homolog.lib";
int p      = printlevel;
printlevel = 1;
ring r     = 0,(x,y,z),dp;
ideal i    = x2y,y2z,z3x;
module E   = Ext_R(1,i);    //computes Ext^1(r/i,r)
@expansion{} // Computing Ext^1:
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of M,
@expansion{} // then F1*-->F2* is given by:
@expansion{} x2, -yz,0,
@expansion{} 0,  z3, -xy,
@expansion{} xz2,0,  -y2
@expansion{} // and F0*-->F1* is given by:
@expansion{} y2z,
@expansion{} x2y,
@expansion{} xz3
@expansion{}
@expansion{} // dimension of Ext^1:  -1
@expansion{}
is_zero(E);
@expansion{} 1
qring R    = std(x2+yz);
intvec v   = 0,2;
printlevel = 2;             //shows what is going on
ideal i    = x,y,z;         //computes Ext^i(r/(x,y,z),r/(x2+yz)), i=0,2
list L     = Ext_R(v,i,1);  //over the qring R=r/(x2+yz), std and kbase
@expansion{} // Computing Ext^0:
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of M,
@expansion{} // then F0*-->F1* is given by:
@expansion{} z,
@expansion{} y,
@expansion{} x
@expansion{} // and F-1*-->F0* is given by:
@expansion{} 0
@expansion{}
@expansion{} // dimension of Ext^0:  -1
@expansion{}
@expansion{} // columns of matrix are kbase of Ext^0 in F0*:
@expansion{} 0
@expansion{}
@expansion{} // Computing Ext^2:
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of M,
@expansion{} // then F2*-->F3* is given by:
@expansion{} x,-y,z, 0,
@expansion{} z,x, 0, z,
@expansion{} 0,0, x, y,
@expansion{} 0,0, -z,x
@expansion{} // and F1*-->F2* is given by:
@expansion{} y,-z,0,
@expansion{} x,0, -z,
@expansion{} 0,x, -y,
@expansion{} 0,z, x
@expansion{}
@expansion{} // dimension of Ext^2:  0
@expansion{} // vdim of Ext^2:       1
@expansion{}
@expansion{} // columns of matrix are kbase of Ext^2 in F2*:
@expansion{} x,
@expansion{} -z,
@expansion{} 0,
@expansion{} 0
@expansion{}
printlevel = p;
@c end example Ext_R d2t_singular/homolog_lib.doc:254
@end smallexample
@c ---end content Ext_R---

@c ------------------- Ext -------------
@node Ext, fitting, Ext_R, homolog_lib
@subsubsection Ext
@cindex Ext
@c ---content Ext---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
Ext(v,M,N[,any]); v int resp. intvec, M,N modules

@item @strong{Compute:}
A presentation of Ext^k(M',N'); for k=v[1],v[2],... where
M'=coker(M) and N'=coker(N). Let
@smallexample
       0 <-- M' <-- F0 <-M-- F1 <-- F2 <--... ,
       0 <-- N' <-- G0 <--N- G1
@end smallexample
be a free resolution of M', resp. a presentation of N'. Consider
the commutative diagram
@smallexample
           0                  0                  0
           |^                 |^                 |^
   --> Hom(Fk-1,N') -Ak-> Hom(Fk,N') -Ak+1-> Hom(Fk+1,N')
           |^                 |^                 |^
   --> Hom(Fk-1,G0) -Ak-> Hom(Fk,G0) -Ak+1-> Hom(Fk+1,G0)
                              |^                 |^
                              |C                 |B
                          Hom(Fk,G1) ------> Hom(Fk+1,G1)

      (Ak,Ak+1 induced by M and B,C induced by N).
@end smallexample
Let K=modulo(Ak+1,B), J=module(Ak)+module(C) and Ext=modulo(K,J),
then we have exact sequences
@smallexample
    R^p --K-> Hom(Fk,G0) --Ak+1-> Hom(Fk+1,G0)/im(B),

    R^q -Ext-> R^p --K-> Hom(Fk,G0)/(im(Ak)+im(C)).
@end smallexample
Hence, Ext presents Ext^k(M',N').

@item @strong{Return:}
- module Ext, a presentation of Ext^k(M',N') if v is of type int@*
- a list of Ext^k (k=v[1],v[2],...) if v is of type intvec.@*
- In case of a third argument of any type return a list l:
@format
             l[1] = module Ext/list of Ext^k
             l[2] = SB of Ext/list of SB of Ext^k
             l[3] = matrix/list of matrices, each representing a kbase of Ext^k
                       (if finite dimensional)
@end format

@item @strong{Display:}
printlevel >=0: dimension, vdim of Ext^k for each k (default).
@* printlevel >=1: matrices Ak, Ak+1 and kbase of Ext^k in Hom(Fk,G0)
(if finite dimensional)

@item @strong{Note:}
In order to compute Ext^k(M,N) use the command Ext(k,syz(M),syz(N));
or: list P=mres(M,2); list Q=mres(N,2); Ext(k,P[2],Q[2]);

@end table
@strong{Example:}
@smallexample
@c computed example Ext d2t_singular/homolog_lib.doc:336
LIB "homolog.lib";
int p      = printlevel;
printlevel = 1;
ring r     = 0,(x,y),dp;
ideal i    = x2-y3;
ideal j    = x2-y5;
list E     = Ext(0..2,i,j);    // Ext^k(r/i,r/j) for k=0,1,2 over r
@expansion{} // Computing Ext^0 (help Ext; gives an explanation):
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of coker(M),
@expansion{} // and 0<--coker(N)<--G0<--G1 a presentation of coker(N),
@expansion{} // then Hom(F0,G0)-->Hom(F1,G0) is given by:
@expansion{} y3-x2
@expansion{} // and Hom(F-1,G0) + Hom(F0,G1)-->Hom(F0,G0) is given by:
@expansion{} 0,-y5+x2
@expansion{}
@expansion{} // dimension of Ext^0:  -1
@expansion{}
@expansion{} // Computing Ext^1 (help Ext; gives an explanation):
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of coker(M),
@expansion{} // and 0<--coker(N)<--G0<--G1 a presentation of coker(N),
@expansion{} // then Hom(F1,G0)-->Hom(F2,G0) is given by:
@expansion{} 0
@expansion{} // and Hom(F0,G0) + Hom(F1,G1)-->Hom(F1,G0) is given by:
@expansion{} y3-x2,-y5+x2
@expansion{}
@expansion{} // dimension of Ext^1:  0
@expansion{} // vdim of Ext^1:       10
@expansion{}
@expansion{} // Computing Ext^2 (help Ext; gives an explanation):
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of coker(M),
@expansion{} // and 0<--coker(N)<--G0<--G1 a presentation of coker(N),
@expansion{} // then Hom(F2,G0)-->Hom(F3,G0) is given by:
@expansion{} 1
@expansion{} // and Hom(F1,G0) + Hom(F2,G1)-->Hom(F2,G0) is given by:
@expansion{} 0,-y5+x2
@expansion{}
@expansion{} // dimension of Ext^2:  -1
@expansion{}
qring R    = std(i);
ideal j    = fetch(r,j);
module M   = [-x,y],[-y2,x];
printlevel = 2;
module E1  = Ext(1,M,j);       // Ext^1(R^2/M,R/j) over R=r/i
@expansion{} // Computing Ext^1 (help Ext; gives an explanation):
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of coker(M),
@expansion{} // and 0<--coker(N)<--G0<--G1 a presentation of coker(N),
@expansion{} // then Hom(F1,G0)-->Hom(F2,G0) is given by:
@expansion{} x, -y,
@expansion{} y2,-x
@expansion{} // and Hom(F0,G0) + Hom(F1,G1)-->Hom(F1,G0) is given by:
@expansion{} x, -y,-y5+x2,0,
@expansion{} y2,-x,0,     -y5+x2
@expansion{}
@expansion{} // dimension of Ext^1:  -1
@expansion{}
list l     = Ext(4,M,M,1);     // Ext^4(R^2/M,R^2/M) over R=r/i
@expansion{} // Computing Ext^4 (help Ext; gives an explanation):
@expansion{} // Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of coker(M),
@expansion{} // and 0<--coker(N)<--G0<--G1 a presentation of coker(N),
@expansion{} // then Hom(F4,G0)-->Hom(F5,G0) is given by:
@expansion{} x, -y,0, 0,
@expansion{} y2,-x,0, 0,
@expansion{} 0, 0, x, -y,
@expansion{} 0, 0, y2,-x
@expansion{} // and Hom(F3,G0) + Hom(F4,G1)-->Hom(F4,G0) is given by:
@expansion{} x, -y,0, 0, -x,0, -y2,0,
@expansion{} y2,-x,0, 0, 0, -x,0,  -y2,
@expansion{} 0, 0, x, -y,y, 0, x,  0,
@expansion{} 0, 0, y2,-x,0, y, 0,  x
@expansion{}
@expansion{} // dimension of Ext^4:  0
@expansion{} // vdim of Ext^4:       2
@expansion{}
@expansion{} // columns of matrix are kbase of Ext^4 in Hom(F4,G0)
@expansion{} 1,0,
@expansion{} 0,y,
@expansion{} 0,1,
@expansion{} 1,0
@expansion{}
@expansion{} // element 1 of kbase of Ext^4 in Hom(F4,G0)
@expansion{} // as matrix: F4-->G0
@expansion{} 1,0,
@expansion{} 0,1
@expansion{} // element 2 of kbase of Ext^4 in Hom(F4,G0)
@expansion{} // as matrix: F4-->G0
@expansion{} 0,y,
@expansion{} 1,0
@expansion{}
printlevel = p;
@c end example Ext d2t_singular/homolog_lib.doc:336
@end smallexample
@c ---end content Ext---

@c ------------------- fitting -------------
@node fitting, flatteningStrat, Ext, homolog_lib
@subsubsection fitting
@cindex fitting
@c ---content fitting---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
fitting (M,n); M module, n int

@item @strong{Return:}
ideal, (standard basis of) n-th Fitting ideal of M'=coker(M).

@end table
@strong{Example:}
@smallexample
@c computed example fitting d2t_singular/homolog_lib.doc:372
LIB "homolog.lib";
ring R=0,x(0..4),dp;
matrix M[2][4]=x(0),x(1),x(2),x(3),x(1),x(2),x(3),x(4);
print(M);
@expansion{} x(0),x(1),x(2),x(3),
@expansion{} x(1),x(2),x(3),x(4)
fitting(M,-1);
@expansion{} _[1]=0
fitting(M,0);
@expansion{} _[1]=x(3)^2-x(2)*x(4)
@expansion{} _[2]=x(2)*x(3)-x(1)*x(4)
@expansion{} _[3]=x(1)*x(3)-x(0)*x(4)
@expansion{} _[4]=x(2)^2-x(0)*x(4)
@expansion{} _[5]=x(1)*x(2)-x(0)*x(3)
@expansion{} _[6]=x(1)^2-x(0)*x(2)
fitting(M,1);
@expansion{} _[1]=x(4)
@expansion{} _[2]=x(3)
@expansion{} _[3]=x(2)
@expansion{} _[4]=x(1)
@expansion{} _[5]=x(0)
fitting(M,2);
@expansion{} _[1]=1
@c end example fitting d2t_singular/homolog_lib.doc:372
@end smallexample
@c ---end content fitting---

@c ------------------- flatteningStrat -------------
@node flatteningStrat, Hom, fitting, homolog_lib
@subsubsection flatteningStrat
@cindex flatteningStrat
@c ---content flatteningStrat---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
flatteningStrat(M); M module

@item @strong{Return:}
list of ideals.
@*The list entries L[1],...,L[r] describe the flattening stratification
of M'=coker(M): setting L[0]=0, L[r+1]=1, the flattening
stratification is given by the open sets Spec(A/V(L[i-1])) \ V(L[i]),
i=1,...,r+1 (A = basering).

@item @strong{Note:}
for more information see the book 'A Singular Introduction to
Commutative Algebra' (by Greuel/Pfister, Springer 2002).

@end table
@strong{Example:}
@smallexample
@c computed example flatteningStrat d2t_singular/homolog_lib.doc:410
LIB "homolog.lib";
ring A = 0,x(0..4),dp;
// presentation matrix:
matrix M[2][4] = x(0),x(1),x(2),x(3),x(1),x(2),x(3),x(4);
list L = flatteningStrat(M);
L;
@expansion{} [1]:
@expansion{}    _[1]=x(3)^2-x(2)*x(4)
@expansion{}    _[2]=x(2)*x(3)-x(1)*x(4)
@expansion{}    _[3]=x(1)*x(3)-x(0)*x(4)
@expansion{}    _[4]=x(2)^2-x(0)*x(4)
@expansion{}    _[5]=x(1)*x(2)-x(0)*x(3)
@expansion{}    _[6]=x(1)^2-x(0)*x(2)
@expansion{} [2]:
@expansion{}    _[1]=x(4)
@expansion{}    _[2]=x(3)
@expansion{}    _[3]=x(2)
@expansion{}    _[4]=x(1)
@expansion{}    _[5]=x(0)
@c end example flatteningStrat d2t_singular/homolog_lib.doc:410
@end smallexample
@c ---end content flatteningStrat---

@c ------------------- Hom -------------
@node Hom, homology, flatteningStrat, homolog_lib
@subsubsection Hom
@cindex Hom
@c ---content Hom---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
Hom(M,N,[any]); M,N=modules

@item @strong{Compute:}
A presentation of Hom(M',N'), M'=coker(M), N'=coker(N) as follows:
let
@smallexample
   F1 --M-> F0 -->M' --> 0,    G1 --N-> G0 --> N' --> 0
@end smallexample
be presentations of M' and N'. Consider
@smallexample
                                  0               0
                                  |^              |^
       0 --> Hom(M',N') ----> Hom(F0,N') ----> Hom(F1,N')
                                  |^              |^
  (A:  induced by M)          Hom(F0,G0) --A-> Hom(F1,G0)
                                  |^              |^
  (B,C:induced by N)              |C              |B
                              Hom(F0,G1) ----> Hom(F1,G1)

@end smallexample
Let D=modulo(A,B) and Hom=modulo(D,C), then we have exact sequences
@smallexample
   R^p  --D-> Hom(F0,G0) --A-> Hom(F1,G0)/im(B),

 R^q -Hom-> R^p --D-> Hom(F0,G0)/im(C) --A-> Hom(F1,G0)/im(B).
@end smallexample
Hence Hom presents Hom(M',N')

@item @strong{Return:}
module Hom, a presentation of Hom(M',N'), resp., in case of
3 arguments, a list l (of size <=3):
@format
           - l[1] = Hom
           - l[2] = SB of Hom
           - l[3] = kbase of coker(Hom) (if finite dimensional, not 0),
                    represented by elements in Hom(F0,G0) via mapping D
@end format

@item @strong{Display:}
printlevel >=0: (affine) dimension of Hom (default)
@* printlevel >=1: D and C and kbase of coker(Hom) in Hom(F0,G0)
@* printlevel >=2: elements of kbase of coker(Hom) as matrix :F0-->G0

@item @strong{Note:}
DISPLAY is as described only for a direct call of 'Hom'. Calling 'Hom'
from another proc has the same effect as decreasing printlevel by 1.

@end table
@strong{Example:}
@smallexample
@c computed example Hom d2t_singular/homolog_lib.doc:480
LIB "homolog.lib";
int p     = printlevel;
printlevel= 1;   //in 'example proc' printlevel has to be increased by 1
ring r    = 0,(x,y),dp;
ideal i   = x2-y3,xy;
qring q   = std(i);
ideal i   = fetch(r,i);
module M  = [-x,y],[-y2,x],[x3];
module H  = Hom(M,i);
@expansion{} // dimension of Hom:  0
@expansion{} // vdim of Hom:       5
@expansion{}
@expansion{} // given  F1 --M-> F0 -->M'--> 0 and  G1 --N-> G0 -->N'--> 0,
@expansion{} // show D = ker( Hom(F0,G0) --> Hom(F1,G0)/im(Hom(F1,G1)->Hom(F1,G0)) )
@expansion{} y,x, 0,
@expansion{} x,y2,x2
@expansion{} // show C = im ( Hom(F0,G1) --> Hom(F0,G0) )
@expansion{} -y3+x2,0,     xy,0,
@expansion{} 0,     -y3+x2,0, xy
@expansion{}
print(H);
@expansion{} 0, x, 0,y2,0,
@expansion{} y, 0, 0,-x,x2,
@expansion{} -1,-1,x,0, 0
printlevel= 2;
list L    = Hom(M,i,1);"";
@expansion{} // dimension of Hom:  0
@expansion{} // vdim of Hom:       5
@expansion{}
@expansion{} // given  F1 --M-> F0 -->M'--> 0 and  G1 --N-> G0 -->N'--> 0,
@expansion{} // show D = ker( Hom(F0,G0) --> Hom(F1,G0)/im(Hom(F1,G1)->Hom(F1,G0)) )
@expansion{} y,x, 0,
@expansion{} x,y2,x2
@expansion{} // show C = im ( Hom(F0,G1) --> Hom(F0,G0) )
@expansion{} -y3+x2,0,     xy,0,
@expansion{} 0,     -y3+x2,0, xy
@expansion{}
@expansion{} // element 1 of kbase of Hom in Hom(F0,G0) as matrix: F0-->G0:
@expansion{} y2,xy
@expansion{} // element 2 of kbase of Hom in Hom(F0,G0) as matrix: F0-->G0:
@expansion{} y,x
@expansion{} // element 3 of kbase of Hom in Hom(F0,G0) as matrix: F0-->G0:
@expansion{} x2,xy2
@expansion{} // element 4 of kbase of Hom in Hom(F0,G0) as matrix: F0-->G0:
@expansion{} x,y2
@expansion{} // element 5 of kbase of Hom in Hom(F0,G0) as matrix: F0-->G0:
@expansion{} 0,x2
@expansion{}
printlevel=1;
ring s    = 3,(x,y,z),(c,dp);
ideal i   = jacob(ideal(x2+y5+z4));
qring rq=std(i);
matrix M[2][2]=xy,x3,5y,4z,x2;
matrix N[3][2]=x2,x,y3,3xz,x2z,z;
print(M);
@expansion{} xy,x3,
@expansion{} -y,z
print(N);
@expansion{} x2, x,
@expansion{} y3, 0,
@expansion{} x2z,z
list l=Hom(M,N,1);
@expansion{} // dimension of Hom:  0
@expansion{} // vdim of Hom:       16
@expansion{}
@expansion{} // given  F1 --M-> F0 -->M'--> 0 and  G1 --N-> G0 -->N'--> 0,
@expansion{} // show D = ker( Hom(F0,G0) --> Hom(F1,G0)/im(Hom(F1,G1)->Hom(F1,G0)) )
@expansion{} 0,0, 0,0, 0,   0,0,   1,
@expansion{} 0,0, 0,0, 0,   0,y3z2,0,
@expansion{} 0,0, 0,0, 0,   1,0,   0,
@expansion{} 0,0, 0,y3,y2z2,0,0,   0,
@expansion{} 0,0, 1,0, 0,   0,0,   0,
@expansion{} z,y3,0,0, 0,   0,0,   0
@expansion{} // show C = im ( Hom(F0,G1) --> Hom(F0,G0) )
@expansion{} x2, 0,  x,0,
@expansion{} 0,  x2, 0,x,
@expansion{} y3, 0,  0,0,
@expansion{} 0,  y3, 0,0,
@expansion{} x2z,0,  z,0,
@expansion{} 0,  x2z,0,z
@expansion{}
@expansion{} // columns of matrix are kbase of Hom in Hom(F0,G0)
@expansion{} 0, 0, 0, 0,0,0,   0,   0,  0, 0,  0, 0,0, 0,0,0,
@expansion{} 0, 0, 0, 0,0,0,   0,   0,  0, 0,  0, 0,0, 0,0,y3z2,
@expansion{} 0, 0, 0, 0,0,0,   y2z2,yz2,z2,y2z,yz,z,y2,y,1,0,
@expansion{} 0, 0, 0, 0,0,y2z2,0,   0,  0, 0,  0, 0,0, 0,0,0,
@expansion{} 0, y3,y2,y,1,0,   0,   0,  0, 0,  0, 0,0, 0,0,0,
@expansion{} y3,0, 0, 0,0,0,   0,   0,  0, 0,  0, 0,0, 0,0,0
printlevel = p;
@c end example Hom d2t_singular/homolog_lib.doc:480
@end smallexample
@c ---end content Hom---

@c ------------------- homology -------------
@node homology, isCM, Hom, homolog_lib
@subsubsection homology
@cindex homology
@c ---content homology---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
homology(A,B,M,N);

@item @strong{Compute:}
Let M and N be submodules of R^m and R^n presenting M'=R^m/M, N'=R^n/N
(R=basering) and let A,B matrices inducing maps
@smallexample
    R^k --A--> R^m --B--> R^n.
@end smallexample
Compute a presentation of the module
@smallexample
    ker(B)/im(A) := ker(M'/im(A) --B--> N'/im(BM)+im(BA)).
@end smallexample
If B induces a map M'-->N' (i.e BM=0) and if im(A) is contained in
ker(B) (that is, BA=0) then ker(B)/im(A) is the homology of the
complex
@smallexample
    R^k--A-->M'--B-->N'.
@end smallexample

@item @strong{Return:}
module H, a presentation of ker(B)/im(A).

@item @strong{Note:}
homology returns a free module of rank m if ker(B)=im(A).

@end table
@strong{Example:}
@smallexample
@c computed example homology d2t_singular/homolog_lib.doc:544
LIB "homolog.lib";
ring r;
ideal id=maxideal(4);
qring qr=std(id);
module N=maxideal(3)*freemodule(2);
module M=maxideal(2)*freemodule(2);
module B=[2x,0],[x,y],[z2,y];
module A=M;
module H=homology(A,B,M,N);
H=std(H);
// dimension of homology:
dim(H);
@expansion{} 0
// vector space dimension:
vdim(H);
@expansion{} 19
ring s=0,x,ds;
qring qs=std(x4);
module A=[x];
module B=A;
module M=[x3];
module N=M;
homology(A,B,M,N);
@expansion{} _[1]=gen(1)
@c end example homology d2t_singular/homolog_lib.doc:544
@end smallexample
@c ---end content homology---

@c ------------------- isCM -------------
@node isCM, isFlat, homology, homolog_lib
@subsubsection isCM
@cindex isCM
@c ---content isCM---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
isCM(M); M module

@item @strong{Return:}
1 if M'=coker(M) is Cohen-Macaulay;@*
0 if this is not the case.

@item @strong{Assume:}
basering is local.

@end table
@strong{Example:}
@smallexample
@c computed example isCM d2t_singular/homolog_lib.doc:591
LIB "homolog.lib";
ring R=0,(x,y,z),ds;  // local ring R = Q[x,y,z]_<x,y,z>
module M=xz,yz,z2;
isCM(M);             // test if R/<xz,yz,z2> is Cohen-Macaulay
@expansion{} 0
M=x2+y2,z7;          // test if R/<x2+y2,z7> is Cohen-Macaulay
isCM(M);
@expansion{} 1
@c end example isCM d2t_singular/homolog_lib.doc:591
@end smallexample
@c ---end content isCM---

@c ------------------- isFlat -------------
@node isFlat, isLocallyFree, isCM, homolog_lib
@subsubsection isFlat
@cindex isFlat
@c ---content isFlat---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
isFlat(M); M module

@item @strong{Return:}
1 if M'=coker(M) is flat;@*
0 if this is not the case.

@end table
@strong{Example:}
@smallexample
@c computed example isFlat d2t_singular/homolog_lib.doc:620
LIB "homolog.lib";
ring A = 0,(x,y),dp;
matrix M[3][3] = x-1,y,x,x,x+1,y,x2,xy+x+1,x2+y;
print(M);
@expansion{} x-1,y,     x,
@expansion{} x,  x+1,   y,
@expansion{} x2, xy+x+1,x2+y
isFlat(M);             // coker(M) is not flat over A=Q[x,y]
@expansion{} 0
qring B = std(x2+x-y);   // the ring B=Q[x,y]/<x2+x-y>
matrix M = fetch(A,M);
isFlat(M);             // coker(M) is flat over B
@expansion{} 1
setring A;
qring C = std(x2+x+y);   // the ring C=Q[x,y]/<x2+x+y>
matrix M = fetch(A,M);
isFlat(M);             // coker(M) is not flat over C
@expansion{} 0
@c end example isFlat d2t_singular/homolog_lib.doc:620
@end smallexample
@c ---end content isFlat---

@c ------------------- isLocallyFree -------------
@node isLocallyFree, isReg, isFlat, homolog_lib
@subsubsection isLocallyFree
@cindex isLocallyFree
@c ---content isLocallyFree---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
isLocallyFree(M,r); M module, r int

@item @strong{Return:}
1 if M'=coker(M) is locally free of constant rank r;@*
0 if this is not the case.

@end table
@strong{Example:}
@smallexample
@c computed example isLocallyFree d2t_singular/homolog_lib.doc:655
LIB "homolog.lib";
ring R=0,(x,y,z),dp;
matrix M[2][3];     // the presentation matrix
M=x-1,y-1,z,y-1,x-2,x;
ideal I=fitting(M,0); // 0-th Fitting ideal of coker(M)
qring Q=I;
matrix M=fetch(R,M);
isLocallyFree(M,1); // as R/I-module, coker(M) is locally free of rk 1
@expansion{} 1
isLocallyFree(M,0);
@expansion{} 0
@c end example isLocallyFree d2t_singular/homolog_lib.doc:655
@end smallexample
@c ---end content isLocallyFree---

@c ------------------- isReg -------------
@node isReg, kernel, isLocallyFree, homolog_lib
@subsubsection isReg
@cindex isReg
@c ---content isReg---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
isReg(I,M); I ideal, M module

@item @strong{Return:}
1 if given (ordered) list of generators for I is coker(M)-sequence;@*
0 if this is not the case.

@end table
@strong{Example:}
@smallexample
@c computed example isReg d2t_singular/homolog_lib.doc:687
LIB "homolog.lib";
ring R = 0,(x,y,z),dp;
ideal I = x*(y-1),y,z*(y-1);
isReg(I,0);             // given list of generators is Q[x,y,z]-sequence
@expansion{} 1
I = x*(y-1),z*(y-1),y;  // change sorting of generators
isReg(I,0);
@expansion{} 0
ring r = 0,(x,y,z),ds;  // local ring
ideal I=fetch(R,I);
isReg(I,0);             // result independent of sorting of generators
@expansion{} 1
@c end example isReg d2t_singular/homolog_lib.doc:687
@end smallexample
@c ---end content isReg---

@c ------------------- kernel -------------
@node kernel, kohom, isReg, homolog_lib
@subsubsection kernel
@cindex kernel
@c ---content kernel---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
kernel(A,M,N);

@item @strong{Compute:}
Let M and N be submodules of R^m and R^n, presenting M'=R^m/M,
N'=R^n/N (R=basering), and let A:R^m-->R^n be a matrix inducing a
map A':M'-->N'. Then kernel(A,M,N); computes a presentation K of
ker(A') as in the commutative diagram:
@smallexample
          ker(A') --->  M' --A'--> N'
             |^         |^         |^
             |          |          |
             R^r  ---> R^m --A--> R^n
             |^         |^         |^
             |K         |M         |N
             |          |          |
             R^s  ---> R^p -----> R^q
@end smallexample

@item @strong{Return:}
module K, a presentation of ker(A':coker(M)->coker(N)).

@end table
@strong{Example:}
@smallexample
@c computed example kernel d2t_singular/homolog_lib.doc:734
LIB "homolog.lib";
ring r;
module N=[2x,x],[0,y];
module M=maxideal(1)*freemodule(2);
matrix A[2][2]=2x,0,x,y,z2,y;
module K=kernel(A,M,N);
// dimension of kernel:
dim(std(K));
@expansion{} 0
// vector space dimension of kernel:
vdim(std(K));
@expansion{} 2
print(K);
@expansion{} z,0,y,0,x,0,
@expansion{} 0,z,0,y,0,x
@c end example kernel d2t_singular/homolog_lib.doc:734
@end smallexample
@c ---end content kernel---

@c ------------------- kohom -------------
@node kohom, kontrahom, kernel, homolog_lib
@subsubsection kohom
@cindex kohom
@c ---content kohom---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
kohom(A,k); A=matrix, k=integer

@item @strong{Return:}
matrix Hom(R^k,A), i.e. let A be a matrix defining a map F1-->F2
of free R-modules, then the matrix of Hom(R^k,F1)-->Hom(R^k,F2)
is computed (R=basering).

@end table
@strong{Example:}
@smallexample
@c computed example kohom d2t_singular/homolog_lib.doc:769
LIB "homolog.lib";
ring r;
matrix n[2][3]=x,y,5,z,77,33;
print(kohom(n,3));
@expansion{} x,0,0,y, 0, 0, 5, 0, 0,
@expansion{} 0,x,0,0, y, 0, 0, 5, 0,
@expansion{} 0,0,x,0, 0, y, 0, 0, 5,
@expansion{} z,0,0,77,0, 0, 33,0, 0,
@expansion{} 0,z,0,0, 77,0, 0, 33,0,
@expansion{} 0,0,z,0, 0, 77,0, 0, 33
@c end example kohom d2t_singular/homolog_lib.doc:769
@end smallexample
@c ---end content kohom---

@c ------------------- kontrahom -------------
@node kontrahom, KoszulHomology, kohom, homolog_lib
@subsubsection kontrahom
@cindex kontrahom
@c ---content kontrahom---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
kontrahom(A,k); A=matrix, k=integer

@item @strong{Return:}
matrix Hom(A,R^k), i.e. let A be a matrix defining a map F1-->F2 of
free R-modules, then the matrix of Hom(F2,R^k)-->Hom(F1,R^k) is
computed (R=basering).

@end table
@strong{Example:}
@smallexample
@c computed example kontrahom d2t_singular/homolog_lib.doc:797
LIB "homolog.lib";
ring r;
matrix n[2][3]=x,y,5,z,77,33;
print(kontrahom(n,3));
@expansion{} x,z, 0,0, 0,0,
@expansion{} y,77,0,0, 0,0,
@expansion{} 5,33,0,0, 0,0,
@expansion{} 0,0, x,z, 0,0,
@expansion{} 0,0, y,77,0,0,
@expansion{} 0,0, 5,33,0,0,
@expansion{} 0,0, 0,0, x,z,
@expansion{} 0,0, 0,0, y,77,
@expansion{} 0,0, 0,0, 5,33
@c end example kontrahom d2t_singular/homolog_lib.doc:797
@end smallexample
@c ---end content kontrahom---

@c ------------------- KoszulHomology -------------
@node KoszulHomology, tensorMod, kontrahom, homolog_lib
@subsubsection KoszulHomology
@cindex KoszulHomology
@c ---content KoszulHomology---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Compute:}
A presentation of the p-th Koszul homology module H_p(f_1,...,f_k;M'),
where M'=coker(M) and f_1,...,f_k are the given (ordered list
of generators of the) ideal I. The computed presentation is minimized
via prune. In particular, if H_p(f_1,...,f_k;M')=0 then the
return value is 0.

@item @strong{Return:}
module H, s.th. coker(H) = H_p(f_1,...,f_k;M').

@item @strong{Note:}
size of input ideal has to be <= 20.

@end table
@strong{Example:}
@smallexample
@c computed example KoszulHomology d2t_singular/homolog_lib.doc:830
LIB "homolog.lib";
ring R=0,x(1..3),dp;
ideal x=maxideal(1);
module M=0;
KoszulHomology(x,M,0);  // H_0(x,R), x=(x_1,x_2,x_3)
@expansion{} _[1]=x(3)*gen(1)
@expansion{} _[2]=x(2)*gen(1)
@expansion{} _[3]=x(1)*gen(1)
KoszulHomology(x,M,1);  // H_1(x,R), x=(x_1,x_2,x_3)
@expansion{} _[1]=0
qring S=std(x(1)*x(2));
module M=0;
ideal x=maxideal(1);
KoszulHomology(x,M,1);
@expansion{} _[1]=-x(3)*gen(1)
@expansion{} _[2]=-x(2)*gen(1)
@expansion{} _[3]=-x(1)*gen(1)
KoszulHomology(x,M,2);
@expansion{} _[1]=0
@c end example KoszulHomology d2t_singular/homolog_lib.doc:830
@end smallexample
@c ---end content KoszulHomology---

@c ------------------- tensorMod -------------
@node tensorMod, Tor, KoszulHomology, homolog_lib
@subsubsection tensorMod
@cindex tensorMod
@c ---content tensorMod---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Usage:}
tensorMod(M,N); M,N modules

@item @strong{Compute:}
presentation matrix A of the tensor product T of the modules
M'=coker(M), N'=coker(N): if matrix(M) defines a map M: R^r-->R^s and
matrix(N) defines a map N: R^p-->R^q, then A defines a presentation
@smallexample
         R^(sp+rq) --A-> R^(sq)  --> T --> 0 .
@end smallexample

@item @strong{Return:}
matrix A satisfying coker(A) = tensorprod(coker(M),coker(N)) .

@end table
@strong{Example:}
@smallexample
@c computed example tensorMod d2t_singular/homolog_lib.doc:871
LIB "homolog.lib";
ring A=0,(x,y,z),dp;
matrix M[3][3]=1,2,3,4,5,6,7,8,9;
matrix N[2][2]=x,y,0,z;
print(M);
@expansion{} 1,2,3,
@expansion{} 4,5,6,
@expansion{} 7,8,9
print(N);
@expansion{} x,y,
@expansion{} 0,z
print(tensorMod(M,N));
@expansion{} x,y,0,0,0,0,1,0,2,0,3,0,
@expansion{} 0,z,0,0,0,0,0,1,0,2,0,3,
@expansion{} 0,0,x,y,0,0,4,0,5,0,6,0,
@expansion{} 0,0,0,z,0,0,0,4,0,5,0,6,
@expansion{} 0,0,0,0,x,y,7,0,8,0,9,0,
@expansion{} 0,0,0,0,0,z,0,7,0,8,0,9
@c end example tensorMod d2t_singular/homolog_lib.doc:871
@end smallexample
@c ---end content tensorMod---

@c ------------------- Tor -------------
@node Tor,, tensorMod, homolog_lib
@subsubsection Tor
@cindex Tor
@c ---content Tor---
Procedure from library @code{homolog.lib} (@pxref{homolog_lib}).

@table @asis
@item @strong{Compute:}
a presentation of Tor_k(M',N'), for k=v[1],v[2],... , where
M'=coker(M) and N'=coker(N): let
@smallexample
       0 <-- M' <-- G0 <-M-- G1
       0 <-- N' <-- F0 <--N- F1 <-- F2 <--...
@end smallexample
be a presentation of M', resp. a free resolution of N', and consider
the commutative diagram
@smallexample
          0                    0                    0
          |^                   |^                   |^
  Tensor(M',Fk+1) -Ak+1-> Tensor(M',Fk) -Ak-> Tensor(M',Fk-1)
          |^                   |^                   |^
  Tensor(G0,Fk+1) -Ak+1-> Tensor(G0,Fk) -Ak-> Tensor(G0,Fk-1)
                               |^                   |^
                               |C                   |B
                          Tensor(G1,Fk) ----> Tensor(G1,Fk-1)

       (Ak,Ak+1 induced by N and B,C induced by M).
@end smallexample
Let K=modulo(Ak,B), J=module(C)+module(Ak+1) and Tor=modulo(K,J),
then we have exact sequences
@smallexample
    R^p  --K-> Tensor(G0,Fk) --Ak-> Tensor(G0,Fk-1)/im(B),

    R^q -Tor-> R^p --K-> Tensor(G0,Fk)/(im(C)+im(Ak+1)).
@end smallexample
Hence, Tor presents Tor_k(M',N').

@item @strong{Return:}
- if v is of type int: module Tor, a presentation of Tor_k(M',N');@*
- if v is of type intvec: a list of Tor_k(M',N') (k=v[1],v[2],...);@*
- in case of a third argument of any type: list l with
@format
     l[1] = module Tor/list of Tor_k(M',N'),
     l[2] = SB of Tor/list of SB of Tor_k(M',N'),
     l[3] = matrix/list of matrices, each representing a kbase of Tor_k(M',N')
                (if finite dimensional), or 0.
@end format

@item @strong{Display:}
printlevel >=0: (affine) dimension of Tor_k for each k (default).
@* printlevel >=1: matrices Ak, Ak+1 and kbase of Tor_k in Tensor(G0,Fk)
(if finite dimensional).

@item @strong{Note:}
In order to compute Tor_k(M,N) use the command Tor(k,syz(M),syz(N));
or: list P=mres(M,2); list Q=mres(N,2); Tor(k,P[2],Q[2]);

@end table
@strong{Example:}
@smallexample
@c computed example Tor d2t_singular/homolog_lib.doc:944
LIB "homolog.lib";
int p      = printlevel;
printlevel = 1;
ring r     = 0,(x,y),dp;
ideal i    = x2,y;
ideal j    = x;
list E     = Tor(0..2,i,j);    // Tor_k(r/i,r/j) for k=0,1,2 over r
@expansion{} // dimension of Tor_0:  0
@expansion{} // vdim of Tor_0:       1
@expansion{}
@expansion{} // Computing Tor_1 (help Tor; gives an explanation):
@expansion{} // Let 0 <- coker(M) <- G0 <-M- G1 be the present. of coker(M),
@expansion{} // and 0 <- coker(N) <- F0 <-N- F1 <- F2 <- ... a resolution of
@expansion{} // coker(N), then Tensor(G0,F1)-->Tensor(G0,F0) is given by:
@expansion{} x
@expansion{} // and Tensor(G0,F2) + Tensor(G1,F1)-->Tensor(G0,F1) is given by:
@expansion{} 0,x2,y
@expansion{}
@expansion{} // dimension of Tor_1:  0
@expansion{} // vdim of Tor_1:       1
@expansion{}
@expansion{} // Computing Tor_2 (help Tor; gives an explanation):
@expansion{} // Let 0 <- coker(M) <- G0 <-M- G1 be the present. of coker(M),
@expansion{} // and 0 <- coker(N) <- F0 <-N- F1 <- F2 <- ... a resolution of
@expansion{} // coker(N), then Tensor(G0,F2)-->Tensor(G0,F1) is given by:
@expansion{} 0
@expansion{} // and Tensor(G0,F3) + Tensor(G1,F2)-->Tensor(G0,F2) is given by:
@expansion{} 1,x2,y
@expansion{}
@expansion{} // dimension of Tor_2:  -1
@expansion{}
qring R    = std(i);
ideal j    = fetch(r,j);
module M   = [x,0],[0,x];
printlevel = 2;
module E1  = Tor(1,M,j);       // Tor_1(R^2/M,R/j) over R=r/i
@expansion{} // Computing Tor_1 (help Tor; gives an explanation):
@expansion{} // Let 0 <- coker(M) <- G0 <-M- G1 be the present. of coker(M),
@expansion{} // and 0 <- coker(N) <- F0 <-N- F1 <- F2 <- ... a resolution of
@expansion{} // coker(N), then Tensor(G0,F1)-->Tensor(G0,F0) is given by:
@expansion{} x,0,
@expansion{} 0,x
@expansion{} // and Tensor(G0,F2) + Tensor(G1,F1)-->Tensor(G0,F1) is given by:
@expansion{} x,0,x,0,
@expansion{} 0,x,0,x
@expansion{}
@expansion{} // dimension of Tor_1:  0
@expansion{} // vdim of Tor_1:       2
@expansion{}
list l     = Tor(3,M,M,1);     // Tor_3(R^2/M,R^2/M) over R=r/i
@expansion{} // Computing Tor_3 (help Tor; gives an explanation):
@expansion{} // Let 0 <- coker(M) <- G0 <-M- G1 be the present. of coker(M),
@expansion{} // and 0 <- coker(N) <- F0 <-N- F1 <- F2 <- ... a resolution of
@expansion{} // coker(N), then Tensor(G0,F3)-->Tensor(G0,F2) is given by:
@expansion{} x,0,0,0,
@expansion{} 0,x,0,0,
@expansion{} 0,0,x,0,
@expansion{} 0,0,0,x
@expansion{} // and Tensor(G0,F4) + Tensor(G1,F3)-->Tensor(G0,F3) is given by:
@expansion{} x,0,0,0,x,0,0,0,
@expansion{} 0,x,0,0,0,x,0,0,
@expansion{} 0,0,x,0,0,0,x,0,
@expansion{} 0,0,0,x,0,0,0,x
@expansion{}
@expansion{} // dimension of Tor_3:  0
@expansion{} // vdim of Tor_3:       4
@expansion{}
@expansion{} // columns of matrix are kbase of Tor_3 in Tensor(G0,F3)
@expansion{} 1,0,0,0,
@expansion{} 0,1,0,0,
@expansion{} 0,0,1,0,
@expansion{} 0,0,0,1
@expansion{}
printlevel = p;
@c end example Tor d2t_singular/homolog_lib.doc:944
@end smallexample
@c ---end content Tor---

repo_name: mthl/texinfo

license: mit


code:
@c ---content LibInfo---
@comment This file was generated by doc2tex.pl from d2t_singular/inout_lib.doc
@comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/inout_lib.doc INSTEAD
@c library version: (1.21.2.5,2002/06/12)
@c library file: ../Singular/LIB/inout.lib
@cindex inout.lib
@cindex inout_lib
@table @asis
@item @strong{Library:}
inout.lib
@item @strong{Purpose:}
     Printing and Manipulating In- and Output

@end table

@strong{Procedures:}
@menu
* allprint:: print list if ALLprint is defined, with pause if >0
* lprint:: display poly/... fitting to pagewidth [size n]
* pmat:: print form-matrix [first n chars of each column]
* rMacaulay:: read Macaulay_1 output and return its Singular format
* show:: display any object in a compact format
* showrecursive:: display id recursively with respect to variables in p
* split:: split given string into lines of length n
* tab:: string of n space tabs
* writelist:: write a list into a file and keep the list structure
* pause:: stop the computation until user input
@end menu
@c ---end content LibInfo---

@c ------------------- allprint -------------
@node allprint, lprint,, inout_lib
@subsubsection allprint
@cindex allprint
@c ---content allprint---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
allprint(L); L list

@item @strong{Display:}
prints L[1], L[2], ... if an integer with name ALLprint is defined.
@* makes "pause", if ALLprint > 0
@* listvar(matrix), if ALLprint = 2

@item @strong{Return:}
no return value

@end table
@strong{Example:}
@smallexample
@c computed example allprint d2t_singular/inout_lib.doc:51
LIB "inout.lib";
ring S;
matrix M=matrix(freemodule(2),3,3);
int ALLprint; export ALLprint;
@expansion{} // ** `ALLprint` is already global
allprint("M =",M);
@expansion{} M =
@expansion{} 1,0,0,
@expansion{} 0,1,0,
@expansion{} 0,0,0
kill ALLprint;
@c end example allprint d2t_singular/inout_lib.doc:51
@end smallexample
@c ---end content allprint---

@c ------------------- lprint -------------
@node lprint, pmat, allprint, inout_lib
@subsubsection lprint
@cindex lprint
@c ---content lprint---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
lprint(id[,n]); id poly/ideal/vector/module/matrix, n integer

@item @strong{Return:}
string of id in a format fitting into lines of size n, such that no
monomial is destroyed, i.e. the new line starts with + or -;
(default: n = pagewidth).

@item @strong{Note:}
id is printed columnwise, each column separated by a blank line;
hence lprint(transpose(id)); displays a matrix id in a format which
can be used as input.

@end table
@strong{Example:}
@smallexample
@c computed example lprint d2t_singular/inout_lib.doc:86
LIB "inout.lib";
ring r= 0,(x,y,z),ds;
poly f=((x+y)*(x-y)*(x+z)*(y+z)^2);
lprint(f,40);
@expansion{}   x3y2-xy4+2x3yz+x2y2z-2xy3z-y4z+x3z2
@expansion{} +2x2yz2-xy2z2-2y3z2+x2z3-y2z3
module m = [f*(x-y)],[0,f*(x-y)];
string s=lprint(m); s;"";
@expansion{}   x4y2-x3y3-x2y4+xy5+2x4yz-x3y2z-3x2y3z+xy4z+y5z+x4z2+x3yz2-3x2y2z2-xy3z2
@expansion{} +2y4z2+x3z3-x2yz3-xy2z3+y3z3,
@expansion{}   0,
@expansion{}
@expansion{}   0,
@expansion{}   x4y2-x3y3-x2y4+xy5+2x4yz-x3y2z-3x2y3z+xy4z+y5z+x4z2+x3yz2-3x2y2z2-xy3z2
@expansion{} +2y4z2+x3z3-x2yz3-xy2z3+y3z3
@expansion{}
execute("matrix M[2][2]="+s+";");      //use the string s as input
module m1 = transpose(M);	          //should be the same as m
print(m-m1);
@expansion{} 0,0,
@expansion{} 0,0
@c end example lprint d2t_singular/inout_lib.doc:86
@end smallexample
@c ---end content lprint---

@c ------------------- pmat -------------
@node pmat, rMacaulay, lprint, inout_lib
@subsubsection pmat
@cindex pmat
@c ---content pmat---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
pmat(M,[n]); M matrix, n integer

@item @strong{Display:}
display M in array format if it fits into pagewidth; if n is given,
only the first n characters of each column are shown

@item @strong{Return:}
no return value

@end table
@strong{Example:}
@smallexample
@c computed example pmat d2t_singular/inout_lib.doc:121
LIB "inout.lib";
ring r=0,(x,y,z),ls;
ideal i= x,z+3y,x+y,z;
matrix m[3][3]=i^2;
pmat(m);
@expansion{} x2,     xz+3xy,     xy+x2,
@expansion{} xz,     z2+6yz+9y2, yz+3y2+xz+3xy,
@expansion{} z2+3yz, y2+2xy+x2,  yz+xz
pmat(m,3);
@expansion{} x2  xz+ xy+
@expansion{} xz  z2+ yz+
@expansion{} z2+ y2+ yz+
@c end example pmat d2t_singular/inout_lib.doc:121
@end smallexample
@c ---end content pmat---

@c ------------------- rMacaulay -------------
@node rMacaulay, show, pmat, inout_lib
@subsubsection rMacaulay
@cindex rMacaulay
@c ---content rMacaulay---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
rMacaulay(s[,n]); s string, n integer

@item @strong{Return:}
A string which should be readable by Singular if s is a string which
was produced by Macaulay. If a second argument is present the first
n lines of the file are deleted (which is useful if the file was
produced e.g. by the putstd command of Macaulay).

@item @strong{Note:}
This does not always work with 'cut and paste' since the character
\ is treated differently

@end table
@strong{Example:}
@smallexample
@c computed example rMacaulay d2t_singular/inout_lib.doc:156
LIB "inout.lib";
// Assume there exists a file 'Macid' with the following ideal in
// Macaulay format:"
// x[0]3-101/74x[0]2x[1]+7371x[0]x[1]2-13/83x[1]3-x[0]2x[2] \
//     -4/71x[0]x[1]x[2]
// Read this file into Singular and assign it to the string s1 by:
// string s1 = read("Macid");
// This is equivalent to";
string s1 =
"x[0]3-101/74x[0]2x[1]+7371x[0]x[1]2-13/83x[1]3-x[0]2x[2]-4/71x[0]x[1]x[2]";
rMacaulay(s1);
@expansion{} x(0)^3-101/74*x(0)^2*x(1)+7371*x(0)*x(1)^2-13/83*x(1)^3-x(0)^2*x(2)-4/71*\
   x(0)*x(1)*x(2)
// You may wish to assign s1 to a Singular ideal id:
string sid = "ideal id =",rMacaulay(s1),";";
ring r = 0,x(0..3),dp;
execute(sid);
id; "";
@expansion{} id[1]=x(0)^3-101/74*x(0)^2*x(1)+7371*x(0)*x(1)^2-13/83*x(1)^3-x(0)^2*x(2)\
   -4/71*x(0)*x(1)*x(2)
@expansion{}
// Now treat a matrix in Macaulay format. Using the execute
// command, this could be assinged to a Singular matrix as above.
string s2 = "
0  0  0  0  0
a3 0  0  0  0
0  b3 0  0  0
0  0  c3 0  0
0  0  0  d3 0
0  0  0  0  e3 ";
rMacaulay(s2);
@expansion{} 0, 0, 0, 0, 0,
@expansion{} a3,0, 0, 0, 0,
@expansion{} 0, b3,0, 0, 0,
@expansion{} 0, 0, c3,0, 0,
@expansion{} 0, 0, 0, d3,0,
@expansion{} 0, 0, 0, 0, e3
@c end example rMacaulay d2t_singular/inout_lib.doc:156
@end smallexample
@c ---end content rMacaulay---

@c ------------------- show -------------
@node show, showrecursive, rMacaulay, inout_lib
@subsubsection show
@cindex show
@c ---content show---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
show(id); id any object of basering or of type ring/qring
@* show(R,s); R=ring, s=string (s = name of an object belonging to R)

@item @strong{Display:}
display id/s in a compact format together with some information

@item @strong{Return:}
no return value

@item @strong{Note:}
objects of type string, int, intvec, intmat belong to any ring.
id may be a ring or a qring. In this case the minimal polynomial is
displayed, and, for a qring, also the defining ideal.
@*id may be of type list but the list must not contain a ring.
@* show(R,s) does not work inside a procedure!

@end table
@strong{Example:}
@smallexample
@c computed example show d2t_singular/inout_lib.doc:215
LIB "inout.lib";
ring r;
show(r);
@expansion{} // ring: (32003),(x,y,z),(dp(3),C);
@expansion{} // minpoly = 0
@expansion{} // objects belonging to this ring:
ideal i=x^3+y^5-6*z^3,xy,x3-y2;
show(i,3);            // introduce 3 space tabs before information
@expansion{}    // ideal, 3 generator(s)
@expansion{} y5+x3-6z3,
@expansion{} xy,
@expansion{} x3-y2
vector v=x*gen(1)+y*gen(3);
module m=v,2*v+gen(4);
list L = i,v,m;
show(L);
@expansion{} // list, 3 element(s):
@expansion{} [1]:
@expansion{}    // ideal, 3 generator(s)
@expansion{} y5+x3-6z3,
@expansion{} xy,
@expansion{} x3-y2
@expansion{} [2]:
@expansion{}    // vector
@expansion{} [x,0,y]
@expansion{} [3]:
@expansion{}    // module, 2 generator(s)
@expansion{} [x,0,y]
@expansion{} [2x,0,2y,1]
ring S=(0,T),(a,b,c,d),ws(1,2,3,4);
minpoly = T^2+1;
ideal i=a2+b,c2+T^2*d2; i=std(i);
qring Q=i;
show(Q);
@expansion{} // qring: (0,T),(a,b,c,d),(ws(1,2,3,4),C);
@expansion{} // minpoly = (T2+1)
@expansion{} // quotient ring from ideal:
@expansion{} _[1]=a2+b
@expansion{} _[2]=c2-d2
map F=r,a2,b^2,3*c3;
show(F);
@expansion{} // i-th variable of preimage ring is mapped to @@map[i]
@expansion{} // @@map                 [1]  map from r
@expansion{} @@map[1]=a2
@expansion{} @@map[2]=b2
@expansion{} @@map[3]=3*c3
// Apply 'show' to i (which does not belong to the basering) by typing
// ring r; ideal i=xy,x3-y2; ring Q; show(r,"i");
@c end example show d2t_singular/inout_lib.doc:215
@end smallexample
@c ---end content show---

@c ------------------- showrecursive -------------
@node showrecursive, split, show, inout_lib
@subsubsection showrecursive
@cindex showrecursive
@c ---content showrecursive---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
showrecursive(id,p[ord]); id= any object of basering, p= product of
variables and ord=string (any allowed ordstr)

@item @strong{Display:}
display 'id' in a recursive format as a polynomial in the variables
occurring in p with coefficients in the remaining variables. This is
done by mapping to a ring with parameters [and ordering 'ord',
if a 3rd argument is present (default: ord="dp")] and applying
procedure 'show'

@item @strong{Return:}
no return value

@end table
@strong{Example:}
@smallexample
@c computed example showrecursive d2t_singular/inout_lib.doc:263
LIB "inout.lib";
ring r=2,(a,b,c,d,x,y),ds;
poly f=y+ax2+bx3+cx2y2+dxy3;
showrecursive(f,x);
@expansion{} // poly, 4 monomial(s)
@expansion{} (b)*x3+(a+cy2)*x2+(dy3)*x+(y)
showrecursive(f,xy,"lp");
@expansion{} // poly, 5 monomial(s)
@expansion{} (b)*x3+(c)*x2y2+(a)*x2+(d)*xy3+y
@c end example showrecursive d2t_singular/inout_lib.doc:263
@end smallexample
@c ---end content showrecursive---

@c ------------------- split -------------
@node split, tab, showrecursive, inout_lib
@subsubsection split
@cindex split
@c ---content split---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
split(s[,n]); s string, n integer

@item @strong{Return:}
same string, split into lines of length n separated by \
(default: n=pagewidth)

@item @strong{Note:}
may be used in connection with lprint

@end table
@strong{Example:}
@smallexample
@c computed example split d2t_singular/inout_lib.doc:294
LIB "inout.lib";
ring r= 0,(x,y,z),ds;
poly f = (x+y+z)^4;
split(string(f),50);
@expansion{} x4+4x3y+6x2y2+4xy3+y4+4x3z+12x2yz+12xy2z+4y3z+6x\
@expansion{} 2z2+12xyz2+6y2z2+4xz3+4yz3+z4
split(lprint(f));
@expansion{}   x4+4x3y+6x2y2+4xy3+y4+4x3z+12x2yz+12xy2z+4y3z+6x2z2+12xyz2+6y2z2+4xz3+4\
   yz3\
@expansion{} +z4
@c end example split d2t_singular/inout_lib.doc:294
@end smallexample
@c ---end content split---

@c ------------------- tab -------------
@node tab, writelist, split, inout_lib
@subsubsection tab
@cindex tab
@c ---content tab---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
tab(n); n integer

@item @strong{Return:}
string of n space tabs

@end table
@strong{Example:}
@smallexample
@c computed example tab d2t_singular/inout_lib.doc:321
LIB "inout.lib";
for(int n=0; n<=5; n=n+1)
@{ tab(5-n)+"*"+tab(n)+"+"+tab(n)+"*"; @}
@expansion{}      *+*
@expansion{}     * + *
@expansion{}    *  +  *
@expansion{}   *   +   *
@expansion{}  *    +    *
@expansion{} *     +     *
@c end example tab d2t_singular/inout_lib.doc:321
@end smallexample
@c ---end content tab---

@c ------------------- writelist -------------
@node writelist, pause, tab, inout_lib
@subsubsection writelist
@cindex writelist
@c ---content writelist---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
writelist(file,name,L); file,name strings (file-name, list-name),
L a list.

@item @strong{Create:}
a file with name `file`, write the content of the list L into it and
call the list `name`, keeping the list structure

@item @strong{Return:}
no return value

@item @strong{Note:}
The syntax of writelist uses and is similar to the syntax of the
write command of Singular which does not manage lists properly.
If (file,name) = ("listfile","L1"), writelist creates (resp.
appends if listfile exists) a file with name listfile and stores
there the list L under the name L1. The Singular command
execute(read("listfile")); assigns the content of L (stored in
listfile) to a list L1.
@* On a UNIX system, write(">file",...) overwrites an existing file
`file` while write("file",...) and write(">>file",...) append.

@end table
@strong{Example:}
@smallexample
@c computed example writelist d2t_singular/inout_lib.doc:362
LIB "inout.lib";
ring r;
ideal i=x,y,z;
list k="Hi",nameof(basering),i,37;
writelist("zumSpass","lustig",k);
read("zumSpass");
@expansion{} list lustig;
@expansion{}    lustig[1]=
@expansion{} Hi;
@expansion{}    lustig[2]=
@expansion{} r;
@expansion{}    lustig[3]=
@expansion{} x,y,z;
@expansion{}    lustig[4]=
@expansion{} 37;
@expansion{}
list L=res(i,0);                    //resolution of the ideal i
writelist("res_list","res-name",L); "";
@expansion{}
read("res_list");
@expansion{} list res-name;
@expansion{}    res-name[1]=
@expansion{} z,y,x;
@expansion{}    res-name[2]=
@expansion{} -y*gen(1)+z*gen(2),-x*gen(1)+z*gen(3),-x*gen(2)+y*gen(3);
@expansion{}    res-name[3]=
@expansion{} x*gen(1)-y*gen(2)+z*gen(3);
@expansion{}
// execute(read("res_list")); would create a list with name res-name,
// which is the resolution of i (the same content as L)
system("sh","/bin/rm res_list zumSpass");
@expansion{} 0
// Under UNIX, this removes the files 'res_list' and 'zumSpass'
// Type help system; to get more information about the shell escape
// If your operating system does not accept the shell escape, you
// must remove the just created files 'zumSpass' and 'res_list' directly
@c end example writelist d2t_singular/inout_lib.doc:362
@end smallexample
@c ---end content writelist---

@c ------------------- pause -------------
@node pause,, writelist, inout_lib
@subsubsection pause
@cindex pause
@c ---content pause---
Procedure from library @code{inout.lib} (@pxref{inout_lib}).

@table @asis
@item @strong{Usage:}
pause([ prompt ]) prompt string

@item @strong{Return:}
none

@item @strong{Purpose:}
interrupt the execution of commands until user input

@item @strong{Note:}
pause is useful in procedures in connection with printlevel to
interrupt the computation and to display intermediate results.

@end table
@strong{Example:}
@smallexample
@c computed example pause d2t_singular/inout_lib.doc:407
LIB "inout.lib";
// can only be shown interactively, try the following commands:
// pause("press <return> to continue");
// pause();
// In the following pocedure TTT, xxx is printed and the execution of
// TTT is stopped until the return-key is pressed, if printlevel>0.
// xxx may be any result of a previous computation or a comment, etc:
//
// proc TTT
// @{ int pp = printlevel-voice+2;  //pp=0 if printlevel=0 and if TTT is
//    ....                         //not called from another procedure
//    if( pp>0 )
//    @{
//       print( xxx );
//       pause("press <return> to continue");
//    @}
//     ....
// @}
@c end example pause d2t_singular/inout_lib.doc:407
@end smallexample
@c inserted refs from d2t_singular/inout_lib.doc:428
@ifinfo
@menu
See also:
* printlevel::
* read::
@end menu
@end ifinfo
@iftex
@strong{See also:}
@ref{printlevel};
@ref{read}.
@end iftex
@c end inserted refs from d2t_singular/inout_lib.doc:428

@c ---end content pause---


code:
@c ---content LibInfo---
@comment This file was generated by doc2tex.pl from d2t_singular/intprog_lib.doc
@comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/intprog_lib.doc INSTEAD
@c library version: (1.5,2001/02/06)
@c library file: ../Singular/LIB/intprog.lib
@cindex intprog.lib
@cindex intprog_lib
@table @asis
@item @strong{Library:}
intprog.lib
@item @strong{Purpose:}
      Integer Programming with Groebner Basis Methods
@item @strong{Author:}
Christine Theis, email: ctheis@@math.uni-sb.de

@end table

@strong{Procedures:}
@menu
* solve_IP:: procedures for solving Integer Programming problems
@end menu
@c ---end content LibInfo---

@c ------------------- solve_IP -------------
@node solve_IP,,, intprog_lib
@subsubsection solve_IP
@cindex solve_IP
@c ---content solve_IP---
Procedure from library @code{intprog.lib} (@pxref{intprog_lib}).

@table @asis
@item @strong{Usage:}
solve_IP(A,bx,c,alg); A intmat, bx intvec, c intvec, alg string.
solve_IP(A,bx,c,alg); A intmat, bx list of intvec, c intvec,
alg string.
@*solve_IP(A,bx,c,alg,prsv); A intmat, bx intvec, c intvec,
alg string, prsv intvec.
@*solve_IP(A,bx,c,alg,prsv); A intmat, bx list of intvec, c intvec,
alg string, prsv intvec.

@item @strong{Return:}
same type as bx: solution of the associated integer programming
problem(s) as explained in

   @ref{Toric ideals and integer programming}.

@item @strong{Note:}
This procedure returns the solution(s) of the given IP-problem(s)
or the message `not solvable'.
@*One may call the procedure with several different algorithms:
@*- the algorithm of Conti/Traverso (ct),
@*- the positive variant of the algorithm of Conti/Traverso (pct),
@*- the algorithm of Conti/Traverso using elimination (ect),
@*- the algorithm of Pottier (pt),
@*- an algorithm of Bigatti/La Scala/Robbiano (blr),
@*- the algorithm of Hosten/Sturmfels (hs),
@*- the algorithm of DiBiase/Urbanke (du).
The argument `alg' should be the abbreviation for an algorithm as
above: ct, pct, ect, pt, blr, hs or du.

`ct' allows computation of an optimal solution of the IP-problem
directly from the right-hand vector b.
@*The same is true for its `positive' variant `pct' which may only be
applied if A and b have nonnegative entries.
@*All other algorithms need initial solutions of the IP-problem.

If `alg' is chosen to be `ct' or `pct', bx is read as the right hand
vector b of the system Ax=b. b should then be an intvec of size m
where m is the number of rows of A.
@*Furthermore, bx and A should be nonnegative if `pct' is used.
If `alg' is chosen to be `ect',`pt',`blr',`hs' or `du',
bx is read as an initial solution x of the system Ax=b.
bx should then be a nonnegative intvec of size n where n is the
number of columns of A.

If `alg' is chosen to be `blr' or `hs', the algorithm needs a vector
with positive coefficients in the row space of A.
@*If no row of A contains only positive entries, one has to use the
versions of solve_IP which take such a vector prsv as an argument.

solve_IP may also be called with a list bx of intvecs instead of a
single intvec.

@end table
@strong{Example:}
@smallexample
@c computed example solve_IP d2t_singular/intprog_lib.doc:85
LIB "intprog.lib";
// 1. call with single right-hand vector
intmat A[2][3]=1,1,0,0,1,1;
intvec b1=1,1;
intvec c=2,2,1;
intvec solution_vector=solve_IP(A,b1,c,"pct");
solution_vector;"";
@expansion{} 0,1,0
@expansion{}
// 2. call with list of right-hand vectors
intvec b2=-1,1;
list l=b1,b2;
l;
@expansion{} [1]:
@expansion{}    1,1
@expansion{} [2]:
@expansion{}    -1,1
list solution_list=solve_IP(A,l,c,"ct");
solution_list;"";
@expansion{} [1]:
@expansion{}    0,1,0
@expansion{} [2]:
@expansion{}    not solvable
@expansion{}
// 3. call with single initial solution vector
A=2,1,-1,-1,1,2;
b1=3,4,5;
solve_IP(A,b1,c,"du");"";
@expansion{} 0,7,2
@expansion{}
// 4. call with single initial solution vector
//    and algorithm needing a positive row space vector
solution_vector=solve_IP(A,b1,c,"hs");"";
@expansion{} ERROR: The chosen algorithm needs a positive vector in the row space of t\
   he matrix.
@expansion{} 0
@expansion{}
// 5. call with single initial solution vector
//     and positive row space vector
intvec prsv=1,2,1;
solution_vector=solve_IP(A,b1,c,"hs",prsv);
solution_vector;"";
@expansion{} 0,7,2
@expansion{}
// 6. call with list of initial solution vectors
//    and positive row space vector
b2=7,8,0;
l=b1,b2;
l;
@expansion{} [1]:
@expansion{}    3,4,5
@expansion{} [2]:
@expansion{}    7,8,0
solution_list=solve_IP(A,l,c,"blr",prsv);
solution_list;
@expansion{} [1]:
@expansion{}    0,7,2
@expansion{} [2]:
@expansion{}    7,8,0
@c end example solve_IP d2t_singular/intprog_lib.doc:85
@end smallexample
@c inserted refs from d2t_singular/intprog_lib.doc:120
@ifinfo
@menu
See also:
* Integer programming::
* intprog_lib::
* toric_lib::
@end menu
@end ifinfo
@iftex
@strong{See also:}
@ref{Integer programming};
@ref{intprog_lib};
@ref{toric_lib}.
@end iftex
@c end inserted refs from d2t_singular/intprog_lib.doc:120

@c ---end content solve_IP---


code:
@c ---content LibInfo---
@comment This file was generated by doc2tex.pl from d2t_singular/latex_lib.doc
@comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/latex_lib.doc INSTEAD
@c library version: (1.19.2.1,2002/02/20)
@c library file: ../Singular/LIB/latex.lib
@cindex latex.lib
@cindex latex_lib
@table @asis
@item @strong{Library:}
latex.lib
@item @strong{Purpose:}
    Typesetting of Singular-Objects in LaTeX2e
@item @strong{Author:}
Christian Gorzel, gorzelc@@math.uni-muenster.de

@end table

@strong{Procedures:}
@menu
* closetex:: writes closing line for LaTeX-document
* opentex:: writes header for LaTeX-file fnm
* tex:: calls LaTeX2e for LaTeX-file fnm
* texdemo:: produces a file explaining the features of this lib
* texfactorize:: creates string in LaTeX-format for factors of poly f
* texmap:: creates string in LaTeX-format for map m:r1->r2
* texname:: creates string in LaTeX-format for identifier
* texobj:: creates string in LaTeX-format for any (basic) type
* texpoly:: creates string in LaTeX-format for poly
* texproc:: creates string in LaTeX-format of text from proc p
* texring:: creates string in LaTeX-format for ring/qring
* rmx:: removes .aux and .log files of LaTeX-files
* xdvi:: calls xdvi for dvi-files
@end menu
@table @asis
@item @strong{Global variables:}
TeXwidth, TeXnofrac, TeXbrack, TeXproj, TeXaligned, TeXreplace, NoDollars
are used to control the typesetting.
Call @code{texdemo();} to obtain a LaTeX2e file @code{texlibdemo.tex}
explaining the features of @code{latex.lib} and its global variables.
@format
  @code{TeXwidth} (int) -1, 0, 1..9, >9:  controls breaking of long polynomials
  @code{TeXnofrac} (int) flag:  write 1/2 instead of \frac@{1@}@{2@}
  @code{TeXbrack} (string) "@{", "(", "<", "|", empty string:
                                   controls brackets around ideals and matrices
  @code{TeXproj} (int) flag:  write ":" instead of "," in vectors
  @code{TeXaligned} (int) flag:  write maps (and ideals) aligned
  @code{TeXreplace} (list) list entries = 2 strings:  replacing symbols
  @code{NoDollars} (int) flag:  suppresses surrounding $ signs
@end format

@end table
@c ---end content LibInfo---

@c ------------------- closetex -------------
@node closetex, opentex,, latex_lib
@subsubsection closetex
@cindex closetex
@c ---content closetex---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
closetex(fname); fname string

@item @strong{Return:}
nothing; writes a LaTeX2e closing line into file @code{<fname>}.

@item @strong{Note:}
preceding ">>" are deleted and suffix ".tex" (if not given)
is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example closetex d2t_singular/latex_lib.doc:73
LIB "latex.lib";
opentex("exmpl");
texobj("exmpl","@{\\large \\bf hello@}");
closetex("exmpl");
@c end example closetex d2t_singular/latex_lib.doc:73
@end smallexample
@c ---end content closetex---

@c ------------------- opentex -------------
@node opentex, tex, closetex, latex_lib
@subsubsection opentex
@cindex opentex
@c ---content opentex---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
opentex(fname); fname string

@item @strong{Return:}
nothing; writes a LaTeX2e header into a new file @code{<fname>}.

@item @strong{Note:}
preceding ">>" are deleted and suffix ".tex" (if not given)
is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example opentex d2t_singular/latex_lib.doc:103
LIB "latex.lib";
opentex("exmpl");
texobj("exmpl","hello");
closetex("exmpl");
@c end example opentex d2t_singular/latex_lib.doc:103
@end smallexample
@c ---end content opentex---

@c ------------------- tex -------------
@node tex, texdemo, opentex, latex_lib
@subsubsection tex
@cindex tex
@c ---content tex---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
tex(fname); fname string

@item @strong{Return:}
nothing; calls latex (LaTeX2e) for compiling the file fname

@item @strong{Note:}
preceding ">>" are deleted and suffix ".tex" (if not given)
is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example tex d2t_singular/latex_lib.doc:133
LIB "latex.lib";
ring r;
ideal I = maxideal(7);
opentex("exp001");              // open latex2e document
texobj("exp001","An ideal ",I);
closetex("exp001");
tex("exp001");
@expansion{} calling  latex2e  for : exp001.tex
@expansion{}
@expansion{} This is TeX, Version 3.14159 (Web2C 7.3.1)
@expansion{} (exp001.tex
@expansion{} LaTeX2e <1998/12/01> patch level 1
@expansion{} Babel <v3.6x> and hyphenation patterns for american, french, german, nger\
   man, i
@expansion{} talian, nohyphenation, loaded.
@expansion{} (/usr/share/texmf/tex/latex/base/article.cls
@expansion{} Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
@expansion{} (/usr/share/texmf/tex/latex/base/size10.clo))
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsmath.sty
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amstext.sty
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsgen.sty))
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsbsy.sty)
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsopn.sty))
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
@expansion{} No file exp001.aux.
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsa.fd)
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsb.fd) [1] (exp001.aux) )
@expansion{} Output written on exp001.dvi (1 page, 2912 bytes).
@expansion{} Transcript written on exp001.log.
system("sh","rm exp001.*");
@expansion{} 0
@c end example tex d2t_singular/latex_lib.doc:133
@end smallexample
@c ---end content tex---

@c ------------------- texdemo -------------
@node texdemo, texfactorize, tex, latex_lib
@subsubsection texdemo
@cindex texdemo
@c ---content texdemo---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texdemo();

@item @strong{Return:}
nothing; generates a LaTeX2e file called @code{texlibdemo.tex}
explaining the features of @code{latex.lib} and its global variables.

@item @strong{Note:}
this proc may take some time.

@end table
@c ---end content texdemo---

@c ------------------- texfactorize -------------
@node texfactorize, texmap, texdemo, latex_lib
@subsubsection texfactorize
@cindex texfactorize
@c ---content texfactorize---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texfactorize(fname,f); fname string, f poly

@item @strong{Return:}
if @code{fname=""}: string, f as a product of its irreducible
factors@*
otherwise: append this string to the file @code{<fname>}, and
return nothing.

@item @strong{Note:}
preceding ">>" are deleted and suffix ".tex" (if not given)
is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example texfactorize d2t_singular/latex_lib.doc:191
LIB "latex.lib";
ring r2 = 13,(x,y),dp;
poly f = (x+1+y)^2*x3y*(2x-2y)*y12;
texfactorize("",f);
@expansion{} $-2\cdot x^@{3@}\cdot y^@{13@}\cdot (-x+y)\cdot (x+y+1)^@{2@}$
ring R49 = (7,a),x,dp;
minpoly = a2+a+3;
poly f = (a24x5+x3)*a2x6*(x+1)^2;
f;
@expansion{} (a+3)*x13+(2a-1)*x12+(-2a+1)*x10+(-a-3)*x9
texfactorize("",f);
@expansion{} $(a+3)\cdot (x-1)\cdot (x+1)^@{3@}\cdot x^@{9@}$
@c end example texfactorize d2t_singular/latex_lib.doc:191
@end smallexample
@c ---end content texfactorize---

@c ------------------- texmap -------------
@node texmap, texname, texfactorize, latex_lib
@subsubsection texmap
@cindex texmap
@c ---content texmap---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texmap(fname,m,@@r1,@@r2); fname string, m string/map, @@r1,@@r2 rings

@item @strong{Return:}
if @code{fname=""}: string, the map m from @@r1 to @@r2 (preceded
by its name if m = string) in TeX-typesetting;@*
otherwise: append this string to the file @code{<fname>}, and
return nothing.

@item @strong{Note:}
preceding ">>" are deleted in @code{fname}, and suffix ".tex"
(if not given) is added to @code{fname}.
If m is a string then it has to be the name of an existing map
from @@r1 to @@r2.

@end table
@strong{Example:}
@smallexample
@c computed example texmap d2t_singular/latex_lib.doc:231
LIB "latex.lib";
// -------- prepare for example ---------
if (defined(TeXaligned)) @{int Teali=TeXaligned; kill TeXaligned;@}
if (defined(TeXreplace)) @{list Terep=TeXreplace; kill TeXreplace;@}
// -------- the example starts here ---------
//
string fname = "tldemo";
ring @@r1=0,(x,y,z),dp;
if(system("with","Namespaces")) @{ exportto(Current, @@r1); @}
else @{ export @@r1; @}
@expansion{} // ** `@@r1` is already global
ring r2=0,(u,v),dp;
map @@phi =(@@r1,u2,uv -v,v2); export @@phi;
@expansion{} // ** `@@phi` is already global
list TeXreplace;
TeXreplace[1] = list("@@phi","\\phi");    // @@phi --> \phi
export TeXreplace;
@expansion{} // ** `TeXreplace` is already global
texmap("","@@phi",@@r1,r2);                // standard form
@expansion{} $$
@expansion{} \begin@{array@}@{rcc@}
@expansion{} \phi:\Q[x,y,z] & \longrightarrow & \Q[u,v]\\[2mm]
@expansion{} \left(x,y,z\right) & \longmapsto &
@expansion{}  \left(
@expansion{} \begin@{array@}@{c@}
@expansion{} u^@{2@}\\
@expansion{} uv-v\\
@expansion{} v^@{2@}
@expansion{} \end@{array@}
@expansion{} \right)
@expansion{} \end@{array@}
@expansion{} $$
//
int TeXaligned; export TeXaligned;       // map in one line
@expansion{} // ** `TeXaligned` is already global
texmap("",@@phi,@@r1,r2);
@expansion{} $\Q[x,y,z]\longrightarrow\Q[u,v], \ \left(x,y,z\right)\longmapsto \left(u\
   ^@{2@},uv-v,v^@{2@}\right)$
//
kill @@r1,TeXreplace,TeXaligned;
//
// --- restore global variables if previously defined ---
if (defined(Teali)) @{int TeXaligned=Teali; export TeXaligned; kill Teali;@}
if (defined(Terep)) @{list TeXreplace=Terep; export TeXreplace; kill Terep;@}
@c end example texmap d2t_singular/latex_lib.doc:231
@end smallexample
@c ---end content texmap---

@c ------------------- texname -------------
@node texname, texobj, texmap, latex_lib
@subsubsection texname
@cindex texname
@c ---content texname---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texname(fname,s); fname,s strings

@item @strong{Return:}
if @code{fname=""}: string, the transformed string s, where the
following rules apply:
@smallexample
      s' + "~"             -->  "\\tilde@{"+ s' +"@}"
     "_" + int             -->       "_@{" + int +"@}"
  "[" + s' + "]"           -->      "_@{" + s' + "@}"
   "A..Z" + int            --> "A..Z" + "^@{" + int + "@}"
   "a..z" + int            --> "a..z" + "_@{" + int + "@}"
"(" + int + "," + s' + ")" --> "_@{"+ int +"@}" + "^@{" + s'+"@}"
@end smallexample
Anyhow, strings which begin with a @code{"@{"} are only changed
by deleting the first and last character (intended to remove the
surrounding curly brackets).

if @code{fname!=""}: append the transformed string s to the file
@code{<fname>}, and return nothing.

@item @strong{Note:}
preceding ">>" are deleted in @code{fname}, and suffix ".tex"
(if not given) is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example texname d2t_singular/latex_lib.doc:297
LIB "latex.lib";
ring r = 0,(x,y),lp;
poly f = 3xy4 + 2xy2 + x5y3 + x + y6;
texname("","@{f(10)@}");
@expansion{} f(10)
texname("","f(10) =");
@expansion{} f_@{10@} =
texname("","n1");
@expansion{} n_@{1@}
texname("","T1_12");
@expansion{} T^@{1@}_@{12@}
texname("","g'_11");
@expansion{} g'_@{11@}
texname("","f23");
@expansion{} f_@{23@}
texname("","M[2,3]");
@expansion{} M_@{2,3@}
texname("","A(0,3);");
@expansion{} A_@{0@}^@{3@};
texname("","E~(3)");
@expansion{} \tilde@{E@}_@{3@}
@c end example texname d2t_singular/latex_lib.doc:297
@end smallexample
@c ---end content texname---

@c ------------------- texobj -------------
@node texobj, texpoly, texname, latex_lib
@subsubsection texobj
@cindex texobj
@c ---content texobj---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texobj(fname,l); fname string, l list

@item @strong{Return:}
if @code{fname=""}: string, the entries of l in LaTeX-typesetting;@*
otherwise: append this string to the file @code{<fname>}, and
return nothing.

@item @strong{Note:}
preceding ">>" are deleted in @code{fname}, and suffix ".tex"
(if not given) is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example texobj d2t_singular/latex_lib.doc:337
LIB "latex.lib";
// -------- prepare for example ---------
if (defined(TeXaligned)) @{int Teali=TeXaligned; kill TeXaligned;@}
if (defined(TeXbrack))@{string Tebra=TeXbrack; kill TeXbrack;@}
//
//  --------------  typesetting for polynomials ----------
ring r = 0,(x,y),lp;
poly f = x5y3 + 3xy4 + 2xy2 + y6;
f;
@expansion{} x5y3+3xy4+2xy2+y6
texobj("",f);
@expansion{} $$\begin@{array@}@{rl@}
@expansion{} & x^@{5@}y^@{3@}+3xy^@{4@}+2xy^@{2@}+y^@{6@}\\
@expansion{} \end@{array@}
@expansion{} $$
@expansion{}
//  --------------  typesetting for ideals ----------
ideal G = jacob(f);
G;
@expansion{} G[1]=5x4y3+3y4+2y2
@expansion{} G[2]=3x5y2+12xy3+4xy+6y5
texobj("",G);
@expansion{} $$\left(
@expansion{} \begin@{array@}@{c@}
@expansion{} 5x^@{4@}y^@{3@}+3y^@{4@}+2y^@{2@}, \\
@expansion{} 3x^@{5@}y^@{2@}+12xy^@{3@}+4xy+6y^@{5@}
@expansion{} \end@{array@}
@expansion{} \right)$$
@expansion{}
//  --------------  variation of typesetting for ideals ----------
int TeXaligned = 1; export TeXaligned;
@expansion{} // ** `TeXaligned` is already global
string TeXbrack = "<"; export TeXbrack;
@expansion{} // ** `TeXbrack` is already global
texobj("",G);
@expansion{} $\left<5x^@{4@}y^@{3@}+3y^@{4@}+2y^@{2@},3x^@{5@}y^@{2@}+12xy^@{3@}+4xy+6y^@{5@}\right>$
@expansion{}
kill TeXaligned, TeXbrack;
//  --------------  typesetting for matrices ----------
matrix J = jacob(G);
texobj("",J);
@expansion{} $$\left(
@expansion{} \begin@{array@}@{*@{2@}@{c@}@}
@expansion{} 20x^@{3@}y^@{3@} & 15x^@{4@}y^@{2@}+12y^@{3@}+4y \\
@expansion{} 15x^@{4@}y^@{2@}+12y^@{3@}+4y & 6x^@{5@}y+36xy^@{2@}+4x+30y^@{4@}
@expansion{} \end@{array@}
@expansion{} \right)
@expansion{} $$
@expansion{}
//  --------------  typesetting for intmats ----------
intmat m[3][4] = 9,2,4,5,2,5,-2,4,-6,10,-1,2,7;
texobj("",m);
@expansion{} $$\left(
@expansion{} \begin@{array@}@{*@{4@}@{r@}@}
@expansion{} 9 & 2 & 4 & 5\\
@expansion{} 2 & 5 & -2 & 4\\
@expansion{} -6 & 10 & -1 & 2
@expansion{} \end@{array@}
@expansion{} \right)
@expansion{} $$
@expansion{}
//
// --- restore global variables if previously defined ---
if (defined(Teali))@{int TeXaligned=Teali; export TeXaligned; kill Teali;@}
if (defined(Tebra))@{string TeXbrack=Tebra; export TeXbrack; kill Tebra;@}
@c end example texobj d2t_singular/latex_lib.doc:337
@end smallexample
@c ---end content texobj---

@c ------------------- texpoly -------------
@node texpoly, texproc, texobj, latex_lib
@subsubsection texpoly
@cindex texpoly
@c ---content texpoly---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texpoly(fname,p); fname string, p poly

@item @strong{Return:}
if @code{fname=""}: string, the poly p in LaTeX-typesetting;@*
otherwise: append this string to the file @code{<fname>}, and
return nothing.

@item @strong{Note:}
preceding ">>" are deleted in @code{fname}, and suffix ".tex"
(if not given) is added to @code{fname}.

@end table
@strong{Example:}
@smallexample
@c computed example texpoly d2t_singular/latex_lib.doc:394
LIB "latex.lib";
ring r0=0,(x,y,z),dp;
poly f = -1x^2 + 2;
texpoly("",f);
@expansion{} $-x^@{2@}+2$
ring rr= real,(x,y,z),dp;
texpoly("",2x2y23z);
@expansion{} $2.000x^@{2@}y^@{23@}z$
ring r7= 7,(x,y,z),dp;
poly f = 2x2y23z;
texpoly("",f);
@expansion{} $2x^@{2@}y^@{23@}z$
ring rab =(0,a,b),(x,y,z),dp;
poly f = (-2a2 +b3 -2)/a * x2y4z5 + (a2+1)*x + a+1;
f;
@expansion{} (-2a2+b3-2)/(a)*x2y4z5+(a2+1)*x+(a+1)
texpoly("",f);
@expansion{} $-\frac@{2a^@{2@}-b^@{3@}+2@}@{a@}x^@{2@}y^@{4@}z^@{5@}+(a^@{2@}+1)x+(a+1)$
@c end example texpoly d2t_singular/latex_lib.doc:394
@end smallexample
@c ---end content texpoly---

@c ------------------- texproc -------------
@node texproc, texring, texpoly, latex_lib
@subsubsection texproc
@cindex texproc
@c ---content texproc---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texproc(fname,pname); fname,pname strings

@item @strong{Assume:}
@code{`pname`} is a procedure.

@item @strong{Return:}
if @code{fname=""}: string, the proc @code{`pname`} in a verbatim
environment in LaTeX-typesetting;@*
otherwise: append this string to the file @code{<fname>}, and
return nothing.

@item @strong{Note:}
preceding ">>" are deleted in @code{fname}, and suffix ".tex"
(if not given) is added to @code{fname}.@*
@code{texproc} cannot be applied to itself correctly.

@end table
@strong{Example:}
@smallexample
@c computed example texproc d2t_singular/latex_lib.doc:440
LIB "latex.lib";
proc exp(int i,int j,list #)
@{ string s;
if (size(#))
@{
for(i;i<=j;i++)
@{ s = s + string(j) + string(#); @}
@}
return(s);
@}
export exp;
@expansion{} // ** `exp` is already global
texproc("","exp");
@expansion{} \begin@{verbatim@}
@expansion{} proc exp(int i,int j,list #)
@expansion{} @{
@expansion{}  string s;
@expansion{} if (size(#))
@expansion{} @{
@expansion{} for(i;i<=j;i++)
@expansion{} @{ s = s + string(j) + string(#); @}
@expansion{} @}
@expansion{} return(s);
@expansion{}
@expansion{} @}
@expansion{} \end@{verbatim@}
@expansion{}
kill exp;
@c end example texproc d2t_singular/latex_lib.doc:440
@end smallexample
@c ---end content texproc---

@c ------------------- texring -------------
@node texring, rmx, texproc, latex_lib
@subsubsection texring
@cindex texring
@c ---content texring---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
texring(fname, r[,L]); fname string, r ring, L list

@item @strong{Return:}
if @code{fname=""}: string, the ring in TeX-typesetting;@*
otherwise: append this string to the file @code{<fname>} and
return nothing.

@item @strong{Note:}
preceding ">>" are deleted and suffix ".tex" (if not given)
is added to @code{fname}.@*
The optional list L is assumed to be a list of strings which control,
e.g., the symbol for the field of coefficients.@*
For more details call @code{texdemo();} (generates a LaTeX2e
file called @code{texlibdemo.tex} which explains all features of
@code{texring}).

@end table
@strong{Example:}
@smallexample
@c computed example texring d2t_singular/latex_lib.doc:486
LIB "latex.lib";
ring r0 = 0,(x,y),dp;                // char = 0, polynomial ordering
texring("",r0);
@expansion{} $\Q[x,y]$
//
ring r7 =7,(x(0..2)),ds;             // char = 7, local ordering
texring("",r7);
@expansion{} $\Z_@{7@}[[x_@{0@},x_@{1@},x_@{2@}]]$
//
ring r1 = 0,(x1,x2,y1,y2),wp(1,2,3,4);
texring("",r1);
@expansion{} $\Q[x_@{1@},x_@{2@},y_@{1@},y_@{2@}]$
//
ring rr = real,(x),dp;               // real numbers
texring("",rr);
@expansion{} $\R[x]$
//
ring rabc =(0,t1,t2,t3),(x,y),dp;    // ring with parameters
texring("",rabc);
@expansion{} $\Q(t_@{1@},t_@{2@},t_@{3@})[x,y]$
//
ring ralg = (7,a),(x1,x2),ds;        // algebraic extension
minpoly = a2-a+3;
texring("",ralg);
@expansion{} $\Z_@{7@}(a)[[x_@{1@},x_@{2@}]]$
texring("",ralg,"mipo");
@expansion{} $\Z_@{7@}(a)/(a^@{2@}-a+3)[[x_@{1@},x_@{2@}]]$
//
ring r49=(49,a),x,dp;                // Galois field
texring("",r49);
@expansion{} $\F_@{49@}[x]$
//
setring r0;                          // quotient ring
ideal i = x2-y3;
qring q = std(i);
texring("",q);
@expansion{} $\Q[x,y]/\left(y^@{3@}-x^@{2@}\right)
@expansion{} $
//
// ------------------ additional features -------------------
ring r9 =0,(x(0..9)),ds;
texring("",r9,1);
@expansion{} $\Q[[x_@{0@},\ldots,x_@{9@}]]$
texring("",r9,"C","@{","^G");
@expansion{} $\C\@{x_@{0@},x_@{1@},x_@{2@},x_@{3@},x_@{4@},x_@{5@},x_@{6@},x_@{7@},x_@{8@},x_@{9@}\@}^G$
//
ring rxy = 0,(x(1..5),y(1..6)),ds;
intvec v = 5,6;
texring("",rxy,v);
@expansion{} $\Q[[x_@{1@},\ldots,x_@{5@},y_@{1@},\ldots,y_@{6@}]]$
@c end example texring d2t_singular/latex_lib.doc:486
@end smallexample
@c ---end content texring---

@c ------------------- rmx -------------
@node rmx, xdvi, texring, latex_lib
@subsubsection rmx
@cindex rmx
@c ---content rmx---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
rmx(fname); fname string

@item @strong{Return:}
nothing; removes the @code{.log} and @code{.aux} files associated to
the LaTeX file <fname>.@*

@item @strong{Note:}
If @code{fname} ends by @code{".dvi"} or @code{".tex"}, the
@code{.dvi} or @code{.tex} file will be deleted, too.

@end table
@strong{Example:}
@smallexample
@c computed example rmx d2t_singular/latex_lib.doc:550
LIB "latex.lib";
ring r;
poly f = x+y+z;
opentex("exp001");              // defaulted latex2e document
texobj("exp001","A polynom",f);
closetex("exp001");
tex("exp001");
@expansion{} calling  latex2e  for : exp001.tex
@expansion{}
@expansion{} This is TeX, Version 3.14159 (Web2C 7.3.1)
@expansion{} (exp001.tex
@expansion{} LaTeX2e <1998/12/01> patch level 1
@expansion{} Babel <v3.6x> and hyphenation patterns for american, french, german, nger\
   man, i
@expansion{} talian, nohyphenation, loaded.
@expansion{} (/usr/share/texmf/tex/latex/base/article.cls
@expansion{} Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
@expansion{} (/usr/share/texmf/tex/latex/base/size10.clo))
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsmath.sty
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amstext.sty
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsgen.sty))
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsbsy.sty)
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsopn.sty))
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
@expansion{} No file exp001.aux.
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsa.fd)
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsb.fd) [1] (exp001.aux) )
@expansion{} Output written on exp001.dvi (1 page, 308 bytes).
@expansion{} Transcript written on exp001.log.
rmx("exp001");   // removes aux and log file of exp001
system("sh","rm exp001.*");
@expansion{} 0
@c end example rmx d2t_singular/latex_lib.doc:550
@end smallexample
@c ---end content rmx---

@c ------------------- xdvi -------------
@node xdvi,, rmx, latex_lib
@subsubsection xdvi
@cindex xdvi
@c ---content xdvi---
Procedure from library @code{latex.lib} (@pxref{latex_lib}).

@table @asis
@item @strong{Usage:}
xdvi(fname[,style]); fname,style = string

@item @strong{Return:}
nothing; displays dvi-file fname.dvi with previewer xdvi

@item @strong{Note:}
ending .dvi may miss in fname
@*style overwrites the default setting xdvi

@end table
@strong{Example:}
@smallexample
@c computed example xdvi d2t_singular/latex_lib.doc:585
LIB "latex.lib";
intmat m[3][4] = 9,2,4,5,2,5,-2,4,-6,10,-1,2,7;
opentex("exp001");
texobj("exp001","An intmat:  ",m);
closetex("exp001");
tex("exp001");
@expansion{} calling  latex2e  for : exp001.tex
@expansion{}
@expansion{} This is TeX, Version 3.14159 (Web2C 7.3.1)
@expansion{} (exp001.tex
@expansion{} LaTeX2e <1998/12/01> patch level 1
@expansion{} Babel <v3.6x> and hyphenation patterns for american, french, german, nger\
   man, i
@expansion{} talian, nohyphenation, loaded.
@expansion{} (/usr/share/texmf/tex/latex/base/article.cls
@expansion{} Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
@expansion{} (/usr/share/texmf/tex/latex/base/size10.clo))
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsmath.sty
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amstext.sty
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsgen.sty))
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsbsy.sty)
@expansion{} (/usr/share/texmf/tex/latex/amslatex/amsopn.sty))
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
@expansion{} No file exp001.aux.
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsa.fd)
@expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsb.fd) [1] (exp001.aux) )
@expansion{} Output written on exp001.dvi (1 page, 524 bytes).
@expansion{} Transcript written on exp001.log.
xdvi("exp001");
@expansion{} calling  xdvi  for : exp001
@expansion{}
system("sh","rm exp001.*");
@expansion{} 0
@c end example xdvi d2t_singular/latex_lib.doc:585
@end smallexample
@c ---end content xdvi---