Is any finite sum of real numbers well-defined? I am trying to find an argument or counterexample for the following proposition. 

Let $ (a_i)_{i=1}^{n} $ be a finite sequence of real numbers. Then, $ \sum \limits_{i=1}^{n}a_i $ is well defined. 

By "well-defined" I mean that the sum exists and equals to the same real number no matter in which order you sum up the terms. 

My guess is to use induction, but is this correct? 

Thanks.
Sorry but your 'proof' is wrong. Your $P(1)$ is a statement, not a number, so it is meaningless to write "$P(1) = a_1$". Secondly, by writing "$\sum_{i=1}^{k+1} a_i = \sum_{i=1}^{k} a_i + a_{k+1}$" you are already assuming that "$\sum_{i=1}^{k+1} a_i$" is well-defined, otherwise it is invalid to write it anywhere! Thirdly, a finite sequence can have length zero. [Edit: You have only fixed the first error.]

In fact depending on your underlying logic system, the proof that such recursive definitions give well-defined results can be anywhere from simple to highly non-trivial. See this post for a sketch of the proof.

Here is what the intuitive proof be in the case of the summation notation.




  Take any $m \in \mathbb{N}$ and any sequence $(a_k)_{k \in [1..m]}$ from $\mathbb{R}$.
  
  Let $\sum_{k=1}^n a_k = \cases{ 0 &amp; if $n=0$ \\ \sum_{k=1}^{n-1} a_k + a_n &amp; if $n &gt; 0$}$, for each $n \in [0..m]$.


[Note that I have given the definition in the above format to make it clear that it is unambiguous how to interpret the summation notation, since the cases are disjoint and one of the cases must hold for any $n \in [0..m]$. Also, the definition must be interpreted as defining "$\sum_{k=1}^n a_k$" only when the relevant sub-expressions are well-defined. For example, "$\sum_{k=1}^0 a_k$" is well-defined, and hence "$\sum_{k=1}^0 a_k + a_1$" also is, which implies that "$\sum_{k=1}^1 a_k$" is well-defined. And so on.]

Now we proceed by induction to prove that "$\sum_{k=1}^n a_k$" is well-defined for any $n \in [0..m]$.

Let $P(n)$ be the assertion that if $n \in [0..m]$ then "$\sum_{k=1}^n a_k$" is a well-defined real number.

Then $P(0)$ is true because "$\sum_{k=1}^0 a_k$" is well-defined since it is defined as "$0$", which is a well-defined real number.

Given any $n \in \mathbb{N}$ such that $P(n)$ is true:

&emsp; If $n+1 \in [0..m]$:

&emsp; &emsp; "$\sum_{k=1}^{n+1} a_k$" is defined as "$\sum_{k=1}^{(n+1)-1} a_k + a_{n+1}$" since $n+1 &gt; 0$.

&emsp; &emsp; Also "$\sum_{k=1}^{(n+1)-1} a_k + a_{n+1}$" reduces to "$\sum_{k=1}^n a_k + a_{n+1}$".

&emsp; &emsp; And "$\sum_{k=1}^n a_k$" is a well-defined real number because $P(n)$ is true and $n \in [0..m]$.

&emsp; &emsp; Thus "$\sum_{k=1}^{n+1} a_k$" is a well-defined real number because $\mathbb{R}$ is closed under addition.

&emsp; Thus $P(n+1)$ is true.

Therefore by induction $P(n)$ is true for every $n \in \mathbb{N}$.

Thus "$\sum_{k=1}^n a_k$" is a well-defined real number for any $n \in [0..m]$.



Note that it is important to include as part of the induction predicate that the sum is a real number, otherwise you cannot perform the induction step! Also, note that the induction predicate contains the cut-off condition that $n \in [0..m]$. This is in general how we can prove statements for (arbitrary-length) finite sequences using induction.

Now I'll sketch the proof that the summation is independent of order of the terms. To state it in full generality, we first have to define permutations on finite sequences:


  We say that a function $σ$ is a permutation on a set $S$ iff $σ$ is a bijection from $S$ to $S$.


And then the theorem would be:


  Take any $n \in \mathbb{N}$ and sequence $(a_k)_{k \in [1..n]}$.
  
  Then $\sum_{k=1}^n a_k = \sum_{k=1}^n a_{σ(k)}$ for any permutation $σ$ on $[1..n]$.


The rough idea of the proof I'm going to give is that we first get rid of the cases of $n = 0$ and $n = 1$, and we permute the first $(n-1)$ terms in such a way that we can swap the last two terms to get the right term at the end, and then we permute the first $(n-1)$ terms again to get the desired permutation. The first permutation we use can be a simple one, such as just swapping the $σ(n)$-th term to the $(n-1)$-th position. Both the first and the last permutations do not change the value by the induction. The swap of the last two terms come from associativity and commutativity of addition on reals.

