File tree Expand file tree Collapse file tree
Mathlib/Analysis/SpecialFunctions/Gamma Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -534,6 +534,26 @@ theorem Gamma_pos_of_pos {s : ℝ} (hs : 0 < s) : 0 < Gamma s := by
534534 · exact GammaIntegral_convergent hs
535535#align real.Gamma_pos_of_pos Real.Gamma_pos_of_pos
536536
537+ theorem Gamma_nonneg_of_nonneg {s : ℝ} (hs : 0 ≤ s) : 0 ≤ Gamma s := by
538+ obtain rfl | h := eq_or_lt_of_le hs
539+ · rw [Gamma_zero]
540+ · exact (Gamma_pos_of_pos h).le
541+
542+ open Lean.Meta Qq in
543+ /-- The `positivity` extension which identifies expressions of the form `Gamma a`. -/
544+ @ [positivity Gamma (_ : ℝ)]
545+ def _root_.Mathlib.Meta.Positivity.evalGamma :
546+ Mathlib.Meta.Positivity.PositivityExt where eval {_ _α} zα pα e := do
547+ let (.app _ (a : Q($_α))) ← withReducible (whnf e) | throwError "not Gamma ·"
548+ match ← Mathlib.Meta.Positivity.core zα pα a with
549+ | .positive pa =>
550+ let pa' ← mkAppM ``Gamma_pos_of_pos #[pa]
551+ pure (.positive pa')
552+ | .nonnegative pa =>
553+ let pa' ← mkAppM ``Gamma_nonneg_of_nonneg #[pa]
554+ pure (.nonnegative pa')
555+ | _ => pure .none
556+
537557/-- The Gamma function does not vanish on `ℝ` (except at non-positive integers, where the function
538558is mathematically undefined and we set it to `0` by convention). -/
539559theorem Gamma_ne_zero {s : ℝ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
You can’t perform that action at this time.
0 commit comments