# Documentation

Mathlib.Analysis.SpecialFunctions.Gamma.Beta

# The Beta function, and further properties of the Gamma function #

In this file we define the Beta integral, relate Beta and Gamma functions, and prove some refined properties of the Gamma function using these relations.

## Results on the Beta function #

• Complex.betaIntegral: the Beta function Β(u, v), where u, v are complex with positive real part.
• Complex.Gamma_mul_Gamma_eq_betaIntegral: the formula Gamma u * Gamma v = Gamma (u + v) * betaIntegral u v.

## Results on the Gamma function #

• Complex.Gamma_ne_zero: for all s : ℂ with s ∉ {-n : n ∈ ℕ} we have Γ s ≠ 0.
• Complex.GammaSeq_tendsto_Gamma: for all s, the limit as n → ∞ of the sequence n ↦ n ^ s * n! / (s * (s + 1) * ... * (s + n)) is Γ(s).
• Complex.Gamma_mul_Gamma_one_sub: Euler's reflection formula Gamma s * Gamma (1 - s) = π / sin π s.
• Complex.differentiable_one_div_Gamma: the function 1 / Γ(s) is differentiable everywhere.
• Complex.Gamma_mul_Gamma_add_half: Legendre's duplication formula Gamma s * Gamma (s + 1 / 2) = Gamma (2 * s) * 2 ^ (1 - 2 * s) * sqrt π.
• Real.Gamma_ne_zero, Real.GammaSeq_tendsto_Gamma, Real.Gamma_mul_Gamma_one_sub, Real.Gamma_mul_Gamma_add_half: real versions of the above.

## The Beta function #

noncomputable def Complex.betaIntegral (u : ) (v : ) :

The Beta function Β (u, v), defined as ∫ x:ℝ in 0..1, x ^ (u - 1) * (1 - x) ^ (v - 1).

Instances For
theorem Complex.betaIntegral_convergent_left {u : } (hu : 0 < u.re) (v : ) :
IntervalIntegrable (fun x => x ^ (u - 1) * (1 - x) ^ (v - 1)) MeasureTheory.volume 0 (1 / 2)

Auxiliary lemma for betaIntegral_convergent, showing convergence at the left endpoint.

theorem Complex.betaIntegral_convergent {u : } {v : } (hu : 0 < u.re) (hv : 0 < v.re) :
IntervalIntegrable (fun x => x ^ (u - 1) * (1 - x) ^ (v - 1)) MeasureTheory.volume 0 1

The Beta integral is convergent for all u, v of positive real part.

theorem Complex.betaIntegral_eval_one_right {u : } (hu : 0 < u.re) :
= 1 / u
theorem Complex.betaIntegral_scaled (s : ) (t : ) {a : } (ha : 0 < a) :
∫ (x : ) in 0 ..a, x ^ (s - 1) * (a - x) ^ (t - 1) = a ^ (s + t - 1) *
theorem Complex.Gamma_mul_Gamma_eq_betaIntegral {s : } {t : } (hs : 0 < s.re) (ht : 0 < t.re) :
= Complex.Gamma (s + t) *

Relation between Beta integral and Gamma function.

theorem Complex.betaIntegral_recurrence {u : } {v : } (hu : 0 < u.re) (hv : 0 < v.re) :

Recurrence formula for the Beta function.

theorem Complex.betaIntegral_eval_nat_add_one_right {u : } (hu : 0 < u.re) (n : ) :
Complex.betaIntegral u (n + 1) = ↑() / Finset.prod (Finset.range (n + 1)) fun j => u + j

Explicit formula for the Beta function when second argument is a positive integer.

## The Euler limit formula #

noncomputable def Complex.GammaSeq (s : ) (n : ) :

The sequence with n-th term n ^ s * n! / (s * (s + 1) * ... * (s + n)), for complex s. We will show that this tends to Γ(s) as n → ∞.

Instances For
theorem Complex.GammaSeq_eq_betaIntegral_of_re_pos {s : } (hs : 0 < s.re) (n : ) :
= n ^ s * Complex.betaIntegral s (n + 1)
theorem Complex.GammaSeq_add_one_left (s : ) {n : } (hn : n 0) :
Complex.GammaSeq (s + 1) n / s = n / (n + 1 + s) *
theorem Complex.GammaSeq_eq_approx_Gamma_integral {s : } (hs : 0 < s.re) {n : } (hn : n 0) :
= ∫ (x : ) in 0 ..n, ↑((1 - x / n) ^ n) * x ^ (s - 1)
theorem Complex.approx_Gamma_integral_tendsto_Gamma_integral {s : } (hs : 0 < s.re) :
Filter.Tendsto (fun n => ∫ (x : ) in 0 ..n, ↑((1 - x / n) ^ n) * x ^ (s - 1)) Filter.atTop ()

The main techical lemma for GammaSeq_tendsto_Gamma, expressing the integral defining the Gamma function for 0 < re s as the limit of a sequence of integrals over finite intervals.

theorem Complex.GammaSeq_tendsto_Gamma (s : ) :
Filter.Tendsto () Filter.atTop ()

Euler's limit formula for the complex Gamma function.

## The reflection formula #

theorem Complex.GammaSeq_mul (z : ) {n : } (hn : n 0) :
* Complex.GammaSeq (1 - z) n = n / (n + 1 - z) * (1 / (z * Finset.prod () fun j => 1 - z ^ 2 / (j + 1) ^ 2))

Euler's reflection formula for the complex Gamma function.

theorem Complex.Gamma_ne_zero {s : } (hs : ∀ (m : ), s -m) :

The Gamma function does not vanish on ℂ (except at non-positive integers, where the function is mathematically undefined and we set it to 0 by convention).

theorem Complex.Gamma_eq_zero_iff (s : ) :
m, s = -m
theorem Complex.Gamma_ne_zero_of_re_pos {s : } (hs : 0 < s.re) :

A weaker, but easier-to-apply, version of Complex.Gamma_ne_zero.

noncomputable def Real.GammaSeq (s : ) (n : ) :

The sequence with n-th term n ^ s * n! / (s * (s + 1) * ... * (s + n)), for real s. We will show that this tends to Γ(s) as n → ∞.

Instances For
theorem Real.GammaSeq_tendsto_Gamma (s : ) :
Filter.Tendsto () Filter.atTop (nhds ())

Euler's limit formula for the real Gamma function.

Euler's reflection formula for the real Gamma function.

## The reciprocal Gamma function #

We show that the reciprocal Gamma function 1 / Γ(s) is entire. These lemmas show that (in this case at least) mathlib's conventions for division by zero do actually give a mathematically useful answer! (These results are useful in the theory of zeta and L-functions.)

A reformulation of the Gamma recurrence relation which is true for s = 0 as well.

The reciprocal of the Gamma function is differentiable everywhere (including the points where Gamma itself is not).

## The doubling formula for Gamma #

We prove the doubling formula for arbitrary real or complex arguments, by analytic continuation from the positive real case. (Knowing that Γ⁻¹ is analytic everywhere makes this much simpler, since we do not have to do any special-case handling for the poles of Γ.)

theorem Complex.Gamma_mul_Gamma_add_half (s : ) :
* Complex.Gamma (s + 1 / 2) = Complex.Gamma (2 * s) * 2 ^ (1 - 2 * s) * ↑()
theorem Real.Gamma_mul_Gamma_add_half (s : ) :
* Real.Gamma (s + 1 / 2) = Real.Gamma (2 * s) * 2 ^ (1 - 2 * s) *