# Riemann series theorem

In mathematics, the Riemann series theorem, also called the Riemann rearrangement theorem, named after 19th-century German mathematician Bernhard Riemann, says that if an infinite series of real numbers is conditionally convergent, then its terms can be arranged in a permutation so that the new series converges to an arbitrary real number, and rearranged such that the new series diverges. This implies that a series of real numbers is absolutely convergent if and only if it is unconditionally convergent.
As an example, the series
    $1-1+{\frac {1}{2}}-{\frac {1}{2}}+{\frac {1}{3}}-{\frac {1}{3}}+{\frac {1}{4}}-{\frac {1}{4}}+\dots$
converges to 0 (for a sufficiently large number of terms, the partial sum gets arbitrarily near to 0); but replacing all terms with their absolute values gives
    $1+1+{\frac {1}{2}}+{\frac {1}{2}}+{\frac {1}{3}}+{\frac {1}{3}}+\dots$
which sums to infinity. Thus, the original series is conditionally convergent, and can be rearranged (by taking the first two positive terms followed by the first negative term, followed by the next two positive terms and then the next negative term, etc.) to give a series that converges to a different sum, such as
    $1+{\frac {1}{2}}-1+{\frac {1}{3}}+{\frac {1}{4}}-{\frac {1}{2}}+\dots$
which evaluates to ln 2. More generally, using this procedure with p positives followed by q negatives gives the sum ln(p/q). Other rearrangements give other finite sums or do not converge to any sum.

## History

It is a basic result that the sum of finitely many numbers does not depend on the order in which they are added. For example, 2 + 6 + 7 = 7 + 2 + 6. The observation that the sum of an infinite sequence of numbers can depend on the ordering of the summands is commonly attributed to Augustin-Louis Cauchy in 1833. He analyzed the alternating harmonic series, showing that certain rearrangements of its summands result in different limits. Around the same time, Peter Gustav Lejeune Dirichlet highlighted that such phenomena are ruled out in the context of absolute convergence, and gave further examples of Cauchy's phenomenon for some other series which fail to be absolutely convergent.
In the course of his analysis of Fourier series and the theory of Riemann integration, Bernhard Riemann gave a full characterization of the rearrangement phenomena. He proved that in the case of a convergent series which does not converge absolutely (known as conditional convergence), rearrangements can be found so that the new series converges to any arbitrarily prescribed real number. Riemann's theorem is now considered as a basic part of the field of mathematical analysis.
For any series, one may consider the set of all possible sums, corresponding to all possible rearrangements of the summands. Riemann’s theorem can be formulated as saying that, for a series of real numbers, this set is either empty, a single point (in the case of absolute convergence), or the entire real number line (in the case of conditional convergence). In this formulation, Riemann’s theorem was extended by Paul Lévy and Ernst Steinitz to series whose summands are complex numbers or, even more generally, elements of a finite-dimensional real vector space. They proved that the set of possible sums forms a real affine subspace. Extensions of the Lévy–Steinitz theorem to series in infinite-dimensional spaces have been considered by a number of authors.

## Definitions

A series ∑$_{n=1}$$^∞$a$_n${\textstyle \sum _{n=1}^{\infty }a_{n}} converges if there exists a value $\ell$ such that the sequence of the partial sums
    $(S_{1},S_{2},S_{3},\ldots ),\quad S_{n}=\sum _{k=1}^{n}a_{k},$
converges to $\ell$. That is, for any ε > 0, there exists an integer N such that if n ≥ N, then
    $\left\vert S_{n}-\ell \right\vert \leq \varepsilon .$
A series converges conditionally if the series ∑$_{n=1}$$^∞$a$_n${\textstyle \sum _{n=1}^{\infty }a_{n}} converges but the series ∑$_{n=1}$$^∞$|a$_n$|{\textstyle \sum _{n=1}^{\infty }\left\vert a_{n}\right\vert } diverges.
A permutation is simply a bijection from the set of positive integers to itself. This means that if $\sigma$ is a permutation, then for any positive integer $b,$ there exists exactly one positive integer $a$ such that $\sigma (a)=b.$ In particular, if $x\neq y$, then $\sigma (x)\neq \sigma (y)$.

## Statement of the theorem

Suppose that $(a_{1},a_{2},a_{3},\ldots )$ is a sequence of real numbers, and that ∑$_{n=1}$$^∞$a$_n${\textstyle \sum _{n=1}^{\infty }a_{n}} is conditionally convergent. Let $M$ be a real number. Then there exists a permutation $\sigma$ such that
    $\sum _{n=1}^{\infty }a_{\sigma (n)}=M.$
