Documentation

Mathlib.Analysis.SpecialFunctions.Gamma.Basic

The Gamma function #

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) #

Gamma function: main statements (real case) #

Tags #

Gamma

theorem Real.Gamma_integrand_isLittleO (s : ℝ) :
(fun (x : ℝ) => exp (-x) * x ^ s) =o[Filter.atTop] fun (x : ℝ) => exp (-(1 / 2) * x)

Asymptotic bound for the Γ function integrand.

theorem Real.GammaIntegral_convergent {s : ℝ} (h : 0 < s) :

The Euler integral for the Γ function converges for positive real s.

theorem Complex.GammaIntegral_convergent {s : ℂ} (hs : 0 < s.re) :
MeasureTheory.IntegrableOn (fun (x : ℝ) => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) (Set.Ioi 0) MeasureTheory.volume

The integral defining the Γ function converges for complex s with 0 < re s.

This is proved by reduction to the real case.

noncomputable def Complex.GammaIntegral (s : ℂ) :

Euler's integral for the Γ function (of a complex variable s), defined as ∫ x in Ioi 0, exp (-x) * x ^ (s - 1).

See Complex.GammaIntegral_convergent for a proof of the convergence of the integral for 0 < re s.

Equations
Instances For
    theorem Complex.GammaIntegral_ofReal (s : ℝ) :
    (↑s).GammaIntegral = ↑(∫ (x : ℝ) in Set.Ioi 0, Real.exp (-x) * x ^ (s - 1))

    Now we establish the recurrence relation Γ(s + 1) = s * Γ(s) using integration by parts.

    noncomputable def Complex.partialGamma (s : ℂ) (X : ℝ) :

    The indefinite version of the Γ function, Γ(s, X) = ∫ x ∈ 0..X, exp(-x) x ^ (s - 1).

    Equations
    Instances For
      theorem Complex.partialGamma_add_one {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
      (s + 1).partialGamma X = s * s.partialGamma X - ↑(Real.exp (-X)) * ↑X ^ s

      The recurrence relation for the indefinite version of the Γ function.

      theorem Complex.GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :

      The recurrence relation for the Γ integral.

      Now we define Γ(s) on the whole complex plane, by recursion.

      noncomputable def Complex.GammaAux :
      ℕ → ℂ → ℂ

      The nth function in this family is Γ(s) if -n < s.re, and junk otherwise.

      Equations
      Instances For
        theorem Complex.GammaAux_recurrence1 (s : ℂ) (n : ℕ) (h1 : -s.re < ↑n) :
        GammaAux n s = GammaAux n (s + 1) / s
        theorem Complex.GammaAux_recurrence2 (s : ℂ) (n : ℕ) (h1 : -s.re < ↑n) :
        GammaAux n s = GammaAux (n + 1) s
        @[irreducible]
        noncomputable def Complex.Gamma (s : ℂ) :

        The Γ function (of a complex variable s).

        Equations
        Instances For
          theorem Complex.Gamma_eq_GammaAux (s : ℂ) (n : ℕ) (h1 : -s.re < ↑n) :
          theorem Complex.Gamma_add_one (s : ℂ) (h2 : s ≠ 0) :
          Gamma (s + 1) = s * Gamma s

          The recurrence relation for the Γ function.

          @[simp]
          @[simp]

          At 0 the Gamma function is undefined; by convention we assign it the value 0.

          theorem Complex.Gamma_neg_nat_eq_zero (n : ℕ) :
          Gamma (-↑n) = 0

          At -n for n ∈ ℕ, the Gamma function is undefined; by convention we assign it the value 0.

          theorem Complex.integral_cpow_mul_exp_neg_mul_Ioi {a : ℂ} {r : ℝ} (ha : 0 < a.re) (hr : 0 < r) :
          ∫ (t : ℝ) in Set.Ioi 0, ↑t ^ (a - 1) * exp (-(↑r * ↑t)) = (1 / ↑r) ^ a * Gamma a

          Expresses the integral over Ioi 0 of t ^ (a - 1) * exp (-(r * t)) in terms of the Gamma function, for complex a.

          noncomputable def Real.Gamma (s : ℝ) :

          The Γ function (of a real variable s).

          Equations
          Instances For
            theorem Real.Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
            Gamma s = ∫ (x : ℝ) in Set.Ioi 0, exp (-x) * x ^ (s - 1)
            theorem Real.Gamma_add_one {s : ℝ} (hs : s ≠ 0) :
            Gamma (s + 1) = s * Gamma s
            @[simp]
            theorem Real.Gamma_one :
            Gamma 1 = 1
            theorem Complex.Gamma_ofReal (s : ℝ) :
            Gamma ↑s = ↑(Real.Gamma s)
            @[simp]
            @[simp]
            theorem Real.Gamma_zero :
            Gamma 0 = 0

            At 0 the Gamma function is undefined; by convention we assign it the value 0.

            theorem Real.Gamma_neg_nat_eq_zero (n : ℕ) :
            Gamma (-↑n) = 0

            At -n for n ∈ ℕ, the Gamma function is undefined; by convention we assign it the value 0.

            theorem Real.Gamma_pos_of_pos {s : ℝ} (hs : 0 < s) :
            0 < Gamma s
            theorem Real.Gamma_nonneg_of_nonneg {s : ℝ} (hs : 0 ≤ s) :
            theorem Real.integral_rpow_mul_exp_neg_mul_Ioi {a r : ℝ} (ha : 0 < a) (hr : 0 < r) :
            ∫ (t : ℝ) in Set.Ioi 0, t ^ (a - 1) * exp (-(r * t)) = (1 / r) ^ a * Gamma a

            Expresses the integral over Ioi 0 of t ^ (a - 1) * exp (-(r * t)), for positive real r, in terms of the Gamma function.

            The positivity extension which identifies expressions of the form Gamma a.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Real.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 Real.Gamma_eq_zero_iff (s : ℝ) :
              Gamma s = 0 ↔ ∃ (m : ℕ), s = -↑m