# Singular          #### 7.10.4.4 lpDivision

Procedure from library freegb.lib (see freegb_lib).

Usage:
lpDivision(p,G); poly p, ideal G

Purpose:
compute a two-sided division with remainder of p wrt G; two-sided noncommutative analogue of the procedure division

Assume:
G = {g1,...,gN} is a Groebner basis, the original ring of the Letterplace ring has the name 'r' and no variable is called 'tag_i' for i in 1...N

Return:
list L

Note:
- L is NF(p,I)
- L is the list of expressions [i,l_(ij),r_(ij)] with \sum_(i,j) l_(ij) g_i r_(ij) = p - NF(p,I) - procedure lpGBPres2Poly, applied to L, reconstructs p

Example:
 LIB "freegb.lib"; ring r = 0,(x,y),dp; def R = freeAlgebra(r, 4); setring R; ideal I = x*x + y*y - 1; // 2D sphere ideal J = letplaceGBasis(I); // compute a Letterplace Groebner basis J; // it is finite and nice ==> J=x*x+y*y-1 ==> J=y*y*x-x*y*y poly h = x*x*y-y*x*x+x*y; lpDivision(h,J); // what means that the NF of h wrt J is x*y ==> : ==> x*y ==> : ==> : ==> : ==> 1 ==> : ==> 1 ==> : ==> y ==> : ==> : ==> 1 ==> : ==> -y ==> : ==> 1 h - lpNF(h,J); // and this poly has the folowing two-sided Groebner presentation: ==> -y*x*x+x*x*y -y*J + J*y; ==> -y*x*x+x*x*y 

### Misc 