up previous next
DivAlg

division algorithm

Syntax
DivAlg(X: RINGELEM, L: LIST of RINGELEM): RECORD
DivAlg(X: MODULEELEM, L: LIST of MODULEELEM): RECORD

Description
This function performs the division algorithm on X with respect to L. It returns a record with two fields: Quotients holding a list of polynomials, and Remainder holding the remainder of X upon division by L.

Example
/**/  use R ::= QQ[x,y,z];
/**/  F := x^2*y +x*y^2 +y^2;
/**/  L := [x*y-1, y^2-1];
/**/  DivAlg(F, L);
record[quotients := [x +y, 1], remainder := x +y +1]

/**/  D := It;
/**/  D.quotients;
[x +y, 1]
/**/  D.remainder;
x +y + 1
/**/  ScalarProduct(D.quotients, L) + D.remainder = F;
true

/**/  R2 := NewFreeModule(R,2);
/**/  V := ModuleElem(R2, [x^2+y^2+z^2, x*y*z]);
/**/  L := gens(SubmoduleRows(R2, mat([[x,y], [y,z], [z,x]])));
/**/  D := DivAlg(V, L);
/**/  indent(D);
record[
  quotients := [x, -z^2 +y +z, y*z -y],
  remainder := [z^2, z^3 -y*z -z^2]
]
/**/ sum([D.quotients[i]*L[i] | i in 1..len(L)]) + D.remainder;
[x^2 +y^2 +z^2, x*y*z]

See Also