Documentation

Lightlike.Asymptotics.Stirling

Complex Stirling formula, midpoint form #

For w in the slit plane ℂ ∖ (−∞, 0],

Γ(w + ½) = √(2π) · exp(w log w − w + μ(w)) (Gamma_half_add),

with principal logarithms and an explicit remainder μ(w) = Σₙ d(w + n), where f(w) = w log w − w (stirF) and d(w) = f(w + 1) − f(w) − log(w + ½) (stirD). The midpoint form is the natural one: d is the error of the midpoint rule for ∫_w^{w+1} log, so ‖d(w)‖ ≤ 3/(8‖w + ½‖²) (norm_stirD_le), and on every sector Re w ≥ −c‖w‖ with c < 1, ‖μ(w)‖ ≤ 4/((1 − c)‖w‖) once ‖w‖² ≥ 2/(1 − c) (norm_stirMu_le).

The proof is by telescoping, with no contour integral: μ(w) = d(w) + μ(w + 1), so √(2π) exp(f + μ) satisfies the functional equation of Γ(w + ½), and the ratio of the two is 1-periodic. Along w + N the ratio tends to 1, by Euler's limit GammaSeq_tendsto_Gamma and the real Stirling formula Stirling.tendsto_stirlingSeq_sqrt_pi.

noncomputable def Lightlike.Asymptotics.stirF (w : ℂ) :

The Stirling exponent f(w) = w log w − w (principal logarithm).

