@@ -3,14 +3,15 @@ Copyright (c) 2019 Floris van Doorn. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Floris van Doorn, Benjamin Davidson
5
5
-/
6
- import analysis.special_functions.pow
6
+ import analysis.special_functions.integrals
7
7
/-!
8
8
# Pi
9
9
10
10
This file contains lemmas which establish bounds on or approximations of `real.pi`. Notably, these
11
11
include `pi_gt_sqrt_two_add_series` and `pi_lt_sqrt_two_add_series`, which bound `π` using series;
12
12
numerical bounds on `π` such as `pi_gt_314`and `pi_lt_315` (more precise versions are given, too);
13
- and `tendsto_sum_pi_div_four`, Leibniz's series for `π`.
13
+ and exact (infinite) formulas involving `π`, such as `tendsto_sum_pi_div_four`, Leibniz's
14
+ series for `π`, and `tendsto_prod_pi_div_two`, the Wallis product for `π`.
14
15
-/
15
16
16
17
open_locale real
@@ -275,4 +276,88 @@ begin
275
276
... = 1 - (u k) + (u k)^(2 *(k:ℝ)+1 ) : by { rw [← pow_succ' (U:ℝ) (2 *k)], norm_cast },
276
277
end
277
278
279
+ open finset interval_integral
280
+
281
+ lemma integral_sin_pow_antimono (n : ℕ) :
282
+ ∫ (x : ℝ) in 0 ..π, sin x ^ (n + 1 ) ≤ ∫ (x : ℝ) in 0 ..π, sin x ^ n :=
283
+ begin
284
+ refine integral_mono_on _ _ pi_pos.le (λ x hx, _),
285
+ { exact ((continuous_pow (n + 1 )).comp continuous_sin).interval_integrable 0 π },
286
+ { exact ((continuous_pow n).comp continuous_sin).interval_integrable 0 π },
287
+ refine pow_le_pow_of_le_one _ (sin_le_one x) (nat.le_add_right n 1 ),
288
+ rw interval_of_le pi_pos.le at hx,
289
+ exact sin_nonneg_of_mem_Icc hx,
290
+ end
291
+
292
+ lemma integral_sin_pow_div_tendsto_one :
293
+ tendsto (λ k, (∫ x in 0 ..π, sin x ^ (2 * k + 1 )) / ∫ x in 0 ..π, sin x ^ (2 * k)) at_top (𝓝 1 ) :=
294
+ begin
295
+ have h₃ : ∀ n, (∫ x in 0 ..π, sin x ^ (2 * n + 1 )) / ∫ x in 0 ..π, sin x ^ (2 * n) ≤ 1 :=
296
+ λ n, (div_le_one (integral_sin_pow_pos _)).mpr (integral_sin_pow_antimono _),
297
+ have h₄ :
298
+ ∀ n, (∫ x in 0 ..π, sin x ^ (2 * n + 1 )) / ∫ x in 0 ..π, sin x ^ (2 * n) ≥ 2 * n / (2 * n + 1 ),
299
+ { intro, cases n,
300
+ { have : 0 ≤ (1 + 1 ) / π, exact div_nonneg (by norm_num) pi_pos.le,
301
+ simp [this ] },
302
+ calc (∫ x in 0 ..π, sin x ^ (2 * n.succ + 1 )) / ∫ x in 0 ..π, sin x ^ (2 * n.succ) ≥
303
+ (∫ x in 0 ..π, sin x ^ (2 * n.succ + 1 )) / ∫ x in 0 ..π, sin x ^ (2 * n + 1 ) :
304
+ by { refine div_le_div (integral_sin_pow_pos _).le (le_refl _) (integral_sin_pow_pos _) _,
305
+ convert integral_sin_pow_antimono (2 * n + 1 ) using 1 }
306
+ ... = 2 * ↑(n.succ) / (2 * ↑(n.succ) + 1 ) :
307
+ by { symmetry, rw [eq_div_iff, nat.succ_eq_add_one],
308
+ convert (integral_sin_pow_succ_succ (2 * n + 1 )).symm using 3 ,
309
+ simp [mul_add], ring, simp [mul_add], ring,
310
+ exact norm_num.ne_zero_of_pos _ (integral_sin_pow_pos (2 * n + 1 )) } },
311
+ refine tendsto_of_tendsto_of_tendsto_of_le_of_le _ _ (λ n, (h₄ n).le) (λ n, (h₃ n)),
312
+ { refine metric.tendsto_at_top.mpr (λ ε hε, ⟨nat_ceil (1 / ε), λ n hn, _⟩),
313
+ have h : (2 :ℝ) * n / (2 * n + 1 ) - 1 = -1 / (2 * n + 1 ),
314
+ { conv_lhs { congr, skip, rw ← @div_self _ _ ((2 :ℝ) * n + 1 ) (by { norm_cast, linarith }), },
315
+ rw [← sub_div, ← sub_sub, sub_self, zero_sub] },
316
+ have hpos : (0 :ℝ) < 2 * n + 1 , { norm_cast, norm_num },
317
+ rw [real.dist_eq, h, abs_div, abs_neg, abs_one, abs_of_pos hpos, one_div_lt hpos hε],
318
+ calc 1 / ε ≤ nat_ceil (1 / ε) : le_nat_ceil _
319
+ ... ≤ n : by exact_mod_cast hn.le
320
+ ... < 2 * n + 1 : by { norm_cast, linarith } },
321
+ exact tendsto_const_nhds,
322
+ end
323
+
324
+ /-- This theorem establishes the Wallis Product for `π`. Our proof is largely about analyzing
325
+ the behavior of the ratio of the integral of `sin x ^ n` as `n → ∞`.
326
+ See: https://en.wikipedia.org/wiki/Wallis_product
327
+
328
+ The proof can be broken down into two pieces.
329
+ (Pieces involving general properties of the integral of `sin x ^n` can be found
330
+ in `analysis.special_functions.integrals`.) First, we use integration by parts to obtain a
331
+ recursive formula for `∫ x in 0..π, sin x ^ (n + 2)` in terms of `∫ x in 0..π, sin x ^ n`.
332
+ From this we can obtain closed form products of `∫ x in 0..π, sin x ^ (2 * n)` and
333
+ `∫ x in 0..π, sin x ^ (2 * n + 1)` via induction. Next, we study the behavior of the ratio
334
+ `∫ (x : ℝ) in 0..π, sin x ^ (2 * k + 1)) / ∫ (x : ℝ) in 0..π, sin x ^ (2 * k)` and prove that
335
+ it converges to one using the squeeze theorem. The final product for `π` is obtained after some
336
+ algebraic manipulation. -/
337
+ theorem tendsto_prod_pi_div_two :
338
+ tendsto (λ k, ∏ i in range k,
339
+ (((2 :ℝ) * i + 2 ) / (2 * i + 1 )) * ((2 * i + 2 ) / (2 * i + 3 ))) at_top (𝓝 (π/2 )) :=
340
+ begin
341
+ suffices h : tendsto (λ k, 2 / π * ∏ i in range k,
342
+ (((2 :ℝ) * i + 2 ) / (2 * i + 1 )) * ((2 * i + 2 ) / (2 * i + 3 ))) at_top (𝓝 1 ),
343
+ { have := tendsto.const_mul (π / 2 ) h,
344
+ have h : π / 2 ≠ 0 , norm_num [pi_ne_zero],
345
+ simp only [← mul_assoc, ← @inv_div _ _ π 2 , mul_inv_cancel h, one_mul, mul_one] at this ,
346
+ exact this },
347
+ have h : (λ (k : ℕ), (2 :ℝ) / π * ∏ (i : ℕ) in range k,
348
+ ((2 * i + 2 ) / (2 * i + 1 )) * ((2 * i + 2 ) / (2 * i + 3 ))) =
349
+ λ k, (2 * ∏ i in range k,
350
+ (2 * i + 2 ) / (2 * i + 3 )) / (π * ∏ (i : ℕ) in range k, (2 * i + 1 ) / (2 * i + 2 )),
351
+ { funext,
352
+ have h : ∏ (i : ℕ) in range k, ((2 :ℝ) * ↑i + 2 ) / (2 * ↑i + 1 ) =
353
+ 1 / (∏ (i : ℕ) in range k, (2 * ↑i + 1 ) / (2 * ↑i + 2 )),
354
+ { rw [one_div, ← finset.prod_inv_distrib'],
355
+ refine prod_congr rfl (λ x hx, _),
356
+ field_simp },
357
+ rw [prod_mul_distrib, h],
358
+ field_simp },
359
+ simp only [h, ← integral_sin_pow_even, ← integral_sin_pow_odd],
360
+ exact integral_sin_pow_div_tendsto_one,
361
+ end
362
+
278
363
end real
0 commit comments