catdef.spad line 413 [edit on github]
A constructive euclidean domain, i.e. one can divide producing a quotient and a remainder where the remainder is either zero or is smaller (euclideanSize) than the divisor. Conditional attributes: multiplicativeValuationSize(a*b)=Size(a)*Size(b)
additiveValuationSize(a*b)=Size(a)+Size(b)
divide(x, y)
divides x
by y
producing a record containing a quotient
and remainder
, where the remainder is smaller (see sizeLess?) than the divisor y
.
euclideanSize(x)
returns the euclidean size of the element x
. Error: if x
is zero.
extendedEuclidean(x, y)
returns a record rec where rec.coef1*x+rec.coef2*y = rec.generator
and rec.generator is a gcd
of x
and y
. The gcd
is unique only up to associates if canonicalUnitNormal is not asserted. principalIdeal provides a version of this operation which accepts an arbitrary length list of arguments.
extendedEuclidean(x, y, z)
either returns a record rec where rec.coef1*x+rec.coef2*y=z
or returns "failed" if z
cannot be expressed as a linear combination of x
and y
.
multiEuclidean([f1, ..., fn], z)
returns a list of coefficients [a1, ..., an]
such that z / prod
. If no such list of coefficients exists, "failed" is returned.fi
= sum aj/fj
x quo y
is the same as divide(x, y).quotient
. See divide.
x rem y
is the same as divide(x, y).remainder
. See divide.
sizeLess?(x, y)
tests whether x
is strictly smaller than y
with respect to the euclideanSize. Note: zero is considered smaller than every nonzero element.
Algebra(%)
RightModule(%)
LeftModule(%)
Module(%)
BiModule(%, %)