There also exists a permutation $\sigma$ such that
    $\sum _{n=1}^{\infty }a_{\sigma (n)}=\infty .$
The sum can also be rearranged to diverge to $-\infty$ or to fail to approach any limit, finite or infinite.

## Alternating harmonic series
### Changing the sum

The alternating harmonic series is a classic example of a conditionally convergent series:$\sum _{n=1}^{\infty }{\frac {(-1)^{n+1}}{n}}$is convergent, whereas$\sum _{n=1}^{\infty }\left|{\frac {(-1)^{n+1}}{n}}\right|=\sum _{n=1}^{\infty }{\frac {1}{n}}$is the ordinary harmonic series, which diverges. Although in standard presentation the alternating harmonic series converges to ln(2), its terms can be arranged to converge to any number, or even to diverge.
One instance of this is as follows. Begin with the series written in the usual order,
    $\ln(2)=1-{\frac {1}{2}}+{\frac {1}{3}}-{\frac {1}{4}}+{\frac {1}{5}}-{\frac {1}{6}}+{\frac {1}{7}}-{\frac {1}{8}}+{\frac {1}{9}}\cdots$
and rearrange and regroup the terms as:
    ${\begin{aligned}&1-{\frac {1}{2}}-{\frac {1}{4}}+{\frac {1}{3}}-{\frac {1}{6}}-{\frac {1}{8}}+{\frac {1}{5}}-{\frac {1}{10}}-{\frac {1}{12}}+\cdots \\=&\left(1-{\frac {1}{2}}\right)-{\frac {1}{4}}+\left({\frac {1}{3}}-{\frac {1}{6}}\right)-{\frac {1}{8}}+\left({\frac {1}{5}}-{\frac {1}{10}}\right)-{\frac {1}{12}}+\cdots \end{aligned}}$
where the pattern is: the first two terms are 1 and −1/2, whose sum is 1/2. The next term is −1/4. The next two terms are 1/3 and −1/6, whose sum is 1/6. The next term is −1/8. The next two terms are 1/5 and −1/10, whose sum is 1/10. In general, since every odd integer occurs once positively and every even integers occur once negatively (half of them as multiples of 4, the other half as twice odd integers), the sum is composed of blocks of three which can be simplified as:
    $\left({\frac {1}{2k-1}}-{\frac {1}{2(2k-1)}}\right)-{\frac {1}{4k}}=\left({\frac {1}{2(2k-1)}}\right)-{\frac {1}{4k}},\quad k=1,2,\dots .$
Hence, the above series can in fact be written as:
    ${\begin{aligned}&{\frac {1}{2}}-{\frac {1}{4}}+{\frac {1}{6}}-{\frac {1}{8}}+{\frac {1}{10}}+\cdots +{\frac {1}{2(2k-1)}}-{\frac {1}{2(2k)}}+\cdots \\=&{\frac {1}{2}}\left(1-{\frac {1}{2}}+{\frac {1}{3}}-\cdots \right)={\frac {1}{2}}\ln(2)\end{aligned}}$
which is half the sum originally, and can only equate to the original sequence if the value were zero. This series can be demonstrated to be greater than zero by the proof of Leibniz's theorem using that the second partial sum is half. Alternatively, the value of $\ln(2)$ which it converges to, cannot be zero. Hence, the value of the sequence is shown to depend on the order in which series is computed.
It is true that the sequence:
    $\{b_{n}\}=1,-{\frac {1}{2}},-{\frac {1}{4}},{\frac {1}{3}},-{\frac {1}{6}},-{\frac {1}{8}},{\frac {1}{5}},-{\frac {1}{10}},-{\frac {1}{12}},{\frac {1}{7}},-{\frac {1}{14}},-{\frac {1}{16}},\cdots$
contains all elements in the sequence:
    $\{a_{n}\}=1,-{\frac {1}{2}},{\frac {1}{3}},-{\frac {1}{4}},{\frac {1}{5}},-{\frac {1}{6}},{\frac {1}{7}},-{\frac {1}{8}},{\frac {1}{9}},-{\frac {1}{10}},{\frac {1}{11}},-{\frac {1}{12}},{\frac {1}{13}},-{\frac {1}{14}},{\frac {1}{15}},\cdots$
