EuclideanDomain¶
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: multiplicativeValuation Size(a*b)=Size(a)*Size(b)
additiveValuation Size(a*b)=Size(a)+Size(b)
- 0: %
from AbelianMonoid
- 1: %
from MagmaWithUnit
- *: (%, %) -> %
from Magma
- *: (Integer, %) -> %
from AbelianGroup
- *: (NonNegativeInteger, %) -> %
from AbelianMonoid
- *: (PositiveInteger, %) -> %
from AbelianSemiGroup
- +: (%, %) -> %
from AbelianSemiGroup
- -: % -> %
from AbelianGroup
- -: (%, %) -> %
from AbelianGroup
- ^: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- ^: (%, PositiveInteger) -> %
from Magma
- annihilate?: (%, %) -> Boolean
from Rng
- antiCommutator: (%, %) -> %
- associates?: (%, %) -> Boolean
from EntireRing
- associator: (%, %, %) -> %
from NonAssociativeRng
- characteristic: () -> NonNegativeInteger
from NonAssociativeRing
- coerce: % -> %
from Algebra %
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: Integer -> %
from NonAssociativeRing
- commutator: (%, %) -> %
from NonAssociativeRng
- divide: (%, %) -> Record(quotient: %, remainder: %)
divide(x, y)
dividesx
byy
producing a record containing aquotient
andremainder
, where the remainder is smaller (see sizeLess?) than the divisory
.
- euclideanSize: % -> NonNegativeInteger
euclideanSize(x)
returns the euclidean size of the elementx
. Error: ifx
is zero.
- expressIdealMember: (List %, %) -> Union(List %, failed)
from PrincipalIdealDomain
- exquo: (%, %) -> Union(%, failed)
from EntireRing
- extendedEuclidean: (%, %) -> Record(coef1: %, coef2: %, generator: %)
extendedEuclidean(x, y)
returns a record rec whererec.coef1*x+rec.coef2*y = rec.generator
and rec.generator is agcd
ofx
andy
. Thegcd
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: (%, %, %) -> Union(Record(coef1: %, coef2: %), failed)
extendedEuclidean(x, y, z)
either returns a record rec whererec.coef1*x+rec.coef2*y=z
or returns “failed” ifz
cannot be expressed as a linear combination ofx
andy
.
- gcdPolynomial: (SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial %
from GcdDomain
- latex: % -> String
from SetCategory
- lcmCoef: (%, %) -> Record(llcm_res: %, coeff1: %, coeff2: %)
from LeftOreRing
- leftPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- leftPower: (%, PositiveInteger) -> %
from Magma
- leftRecip: % -> Union(%, failed)
from MagmaWithUnit
- multiEuclidean: (List %, %) -> Union(List %, failed)
multiEuclidean([f1, ..., fn], z)
returns a list of coefficients[a1, ..., an]
such that `` z / prod fi = sum aj/fj``. If no such list of coefficients exists, “failed” is returned.
- one?: % -> Boolean
from MagmaWithUnit
- opposite?: (%, %) -> Boolean
from AbelianMonoid
- plenaryPower: (%, PositiveInteger) -> %
from NonAssociativeAlgebra %
- principalIdeal: List % -> Record(coef: List %, generator: %)
from PrincipalIdealDomain
- quo: (%, %) -> %
x quo y
is the same asdivide(x, y).quotient
. See divide.
- recip: % -> Union(%, failed)
from MagmaWithUnit
- rem: (%, %) -> %
x rem y
is the same asdivide(x, y).remainder
. See divide.
- rightPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> %
from Magma
- rightRecip: % -> Union(%, failed)
from MagmaWithUnit
- sample: %
from AbelianMonoid
- sizeLess?: (%, %) -> Boolean
sizeLess?(x, y)
tests whetherx
is strictly smaller thany
with respect to the euclideanSize. Note: zero is considered smaller than every nonzero element.
- subtractIfCan: (%, %) -> Union(%, failed)
- unit?: % -> Boolean
from EntireRing
- unitCanonical: % -> %
from EntireRing
- unitNormal: % -> Record(unit: %, canonical: %, associate: %)
from EntireRing
- zero?: % -> Boolean
from AbelianMonoid
Algebra %
BiModule(%, %)
Module %