Documentation

Interval.EulerMaclaurin.Gamma

The Stirling series for the gamma function #

Derivatives of y ↦ log (x + y) #

theorem contDiffAt_log_add {x y : } (xy : 0 < x + y) :
ContDiffAt (fun (y : ) => Real.log (x + y)) y
theorem contDiffOn_log_add {x : } {s : WithTop ℕ∞} :
ContDiffOn s (fun (y : ) => Real.log (x + y)) (Set.Ioi (-x))
theorem deriv_log_add {x y : } (xy : 0 < x + y) :
deriv (fun (y : ) => Real.log (x + y)) y = (x + y)⁻¹
theorem HasDerivAt.zpow {x : } {f : } {f' : } (df : HasDerivAt f f' x) {n : } (g : f x 0 0 n) :
HasDerivAt (fun (x : ) => f x ^ n) (n * f x ^ (n - 1) * f') x
theorem iteratedDeriv_log_add {x y : } (xy : 0 < x + y) (s : ) :
iteratedDeriv (s + 1) (fun (y : ) => Real.log (x + y)) y = (-1) ^ s * s.factorial * (x + y) ^ (-s - 1)
@[simp]
theorem iteratedDerivWithin_log_add_succ {x y : } (s : ) (xy : 0 < x + y) :
iteratedDerivWithin (s + 1) (fun (y : ) => Real.log (x + y)) (Set.Ioi (-x)) y = (-1) ^ s * s.factorial * (x + y) ^ (-s - 1)
@[simp]
theorem iteratedDerivWithin_log_add_one {x y : } (xy : 0 < x + y) :
iteratedDerivWithin 1 (fun (y : ) => Real.log (x + y)) (Set.Ioi (-x)) y = (x + y)⁻¹

Rising log factorials and logGammaSeq #

def log_rising (x : ) (n : ) :

log x + log (x + 1) + ... + log (x + n)

Equations
Instances For
    @[simp]
    theorem log_rising_zero (x : ) :
    theorem log_rising_succ (x : ) (n : ) :
    log_rising x (n + 1) = log_rising x n + Real.log (x + n + 1)
    theorem log_rising_eq_sum (x : ) (n : ) :
    log_rising x n = mFinset.range (n + 1), Real.log (x + m)

    Approximating log_rising and gamma via Euler-Maclaurin #

    def term (x : ) (s : ) :
    Equations
    Instances For
      def sum (x : ) (s : ) :
      Equations
      Instances For
        def rem_n (x : ) (n s : ) :
        Equations
        Instances For
          def rem (x : ) (s : ) :
          Equations
          Instances For
            def pre_n (x : ) (n : ) :
            Equations
            Instances For
              def const_n (n s : ) :
              Equations
              Instances For
                def const (s : ) :
                Equations
                Instances For
                  theorem log_rising_em (x : ) (n s : ) (x0 : 0 < x) :
                  log_rising x n = 2⁻¹ * (Real.log x + Real.log (x + n)) + (x + n) * Real.log (x + n) - x * Real.log x - n + sum (x + n) s - sum x s + rem_n x n s
                  theorem logGammaSeq_em (x : ) (n s : ) (x0 : 0 < x) (n1 : 1 n) :
                  Real.BohrMollerup.logGammaSeq x n = pre_n x n + const_n n s + (x - 2⁻¹) * Real.log x - sum (x + n) s + sum x s - rem_n x n s
                  theorem tendsto_sum {x : } {s : } (x0 : 0 x) :
                  Filter.Tendsto (fun (n : ) => sum (x + n) s) Filter.atTop (nhds 0)
                  theorem integrableOn_bound {c x : } {s : } (x0 : 0 < x) :
                  MeasureTheory.IntegrableOn (fun (t : ) => c * (x + t) ^ (-s - 2)) (Set.Ioi 0) MeasureTheory.volume
                  theorem integrableOn_bound' {c x : } {s : } (x0 : 0 < x) :
                  MeasureTheory.IntegrableOn (fun (t : ) => c / (x + t) ^ (s + 2)) (Set.Ioi 0) MeasureTheory.volume
                  theorem tendsto_rem {x : } {s : } (x0 : 0 < x) :
                  Filter.Tendsto (fun (n : ) => rem_n x n s) Filter.atTop (nhds (rem x s))
                  theorem tendsto_const {s : } :
                  Filter.Tendsto (fun (n : ) => const_n n s) Filter.atTop (nhds (const s))
                  theorem log_gamma_em (x : ) (s : ) (x0 : 0 < x) :
                  Real.log (Real.Gamma x) = (x - 2⁻¹) * Real.log x - x + const s + sum x s - rem x s

                  Delegate the constant to Stirling's formula #

                  theorem MeasureTheory.norm_set_integral_le_set_integral_norm {α : Type u_1} {G : Type u_2} [NormedAddCommGroup G] [NormedSpace G] {m : MeasurableSpace α} {μ : Measure α} (f : αG) (s : Set α) :
                  (a : α) in s, f a μ (a : α) in s, f a μ
                  theorem MeasureTheory.norm_set_integral_le_of_norm_le {α : Type u_1} {G : Type u_2} [NormedAddCommGroup G] [NormedSpace G] {m : MeasurableSpace α} {μ : Measure α} {f : αG} {g : α} {s : Set α} (hg : IntegrableOn g s μ) (h : ∀ᵐ (x : α) μ.restrict s, f x g x) :
                  (x : α) in s, f x μ (x : α) in s, g x μ
                  theorem tendsto_sum_atTop {s : } :
                  Filter.Tendsto (fun (x : ) => sum x s) Filter.atTop (nhds 0)
                  theorem integral_bound {c x a : } (x0 : 0 < x) (a1 : a < -1) :
                  (t : ) in Set.Ioi 0, c * (x + t) ^ a = c * (x ^ (a + 1) / (-a - 1))
                  theorem tendsto_rem_atTop {s : } :
                  Filter.Tendsto (fun (x : ) => rem x s) Filter.atTop (nhds 0)
                  theorem const_eq (s : ) :

                  Sum needs only even powers #

                  theorem Finset.sum_range_even_odd {α : Type u_1} [AddCommMonoid α] {f : α} {n : } :
                  krange n, f k = krange ((n + 1) / 2), f (2 * k) + krange (n / 2), f (2 * k + 1)
                  theorem sum_eq_even (x : ) (s : ) :
                  sum x (2 * s) = mFinset.range (s + 1), term x (2 * m)

                  Bounding the remainder #

                  theorem abs_rem_le (x : ) (s : ) (e : Even s) (x0 : 0 < x) :
                  |rem x s| |bernoulli (s + 2)| / (s + 1) / (s + 2) / x ^ (s + 1)

                  Not sure if this is tight

                  theorem abs_rem_le' (x : ) (s : ) (e : Even s) (x0 : 0 < x) :
                  |rem x s| |term x s|

                  Not sure if this is tight

                  The main result, stated succinctly #

                  theorem term_eq (x : ) (s : ) :
                  term x s = (bernoulli (s + 2)) / ((s + 1) * (s + 2)) / x ^ (s + 1)

                  Each term in the Stirling series

                  theorem abs_log_gamma_sub_le (x : ) (x0 : 0 < x) (s : ) :
                  |Real.log (Real.Gamma x) - ((x - 2⁻¹) * Real.log x - x + Real.log (2 * Real.pi) / 2 + mFinset.range (s + 1), term x (2 * m))| |term x (2 * s)|

                  Effective Stirling series for log Gamma, but with a non-tight remainder bound