The Gamma function #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the Γ function (of a real or complex variable s). We define this by Euler's
integral Γ(s) = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) in the range where this integral converges
(i.e., for 0 < s in the real case, and 0 < re s in the complex case).
We show that this integral satisfies Γ(1) = 1 and Γ(s + 1) = s * Γ(s); hence we can define
Γ(s) for all s as the unique function satisfying this recurrence and agreeing with Euler's
integral in the convergence range. (If s = -n for n ∈ ℕ, then the function is undefined, and we
set it to be 0 by convention.)
Gamma function: main statements (complex case) #
complex.Gamma: theΓfunction (of a complex variable).complex.Gamma_eq_integral: for0 < re s,Γ(s)agrees with Euler's integral.complex.Gamma_add_one: for alls : ℂwiths ≠ 0, we haveΓ (s + 1) = s Γ(s).complex.Gamma_nat_eq_factorial: for alln : ℕwe haveΓ (n + 1) = n!.complex.differentiable_at_Gamma:Γis complex-differentiable at alls : ℂwiths ∉ {-n : n ∈ ℕ}.
Gamma function: main statements (real case) #
real.Gamma: theΓfunction (of a real variable).- Real counterparts of all the properties of the complex Gamma function listed above:
real.Gamma_eq_integral,real.Gamma_add_one,real.Gamma_nat_eq_factorial,real.differentiable_at_Gamma.
Tags #
Gamma
The Euler integral for the Γ function converges for positive real s.
The integral defining the Γ function converges for complex s with 0 < re s.
This is proved by reduction to the real case.
Euler's integral for the Γ function (of a complex variable s), defined as
∫ x in Ioi 0, exp (-x) * x ^ (s - 1).
See complex.Gamma_integral_convergent for a proof of the convergence of the integral for
0 < re s.
Now we establish the recurrence relation Γ(s + 1) = s * Γ(s) using integration by parts.
The recurrence relation for the Γ integral.
Now we define Γ(s) on the whole complex plane, by recursion.
The nth function in this family is Γ(s) if -n < s.re, and junk otherwise.
Equations
- complex.Gamma_aux (n + 1) = λ (s : ℂ), complex.Gamma_aux n (s + 1) / s
- complex.Gamma_aux 0 = complex.Gamma_integral
The Γ function (of a complex variable s).
Equations
- complex.Gamma s = complex.Gamma_aux ⌊1 - s.re⌋₊ s
The recurrence relation for the Γ function.
At 0 the Gamma function is undefined; by convention we assign it the value 0.
At -n for n ∈ ℕ, the Gamma function is undefined; by convention we assign it the value 0.
Now check that the Γ function is differentiable, wherever this makes sense.
Rewrite the Gamma integral as an example of a Mellin transform.
The derivative of the Γ integral, at any s ∈ ℂ with 1 < re s, is given by the Melllin
transform of log t * exp (-t).
At s = 0, the Gamma function has a simple pole with residue 1.
The Γ function (of a real variable s).
Equations
- real.Gamma s = (complex.Gamma ↑s).re
At 0 the Gamma function is undefined; by convention we assign it the value 0.
At -n for n ∈ ℕ, the Gamma function is undefined; by convention we assign it the value 0.
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).