Theorem: Complex.hasDerivAt_Gammaℝ_one
File: Mathlib/NumberTheory/Harmonic/GammaDeriv.lean

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

tactic: let g (s : ℂ) : ℂ := Gamma (s / 2)
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1
state_after: 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]
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1
state_after: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

tactic: have aux2 : (√π : ℂ) ≠ 0 := by rw [ofReal_ne_zero]; positivity
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1
state_after: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

tactic: have hf : HasDerivAt f (-log π / 2 / √π) 1 := by
  have := ((hasDerivAt_neg (1 : ℂ)).div_const 2).const_cpow (c := π) (Or.inr (by norm_num))
  refine this.congr_deriv ?_
  rw [mul_assoc, ← mul_div_assoc, mul_neg_one, neg_div, cpow_neg, ← div_eq_inv_mul, aux]
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1
state_after: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
hf : HasDerivAt f (-log ↑π / 2 / ↑√π) 1
⊢ HasDerivAt Gammaℝ (-(↑γ + log (4 * ↑π)) / 2) 1

tactic: refine HasDerivAt.congr_deriv (hf.mul hg) ?_
state_before: 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
state_after: 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]
state_before: 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
state_after: 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)]
state_before: 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
state_after: 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
state_before: 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
state_after: no goals

tactic: rw [Real.sqrt_eq_rpow, ofReal_cpow Real.pi_pos.le, ofReal_div, ofReal_one, ofReal_ofNat]
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
⊢ ↑π ^ (1 / 2) = ↑√π
state_after: no goals

tactic: rw [ofReal_ne_zero]
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ ↑√π ≠ 0
state_after: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ √π ≠ 0

tactic: positivity
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
⊢ √π ≠ 0
state_after: no goals

tactic: have := ((hasDerivAt_neg (1 : ℂ)).div_const 2).const_cpow (c := π) (Or.inr (by norm_num))
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
⊢ HasDerivAt f (-log ↑π / 2 / ↑√π) 1
state_after: 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

tactic: refine this.congr_deriv ?_
state_before: 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
state_after: 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]
state_before: 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 / ↑√π
state_after: no goals

tactic: norm_num
state_before: f : ℂ → ℂ := fun s => ↑π ^ (-s / 2)
g : ℂ → ℂ := fun s => Gamma (s / 2)
aux : ↑π ^ (1 / 2) = ↑√π
aux2 : ↑√π ≠ 0
⊢ -1 / 2 ≠ 0
state_after: no goals

tactic: have := hasDerivAt_Gamma_one_half.comp 1 (?_ : HasDerivAt (fun s : ℂ ↦ s / 2) (1 / 2) 1)
state_before: 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
state_after: 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

tactic: rwa [mul_one_div] at this
state_before: 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
state_after: no goals

tactic: exact (hasDerivAt_id _).div_const _
state_before: 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
state_after: no goals

tactic: positivity
state_before: 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
state_after: no goals

tactic: positivity
state_before: 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
state_after: no goals

tactic: positivity
state_before: 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 * π
state_after: no goals