-- Mathlib/NumberTheory/Harmonic/GammaDeriv.lean
lemma hasDerivAt_Gammaℝ_one : HasDerivAt Gammaℝ (-(γ + log (4 * π)) / 2) 1

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ ↑√π ≠ 0

Tactic:
rw [ofReal_ne_zero]

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ √π ≠ 0

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
⊢ HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1

Tactic:
have := hasDerivAt_Gamma_one_half.comp 1 (?_ : HasDerivAt (fun s : ℂ ↦ s / 2) (1 / 2) 1)

Result:
case refine_2
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
this : HasDerivAt (Gamma ∘ fun s => s / 2) (-↑√π * (↑γ + 2 * log 2) * (1 / 2)) 1
⊢ HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1

case refine_1
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
⊢ HasDerivAt (fun s => s / 2) (1 / 2) 1

Proof state:
case refine_1
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
⊢ HasDerivAt (fun s => s / 2) (1 / 2) 1

Tactic:
exact (hasDerivAt_id _).div_const _

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ √π ≠ 0

Tactic:
positivity

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Tactic:
refine HasDerivAt.congr_deriv (hf.mul hg) ?_

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ -log ↑π / 2 / ↑√π * Gamma (1 / 2) + f 1 * (-↑√π * (↑γ + 2 * log 2) / 2) = -(↑γ + log (4 * ↑π)) / 2

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ -log ↑π / 2 / ↑√π * Gamma (1 / 2) + ↑π ^ (-1 / 2) * (-↑√π * (↑γ + 2 * log 2) / 2) = -(↑γ + log (4 * ↑π)) / 2

Tactic:
rw [Gamma_one_half_eq, aux, div_mul_cancel₀ _ aux2, neg_div _ (1 : ℂ), cpow_neg, aux,
  mul_div_assoc, ← mul_assoc, mul_neg, inv_mul_cancel₀ aux2, neg_one_mul, ← neg_div,
  ← _root_.add_div, ← neg_add, add_comm, add_assoc, ← ofReal_log Real.pi_pos.le, ← ofReal_ofNat,
  ← ofReal_log zero_le_two,
  ← ofReal_mul, ← Nat.cast_ofNat (R := ℝ), ← Real.log_pow, ← ofReal_add,
  ← Real.log_mul (by positivity) (by positivity),
  Nat.cast_ofNat, ofReal_ofNat, ofReal_log (by positivity)]

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ -(↑γ + log ↑(2 ^ 2 * π)) / 2 = -(↑γ + log (4 * ↑π)) / 2

Proof state:
case refine_2
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
this : HasDerivAt (Gamma ∘ fun s => s / 2) (-↑√π * (↑γ + 2 * log 2) * (1 / 2)) 1
⊢ HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1

Tactic:
rwa [mul_one_div] at this

Result:
no goals

Proof state:
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Tactic:
let f (s : ℂ) : ℂ := π ^ (-s / 2)

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Tactic:
have aux : (π : ℂ) ^ (1 / 2 : ℂ) = ↑√π := by
  rw [Real.sqrt_eq_rpow, ofReal_cpow Real.pi_pos.le, ofReal_div, ofReal_one, ofReal_ofNat]

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
⊢ ↑π ^ (1 / 2) = ↑√π

Tactic:
rw [Real.sqrt_eq_rpow, ofReal_cpow Real.pi_pos.le, ofReal_div, ofReal_one, ofReal_ofNat]

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ -(↑γ + log ↑(2 ^ 2 * π)) / 2 = -(↑γ + log (4 * ↑π)) / 2

Tactic:
norm_num

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
this : HasDerivAt (fun x => ↑π ^ (-x / 2)) (↑π ^ (-1 / 2) * log ↑π * (-1 / 2)) 1
⊢ ↑π ^ (-1 / 2) * log ↑π * (-1 / 2) = -log ↑π / 2 / ↑√π

Tactic:
rw [mul_assoc, ← mul_div_assoc, mul_neg_one, neg_div, cpow_neg, ← div_eq_inv_mul, aux]

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Tactic:
let g (s : ℂ) : ℂ := Gamma (s / 2)

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ -log ↑π / 2 / ↑√π * Gamma (1 / 2) + f 1 * (-↑√π * (↑γ + 2 * log 2) / 2) = -(↑γ + log (4 * ↑π)) / 2

Tactic:
simp only [f]

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ -log ↑π / 2 / ↑√π * Gamma (1 / 2) + ↑π ^ (-1 / 2) * (-↑√π * (↑γ + 2 * log 2) / 2) = -(↑γ + log (4 * ↑π)) / 2

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ π ≠ 0

Tactic:
positivity

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
⊢ HasDerivAt f (-log ↑π / 2 / ↑√π) 1

Tactic:
have := ((hasDerivAt_neg (1 : ℂ)).div_const 2).const_cpow (c := π) (Or.inr (by norm_num))

Result:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
this : HasDerivAt (fun x => ↑π ^ (-x / 2)) (↑π ^ (-1 / 2) * log ↑π * (-1 / 2)) 1
⊢ HasDerivAt f (-log ↑π / 2 / ↑√π) 1

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ 0 ≤ 2 ^ 2 * π

Tactic:
positivity

Result:
no goals

Proof state:
f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
hg : HasDerivAt g (-↑√π * (↑γ + 2 * log 2) / 2) 1
⊢ ↑2 ^ 2 ≠ 0

Tactic:
positivity

Result:
no goals