However, since the summation is defined as $\sum _{n=1}^{\infty }a_{n}:=\lim _{n\to \infty }\left(a_{1}+a_{2}+\cdots +a_{n}\right)$ and $\sum _{n=1}^{\infty }b_{n}:=\lim _{n\to \infty }\left(b_{1}+b_{2}+\cdots +b_{n}\right)$, the order of the terms can influence the limit.

### Getting an arbitrary sum

An efficient way to recover and generalize the result of the previous section is to use the fact that
    $1+{1 \over 2}+{1 \over 3}+\cdots +{1 \over n}=\gamma +\ln n+o(1),$
where γ is the Euler–Mascheroni constant, and where the notation o(1) denotes a quantity that depends upon the current variable (here, the variable is n) in such a way that this quantity goes to 0 when the variable tends to infinity.
It follows that the sum of q even terms satisfies
    ${1 \over 2}+{1 \over 4}+{1 \over 6}+\cdots +{1 \over 2q}={1 \over 2}\,\gamma +{1 \over 2}\ln q+o(1),$
and by taking the difference, one sees that the sum of p odd terms satisfies
    ${1}+{1 \over 3}+{1 \over 5}+\cdots +{1 \over 2p-1}={1 \over 2}\,\gamma +{1 \over 2}\ln p+\ln 2+o(1).$
Suppose that two positive integers a and b are given, and that a rearrangement of the alternating harmonic series is formed by taking, in order, a positive terms from the alternating harmonic series, followed by b negative terms, and repeating this pattern at infinity (the alternating series itself corresponds to a = b = 1, the example in the preceding section corresponds to a = 1, b = 2):
    ${1}+{1 \over 3}+\cdots +{1 \over 2a-1}-{1 \over 2}-{1 \over 4}-\cdots -{1 \over 2b}+{1 \over 2a+1}+\cdots +{1 \over 4a-1}-{1 \over 2b+2}-\cdots$
Then the partial sum of order (a + b)n of this rearranged series contains p = an positive odd terms and q = bn negative even terms, hence
    $S_{(a+b)n}={1 \over 2}\ln p+\ln 2-{1 \over 2}\ln q+o(1)={1 \over 2}\ln \left({\frac {a}{b}}\right)+\ln 2+o(1).$
It follows that the sum of this rearranged series is
    ${1 \over 2}\ln \left({\frac {a}{b}}\right)+\ln 2=\ln \left(2{\sqrt {\frac {a}{b}}}\right).$
Suppose now that, more generally, a rearranged series of the alternating harmonic series is organized in such a way that the ratio p$_n$/q$_n$ between the number of positive and negative terms in the partial sum of order n tends to a positive limit r. Then, the sum of such a rearrangement will be
    $\ln \left(2{\sqrt {r}}\right),$
and this explains that any real number x can be obtained as sum of a rearranged series of the alternating harmonic series: it suffices to form a rearrangement for which the limit r is equal to e$^{2x}$/ 4.

## Proof
### Existence of a rearrangement that sums to any positive real M

Riemann's description of the theorem and its proof reads in full:
   … infinite series fall into two distinct classes, depending on whether or not they remain convergent when all the terms are made positive. In the first class the terms can be arbitrarily rearranged; in the second, on the other hand, the value is dependent on the ordering of the terms. Indeed, if we denote the positive terms of a series in the second class by a$_1$, a$_2$, a$_3$, ... and the negative terms by −b$_1$, −b$_2$, −b$_3$, ... then it is clear that Σa as well as Σb must be infinite. For if they were both finite, the series would still be convergent after making all the signs the same. If only one were infinite, then the series would diverge. Clearly now an arbitrarily given value C can be obtained by a suitable reordering of the terms. We take alternately the positive terms of the series until the sum is greater than C, and then the negative terms until the sum is less than C. The deviation from C never amounts to more than the size of the term at the last place the signs were switched. Now, since the number a as well as the numbers b become infinitely small with increasing index, so also are the deviations from C. If we proceed sufficiently far in the series, the deviation becomes arbitrarily small, that is, the series converges to C.
This can be given more detail as follows. Recall that a conditionally convergent series of real terms has both infinitely many negative terms and infinitely many positive terms. First, define two quantities, $a_{n}^{+}$ and $a_{n}^{-}$ by:
    $a_{n}^{+}={\begin{cases}a_{n}&{\text{if }}a_{n}\geq 0\\0&{\text{if }}a_{n}<0,\end{cases}}\qquad a_{n}^{-}={\begin{cases}0&{\text{if }}a_{n}\geq 0\\a_{n}&{\text{if }}a_{n}<0.\end{cases}}$
