This chapter describes the operations on formal power, Laurent and Puiseux series available in Magma.
Internally Magma has only one kind of formal series, where general fractional exponents are allowed, but externally there are three kinds of series: power, Laurent and Puiseux. Power series must have a non-negative integral valuation and integral exponents, Laurent series must have an integral valuation and integral exponents (possibly negative), while Puiseux series may have a general rational valuation and general rational exponents. The main reason for the three kinds is simply to supply error checking for operations illegal to a specific kind, so the user will not move into the next kind of exponents inadvertently. Apart from these error checks, there is no difference at all between the different kinds of series, so one can simply use Puiseux series always if the restrictions on exponents are not desired, and this will cause no loss of efficiency or functionality at all even if all exponents remain integral or integral and non-negative.
In Magma, the set of all power series over a given base ring R is called a power series ring (denoted by R[[x]]) and the category names are RngSerPow for the ring and RngSerPowElt for the elements. The set of all Laurent series over a given base ring R is called a Laurent series ring (denoted by R((x))) and the category names are RngSerLaur for the ring and RngSerLaurElt for the elements. Finally, the set of all Puiseux series over a given base ring R is called a Puiseux series ring (denoted by R< < x > >) and the category names are RngSerPuis for the ring and RngSerPuisElt for the elements. For the rest of this chapter, the term "series ring" refers to any of the above rings and the corresponding virtual category name is RngSer; the term "series" refers to any of the above series kinds and the corresponding virtual category name is RngSerElt.
Puiseux series in a variable x are often mathematically defined to be Laurent series in another variable y say, where y=x1/d, for a fixed positive integer d; this d is usually fixed for all the series under consideration. Magma is more general, in that although each series is internally represented in this way (i.e., its valuation, exponents and precision are thought to be divided by a single denominator associated with it), different Puiseux series may have different exponent denominators and may be freely mixed (for example, in addition, where the exponent denominator of the result will be derived from that of the arguments). Thus there is no restriction whatsoever to a fixed exponent denominator for a given Puiseux series ring.
Formal series are stored in truncated form, unless only finitely many terms are non-zero. If a series has precision p, that means that its coefficients are unknown from exponent p onwards. This truncated form is similar to the floating point representation of real numbers except for one significant difference: because for series terms do not "carry" in arithmetic operations like they do in integer and real arithmetic, error propagation common in floating point methods does not occur. Consequently, given a result of any sequence of arithmetic operations with formal series, the coefficients of the known terms (the ones up to the given precision) will always be exactly correct, with no error (assuming the coefficient ring has exact arithmetic for its elements of course).
Elements cvxv + cv + 1xv + 1 + ... (with v∈Q and rv != 0) of series ring over a commutative ring R are stored in the form of approximations cvxv + cv + 1xv + 1 + ... + O(xp) to a certain precision p≥v. The O(xp) notation is used to refer to terms of degree at least the precision p in x. For Laurent series v must be an integer and for power series v must be a non-negative integer. Note that for Puiseux series the above element is actually internally stored in the form cwxw/d + cw + 1x(w + 1)/d + ... + O(xq/d) where v=w/d and p=q/d and d (the exponent denominator) is minimal.
Associated with any series there are two types of precision: the absolute precision and the relative precision. For the element cvxv + cv + 1xv + 1 + ... + O(xp) (with v∈Q and rv != 0), the absolute precision is p and the relative precision is p - v.
The absolute precision indicates the largest known term, and the relative precision indicates the size of the range over which terms are known. The two types of precision and the valuation of the series, which equals v in the above, are therefore always related via p=v + r.
For each type of series ring, there are two sub-kinds: a free precision ring (the usual case), where elements of the ring have arbitrary precision, and a fixed precision ring, where all elements of the ring have a fixed precision. In the latter case, for power series rings the fixed precision is absolute, while for Laurent and Puiseux series ring the fixed precision is relative.
The free precision rings most closely resemble the mathematical objects R[[x]] and R((x)); elements in these free rings and fields carry their own precision with them. Operations usually return results to a precision that is maximal given the input (and the nature of the operation). Operations which are given infinite precision series but which must return finite precision series (e.g., division) return series whose precision is the default precision for the series ring (this is different from the fixed precision of fixed precision rings); the default precision is 20 by default but may be set to another value at creation by a parameter (see below). Elements of free structures that have finite series expansion (i.e., polynomials) can be created and stored exactly, with infinite (absolute and relative) precision. Also note that the relative precision will be 0 for approximations to 0.
The structures with fixed precision, which we will sometimes refer to as quotient structures, behave differently. All elements in a power series ring of fixed precision have the same fixed absolute precision p, and the relative precision may be anything from 0 to p. This means that the ring with fixed precision p behaves like a quotient of a polynomial ring, R[x]/xp. All elements in a Laurent or Puiseux series ring of fixed precision have the same fixed relative precision; the only exception to this rule is that 0 in the ring is stored as zero with infinite absolute precision. The absolute precision of elements in a free Laurent or Puiseux series ring can be anything.
Since a given series ring will contain series truncated at arbitrary precision, care has to be taken as to the meaning of equality of two elements. Two series are considered equal iff they are identical (the equality operator eq follows this convention). But we call two series A and B in the same ring weakly equal if and only if their coefficients are the same whenever both are defined, that is, if and only if for every n≤p the coefficients An and Bn are equal, where p is the minimum of the precisions of A and B. Thus, for example, A=3 + x + O(x2) and B=3 + x + 17x2 + O(x4) are the same, but C=3 + x + 17x2 + x3 + O(x4) is different from B. Note that A and C are equal under this definition, and hence weak equality is not transitive!
For a discussion of operations for polynomials over series rings see Chapter NEWTON POLYGONS and Section Polynomials over Series Rings.