5. Basel problem
The Basel problem asserts the value of the convergent series
\sum_{n \geq 1} \frac{1}{n^2} = \frac{\pi^2}{6}. The summand at n = 0 is
1 / 0 = 0 by convention.
Lean code for Definition5.1●1 definition
Associated Lean declarations
-
BaselProblem[complete]
-
BaselProblem[complete]
-
defdefined in DifferentProofs/BaselProblem/Defs.leancomplete
def BaselProblem : Prop
def BaselProblem : Prop
The **Basel problem**: `∑ 1/n² = π²/6`, where the `n = 0` term is `1 / 0 = 0` by convention.
First proof uses Parseval's identity, applied to the function f(x) = x on (-\pi, \pi].
\sum_{n \geq 1} \frac{1}{n^2} = \frac{\pi^2}{6}.
Lean code for Theorem5.2●1 theorem
Associated Lean declarations
-
BaselProblem_Parseval[complete]
-
BaselProblem_Parseval[complete]
-
theoremdefined in DifferentProofs/BaselProblem/Parseval.leancomplete
theorem BaselProblem_Parseval : BaselProblem
theorem BaselProblem_Parseval : BaselProblem
Let f(x) = x on the interval (-\pi, \pi], viewed as a square-integrable
function on the circle \mathbb{R} / 2\pi\mathbb{Z}. Integration by parts gives
its Fourier coefficients c_n; for n \neq 0 the boundary term contributes
c_n = \frac{(-1)^n}{2\pi i n} \cdot 2\pi, whose squared modulus is
\lvert c_n \rvert^2 = 1/n^2, while c_0 = 0 because f is odd. Hence the
identity \lvert c_0 \rvert^2 = 1/0^2 = 0 makes \lvert c_n\rvert^2 = 1/n^2
hold for every integer n.
Parseval's identity states
\sum_{n \in \mathbb{Z}} \lvert c_n \rvert^2
= \frac{1}{2\pi} \int_{-\pi}^{\pi} \lvert f(x) \rvert^2 \, dx.
The right-hand side is \frac{1}{2\pi} \int_{-\pi}^{\pi} x^2 \, dx
= \frac{1}{2\pi} \cdot \frac{2\pi^3}{3} = \frac{\pi^2}{3}. The left-hand side
is \sum_{n \in \mathbb{Z}} \frac{1}{n^2}
= 2 \sum_{n \geq 1} \frac{1}{n^2} because the summand is even and the
n = 0 term vanishes. Equating the two sides gives
2 \sum_{n \geq 1} \frac{1}{n^2} = \frac{\pi^2}{3}, hence
\sum_{n \geq 1} \frac{1}{n^2} = \frac{\pi^2}{6}, the value asserted by the
Basel problem Definition 5.1.
Second proof uses Cauchy's method of bounding the partial sums by evaluating a certain
trigonometric polynomial at the angles \frac{k\pi}{2n+1} for k = 1, \dots, n.
For all \theta \in \mathbb{R} and n \in \mathbb{N},
\sin((2n+1)\theta) = \sum_{j=0}^{n} (-1)^j \binom{2n+1}{2j+1}
\cos^{2(n-j)}\theta \, \sin^{2j+1}\theta.
Lean code for Lemma5.3●1 theorem
Associated Lean declarations
-
BaselProblem.Cauchy.sin_two_mul_add_one[complete]
-
BaselProblem.Cauchy.sin_two_mul_add_one[complete]
-
theoremdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
theorem BaselProblem.Cauchy.sin_two_mul_add_one (n : ℕ) (θ : ℝ) : Real.sin ((2 * ↑n + 1) * θ) = ∑ j ∈ Finset.range (n + 1), (-1) ^ j * ↑((2 * n + 1).choose (2 * j + 1)) * Real.cos θ ^ (2 * (n - j)) * Real.sin θ ^ (2 * j + 1)
theorem BaselProblem.Cauchy.sin_two_mul_add_one (n : ℕ) (θ : ℝ) : Real.sin ((2 * ↑n + 1) * θ) = ∑ j ∈ Finset.range (n + 1), (-1) ^ j * ↑((2 * n + 1).choose (2 * j + 1)) * Real.cos θ ^ (2 * (n - j)) * Real.sin θ ^ (2 * j + 1)
De Moivre expansion of `sin ((2n+1)θ)` as an odd polynomial in `sin θ` and `cos θ`.
Since \cos\theta + i\sin\theta = e^{i\theta}, we have
\sin((2n+1)\theta) = \operatorname{Im}\big((\cos\theta + i\sin\theta)^{2n+1}\big).
Expanding the power by the binomial theorem and taking the imaginary part keeps
exactly the terms with an odd power of i\sin\theta; reindexing those terms by
j gives the stated sum.
For n \in \mathbb{N}, let
P_n(t) = \sum_{j=0}^{n} (-1)^j \binom{2n+1}{2j+1} t^{n-j}. This polynomial has
degree n, leading coefficient 2n+1, and coefficient of t^{n-1} equal to
-\binom{2n+1}{3}.
Lean code for Definition5.4●1 definition
Associated Lean declarations
-
BaselProblem.Cauchy.cotPoly[complete]
-
BaselProblem.Cauchy.cotPoly[complete]
-
defdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
def BaselProblem.Cauchy.cotPoly (n : ℕ) : Polynomial ℝ
def BaselProblem.Cauchy.cotPoly (n : ℕ) : Polynomial ℝ
The degree-`n` polynomial whose roots are `(cot (kπ/(2n+1)))²` for `k = 1, …, n`.
If \sin\theta \neq 0 then
P_n(\cot^2\theta)\,\sin^{2n+1}\theta = \sin((2n+1)\theta).
Lean code for Lemma5.5●1 theorem
Associated Lean declarations
-
BaselProblem.Cauchy.cotPoly_eval[complete]
-
BaselProblem.Cauchy.cotPoly_eval[complete]
-
theoremdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
theorem BaselProblem.Cauchy.cotPoly_eval (n : ℕ) (θ : ℝ) (hθ : Real.sin θ ≠ 0) : Polynomial.eval (θ.cot ^ 2) (BaselProblem.Cauchy.cotPoly n) * Real.sin θ ^ (2 * n + 1) = Real.sin ((2 * ↑n + 1) * θ)
theorem BaselProblem.Cauchy.cotPoly_eval (n : ℕ) (θ : ℝ) (hθ : Real.sin θ ≠ 0) : Polynomial.eval (θ.cot ^ 2) (BaselProblem.Cauchy.cotPoly n) * Real.sin θ ^ (2 * n + 1) = Real.sin ((2 * ↑n + 1) * θ)
Evaluating `cotPoly` at `(cot θ)²` recovers `sin ((2n+1)θ) / sin θ ^ (2n+1)`.
Divide the De Moivre expansion Lemma 5.3 by \sin^{2n+1}\theta.
Each summand becomes
(-1)^j \binom{2n+1}{2j+1} \cos^{2(n-j)}\theta / \sin^{2(n-j)}\theta
= (-1)^j \binom{2n+1}{2j+1} (\cot^2\theta)^{n-j},
and the sum of these is exactly P_n(\cot^2\theta) Definition 5.4.
For n \geq 1,
\sum_{k=1}^{n} \cot^2\!\left(\frac{k\pi}{2n+1}\right) = \frac{n(2n-1)}{3}.
Lean code for Lemma5.6●1 theorem
Associated Lean declarations
-
BaselProblem.Cauchy.cotSq_sum[complete]
-
BaselProblem.Cauchy.cotSq_sum[complete]
-
theoremdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
theorem BaselProblem.Cauchy.cotSq_sum (n : ℕ) (hn : 1 ≤ n) : ∑ k ∈ Finset.Icc 1 n, (↑k * Real.pi / (2 * ↑n + 1)).cot ^ 2 = ↑n * (2 * ↑n - 1) / 3
theorem BaselProblem.Cauchy.cotSq_sum (n : ℕ) (hn : 1 ≤ n) : ∑ k ∈ Finset.Icc 1 n, (↑k * Real.pi / (2 * ↑n + 1)).cot ^ 2 = ↑n * (2 * ↑n - 1) / 3
**Cauchy's identity.** The sum of `(cot (kπ/(2n+1)))²` over `k = 1, …, n` equals `n(2n-1)/3`, obtained from Vieta's formula applied to `cotPoly n`.
For k = 1, \dots, n the angle \theta_k = \frac{k\pi}{2n+1} lies in
(0, \pi/2) and satisfies \sin((2n+1)\theta_k) = \sin(k\pi) = 0 while
\sin\theta_k \neq 0, so Lemma 5.5 shows each
\cot^2\theta_k is a root of P_n. The n values \cot^2\theta_k are
distinct, hence are exactly the roots of the degree-n polynomial P_n. By
Vieta's formula their sum is the negative ratio of the two leading coefficients,
\binom{2n+1}{3} / (2n+1) = \frac{n(2n-1)}{3}.
For 0 < x < \pi/2, \cot^2 x < \frac{1}{x^2}.
Lean code for Lemma5.7●1 theorem
Associated Lean declarations
-
BaselProblem.Cauchy.cotSq_lt_inv_sq[complete]
-
BaselProblem.Cauchy.cotSq_lt_inv_sq[complete]
-
theoremdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
theorem BaselProblem.Cauchy.cotSq_lt_inv_sq (x : ℝ) (hx0 : 0 < x) (hx : x < Real.pi / 2) : x.cot ^ 2 < 1 / x ^ 2
theorem BaselProblem.Cauchy.cotSq_lt_inv_sq (x : ℝ) (hx0 : 0 < x) (hx : x < Real.pi / 2) : x.cot ^ 2 < 1 / x ^ 2
For `x ∈ (0, π/2)`, `cot²x < 1/x²`.
From x < \tan x on (0, \pi/2) we get \cot x < \frac{1}{x}; both sides
are positive, so squaring preserves the inequality.
For 0 < x < \pi/2, \frac{1}{x^2} < 1 + \cot^2 x.
Lean code for Lemma5.8●1 theorem
Associated Lean declarations
-
theoremdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
theorem BaselProblem.Cauchy.inv_sq_lt_one_add_cotSq (x : ℝ) (hx0 : 0 < x) (hx : x < Real.pi / 2) : 1 / x ^ 2 < 1 + x.cot ^ 2
theorem BaselProblem.Cauchy.inv_sq_lt_one_add_cotSq (x : ℝ) (hx0 : 0 < x) (hx : x < Real.pi / 2) : 1 / x ^ 2 < 1 + x.cot ^ 2
For `x ∈ (0, π/2)`, `1/x² < 1 + cot²x` (right half of the squeeze; `csc² = 1 + cot²`).
From 0 < \sin x < x we get
\frac{1}{x^2} < \frac{1}{\sin^2 x} = 1 + \cot^2 x.
\sum_{n \geq 1} \frac{1}{n^2} = \frac{\pi^2}{6}.
Lean code for Theorem5.9●1 theorem
Associated Lean declarations
-
BaselProblem_Cauchy[complete]
-
BaselProblem_Cauchy[complete]
-
theoremdefined in DifferentProofs/BaselProblem/Cauchy.leancomplete
theorem BaselProblem_Cauchy : BaselProblem
theorem BaselProblem_Cauchy : BaselProblem
Apply the squeeze \cot^2 x < \frac{1}{x^2} < 1 + \cot^2 x
(Lemma 5.7 and Lemma 5.8) at the
n angles \theta_k = \frac{k\pi}{2n+1} and sum over k. Using
\sum_{k=1}^n \frac{1}{\theta_k^2} = \frac{(2n+1)^2}{\pi^2}
\sum_{k=1}^n \frac{1}{k^2} together with Cauchy's identity
Lemma 5.6 gives
\frac{n(2n-1)}{3} < \frac{(2n+1)^2}{\pi^2} \sum_{k=1}^n \frac{1}{k^2}
< \frac{n(2n-1)}{3} + n.
Multiplying through by \frac{\pi^2}{(2n+1)^2} sandwiches the partial sum
\sum_{k=1}^n \frac{1}{k^2} between two sequences both tending to
\frac{\pi^2}{6}, so by the squeeze theorem the series converges to
\frac{\pi^2}{6}, the value asserted by the Basel problem Definition 5.1.