That is, the series ∑$_{n=1}$$^∞$a$_n$$^+${\textstyle \sum _{n=1}^{\infty }a_{n}^{+}} includes all a$_n$ positive, with all negative terms replaced by zeroes, and the series ∑$_{n=1}$$^∞$a$_n$$^−${\textstyle \sum _{n=1}^{\infty }a_{n}^{-}} includes all a$_n$ negative, with all positive terms replaced by zeroes. Since ∑$_{n=1}$$^∞$a$_n${\textstyle \sum _{n=1}^{\infty }a_{n}} is conditionally convergent, both the 'positive' and the 'negative' series diverge. Let M be any real number. Take just enough of the positive terms $a_{n}^{+}$ so that their sum exceeds M. That is, let p$_1$ be the smallest positive integer such that
    $M<\sum _{n=1}^{p_{1}}a_{n}^{+}.$
This is possible because the partial sums of the $a_{n}^{+}$ series tend to $+\infty$. Now let q$_1$ be the smallest positive integer such that
    $M>\sum _{n=1}^{p_{1}}a_{n}^{+}+\sum _{n=1}^{q_{1}}a_{n}^{-}.$
This number exists because the partial sums of $a_{n}^{-}$ tend to $-\infty$. Now continue inductively, defining p$_2$ as the smallest integer larger than p$_1$ such that
    $M<\sum _{n=1}^{p_{2}}a_{n}^{+}+\sum _{n=1}^{q_{1}}a_{n}^{-},$
and so on. The result may be viewed as a new sequence
    $a_{1}^{+},\ldots ,a_{p_{1}}^{+},a_{1}^{-},\ldots ,a_{q_{1}}^{-},a_{p_{1}+1}^{+},\ldots ,a_{p_{2}}^{+},a_{q_{1}+1}^{-},\ldots ,a_{q_{2}}^{-},a_{p_{2}+1}^{+},\ldots .$
Furthermore the partial sums of this new sequence converge to M. This can be seen from the fact that for any i,
    $\sum _{n=1}^{p_{i+1}-1}a_{n}^{+}+\sum _{n=1}^{q_{i}}a_{n}^{-}\leq M<\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i}}a_{n}^{-},$
with the first inequality holding due to the fact that p$_{i+1}$ has been defined as the smallest number larger than p$_i$ which makes the second inequality true; as a consequence, it holds that
    $0<\left(\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i}}a_{n}^{-}\right)-M\leq a_{p_{i+1}}^{+}.$
Since the right-hand side converges to zero due to the assumption of conditional convergence, this shows that the (p$_{i+1}$ + q$_i$)'th partial sum of the new sequence converges to M as i increases. Similarly, the (p$_{i+1}$ + q$_{i+1}$)'th partial sum also converges to M. Since the (p$_{i+1}$ + q$_i$ + 1)'th, (p$_{i+1}$ + q$_i$ + 2)'th, ... (p$_{i+1}$ + q$_{i+1}$ − 1)'th partial sums are valued between the (p$_{i+1}$ + q$_i$)'th and (p$_{i+1}$ + q$_{i+1}$)'th partial sums, it follows that the whole sequence of partial sums converges to M.
Every entry in the original sequence a$_n$ appears in this new sequence whose partial sums converge to M. Those entries of the original sequence which are zero will appear twice in the new sequence (once in the 'positive' sequence and once in the 'negative' sequence), and every second such appearance can be removed, which does not affect the summation in any way. The new sequence is thus a permutation of the original sequence.

### Existence of a rearrangement that diverges to infinity

Let ∑$_{i=1}$$^∞$a$_i${\textstyle \sum _{i=1}^{\infty }a_{i}} be a conditionally convergent series. The following is a proof that there exists a rearrangement of this series that tends to $\infty$ (a similar argument can be used to show that $-\infty$ can also be attained).
The above proof of Riemann's original formulation only needs to be modified so that p$_{i+1}$ is selected as the smallest integer larger than p$_i$ such that
    $i+1<\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i}}a_{n}^{-},$
and with q$_{i+1}$ selected as the smallest integer larger than q$_i$ such that
    $i+1>\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i+1}}a_{n}^{-}.$
