Introduction

The lazy series rings RngLaz and their elements RngLazElt allow the creation of infinite precision series by providing series for which all coefficients can be calculated by some given formula. Only finitely many coefficients of such a series can be known at any one time but all infinitely many of the coefficients are knowable. Any coefficient of a lazy series can be generated and once a coefficient is computed it will be stored in the series for quick retrieval.

The simplest implementation of this idea is creating a series by providing a map. This map is a formula for computing coefficients of a series. Given the exponents of the variables of a term it will give you the coefficient of that term. Series with finitely many non--zero terms can be created in special ways and several usual arithmetic operations can be applied to lazy series. Such constructions yield lazy series with more complicated formulas for their coefficients.

Consider the series ∑i = 0n i * xi. A formula for the coefficients is given by i |-> i. This series can be created as a lazy series as follows:

> L<x> := LazyPowerSeriesRing(Integers(), 1);
> m := map<Integers() -> Integers() | i :-> i>;
> s := elt<L | m>;
> s;
Lazy power series
Currently s does not know what any of its coefficients are yet it is possible to calculate any coefficient of s.
> Coefficient(s, 0);
0
> Coefficient(s, 100);
100
> Coefficient(s, 100000000000000000000000);
100000000000000000000000
V2.28, 13 July 2023