l3lab/ntp-mathlib huggingface dataset:
theorem mellin_zetaKernel₁_eq_tsum {s : ℂ} (hs : 1 / 2 < s.re) :
    mellin zetaKernel₁ s = (π : ℂ) ^ (-s) * Gamma s * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ (2 * s) := by
  let bd : ℕ → ℝ → ℝ := fun n t => t ^ (s.re - 1) * exp (-π * t * ((n : ℝ) + 1) ^ 2)
  let f : ℕ → ℝ → ℂ := fun n t => (t : ℂ) ^ (s - 1) * exp (-π * t * ((n : ℝ) + 1) ^ 2)
  have hm : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  have h_norm : ∀ (n : ℕ) {t : ℝ} (_ : 0 < t), ‖f n t‖ = bd n t := by
    intro n t ht
    rw [norm_mul, Complex.norm_eq_abs, Complex.norm_eq_abs, Complex.abs_of_nonneg (exp_pos _).le,
      abs_cpow_eq_rpow_re_of_pos ht, sub_re, one_re]
  have hf_meas : ∀ n : ℕ, AEStronglyMeasurable (f n) (volume.restrict <| Ioi 0) := by
    intro n
    refine (ContinuousOn.mul ?_ ?_).aestronglyMeasurable hm
    · exact ContinuousAt.continuousOn fun x hx =>
          continuousAt_ofReal_cpow_const _ _ <| Or.inr <| ne_of_gt hx
    · apply Continuous.continuousOn
      exact continuous_ofReal.comp
          (continuous_exp.comp ((continuous_const.mul continuous_id').mul continuous_const))
  have h_le : ∀ n : ℕ, ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), ‖f n t‖ ≤ bd n t := fun n =>
    (ae_restrict_iff' hm).mpr (ae_of_all _ fun t ht => le_of_eq (h_norm n ht))
  have h_sum0 : ∀ {t : ℝ} (_ : 0 < t), HasSum (fun n => f n t)
      ((t : ℂ) ^ (s - 1) * zetaKernel₁ t) := by
    intro t ht
    rw [zetaKernel₁]
    convert
      (hasSum_ofReal.mpr (summable_exp_neg_pi_mul_nat_sq ht).hasSum).mul_left ((t : ℂ) ^ (s - 1))
    simp only [neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, ofReal_pow, ofReal_add,
      ofReal_nat_cast, ofReal_one, ofReal_tsum]
  have h_sum' : ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), HasSum (fun n : ℕ => f n t)
      ((t : ℂ) ^ (s - 1) * zetaKernel₁ t) :=
    (ae_restrict_iff' hm).mpr (ae_of_all _ fun t ht => h_sum0 ht)
  have h_sum : ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), Summable fun n : ℕ => bd n t := by
    refine (ae_restrict_iff' hm).mpr (ae_of_all _ fun t ht => ?_)
    

Proof state:
s : ℂ
hs : 1 / 2 < s.re
bd : ℕ → ℝ → ℝ := fun n t => t ^ (s.re - 1) * rexp (-π * t * (↑n + 1) ^ 2)
f : ℕ → ℝ → ℂ := fun n t => ↑t ^ (s - 1) * ↑(rexp (-π * t * (↑n + 1) ^ 2))
hm : MeasurableSet (Ioi 0)
h_norm : ∀ (n : ℕ) {t : ℝ}, 0 < t → ‖f n t‖ = bd n t
hf_meas : ∀ (n : ℕ), AEStronglyMeasurable (f n) (Measure.restrict volume (Ioi 0))
h_le : ∀ (n : ℕ), ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ‖f n t‖ ≤ bd n t
h_sum0 : ∀ {t : ℝ}, 0 < t → HasSum (fun n => f n t) (↑t ^ (s - 1) * zetaKernel₁ t)
h_sum' : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), HasSum (fun n => f n t) (↑t ^ (s - 1) * zetaKernel₁ t)
t : ℝ
ht : t ∈ Ioi 0
⊢ Summable fun n => bd n t

Next tactic:
simpa only [fun n => h_norm n ht] using (h_sum0 ht).summable.norm
theorem mellin_zetaKernel₁_eq_tsum {s : ℂ} (hs : 1 / 2 < s.re) :
    mellin zetaKernel₁ s = (π : ℂ) ^ (-s) * Gamma s * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ (2 * s) := by
  let bd : ℕ → ℝ → ℝ := fun n t => t ^ (s.re - 1) * exp (-π * t * ((n : ℝ) + 1) ^ 2)
  let f : ℕ → ℝ → ℂ := fun n t => (t : ℂ) ^ (s - 1) * exp (-π * t * ((n : ℝ) + 1) ^ 2)
  have hm : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
  have h_norm : ∀ (n : ℕ) {t : ℝ} (_ : 0 < t), ‖f n t‖ = bd n t := by
    intro n t ht
    rw [norm_mul, Complex.norm_eq_abs, Complex.norm_eq_abs, Complex.abs_of_nonneg (exp_pos _).le,
      abs_cpow_eq_rpow_re_of_pos ht, sub_re, one_re]
  have hf_meas : ∀ n : ℕ, AEStronglyMeasurable (f n) (volume.restrict <| Ioi 0) := by
    intro n
    refine (ContinuousOn.mul ?_ ?_).aestronglyMeasurable hm
    · exact ContinuousAt.continuousOn fun x hx =>
          continuousAt_ofReal_cpow_const _ _ <| Or.inr <| ne_of_gt hx
    · apply Continuous.continuousOn
      exact continuous_ofReal.comp
          (continuous_exp.comp ((continuous_const.mul continuous_id').mul continuous_const))
  have h_le : ∀ n : ℕ, ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), ‖f n t‖ ≤ bd n t := fun n =>
    (ae_restrict_iff' hm).mpr (ae_of_all _ fun t ht => le_of_eq (h_norm n ht))
  have h_sum0 : ∀ {t : ℝ} (_ : 0 < t), HasSum (fun n => f n t)
      ((t : ℂ) ^ (s - 1) * zetaKernel₁ t) := by
    intro t ht
    rw [zetaKernel₁]
    convert
      (hasSum_ofReal.mpr (summable_exp_neg_pi_mul_nat_sq ht).hasSum).mul_left ((t : ℂ) ^ (s - 1))
    simp only [neg_mul, ofReal_exp, ofReal_neg, ofReal_mul, ofReal_pow, ofReal_add,
      ofReal_nat_cast, ofReal_one, ofReal_tsum]
  have h_sum' : ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), HasSum (fun n : ℕ => f n t)
      ((t : ℂ) ^ (s - 1) * zetaKernel₁ t) :=
    (ae_restrict_iff' hm).mpr (ae_of_all _ fun t ht => h_sum0 ht)
  have h_sum : ∀ᵐ t : ℝ ∂volume.restrict (Ioi 0), Summable fun n : ℕ => bd n t := by
    refine (ae_restrict_iff' hm).mpr (ae_of_all _ fun t ht => ?_)
    simpa only [fun n => h_norm n ht] using (h_sum0 ht).summable.norm
  have h_int : Integrable (fun t : ℝ => ∑' n : ℕ, bd n t) (volume.restrict (Ioi 0)) := by
    

Proof state:
s : ℂ
hs : 1 / 2 < s.re
bd : ℕ → ℝ → ℝ := fun n t => t ^ (s.re - 1) * rexp (-π * t * (↑n + 1) ^ 2)
f : ℕ → ℝ → ℂ := fun n t => ↑t ^ (s - 1) * ↑(rexp (-π * t * (↑n + 1) ^ 2))
hm : MeasurableSet (Ioi 0)
h_norm : ∀ (n : ℕ) {t : ℝ}, 0 < t → ‖f n t‖ = bd n t
hf_meas : ∀ (n : ℕ), AEStronglyMeasurable (f n) (Measure.restrict volume (Ioi 0))
h_le : ∀ (n : ℕ), ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), ‖f n t‖ ≤ bd n t
h_sum0 : ∀ {t : ℝ}, 0 < t → HasSum (fun n => f n t) (↑t ^ (s - 1) * zetaKernel₁ t)
h_sum' : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), HasSum (fun n => f n t) (↑t ^ (s - 1) * zetaKernel₁ t)
h_sum : ∀ᵐ (t : ℝ) ∂Measure.restrict volume (Ioi 0), Summable fun n => bd n t
⊢ Integrable fun t => ∑' (n : ℕ), bd n t

Next tactic:
refine IntegrableOn.congr_fun
        (mellinConvergent_of_isBigO_rpow_exp pi_pos locally_integrable_zetaKernel₁
            isBigO_atTop_zetaKernel₁ isBigO_zero_zetaKernel₁ hs).norm (fun t ht => ?_) hm
theorem completed_zeta_eq_tsum_of_one_lt_re {s : ℂ} (hs : 1 < re s) :
    riemannCompletedZeta s =
      (π : ℂ) ^ (-s / 2) * Gamma (s / 2) * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  

Proof state:
s : ℂ
hs : 1 < s.re
⊢ riemannCompletedZeta s = ↑π ^ (-s / 2) * Complex.Gamma (s / 2) * ∑' (n : ℕ), 1 / (↑n + 1) ^ s

Next tactic:
rw [completed_zeta_eq_mellin_of_one_lt_re hs, mellin_zetaKernel₁_eq_tsum, neg_div,
    mul_div_cancel' _ (two_ne_zero' ℂ)]
theorem completed_zeta_eq_tsum_of_one_lt_re {s : ℂ} (hs : 1 < re s) :
    riemannCompletedZeta s =
      (π : ℂ) ^ (-s / 2) * Gamma (s / 2) * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  rw [completed_zeta_eq_mellin_of_one_lt_re hs, mellin_zetaKernel₁_eq_tsum, neg_div,
    mul_div_cancel' _ (two_ne_zero' ℂ)]
  

Proof state:
s : ℂ
hs : 1 < s.re
⊢ 1 / 2 < (s / 2).re

Next tactic:
rw [show s / 2 = ↑(2⁻¹ : ℝ) * s by push_cast; rw [mul_comm]; rfl]
theorem completed_zeta_eq_tsum_of_one_lt_re {s : ℂ} (hs : 1 < re s) :
    riemannCompletedZeta s =
      (π : ℂ) ^ (-s / 2) * Gamma (s / 2) * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  rw [completed_zeta_eq_mellin_of_one_lt_re hs, mellin_zetaKernel₁_eq_tsum, neg_div,
    mul_div_cancel' _ (two_ne_zero' ℂ)]
  rw [show s / 2 = ↑(2⁻¹ : ℝ) * s by 

Proof state:
s : ℂ
hs : 1 < s.re
⊢ s / 2 = ↑2⁻¹ * s

Next tactic:
push_cast
theorem completed_zeta_eq_tsum_of_one_lt_re {s : ℂ} (hs : 1 < re s) :
    riemannCompletedZeta s =
      (π : ℂ) ^ (-s / 2) * Gamma (s / 2) * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  rw [completed_zeta_eq_mellin_of_one_lt_re hs, mellin_zetaKernel₁_eq_tsum, neg_div,
    mul_div_cancel' _ (two_ne_zero' ℂ)]
  rw [show s / 2 = ↑(2⁻¹ : ℝ) * s by push_cast; 

Proof state:
s : ℂ
hs : 1 < s.re
⊢ s / 2 = 2⁻¹ * s

Next tactic:
rw [mul_comm]
theorem completed_zeta_eq_tsum_of_one_lt_re {s : ℂ} (hs : 1 < re s) :
    riemannCompletedZeta s =
      (π : ℂ) ^ (-s / 2) * Gamma (s / 2) * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  rw [completed_zeta_eq_mellin_of_one_lt_re hs, mellin_zetaKernel₁_eq_tsum, neg_div,
    mul_div_cancel' _ (two_ne_zero' ℂ)]
  rw [show s / 2 = ↑(2⁻¹ : ℝ) * s by push_cast; rw [mul_comm]; 

Proof state:
s : ℂ
hs : 1 < s.re
⊢ s / 2 = s * 2⁻¹

Next tactic:
rfl
theorem completed_zeta_eq_tsum_of_one_lt_re {s : ℂ} (hs : 1 < re s) :
    riemannCompletedZeta s =
      (π : ℂ) ^ (-s / 2) * Gamma (s / 2) * ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  rw [completed_zeta_eq_mellin_of_one_lt_re hs, mellin_zetaKernel₁_eq_tsum, neg_div,
    mul_div_cancel' _ (two_ne_zero' ℂ)]
  rw [show s / 2 = ↑(2⁻¹ : ℝ) * s by push_cast; rw [mul_comm]; rfl]
  

Proof state:
s : ℂ
hs : 1 < s.re
⊢ 1 / 2 < (↑2⁻¹ * s).re

Next tactic:
rwa [ofReal_mul_re, ← div_eq_inv_mul, div_lt_div_right (zero_lt_two' ℝ)]
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  

Proof state:
s : ℂ
hs : 1 < s.re
⊢ riemannZeta s = ∑' (n : ℕ), 1 / (↑n + 1) ^ s

Next tactic:
have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by 

Proof state:
s : ℂ
hs : 1 < s.re
⊢ s ≠ 0

Next tactic:
contrapose! hs
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; 

Proof state:
s : ℂ
hs : s = 0
⊢ s.re ≤ 1

Next tactic:
rw [hs, zero_re]
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; 

Proof state:
s : ℂ
hs : s = 0
⊢ 0 ≤ 1

Next tactic:
exact zero_le_one
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  

Proof state:
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ riemannZeta s = ∑' (n : ℕ), 1 / (↑n + 1) ^ s

Next tactic:
rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
  · 

Proof state:
case ha
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ Complex.Gamma (s / 2) ≠ 0

Next tactic:
apply Gamma_ne_zero_of_re_pos
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
  · apply Gamma_ne_zero_of_re_pos
    

Proof state:
case ha.hs
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ 0 < (s / 2).re

Next tactic:
rw [div_eq_mul_inv, mul_comm, show (2⁻¹ : ℂ) = (2⁻¹ : ℝ) by norm_num, ofReal_mul_re]
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
  · apply Gamma_ne_zero_of_re_pos
    rw [div_eq_mul_inv, mul_comm, show (2⁻¹ : ℂ) = (2⁻¹ : ℝ) by 

Proof state:
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ 2⁻¹ = ↑2⁻¹

Next tactic:
norm_num
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
  · apply Gamma_ne_zero_of_re_pos
    rw [div_eq_mul_inv, mul_comm, show (2⁻¹ : ℂ) = (2⁻¹ : ℝ) by norm_num, ofReal_mul_re]
    

Proof state:
case ha.hs
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ 0 < 2⁻¹ * s.re

Next tactic:
exact mul_pos (inv_pos_of_pos two_pos) (zero_lt_one.trans hs)
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
  · apply Gamma_ne_zero_of_re_pos
    rw [div_eq_mul_inv, mul_comm, show (2⁻¹ : ℂ) = (2⁻¹ : ℝ) by norm_num, ofReal_mul_re]
    exact mul_pos (inv_pos_of_pos two_pos) (zero_lt_one.trans hs)
  · 

Proof state:
case h
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ ↑π ^ (s / 2) ≠ 0

Next tactic:
rw [Ne.def, cpow_eq_zero_iff, not_and_or, ← Ne.def, ofReal_ne_zero]
/-- The Riemann zeta function agrees with the naive Dirichlet-series definition when the latter
converges. (Note that this is false without the assumption: when `re s ≤ 1` the sum is divergent,
and we use a different definition to obtain the analytic continuation to all `s`.) -/
theorem zeta_eq_tsum_one_div_nat_add_one_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / ((n : ℂ) + 1) ^ s := by
  have : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [riemannZeta, Function.update_noteq this, completed_zeta_eq_tsum_of_one_lt_re hs, ← mul_assoc,
    neg_div, cpow_neg, mul_inv_cancel_left₀, mul_div_cancel_left]
  · apply Gamma_ne_zero_of_re_pos
    rw [div_eq_mul_inv, mul_comm, show (2⁻¹ : ℂ) = (2⁻¹ : ℝ) by norm_num, ofReal_mul_re]
    exact mul_pos (inv_pos_of_pos two_pos) (zero_lt_one.trans hs)
  · rw [Ne.def, cpow_eq_zero_iff, not_and_or, ← Ne.def, ofReal_ne_zero]
    

Proof state:
case h
s : ℂ
hs : 1 < s.re
this : s ≠ 0
⊢ π ≠ 0 ∨ ¬s / 2 ≠ 0

Next tactic:
exact Or.inl pi_pos.ne'
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  

Proof state:
s : ℂ
hs : 1 < s.re
⊢ riemannZeta s = ∑' (n : ℕ), 1 / ↑n ^ s

Next tactic:
have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by 

Proof state:
s : ℂ
hs : 1 < s.re
⊢ s ≠ 0

Next tactic:
contrapose! hs
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; 

Proof state:
s : ℂ
hs : s = 0
⊢ s.re ≤ 1

Next tactic:
rw [hs, zero_re]
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; 

Proof state:
s : ℂ
hs : s = 0
⊢ 0 ≤ 1

Next tactic:
exact zero_le_one
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  

Proof state:
s : ℂ
hs : 1 < s.re
hs' : s ≠ 0
⊢ riemannZeta s = ∑' (n : ℕ), 1 / ↑n ^ s

Next tactic:
rw [tsum_eq_zero_add]
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [tsum_eq_zero_add]
  · 

Proof state:
s : ℂ
hs : 1 < s.re
hs' : s ≠ 0
⊢ riemannZeta s = 1 / ↑0 ^ s + ∑' (b : ℕ), 1 / ↑(b + 1) ^ s

Next tactic:
simp_rw [Nat.cast_zero, zero_cpow hs', div_zero, zero_add,
      zeta_eq_tsum_one_div_nat_add_one_cpow hs, Nat.cast_add, Nat.cast_one]
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [tsum_eq_zero_add]
  · simp_rw [Nat.cast_zero, zero_cpow hs', div_zero, zero_add,
      zeta_eq_tsum_one_div_nat_add_one_cpow hs, Nat.cast_add, Nat.cast_one]
  · 

Proof state:
s : ℂ
hs : 1 < s.re
hs' : s ≠ 0
⊢ Summable fun n => 1 / ↑n ^ s

Next tactic:
refine .of_norm ?_
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [tsum_eq_zero_add]
  · simp_rw [Nat.cast_zero, zero_cpow hs', div_zero, zero_add,
      zeta_eq_tsum_one_div_nat_add_one_cpow hs, Nat.cast_add, Nat.cast_one]
  · refine .of_norm ?_
    

Proof state:
s : ℂ
hs : 1 < s.re
hs' : s ≠ 0
⊢ Summable fun a => ‖1 / ↑a ^ s‖

Next tactic:
simp_rw [norm_div, norm_one, Complex.norm_eq_abs, ← ofReal_nat_cast,
      abs_cpow_eq_rpow_re_of_nonneg (Nat.cast_nonneg _) (zero_lt_one.trans hs).ne',
      summable_one_div_nat_rpow]
/-- Alternate formulation of `zeta_eq_tsum_one_div_nat_add_one_cpow` without the `+ 1`, using the
fact that for `s ≠ 0` we define `0 ^ s = 0`.  -/
theorem zeta_eq_tsum_one_div_nat_cpow {s : ℂ} (hs : 1 < re s) :
    riemannZeta s = ∑' n : ℕ, 1 / (n : ℂ) ^ s := by
  have hs' : s ≠ 0 := by contrapose! hs; rw [hs, zero_re]; exact zero_le_one
  rw [tsum_eq_zero_add]
  · simp_rw [Nat.cast_zero, zero_cpow hs', div_zero, zero_add,
      zeta_eq_tsum_one_div_nat_add_one_cpow hs, Nat.cast_add, Nat.cast_one]
  · refine .of_norm ?_
    simp_rw [norm_div, norm_one, Complex.norm_eq_abs, ← ofReal_nat_cast,
      abs_cpow_eq_rpow_re_of_nonneg (Nat.cast_nonneg _) (zero_lt_one.trans hs).ne',
      summable_one_div_nat_rpow]
    

Proof state:
s : ℂ
hs : 1 < s.re
hs' : s ≠ 0
⊢ 1 < s.re

Next tactic:
assumption
/-- Special case of `zeta_eq_tsum_one_div_nat_cpow` when the argument is in `ℕ`, so the power
function can be expressed using naïve `pow` rather than `cpow`. -/
theorem zeta_nat_eq_tsum_of_gt_one {k : ℕ} (hk : 1 < k) :
    riemannZeta k = ∑' n : ℕ, 1 / (n : ℂ) ^ k := by
  

Proof state:
k : ℕ
hk : 1 < k
⊢ riemannZeta ↑k = ∑' (n : ℕ), 1 / ↑n ^ k

Next tactic:
simp only [zeta_eq_tsum_one_div_nat_cpow
      (by rwa [← ofReal_nat_cast, ofReal_re, ← Nat.cast_one, Nat.cast_lt] : 1 < re k),
    cpow_nat_cast]
/-- Special case of `zeta_eq_tsum_one_div_nat_cpow` when the argument is in `ℕ`, so the power
function can be expressed using naïve `pow` rather than `cpow`. -/
theorem zeta_nat_eq_tsum_of_gt_one {k : ℕ} (hk : 1 < k) :
    riemannZeta k = ∑' n : ℕ, 1 / (n : ℂ) ^ k := by
  simp only [zeta_eq_tsum_one_div_nat_cpow
      (by 

Proof state:
k : ℕ
hk : 1 < k
⊢ 1 < (↑k).re

Next tactic:
rwa [← ofReal_nat_cast, ofReal_re, ← Nat.cast_one, Nat.cast_lt]
/-- Explicit formula for `ζ (2 * k)`, for `k ∈ ℕ` with `k ≠ 0`: we have
`ζ (2 * k) = (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * π ^ (2 * k) * bernoulli (2 * k) / (2 * k)!`.
Compare `hasSum_zeta_nat` for a version formulated explicitly as a sum, and
`riemannZeta_neg_nat_eq_bernoulli` for values at negative integers (equivalent to the above via
the functional equation). -/
theorem riemannZeta_two_mul_nat {k : ℕ} (hk : k ≠ 0) :
    riemannZeta (2 * k) = (-1 : ℂ) ^ (k + 1) * (2 : ℂ) ^ (2 * k - 1)
      * (π : ℂ) ^ (2 * k) * bernoulli (2 * k) / (2 * k)! := by
  

Proof state:
k : ℕ
hk : k ≠ 0
⊢ riemannZeta (2 * ↑k) = (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * ↑π ^ (2 * k) * ↑(bernoulli (2 * k)) / ↑(2 * k)!

Next tactic:
convert congr_arg ((↑) : ℝ → ℂ) (hasSum_zeta_nat hk).tsum_eq
/-- Explicit formula for `ζ (2 * k)`, for `k ∈ ℕ` with `k ≠ 0`: we have
`ζ (2 * k) = (-1) ^ (k + 1) * 2 ^ (2 * k - 1) * π ^ (2 * k) * bernoulli (2 * k) / (2 * k)!`.
Compare `hasSum_zeta_nat` for a version formulated explicitly as a sum, and
`riemannZeta_neg_nat_eq_bernoulli` for values at negative integers (equivalent to the above via
the functional equation). -/
theorem riemannZeta_two_mul_nat {k : ℕ} (hk : k ≠ 0) :
    riemannZeta (2 * k) = (-1 : ℂ) ^ (k + 1) * (2 : ℂ) ^ (2 * k - 1)
      * (π : ℂ) ^ (2 * k) * bernoulli (2 * k) / (2 * k)! := by
  convert congr_arg ((↑) : ℝ → ℂ) (hasSum_zeta_nat hk).tsum_eq
  · 

Proof state:
case h.e'_2
k : ℕ
hk : k ≠ 0
⊢ riemannZeta (2 * ↑k) = ↑(∑' (b : ℕ), 1 / ↑b ^ (2 * k))

Next tactic:
rw [← Nat.cast_two, ← Nat.cast_mul, zeta_nat_eq_tsum_of_gt_one]