The choice of i+1 on the left-hand sides is immaterial, as it could be replaced by any sequence increasing to infinity. Since $a_{n}^{-}$ converges to zero as n increases, for sufficiently large i there is
    $\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i+1}}a_{n}^{-}>i,$
and this proves (just as with the analysis of convergence above) that the sequence of partial sums of the new sequence diverge to infinity.

### Existence of a rearrangement that fails to approach any limit, finite or infinite

The above proof only needs to be modified so that p$_{i+1}$ is selected as the smallest integer larger than p$_i$ such that
    $1<\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i}}a_{n}^{-},$
and with q$_{i+1}$ selected as the smallest integer larger than q$_i$ such that
    $-1>\sum _{n=1}^{p_{i+1}}a_{n}^{+}+\sum _{n=1}^{q_{i+1}}a_{n}^{-}.$
This directly shows that the sequence of partial sums contains infinitely many entries which are larger than 1, and also infinitely many entries which are less than −1, so that the sequence of partial sums cannot converge.

## Generalizations
### Sierpiński theorem

Given an infinite series $a=(a_{1},a_{2},...)$, we may consider a set of "fixed points" $I\subset \mathbb {N}$, and study the real numbers that the series can sum to if we are only allowed to permute indices in $I$. That is, we let$S(a,I)=\left\{\sum _{n\in \mathbb {N} }a_{\pi (n)}:\pi {\text{ is a permutation on }}\mathbb {N} ,{\text{ such that }}\forall n\not \in I,\pi (n)=n,{\text{ and the summation converges.}}\right\}$With this notation, we have:
* If $I\mathbin {\triangle } I'$ is finite, then $S(a,I)=S(a,I')$. Here $\triangle$ means symmetric difference.
* If $I\subset I'$ then $S(a,I)\subset S(a,I')$.
* If the series is an absolutely convergent sum, then $S(a,I)=\left\{\sum _{n\in \mathbb {N} }a_{n}\right\}$ for any $I$.
* If the series is a conditionally convergent sum, then by Riemann series theorem, $S(a,\mathbb {N} )=[-\infty ,+\infty ]$.
Sierpiński proved that rearranging only the positive terms one can obtain a series converging to any prescribed value less than or equal to the sum of the original series, but larger values in general can not be attained. That is, let $a$ be a conditionally convergent sum, then $S(a,\{n\in \mathbb {N} :a_{n}>0\})$ contains $\left[-\infty ,\sum _{n\in \mathbb {N} }a_{n}\right]$, but there is no guarantee that it contains any other number.
More generally, let $J$ be an ideal of $\mathbb {N}$, then we can define $S(a,J)=\cup _{I\in J}S(a,I)$.
Let $J_{d}$ be the set of all asymptotic density zero sets $I\subset \mathbb {N}$, that is, $\lim _{n\to \infty }{\frac {|[0,n]\cap I|}{n}}=0$. It's clear that $J_{d}$ is an ideal of $\mathbb {N}$.
(Władysław, 2007) —  If $a$ is a conditionally convergent sum, then $S(a,J_{d})=[-\infty ,\infty ]$ (that is, it is sufficient to rearrange a set of indices of asymptotic density zero).
Proof sketch: Given $a$, a conditionally convergent sum, construct some $I\in J_{d}$ such that $\sum _{n\in I}a_{n}$ and $\sum _{n\not \in I}a_{n}$ are both conditionally convergent. Then, rearranging $\sum _{n\in I}a_{n}$ suffices to converge to any number in $[-\infty ,+\infty ]$.
Filipów and Szuca proved that other ideals also have this property.

### Steinitz's theorem

Given a converging series ∑a$_n${\textstyle \sum a_{n}}of complex numbers, several cases can occur when considering the set of possible sums for all series ∑a$_{σ(n)}${\textstyle \sum a_{\sigma (n)}} obtained by rearranging (permuting) the terms of that series:
* the series ∑a$_n${\textstyle \sum a_{n}} may converge unconditionally; then, all rearranged series converge, and have the same sum: the set of sums of the rearranged series reduces to one point;
* the series ∑a$_n${\textstyle \sum a_{n}} may fail to converge unconditionally; if S denotes the set of sums of those rearranged series that converge, then, either the set S is a line L in the complex plane C, of the form $L=\{a+tb:t\in \mathbb {R} \},\quad a,b\in \mathbb {C} ,\ b\neq 0,$ or the set S is the whole complex plane C.
More generally, given a converging series of vectors in a finite-dimensional real vector space E, the set of sums of converging rearranged series is an affine subspace of E.