Trust checks for the uniform bounds on 1/Γ and Γ #
- Known value. The Stirling exponent
f(w) = w log w − whasRe f(i) = Re f(−i) = −π/2(re_stirF_I), in agreement withre_stirF_neg:Re f(−i) = −Re f(i) − π. The reflection formula in midpoint form givesΓ(½)² = πatw = 0(Gamma_half_mul_self), the square of Mathlib's independent valueΓ(½) = √π(Complex.Gamma_one_half_eq, from the Gaussian integral). The bounds are checked numerically on polar grids up to|w| = 40, the1/Γbound in all four quadrants and next to the poles on the negative axis: the largest ratio of‖1/Γ(w + ½)‖to its bound is0.78(the limit√(2π)/π = 0.80on the negative axis), and of‖Γ(w + ½)‖to its bound0.98, which isexp(−3/160)at|w| = 40, so the constant√(2π)cannot be lowered (scripts/asymptotics/gamma_bounds_check.py). - Wrong input fails. Without the term
π |Im w|, the reflection of the exponent is false:Re f(−i) ≠ −Re f(i)(re_stirF_neg_wrong). This term is what cancels the growthexp(π |Im w|)ofcos(π w)on the left half-plane. The script shows that theΓbound fails on the left half-plane, near the poles atw = −½ − n, so its hypothesisRe w ≥ 0is needed. - Non-vacuity. At
w = 2i, with‖w‖² = 4 ≥ 2andRe f(2i) = −π, the two bounds give‖1/Γ(½ + 2i)‖ ≤ exp(3/8 + π)and‖Γ(½ + 2i)‖ ≤ √(2π) exp(3/8 − π)(norm_Gamma_bounds_two_I). - Junk values. Lean's
log 0 = 0givesf(0) = 0(stirF_zero), which is also the limit ofw log w − wat0, soabs_re_stirF_leholds at0for the right reason. Mathlib'sΓ(−n) = 0gives1/Γ(−n) = 0(inv_Gamma_neg_nat), the true value of the entire function1/Γ; the bound on1/Γis trivially true there. The bound onΓis stated only forRe w ≥ 0, whereΓ(w + ½)has no poles, so the junk valueΓ(−n) = 0never enters it.
Known value: the reflection formula at w = 0 gives Γ(½) Γ(½) = π, the square of
Mathlib's value Γ(½) = √π.
Non-vacuity of norm_inv_Gamma_half_add_le and norm_Gamma_half_add_le at w = 2i:
‖1/Γ(½ + 2i)‖ ≤ exp(3/8 + π) and ‖Γ(½ + 2i)‖ ≤ √(2π) exp(3/8 − π).
Junk value: Lean's log 0 = 0 gives f(0) = 0, which is also the limit of
w log w − w at 0.
Junk value: Mathlib's Γ(−n) = 0 gives 1/Γ(−n) = 0, the true value of the entire
function 1/Γ.