Singularities play an essential role in algorithms for analyzing recurrence or differential equations, and for symbolic summation and integration. The “local” behaviour at a singularity typically gives rise to severe restrictions of the possible “global” shape of a solution, and such restrictions are exploited in the design of algorithms for finding such solutions. It is therefore important to have access to information about what is going on at the singularities. Integral bases provide such access.
For algebraic number fields and algebraic function fields, this is a classical notion. Let be the field of rational functions in over a field and be an algebraic extension of . Every element of has a minimal polynomial . An element of is called integral if all its series expansions only involve terms with nonnegative exponents. The integral elements of form a -submodule of , which somehow plays the role in that plays in . An integral basis of is a -vector space basis of which at the same time is a -module basis of the module of integral elements.
Trager [15, 2, 1, 3] used integral bases in his integration algorithm for algebraic functions. This was one of the motivations for introducing the notion of integral D-finite functions , which were then used not only for integration  but also for solving differential equations in terms of hypergeometric series [10, 9]. Also for D-finite functions, integrality is defined in terms of the exponents appearing in the series expansions. The goal of the present paper is to introduce a notion of integrality for the recurrence case. Our hope is that this work will subsequently be useful for the development of new summation algorithms.
A major difference between the differential case and the shift case is the fact that singularities are no longer isolated points . Instead, as pointed out for instance in , singularities should be viewed as orbits consisting of some together with all elements of that have integer distance to . Instead of certain kinds of series solutions at of differential operators or algebraic equations, we have to consider certain kinds of sequence solutions of a recurrence operator. This makes the matter considerably more technical.
We proceed in two stages. In the first stage (Sections 2 and 3), we give a general formulation of the algorithm proposed by van Hoeij for algebraic function fields  and adapted to D-finite functions by Kauers and Koutschan . The general formulation applies to arbitrary valued vector spaces, and we identify the computational assumptions on which the correctness and termination arguments of the algorithms are based. In Section 4, we show how it indeed generalizes the previous algorithms. In the second stage (Section 5), we show how the general setting developed in Sections 2 and 3 can be applied to the shift case.
2 Value functions and Integral Elements
In this section, we recall basic terminologies about valuations on fields and vector spaces from [8, 18, 14]. Let be a field of characteristic zero and be a totally ordered abelian group, written additively, and let in which for all and for all . A mapping is called a valuation on if for all ,
if and only if ;
The pair is called a valued field and is called the value group of . The set forms a subring of that is called the valuation ring of .
A typical example of a valued field is the field of rational functions. Let be a field of characteristic 0 and . For any irreducible and , we can always write for some and with and . The valuation of at is defined as the integer . Set . Then is a valued field with being a local ring with its maximal ideal generated by . The valuation defined by for any is called the valuation at . Any valuation on the field is either or for some irreducible (see [5, Chapter 1, 3] in the language of places). When with , we will write instead of . For , the field of formal Laurent series admits a valuation , defined as , where . Any admits a representation in with .
Let be a vector space over a valued field . A map is called a value function on if for all and ,
if and only if ;
The pair is called a valued vector space over . An element is said to be integral if .
Let be any subspace of a valued vector space . Then the restriction of on is also a value function on , which makes a valued vector space.
Let be a valued field and be a valued vector space over . The set of all integral elements in forms an -module.
For any and , we have
Since and , we have . So .
A -vector space basis of a valued vector space which is at the same time an -module basis of is called a (local) integral basis with respect to . Assume that the module has a local integral basis and . Then if and only if for all . When does a local integral basis exist and how to construct such a basis are the main problems we study in this paper. Value functions and integral bases for algebraic functions fields have been extensively studied both theoretically [5, 7, 14] and algorithmically [15, 17, 16] and have also been extended to the D-finite case .
(See [14, Example 3.3]) Any finite dimensional -vector space can be equipped with a valuation. More precisely, let be a vector space over a valued field of dimension . Let be a basis of . Take values in and define by for all ,
It is easy to check that is a value function on .
Let be an algebraically closed field of characteristic 0, and be the valuation of at as in Example 1. Then is a valued field. Let with being algebraic over . Any nonzero element can be expanded as a Puiseux series of the form
where with and with . The value function is then defined by for nonzero and . In this setting, is a free -module.
Let be a field with characteristic 0, and consider a linear differential operator with . The quotient module is a -vector space with as a basis. Its element is a solution of . If is a so-called regular singular point of , then there are linearly independent solutions in the -vector space generated by
Following , we construct a value function on as follows. First choose a function with for every and , with
for every and , and with . This function picks from each -equivalence class in a canonical representative.
Using this auxiliary function, the valuation of a term is the integer , and the valuation of a series is the minimum of the valuations of all the terms appearing in it (with nonzero coefficients). The valuation of is defined as .
The value function is then defined as the smallest valuation of a series , when runs through all solutions of . We now check that the function is indeed a value function.
Let . Clearly if , for all . Conversely, assume that , then by definition and so for all , which implies that the dimension of the solution space of is at least . But the order of is less than , and the dimension of the solution space of a nonzero operator cannot exceed its order, so it follows that .
For any and , the valuation of is the sum of the valuations of and by definition. Then for any , , which is then equal to .
By for all , we have
When , the valued field can be endowed with a topology. We summarize here the relevant constructions, more details can be found in [13, Chapter 2]. For , let . The properties of the valuation ensure that is an absolute value, called the -adic absolute value. This absolute value defines a topology on , in which elements are “small” if their valuation is “large”.
Recall that a sequence of elements is said to be Cauchy if for each , there exists such that for every , , or, equivalently, if for each , there exists such that for every , . The field is said to be complete if every Cauchy sequence is convergent.
The completion of is a minimal field extension which is complete. It can be constructed as follows. As a set, let be the set of all Cauchy sequences in , modulo the equivalence relation converges to at infinity. The field is contained in via the constant sequences. Ring operations on extend to component-wise, and make a field. The valuation on extends to by taking the limit of the valuations of the terms of the sequences, we use the same letter for that valuation.
An important feature of the topology on and is that the -adic absolute value is ultrametric: it satisfies the stronger triangular condition . In particular, any series with and is convergent in .
The completion of w.r.t. the valuation is , and its completion w.r.t. is .
These definitions extend naturally to a valued -vector space. Just like in the case of fields, the hypotheses (i) and (iii) of Definition 2 ensure that we can define a norm on by setting . This turns into a topological vector space: addition and scalar multiplication are continuous.
Part (ii) of Definition 2 further ensures that for , . In particular, if a sequence in converges to , then converges to in .
More generally, if and are sequences in converging to , respectively, then the sequence in converges to .
Let be the -vector space obtained from scalar extension of . If is finite dimensional and is a basis, can be seen as the -vector space generated by , identifying its elements with elements of whenever possible, and it is the completion of with respect to the above topology.
The inequality always holds, but it may happen that the inequality is strict. For example, consider as a -vector space, with valuation , and let be a -dimensional sub-vector space of . Then has dimension over .
3 Computing Integral Bases
In this section, we present a general algorithm for computing local and global integral bases of valued vector spaces and conditions on the termination of this algorithm.
3.1 The local case
Given a valued field , a basis of a -vector space of dimension , and a value function on , our goal is to compute a local integral basis of if it exists. The algorithm described below is based on the algorithm given by van Hoeij  for computing integral bases of algebraic function fields. It also covers the adaption by Kauers and Koutschan to D-finite functions . For simplicity, we restrict to the case .
For the algorithm to apply in the general setting, we need to make the following assumptions.
arithmetic in and is constructive, and and are computable.
we know an element with .
for any given , we can find in such that
or prove that no such ’s exist.
the completion of has dimension .
The algorithm is then as follows.
INPUT: a -vector space basis of
OUTPUT: a local integral basis of w.r.t.
1for , do:
2replace by .
3while there exist such that
4choose such .
5replace by .
Alg. 10 is correct.
We show by induction on that for every , the output elements form a local integral basis for the subspace of generated by the input elements . From the updates in lines 2 and 5, it is clear that the output elements generate the same subspace, so the only claim to be proven is that they are also module generators for the module of integral elements.
For , line 2 ensures that , and no further change is going to happen in the while loop. When , then the integral elements of the subspace generated by are precisely the elements for with , so is an integral basis.
Now assume that is such that is an integral basis, and let . After executing line 2, we may assume . After termination of the while loop, we know that there are no such that . Let be such that is an integral element. We have to show that for .
We cannot have , otherwise, , which would contradict the termination condition of the while loop. Thus . But then, , so is also integral. Since is in the -subspace generated by and the latter is an integral basis by induction hypothesis, it follows that for .
We prove that Alg. 10 terminates under our hypotheses. The existence of local integral bases then follows from the termination by Theorem 11. We give two proofs of termination. The first proof only uses the topological assumption (D) on . The second proof requires an additional assumption but has the advantage of providing a bound for the number of iterations of the loop.
Alg. 10 terminates.
Assume that for some , the loop does not terminate. Let be the value of before entering the th iteration, and let . For all , and . For all , there exists for such that
and has valuation at . We can unroll the sum as
Viewing this equality in and taking the limit as yields
Furthermore, has valuation , so it is zero and
But by hypothesis (D), has dimension , so must be linearly independent over too. This is a contradiction, so the loop terminates.
The second termination proof is more explicit. It depends on a generalization of what is called discriminant in fields of algebraic numbers or functions.
Let be a valued vector space of finite dimension over a valued field with the value group . Let be such that and denote the set of all bases of . A map is called a discriminant function on if for every basis of , we have
if all the ’s are integral in
if there exist with such that
where , then
Let be a valued vector space of finite dimension over a valued field with the value group . If is surjective and there exists a discriminant function , Alg. 10 terminates.
Since is surjective, there exists such that . Let be any basis of over . We may always assume that by replacing by for all . It suffices to show that Alg. 10 terminates on . Let . At any intermediate step of Alg. 10, are always integral and form a basis of . If ’s exist in the while loop, decreases strictly. So there are at most times of basis updating, which implies that Alg. 10 terminates.
3.2 The global case
In a next step, we seek integral bases with respect to several valuations simultaneously. Instead of a single valuation , we have a set of valuations () and a set of value functions () and want to find a vector space basis of that is also an -module basis of for every . The idea is to apply Alg. 10 repeatedly. In order to make this work, we impose the following additional assumptions:
for every we know an element with and for all
for every and any given , we can compute with for all and all such that
or prove that no such ’s exist.
for every , the completion of has dimension .
we know a finite set and a basis of that is an integral basis for all .
Under these circumstances, we can proceed as follows.
INPUT: a -vector space basis of which is an integral basis for all
OUTPUT: an integral basis for all
1for all , do:
2apply Alg. 10 to , using and in place of , and , and ensuring in step 3 that for all and all .
3replace by the output of Alg. 10.
Alg. 15 is correct.
We only have to show that one application of Alg. 10 does not destroy the integrality properties arranged in earlier calls. To see that this is the case, consider the effects of steps 2 and 5 with respect to a value function other than . If is such a function, then by the assumption on , we have , so and generate the same -module. Hence this step is safe. Likewise, by the assumptions on the chosen in step 5, and generate the same -module. So this step is safe too.
3.3 Avoiding constant field extensions
We shall discuss one more refinement. In applications, we typically have where is a field and is an algebraic closure of , with the usual valuation for (see Example 1). For this valuation, is a canonical choice.
For theoretical purposes it is advantageous to work with vector spaces over , but computationally it would be preferable to work with coefficients in rather than . It is therefore desirable to ensure that the basis elements returned by Alg. 15 have coefficients in with respect to the input basis.
Note that in this setting, we have the following properties:
For every automorphism leaving fixed, for every , and for every , we have , where is the element of obtained by applying to the coefficients of .
For every , and for every , admits a unique Laurent series expansion
with and .
The constant in item 2 is called the leading coefficient of .
The second property of the lemma ensures that the coefficients from (C) and (3.2) can be chosen in . Indeed, we can replace by its leading coefficient if and by zero otherwise, because whenever is a solution and are arbitrary with for all , then also is a solution.
If we restrict to , then there can be at most one solution whenever we seek a solution in step 3 of Alg. 10, because the difference of any two distinct solutions would be a nontrivial -linear combination of , and by the invariant of the outer loop, already form an integral basis of the -subspace they generate.
We shall adopt the following last assumption, stating that we can apply on :
We know a basis as in (E) such that for every automorphism fixing , and for all , we have .
Using this assumption, it can further be shown that the unique elements from (3.2) must in fact belong to (if they exist at all). This is because if some were in , then there would be some automorphism fixing but moving , and (F) would imply that would be another solution to (3.2), in contradiction to the uniqueness.
In order to ensure that the output elements of Alg. 15 are -linear combinations of the input elements, we adjust Alg. 10 as follows. Let be the Galois group of over . In step 2, instead of replacing by , we replace by
Note that is the minimal polynomial of in .
In step 5 of Alg. 10, we choose (if there are any), and instead of replacing by (with ), we replace by
By Galois theory, and for every . Therefore, all updates in the modified Alg. 10 replace certain basis elements by -linear combinations of basis elements.
It remains to show that the output is an integral basis for all . To see this, we have to check the effect of Alg. 10 concerning and concerning for . For the latter, we distinguish the case when is conjugate to and when it is not.
By part 1 of Lemma 17, for all that are not conjugate to we have for and . Therefore, and generate the same -module as and , for every that is not conjugate to . This settles the case when is not conjugate to .
Moreover, since and for all , we have that and generate the same -module as and . This settles the concern about .
Finally, if is conjugate to , say for some automorphism , then by assumption (F), because is a -linear combination of the original basis elements. So belongs to the -module of all integral elements (w.r.t. ) of the subspace generated by in , so we are not making the module larger than we should. Conversely, the old belongs to the -module generated by and , so by updating to , the module generated by does not become smaller.
Informally, what happens by taking the sums over the Galois group is that the algorithm working locally at simultaneously works at all its conjugates. If for a certain , the set contains as well as its conjugates, it is fair (and advisable) to discard all the conjugates from and only keep . More precisely, the whole process requires only knowing the minimal polynomial of in , so for applications where the set is computed as the set of roots of some polynomial , the algorithms can proceed with the factors of instead of all its roots.
4 The Algebraic and D-finite Cases
Let be a computable subfield of and with a valuation for . The value function on with is defined in Example 6 and on is defined in Example 7. We show that the assumptions imposed on value functions in Section 3 are fulfilled in the algebraic and D-finite settings. Note that (B), (C), (D) are subsumed in (3.2), (