Generic Element Functions
Parent and Category
Creation of Elements
- One(R): Rng -> RngElt
- Id(R): Rng -> RngElt
The multiplicative identity \(1\) of ring \(R\); this is equivalent to
R ! 1.
- R ! a: Rng, RngElt -> RngElt
Coerce the element \(a\) of some ring into the ring \(R\). (The rules on coercion are explained earlier in this Chapter.) If \(a\) is an integer, the coercion will always succeed: the element \(a\cdot 1_R\) will be returned, where \(1_R\) is the unit element of \(R\).
Arithmetic Operations
- a + b: RngElt, RngElt -> RngElt
The sum of the ring elements \(a\) and \(b\); if \(a\) and \(b\) do not belong to the same ring \(R\), an attempt will be made to find a common overstructure in which the sum can be taken.
- a - b: RngElt, RngElt -> RngElt
The difference of the ring elements \(a\) and \(b\); if \(a\) and \(b\) do not belong to the same ring \(R\), an attempt will be made to find a common overstructure in which the difference can be taken.
- a * b: RngElt, RngElt -> RngElt
The product of the ring elements \(a\) and \(b\); if \(a\) and \(b\) do not belong to the same ring \(R\), an attempt will be made to find a common overstructure in which the product can be taken.
- a ^ k: RngElt, RngIntElt -> RngElt
Form the \(k\)-th power of the ring element \(a\), for small \(k\). If \(k = 0\), then \(a^k\) returns \(1\), even when \(a = 0\). If \(k\) is negative, \(a\) must have a multiplicative inverse and the result is \((a^{-1})^{-k}\).
- a / b: RngElt, RngElt -> RngElt
Given an element \(a\) of \(R\) and a unit \(b\) of \(R\), form the quotient of the elements \(a\) and \(b\). If \(b\) is not invertible in \(R\), an error results, unless both \(a\) and \(b\) are integers, in which case
a / breturns the rational number \(a/b\). If \(a\) and \(b\) do not belong to the same ring \(R\), an attempt will be made to find a common overstructure in which the quotient can be taken.
- a +:= b: RngElt, RngElt -> RngElt
Mutation assignment: change \(a\) into the sum of \(a\) and \(b\).
- a -:= b: RngElt, RngElt -> RngElt
Mutation assignment: change \(a\) into the difference of \(a\) and \(b\).
- a *:= b: RngElt, RngElt -> RngElt
Mutation assignment: change \(a\) into the product of \(a\) and \(b\).
Equality and Membership
- a eq b: RngElt, RngElt -> BoolElt
Returns
trueif the elements \(a\) and \(b\) of \(R\) are the same, otherwisefalse.
- a ne b: RngElt, RngElt -> BoolElt
Returns
trueif the elements \(a\) and \(b\) of \(R\) are distinct, otherwisefalse.
- R eq S: Rng, Rng -> BoolElt
Returns
trueif the rings \(R\) and \(S\) are the same, otherwisefalse.
Predicates on Ring Elements
- IsMinusOne(a): RngElt -> BoolElt
Returns
trueif and only if the element \(a\) of \(R\) equals the element \(-1\) of \(R\).
- IsNilpotent(x): RngElt -> BoolElt
Returns
trueif and only if some integer power \(x^i\) of \(x\) is zero.
- IsZeroDivisor(x): RngElt -> BoolElt
Returns
trueif and only if \(x\) is a zero-divisor, that is, there exists an element \(y\) in the parent \(R\) of \(x\) such that \(xy=0\).
Comparison of Ring Elements
The comparison operations are only defined on types of ring that are ordered.
- a gt b: RngElt, RngElt -> BoolElt
Returns
trueif the ring element \(a\) is greater than the ring element \(b\), otherwisefalse.
- a ge b: RngElt, RngElt -> BoolElt
Returns
trueif the ring element \(a\) is greater than or equal to the ring element \(b\), otherwisefalse.
- a lt b: RngElt, RngElt -> BoolElt
Returns
trueif the ring element \(a\) is less than the ring element \(b\), otherwisefalse.
- a le b: RngElt, RngElt -> BoolElt
Returns
trueif the ring element \(a\) is less than or equal to the ring element \(b\), otherwisefalse.
- Maximum(a, b): RngElt, RngElt -> RngElt
The maximum of the ring elements \(a\) and \(b\); if \(a\) and \(b\) do not belong to the same ring \(R\), an attempt will be made to find a common overstructure in which the maximum can be taken.