# Singular

##### 7.7.1.0. bitrinity
Procedure from library bimodules.lib (see bimodules_lib).

Usage:
bitrinity(M); M is (two-sided) ideal/module

Return:
ring, the enveloping algebra of the basering, with objects in it. additionally it exports a list L = Coeff, Bisyz.

Theory:
Let psi_s be the epimorphism of left R (X) R^{opp} modules:
psi_s(s (X)_K t) = smt := (s_1 m t_1, ... , s_s m t_s) = (\psi(s_1 (X) t_1) , \dots , psi(s_s (X) t_s)) in R^s.
Then psi_s(A) := (psi_s(a_{ij})) for every matrix A in Mat(n x m, R)$. For a two-sided ideal I = < f_1, ... , f_j> with Groebner basis G = {g_1, ... , g_k} in R, Coeff is the Coefficient-Matrix and BiSyz a bisyzygy matrix. Let C be the submatrix of Coeff, where C is Coeff without the first row. Then (g_1,...,g_k) = psi_s(C^T * (f_1 ... f_j)^T) and (0,...,0) = psi_s(BiSyz^T * (f_1 ... f_j)^T). The first row of Coeff (G_1 ... G_n)$ corresponds to the image of the Groebner basis of I: psi_s((G_1 ... G_n)) = G = {g_1 ... g_k }.
For a (R,R)-bimodule M with Groebner basis G = {g_1, ... , g_k} in R^r, Coeff is the coefficient matrix and BiSyz a bisyzygy matrix.
Let C be the submatrix of Coeff, where C is Coeff without the first r rows. Then (g_1 ... g_k) = psi_s(C^T * (f_1 ... f_j)^T) and (0 ... 0) = psi_s(BiSyz^T * (f_1 ... f_j)^T).
The first r rows of Coeff = (G_1 ... G_n) (Here G_i denotes to the i-th column of the first r rows) corresponds to the image of the Groebner basis of M: psi_s((G_1 ... G_n)) = G = {g_1 ... g_k}.

Purpose:
This procedure returns a coefficient matrix in the enveloping algebra of the basering R, that gives implicitly the two-sided Groebner basis of a (R,R)-bimodule M and the coefficients that produce the Groebner basis with the help of the originally used generators of M. Additionally it calculates the bisyzygies of M as left-module of the enveloping algebra of R.

Auxiliary procedures:
Note:
To get list L = Coeff, BiSyz, we set: def G = bitrinity(); setring G; L; or \$L[1]; L[2];.

Example:
 LIB "bimodules.lib"; ring r = 0,(x,s),dp; def R = nc_algebra(1,s); setring R; // 1st shift algebra poly f = x*s + s^2; // only one generator ideal I = f; // note, two sided Groebner basis of I is xs, s^2 def G = bitrinity(I); setring G; print(L[1]); // Coeff ==> SX, S2, ==> -s+S+1,s-S //the first row shows the Groebnerbasis of I consists of // psi_s(SX) = xs , phi(S^2) = s^2: // remember phi(a (X) b - c (X) d) = psi_s(a (X) b) - phi(c (X) d) := ab - cd in R. // psi_s((-s+S+1)*(x*s + s^2)) = psi_s(-xs2-s3+xsS+xs+s2S) // = -xs^2-s^3+xs^2+xs+s^3 = xs // psi_s((s-S)*(x*s + s^2)) = psi_s(xs2+s3-xsS-s2S+s2) = s^2 print(L[2]); //Bisyzygies ==> x+s-X-S+1,sX+sS-2s-SX-S2,x2-2sS+s-X2+2S2+2X+S-1,s2-2sS+S2 // e.g. psi_s((x2-2sS+s-X2+2S2+2X+S-1)(x*s + s^2)) // = psi_s(x3s+x2s2-2xs2S+xs2-2s3S+s3-xsX2+2xsS2+2xsX+xsS-xs-s2X2+2s2S2+2s2X-s2S) // = x^3s+x^2s^2-2xs^3+xs^2-2s^4+s^3-xsx^2+2xs^3+2xsx+xs^2-xs-s^2x^2+2s^4+2s^2x-s^3 // = 0 in R