Summation in finite terms using sage

Burçin Eröcal
2011 ACM SIGSAM Bulletin
The summation analogue of the Risch integration algorithm developed by Karr [4, 5] uses towers of difference fields to model nested indefinite sums and products, as the Risch algorithm uses towers of differential fields to model the so called elementary functions  . The algorithmic machinery developed by Karr, and later generalized and extended in [1, 13, 7, 6] , allows one to find solutions of first order difference equations over such towers of difference fields, in turn simplifying
more » ... simplifying expressions involving sums and products. We present an implementation of this machinery in the open source computer algebra system Sage  . Due to the nature of open source software, this allows direct experimentation with the algorithms and structures involved while taking advantage of the state of the art primitives provided by Sage. Even though these methods are used behind the scenes in the summation package Sigma  and they were previously implemented in  , this is the first open source implementation. Mathematical Preliminaries We call a field F equipped with an automorphism σ a difference field. In order to model a sum or a product in a given expression, we extend a difference field with a new indeterminate t, where the action of σ on t is determined by the shift behavior of the given sum or product. For example, take Q(n) with σ(n) = n + 1. In order to model n i=1 1 i , we add a new indeterminate t such that σ(t) = t + 1 n+1 . Similarly, in order to model 2 n , we take σ(t) = 2t. The summation analogues of the elementary extensions in the Risch algorithm  are called Π and Σ extensions by Karr. Intuitively, Π extensions correspond to product extensions and Σ extensions to sum expressions. Definitions and structure theorems about these can be found in  . In the following discussion we'll mainly use the definition of a ΠΣ-field or extension from [4, Definition 10]. Design Issues Sage provides an algebraic type hierarchy similar to that of Magma. In order to add the required structures to work with ΠΣ-fields we have extended this hierarchy with a new construct PiSigmaExtension, which takes 3 arguments: the base field, and the coefficients α and β where σ(t) = αt + β. sage : from k a r r . p i s i g m a f i e l d import PiSigmaExtension sage : F. = PiSigmaExtension (QQ, 1 , 1 ) sage : sigma = F . sigma ( ) ; sigma 1