Equations
Instances For
    noncomputable def Lightlike.Asymptotics.stirD (w : ℂ) :

    The midpoint defect d(w) = f(w + 1) − f(w) − log(w + ½).

    Equations
    Instances For
      noncomputable def Lightlike.Asymptotics.stirMu (w : ℂ) :

      The Stirling remainder μ(w) = Σₙ d(w + n).

      Equations
      Instances For

        Branch identities #

        theorem Lightlike.Asymptotics.arg_nonpos_of {y : ℂ} (h : y.im < 0 ∨ y.im = 0 ∧ 0 ≤ y.re) :
        y.arg ≤ 0

        arg y ≤ 0 when y lies in the open lower half-plane or on the closed positive axis.

        theorem Lightlike.Asymptotics.log_mul_of_arg {x y : ℂ} (hx0 : x ≠ 0) (hy0 : y ≠ 0) (hx : 0 ≤ x.arg) (hy : y.arg ≤ 0) :

        log (x y) = log x + log y when arg x ≥ 0 ≥ arg y: the arguments then add up to a value in (−π, π].

        For v in the slit plane, log (v + ½) = log v + log (1 + 1/(2v)). The imaginary parts of v and of 1 + 1/(2v) have opposite signs, so no branch cut is crossed.

        theorem Lightlike.Asymptotics.log_sub_half {w : ℂ} (hw : w ∈ Complex.slitPlane) (hu : 1 ≤ ‖w + 1 / 2‖) :
        Complex.log w = Complex.log (w + 1 / 2) + Complex.log (1 - (2 * (w + 1 / 2))⁻¹)

        For w in the slit plane with ‖w + ½‖ ≥ 1, log w = log (w + ½) + log (1 − 1/(2(w + ½))).

        The midpoint defect #

        logTaylor 3 z = z − z²/2.

        theorem Lightlike.Asymptotics.norm_log_sub_taylor2_le {z : ℂ} (hz : ‖z‖ ≤ 1 / 2) :
        ‖Complex.log (1 + z) - (z - z ^ 2 / 2)‖ ≤ 2 / 3 * ‖z‖ ^ 3

        Third-order Taylor bound for log (1 + z) on ‖z‖ ≤ ½.

        theorem Lightlike.Asymptotics.norm_stirD_le {w : ℂ} (hw : w ∈ Complex.slitPlane) (hu : 1 ≤ ‖w + 1 / 2‖) :
        ‖stirD w‖ ≤ 3 / 8 / ‖w + 1 / 2‖ ^ 2

        The midpoint defect is quadratically small: ‖d(w)‖ ≤ 3/(8‖w + ½‖²) for w in the slit plane with ‖w + ½‖ ≥ 1. With u = w + ½ and ε = 1/(2u), d(w) = −ε²/2 + u((1 + ε)R₊ − (1 − ε)R₋), where R± are the cubic Taylor remainders of log (1 ± ε).

        Sector and summation bounds #

        theorem Lightlike.Asymptotics.sq_norm_add_ofReal_ge {w : ℂ} {c t : ℝ} (hc : 0 ≤ c) (hw : -c * ‖w‖ ≤ w.re) (ht : 0 ≤ t) :
        (1 - c) * (‖w‖ + t) ^ 2 / 2 ≤ ‖w + ↑t‖ ^ 2

        Sector bound: if Re w ≥ −c‖w‖ with c ≥ 0, then ‖w + t‖² ≥ (1 − c)(‖w‖ + t)²/2 for real t ≥ 0. The gap is (1 + c)(‖w‖ − t)²/2 ≥ 0.

        theorem Lightlike.Asymptotics.sum_range_inv_sq_le {a : ℝ} (ha : 1 / 2 < a) (N : ℕ) :
        ∑ n ∈ Finset.range N, 1 / (a + ↑n) ^ 2 ≤ 1 / (a - 1 / 2) - 1 / (a + ↑N - 1 / 2)

        Telescoping bound Σ_{n<N} 1/(a + n)² ≤ 1/(a − ½) − 1/(a + N − ½) for a > ½, from 1/x² ≤ 1/(x − ½) − 1/(x + ½).

        theorem Lightlike.Asymptotics.sector_shift {w : ℂ} {c : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) (hw : -c * ‖w‖ ≤ w.re) (hR : 2 / (1 - c) ≤ ‖w‖ ^ 2) (n : ℕ) :
        w + ↑n ∈ Complex.slitPlane ∧ (1 - c) * (‖w‖ + 1 / 2 + ↑n) ^ 2 / 2 ≤ ‖w + ↑n + 1 / 2‖ ^ 2 ∧ 1 ≤ ‖w + ↑n + 1 / 2‖

        In the sector Re w ≥ −c‖w‖ (0 ≤ c < 1) with ‖w‖² ≥ 2/(1 − c), every w + n lies in the slit plane, ‖w + n + ½‖ ≥ 1, and ‖w + n + ½‖² ≥ (1 − c)(‖w‖ + ½ + n)²/2.

        theorem Lightlike.Asymptotics.norm_stirMu_le {w : ℂ} {c : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) (hw : -c * ‖w‖ ≤ w.re) (hR : 2 / (1 - c) ≤ ‖w‖ ^ 2) :
        (Summable fun (n : ℕ) => stirD (w + ↑n)) ∧ ‖stirMu w‖ ≤ 3 / 4 / ((1 - c) * ‖w‖)

        The Stirling remainder is O(1/‖w‖) on sectors: if Re w ≥ −c‖w‖ with 0 ≤ c < 1 and ‖w‖² ≥ 2/(1 − c), the series Σ d(w + n) converges and ‖μ(w)‖ ≤ 3/(4(1 − c)‖w‖).

        theorem Lightlike.Asymptotics.summable_stirD (w : ℂ) :
        Summable fun (n : ℕ) => stirD (w + ↑n)

        The series Σ d(w + n) converges for every w: some shift w + N lies in the sector Re ≥ 0 far from the origin.

        Shift identity μ(w) = d(w) + μ(w + 1).

        The functional equation #

        theorem Lightlike.Asymptotics.add_nat_add_half_ne_zero {w : ℂ} (hw : w ∈ Complex.slitPlane) (n : ℕ) :
        w + ↑n + 1 / 2 ≠ 0

        w + n + ½ ≠ 0 for w in the slit plane.

        f(w + 1) + μ(w + 1) = f(w) + μ(w) + log(w + ½).

        theorem Lightlike.Asymptotics.exp_stir_succ {w : ℂ} (hw : w + 1 / 2 ≠ 0) :
        Complex.exp (stirF (w + 1) + stirMu (w + 1)) = (w + 1 / 2) * Complex.exp (stirF w + stirMu w)

        Functional equation: exp(f + μ) is multiplied by w + ½ under w ↦ w + 1, like Γ(w + ½).

        The limit along w + N #

        theorem Lightlike.Asymptotics.Gamma_add_nat_eq_prod {s : ℂ} (hs : ∀ (j : ℕ), s + ↑j ≠ 0) (n : ℕ) :
        Complex.Gamma (s + ↑n) = Complex.Gamma s * ∏ j ∈ Finset.range n, (s + ↑j)

        Γ(s + n) = Γ(s) ∏_{j<n} (s + j) when no s + j vanishes.

        theorem Lightlike.Asymptotics.tendsto_Gamma_add_nat_div {s : ℂ} (hs : ∀ (j : ℕ), s + ↑j ≠ 0) :
        Filter.Tendsto (fun (N : ℕ) => Complex.Gamma (s + ↑N + 1) / (↑N ^ s * ↑N.factorial)) Filter.atTop (nhds 1)

        Euler's limit in the form Γ(s + N + 1)/(N^s N!) → 1.

        noncomputable def Lightlike.Asymptotics.stirQ (N : ℕ) :

        The normalised factorial q(N) = N!/(√(2π) e^{(N + ½) log N − N}).

        Equations
        Instances For

          q(N) = stirlingSeq N / √π for N ≥ 1.

          q(N) → 1: the real Stirling formula.

          theorem Lightlike.Asymptotics.factorial_eq_stirQ (N : ℕ) :
          ↑N.factorial = ↑(stirQ N) * ↑√(2 * Real.pi) * Complex.exp ((↑N + 1 / 2) * Complex.log ↑N - ↑N)

          N! = q(N) √(2π) e^{(N + ½) log N − N} in ℂ.

          theorem Lightlike.Asymptotics.stir_alg {G P q c e1 e2 e3 e4 N : ℂ} (hP : P ≠ 0) (hq : q ≠ 0) (hc : c ≠ 0) (he1 : e1 ≠ 0) (he2 : e2 ≠ 0) :
          P * G / (e1 * (q * c * e2)) * q * e3 * (N / P * e4) = G / c * (N * (e3 * e4 / (e1 * e2)))

          An algebraic rearrangement used in tendsto_Gamma_div_stir.

          theorem Lightlike.Asymptotics.tendsto_Gamma_div_stir {w : ℂ} (hw : w ∈ Complex.slitPlane) :
          Filter.Tendsto (fun (N : ℕ) => Complex.Gamma (w + ↑N + 1 / 2) / (↑√(2 * Real.pi) * Complex.exp (stirF (w + ↑N) + stirMu (w + ↑N)))) Filter.atTop (nhds 1)

          Stirling along w + N: Γ(w + N + ½)/(√(2π) exp(f(w + N) + μ(w + N))) → 1.

          Complex Stirling formula, midpoint form: for w in the slit plane, Γ(w + ½) = √(2π) · exp(w log w − w + μ(w)), with μ(w) = Σₙ d(w + n) bounded by 3/(4(1 − c)‖w‖) on the sector Re w ≥ −c‖w‖ (norm_stirMu_le).