Infinities

Occasionally it is convenient to work with infinite quantities (for example, when working with valuations or cardinalities). Magma provides two such objects, the positive and negative infinities. This section describes the Magma facilities for dealing with such objects.

The infinities are compatible with certain finite quantities: integers, rationals and real numbers. In contexts where a common universe is needed to contain both finite and infinite quantities (for example, if creating a sequence of valuations) the extended reals (type ExtRe) are used. The extended reals are a coproduct-like object that can contain both infinities and compatible finite objects. When viewed as members of the extended reals, the elements are of type ExtReElt.

Contents

Creation

Certain system intrinsics such as Valuation which normally return an integer may return an infinite object for appropriate exceptional cases. Two special intrinsics are also provided to create infinite objects.

Infinity() : -> Infty
The positive infinity object.
MinusInfinity() : -> Infty
The negative infinity object.

Arithmetic

Only basic arithmetic operations are provided for infinite objects. The operations described below may freely mix infinite and finite quantities, but note that certain forms (such as ∞ - ∞ or ∞ * 0) are not well defined and will cause an error.

- x : Infty -> Infty
x + y : Infty, Infty -> Infty
x + y : Infty, RngIntElt -> Infty
x + y : RngIntElt, Infty -> Infty
x - y : Infty, Infty -> Infty
x - y : Infty, RngIntElt -> Infty
x - y : RngIntElt, Infty -> Infty
x * y : Infty, Infty -> Infty
x * y : Infty, RngIntElt -> Infty
x * y : RngIntElt, Infty -> Infty
x / y : RngIntElt, Infty -> RngIntElt
x / y : Infty, RngIntElt -> Infty
x ^ n : Infty, Infty -> Infty
x ^ n : Infty, RngIntElt -> Infty

Comparison

Infinite objects may be compared with themselves and finite quantities.

x eq y : Infty, Infty -> BoolElt
x eq y : Infty, RngIntElt -> BoolElt
x eq y : RngIntElt, Infty -> BoolElt
x ne y : Infty, Infty -> BoolElt
x ne y : Infty, RngIntElt -> BoolElt
x ne y : RngIntElt, Infty -> BoolElt
x lt y : Infty, Infty -> BoolElt
x lt y : Infty, RngIntElt -> BoolElt
x lt y : RngIntElt, Infty -> BoolElt
x le y : Infty, Infty -> BoolElt
x le y : Infty, RngIntElt -> BoolElt
x le y : RngIntElt, Infty -> BoolElt
x gt y : Infty, Infty -> BoolElt
x gt y : Infty, RngIntElt -> BoolElt
x gt y : RngIntElt, Infty -> BoolElt
x ge y : Infty, Infty -> BoolElt
x ge y : Infty, RngIntElt -> BoolElt
x ge y : RngIntElt, Infty -> BoolElt
Maximum(x, y) : Infty, Infty -> .
Maximum(x, y) : Infty, RngIntElt -> .
Maximum(x, y) : RngIntElt, Infty -> .
Minimum(x, y) : Infty, Infty -> .
Minimum(x, y) : Infty, RngIntElt -> .
Minimum(x, y) : RngIntElt, Infty -> .

Miscellaneous

Sign(x) : Infty -> RngIntElt
Returns 1 if x is the positive infinite object, -1 if x is the negative infinite object.
Abs(x) : Infty -> Infty
AbsoluteValue(x) : Infty -> Infty
Returns the positive infinite object.
Round(x) : Infty -> Infty
Floor(x) : Infty -> Infty
Ceiling(x) : Infty -> Infty
Returns the infinite object x again; these functions are for convenience when dealing with objects which could be either finite numeric types or infinite objects.
IsFinite(x) : Infty -> BoolElt
IsFinite(x) : RngIntElt -> BoolElt
Returns true if x is finite, otherwise false. This is more convenient than checking the type of x.
V2.28, 13 July 2023