Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore(SpecialFunctions/Gamma): golf a proof #9277

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 12 additions & 17 deletions Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
Original file line number Diff line number Diff line change
Expand Up @@ -532,26 +532,21 @@ theorem one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (s : ℂ) :
· rw [zero_add, Gamma_zero, inv_zero, zero_mul]
#align complex.one_div_Gamma_eq_self_mul_one_div_Gamma_add_one Complex.one_div_Gamma_eq_self_mul_one_div_Gamma_add_one

/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
exact fun s =>
let ⟨n, h⟩ := exists_nat_gt (-s.re)
this n s h
intro n
induction' n with m hm
· intro s hs
/-- The reciprocal of the Gamma function is differentiable everywhere
(including the points where Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := fun s ↦ by
rcases exists_nat_gt (-s.re) with ⟨n, hs⟩
induction n generalizing s with
| zero =>
rw [Nat.cast_zero, neg_lt_zero] at hs
suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
contrapose! hs
rcases hs with ⟨m, rfl⟩
simpa only [neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg m
· intro s hs
rintro m rfl
apply hs.not_le
simp
| succ n ihn =>
rw [funext one_div_Gamma_eq_self_mul_one_div_Gamma_add_one]
specialize hm (s + 1) (by rwa [add_re, one_re, neg_add', sub_lt_iff_lt_add, ← Nat.cast_succ])
refine' differentiableAt_id.mul (hm.comp s _)
exact differentiableAt_id.add (differentiableAt_const _)
specialize ihn (s + 1) (by rwa [add_re, one_re, neg_add', sub_lt_iff_lt_add, ← Nat.cast_succ])
exact differentiableAt_id.mul (ihn.comp s <| differentiableAt_id.add_const _)
#align complex.differentiable_one_div_Gamma Complex.differentiable_one_div_Gamma

end Complex
Expand Down