Example 52 (Sum of the first \(n\) natural numbers) For every \(n \in \mathbb{N}\),
\[
\sum_{i=1}^ni = \frac{n(n+1)}{2}.
\]
For example, with \(n = 3\), \(1 + 2 + 3 = 6\) and \(\frac{3 \cdot 4}{2} = 6\). To prove the equation for every \(n\), let \(P(n)\) be the equation and use Definition 42 with \(n_0 = 1\).
Base case, \(n = 1\). The sum has one term:
\[
\begin{aligned}
\sum_{i=1}^{1} i
&= 1
&& \text{(definition of a sum)}
\end{aligned}
\]
and the right side is
\[
\begin{aligned}
\frac{1\,(1+1)}{2}
&= \frac{1 \cdot 2}{2}
&& \text{(} 1 + 1 = 2 \text{)}
\\
&= \frac{2}{2}
&& \text{(} 1 \cdot 2 = 2 \text{)}
\\
&= 1.
&& \text{(} \tfrac{2}{2} = 1 \text{)}
\end{aligned}
\]
So \(P(1)\) holds.
Inductive step. Let \(n \ge 2\), and suppose \(P(n - 1)\) holds:
\[
\sum_{i=1}^{n-1} i = \frac{(n-1)\,\mathopen{}\left((n-1)+1\right)\mathclose{}}{2}.
\]
Then
\[
\begin{aligned}
\sum_{i=1}^ni
&= 1 + 2 + \cdots + (n-1) + n
&& \text{(definition of a sum)}
\\
&= \mathopen{}\left(1 + 2 + \cdots + (n-1)\right)\mathclose{} + n
&& \text{(associative law)}
\\
&= \sum_{i=1}^{n-1} i + n
&& \text{(definition of a sum)}
\\
&= \frac{(n-1)\,\mathopen{}\left((n-1)+1\right)\mathclose{}}{2} + n
&& \text{(induction hypothesis)}
\\
&= \frac{(n-1)\,n}{2} + n
&& \text{(} (n-1) + 1 = n \text{)}
\\
&= \frac{(n-1)\,n}{2} + \frac{2n}{2}
&& \text{(} n = \tfrac{2n}{2} \text{)}
\\
&= \frac{(n-1)\,n + 2n}{2}
&& \text{(common denominator)}
\\
&= \frac{\mathopen{}\left((n-1) + 2\right)\mathclose{}\,n}{2}
&& \text{(distributive law)}
\\
&= \frac{(n+1)\,n}{2}
&& \text{(} (n-1) + 2 = n + 1 \text{)}
\\
&= \frac{n(n+1)}{2},
&& \text{(commutative law)}
\end{aligned}
\]
which is \(P(n)\). By Definition 42, the equation holds for every \(n \in \mathbb{N}\).