Normally, the above paragraph is sufficient for an informal proof, but below is the sketch of the rigorous proof. Suffice to say that it is worth knowing how it is done but not worth doing it every time.
$
\def\l{\left}
\def\r{\right}
\def\less{\smallsetminus}
\def\on{\restriction}
$



Let $P(n)$ be the assertion that for any sequence $(a_k)_{k \in [1..n]}$ we have $\sum_{k=1}^n a_{σ(k)} = \sum_{k=1}^n a_k$ for any permutation $σ$ on $[1..n]$.

Then $P(0)$ and $P(1)$ are trivially true.

Take any $n \in \mathbb{N}$ such that $n &gt; 1$.

By induction we can assume that $P(n-1)$ is true. [I will mark each use of this with a "$\ast$".]

If $σ(n) = n$:

&emsp; $σ \on [1..n-1]$ ($σ$ with domain restricted to $[1..n-1]$) is a permutation on $[1..n-1]$.

&emsp; Thus $\sum_{k=1}^n a_k = \sum_{k=1}^{n-1} a_k + a_n \overset{\ast}= \sum_{k=1}^{n-1} a_{σ(k)} + a_n = \sum_{k=1}^{n-1} a_{σ(k)} + a_{σ(n)} = \sum_{k=1}^n a_{σ(k)}$.

If $σ(n) \ne n$:

&emsp; Let $c \in [1..n-1]$ such that $σ(c) = n$.

&emsp; Let $τ$ be the swap $(\ n-1 \quad σ(n)\ )$ on $[1..n-1]$. [This is the first permutation.]

&emsp; [Precisely, let $τ(i) = \cases{ σ(n) &amp; if $i = n-1$ \\ n-1 &amp; if $i = σ(n)$ \\ i &amp; if $i \in [1..n-2] \less \{σ(n)\}$ }$, for each $i \in [1..n-1]$.]

&emsp; Then $\sum_{k=1}^n a_k = \sum_{k=1}^{n-1} a_k + a_n \overset{\ast}= \sum_{k=1}^{n-1} a_{τ(k)} + a_n = \l( \sum_{k=1}^{n-2} a_{τ(k)} + a_{σ(n)} \r) + a_n$

&emsp; &emsp; $= \l( \sum_{k=1}^{n-2} a_{τ(k)} + a_n \r) + a_{σ(n)} = \sum_{k=1}^{n-1} b_k + a_{σ(n)}$

&emsp; &emsp; &emsp; where $b_k = \cases{ a_{τ(k)} &amp; if $k \in [1..n-2]$ \\ a_n &amp; if $k = n-1$ }$, for each $k \in [1..n-1]$.

&emsp; Note that $\langle τ(k) \rangle_{k \in [1..n-2]} \cdot \langle n \rangle$ is a permutation of $[1..n] \less \{σ(n)\}$.

&emsp; Note also that $\langle σ(k) \rangle_{k \in [1..n-1]}$ is a permutation of $[1..n] \less \{σ(n)\}$.

&emsp; Thus $b$ is a bijection from $[1..n-1]$ to $\{ a_{σ(k)} : k \in [1..n-1] \}$.

&emsp; Thus let $ρ$ be a permutation on $[1..n-1]$ such that $b_{ρ(k)} = a_{σ(k)}$ for each $k \in [1..n-1]$.

&emsp; [Precisely, let $ρ(k) = b^{-1}(a_{σ(k)})$, for each $k \in [1..n-1]$.]

&emsp; Then $\sum_{k=1}^{n-1} b_k + a_{σ(n)} \overset{\ast}= \sum_{k=1}^{n-1} b_{ρ(k)} + a_{σ(n)} = \sum_{k=1}^{n-1} a_{σ(k)} + a_{σ(n)} = \sum_{k=1}^n a_{σ(k)}$.

Therefore $\sum_{k=1}^n a_k = \sum_{k=1}^n a_{σ(k)}$.
Let $\left(a_i\right)_1^n\in\mathbb{R}$ and $A_k=\sum_{i=1}^k a_i$, then:

Addition is binary relation: $\forall a,b\in\mathbb R:a+b\in\mathbb R$
Addition is comutative: $\forall a,b\in\mathbb R:a+b=b+a$

$A_1=\sum_{i=1}^1a_i=a_1\in\mathbb R$;
$A_2=\sum_{i=1}^2a_i=a_1+a_2=A_1+a_2=a_2+A_1\in\mathbb R$;
$A_3=\sum_{i=1}^3a_i=a_1+a_2+a_3=A_2+a_3=a_3+A_2\in\mathbb R$;
$\qquad\vdots$
$A_{k}=\sum_{i=1}^ka_i=A_{k-1}+a_k=a_k+A_{k-1}\in\mathbb R$.