l3lab/ntp-mathlib huggingface dataset:
theorem riemannZeta_neg_nat_eq_bernoulli (k : ℕ) :
    riemannZeta (-k) = (-1 : ℂ) ^ k * bernoulli (k + 1) / (k + 1) := by
  rcases Nat.even_or_odd' k with ⟨m, rfl | rfl⟩
  · cases' m with m m
    ·-- k = 0 : evaluate explicitly
      rw [Nat.zero_eq, mul_zero, Nat.cast_zero, pow_zero, one_mul, zero_add, neg_zero, zero_add,
        div_one, bernoulli_one, riemannZeta_zero]
      norm_num
    · -- k = 2 * (m + 1) : both sides "trivially" zero
      rw [Nat.cast_mul, ← neg_mul, Nat.cast_two, Nat.cast_succ, riemannZeta_neg_two_mul_nat_add_one,
        bernoulli_eq_bernoulli'_of_ne_one]
      swap; · apply ne_of_gt; norm_num
      rw [bernoulli'_odd_eq_zero ⟨m + 1, rfl⟩ (by norm_num), Rat.cast_zero, mul_zero,
        zero_div]
  · -- k = 2 * m + 1 : the interesting case
    rw [Odd.neg_one_pow ⟨m, rfl⟩]
    rw [show -(↑(2 * m + 1) : ℂ) = 1 - (2 * m + 2) by push_cast; ring]
    rw [riemannZeta_one_sub]
    rotate_left
    · intro n
      rw [(by norm_cast : 2 * (m : ℂ) + 2 = ↑(2 * m + 2)), ← Int.cast_neg_natCast, ← Int.cast_ofNat,
        Ne.def, Int.cast_inj]
      apply ne_of_gt
      exact lt_of_le_of_lt (by norm_num : (-n : ℤ) ≤ 0) (by positivity)
    · rw [(by norm_cast : 2 * (m : ℂ) + 2 = ↑(2 * m + 2)), Ne.def, Nat.cast_eq_one]; norm_num
    -- get rid of sine term
    rw [show Complex.sin (↑π * (1 - (2 * ↑m + 2)) / 2) = -(-1 : ℂ) ^ m by
        rw [(by field_simp; ring : (π : ℂ) * (1 - (2 * ↑m + 2)) / 2 = π / 2 - (π * m + π))]
        rw [Complex.sin_pi_div_two_sub, Complex.cos_add_pi, neg_inj]
        rcases Nat.even_or_odd' m with ⟨t, rfl | rfl⟩
        · rw [pow_mul, neg_one_sq, one_pow]
          convert Complex.cos_nat_mul_two_pi t using 2
          push_cast; ring_nf
        · rw [pow_add, pow_one, pow_mul, neg_one_sq, one_pow, one_mul]
          convert Complex.cos_nat_mul_two_pi_add_pi t using 2
          push_cast; ring_nf]
    -- substitute in what we know about zeta values at positive integers
    have step1 := congr_arg ((↑) : ℝ → ℂ) (hasSum_zeta_nat (by norm_num : m + 1 ≠ 0)).tsum_eq
    have step2 := zeta_nat_eq_tsum_of_gt_one (by rw [mul_add]; norm_num : 1 < 2 * (m + 1))
    simp_rw [ofReal_tsum, ofReal_div, ofReal_one, ofReal_pow, ofReal_nat_cast] at step1
    rw [step1, (by norm_cast : (↑(2 * (m + 1)) : ℂ) = 2 * ↑m + 2)] at step2
    rw [step2, mul_div]
    -- now the rest is just a lengthy but elementary rearrangement
    rw [show ((2 * (m + 1))! : ℂ) = Complex.Gamma (2 * m + 2) * (↑(2 * m + 1) + 1) by
        rw [(by push_cast; ring : (2 * m + 2 : ℂ) = ↑(2 * m + 1) + 1),
          Complex.Gamma_nat_eq_factorial, (by 

Proof state:
m : ℕ
step2 :
  riemannZeta (2 * ↑m + 2) =
    ↑((-1) ^ (m + 1 + 1) * 2 ^ (2 * (m + 1) - 1) * π ^ (2 * (m + 1)) * ↑(bernoulli (2 * (m + 1)))) / ↑(2 * (m + 1))!
step1 :
  ∑' (a : ℕ), 1 / ↑a ^ (2 * (m + 1)) =
    ↑((-1) ^ (m + 1 + 1) * 2 ^ (2 * (m + 1) - 1) * π ^ (2 * (m + 1)) * ↑(bernoulli (2 * (m + 1)))) / ↑(2 * (m + 1))!
⊢ 2 * (m + 1) = 2 * m + 1 + 1

Next tactic:
ring
theorem riemannZeta_neg_nat_eq_bernoulli (k : ℕ) :
    riemannZeta (-k) = (-1 : ℂ) ^ k * bernoulli (k + 1) / (k + 1) := by
  rcases Nat.even_or_odd' k with ⟨m, rfl | rfl⟩
  · cases' m with m m
    ·-- k = 0 : evaluate explicitly
      rw [Nat.zero_eq, mul_zero, Nat.cast_zero, pow_zero, one_mul, zero_add, neg_zero, zero_add,
        div_one, bernoulli_one, riemannZeta_zero]
      norm_num
    · -- k = 2 * (m + 1) : both sides "trivially" zero
      rw [Nat.cast_mul, ← neg_mul, Nat.cast_two, Nat.cast_succ, riemannZeta_neg_two_mul_nat_add_one,
        bernoulli_eq_bernoulli'_of_ne_one]
      swap; · apply ne_of_gt; norm_num
      rw [bernoulli'_odd_eq_zero ⟨m + 1, rfl⟩ (by norm_num), Rat.cast_zero, mul_zero,
        zero_div]
  · -- k = 2 * m + 1 : the interesting case
    rw [Odd.neg_one_pow ⟨m, rfl⟩]
    rw [show -(↑(2 * m + 1) : ℂ) = 1 - (2 * m + 2) by push_cast; ring]
    rw [riemannZeta_one_sub]
    rotate_left
    · intro n
      rw [(by norm_cast : 2 * (m : ℂ) + 2 = ↑(2 * m + 2)), ← Int.cast_neg_natCast, ← Int.cast_ofNat,
        Ne.def, Int.cast_inj]
      apply ne_of_gt
      exact lt_of_le_of_lt (by norm_num : (-n : ℤ) ≤ 0) (by positivity)
    · rw [(by norm_cast : 2 * (m : ℂ) + 2 = ↑(2 * m + 2)), Ne.def, Nat.cast_eq_one]; norm_num
    -- get rid of sine term
    rw [show Complex.sin (↑π * (1 - (2 * ↑m + 2)) / 2) = -(-1 : ℂ) ^ m by
        rw [(by field_simp; ring : (π : ℂ) * (1 - (2 * ↑m + 2)) / 2 = π / 2 - (π * m + π))]
        rw [Complex.sin_pi_div_two_sub, Complex.cos_add_pi, neg_inj]
        rcases Nat.even_or_odd' m with ⟨t, rfl | rfl⟩
        · rw [pow_mul, neg_one_sq, one_pow]
          convert Complex.cos_nat_mul_two_pi t using 2
          push_cast; ring_nf
        · rw [pow_add, pow_one, pow_mul, neg_one_sq, one_pow, one_mul]
          convert Complex.cos_nat_mul_two_pi_add_pi t using 2
          push_cast; ring_nf]
    -- substitute in what we know about zeta values at positive integers
    have step1 := congr_arg ((↑) : ℝ → ℂ) (hasSum_zeta_nat (by norm_num : m + 1 ≠ 0)).tsum_eq
    have step2 := zeta_nat_eq_tsum_of_gt_one (by rw [mul_add]; norm_num : 1 < 2 * (m + 1))
    simp_rw [ofReal_tsum, ofReal_div, ofReal_one, ofReal_pow, ofReal_nat_cast] at step1
    rw [step1, (by norm_cast : (↑(2 * (m + 1)) : ℂ) = 2 * ↑m + 2)] at step2
    rw [step2, mul_div]
    -- now the rest is just a lengthy but elementary rearrangement
    rw [show ((2 * (m + 1))! : ℂ) = Complex.Gamma (2 * m + 2) * (↑(2 * m + 1) + 1) by
        rw [(by push_cast; ring : (2 * m + 2 : ℂ) = ↑(2 * m + 1) + 1),
          Complex.Gamma_nat_eq_factorial, (by ring : 2 * (m + 1) = 2 * m + 1 + 1),
          Nat.factorial_succ, Nat.cast_mul, mul_comm]
        

Proof state:
m : ℕ
step2 :
  riemannZeta (2 * ↑m + 2) =
    ↑((-1) ^ (m + 1 + 1) * 2 ^ (2 * (m + 1) - 1) * π ^ (2 * (m + 1)) * ↑(bernoulli (2 * (m + 1)))) / ↑(2 * (m + 1))!
step1 :
  ∑' (a : ℕ), 1 / ↑a ^ (2 * (m + 1)) =
    ↑((-1) ^ (m + 1 + 1) * 2 ^ (2 * (m + 1) - 1) * π ^ (2 * (m + 1)) * ↑(bernoulli (2 * (m + 1)))) / ↑(2 * (m + 1))!
⊢ ↑(2 * m + 1)! * ↑(2 * m + 1 + 1) = ↑(2 * m + 1)! * (↑(2 * m + 1) + 1)

Next tactic:
norm_num
theorem riemannZeta_neg_nat_eq_bernoulli (k : ℕ) :
    riemannZeta (-k) = (-1 : ℂ) ^ k * bernoulli (k + 1) / (k + 1) := by
  rcases Nat.even_or_odd' k with ⟨m, rfl | rfl⟩
  · cases' m with m m
    ·-- k = 0 : evaluate explicitly
      rw [Nat.zero_eq, mul_zero, Nat.cast_zero, pow_zero, one_mul, zero_add, neg_zero, zero_add,
        div_one, bernoulli_one, riemannZeta_zero]
      norm_num
    · -- k = 2 * (m + 1) : both sides "trivially" zero
      rw [Nat.cast_mul, ← neg_mul, Nat.cast_two, Nat.cast_succ, riemannZeta_neg_two_mul_nat_add_one,
        bernoulli_eq_bernoulli'_of_ne_one]
      swap; · apply ne_of_gt; norm_num
      rw [bernoulli'_odd_eq_zero ⟨m + 1, rfl⟩ (by norm_num), Rat.cast_zero, mul_zero,
        zero_div]
  · -- k = 2 * m + 1 : the interesting case
    rw [Odd.neg_one_pow ⟨m, rfl⟩]
    rw [show -(↑(2 * m + 1) : ℂ) = 1 - (2 * m + 2) by push_cast; ring]
    rw [riemannZeta_one_sub]
    rotate_left
    · intro n
      rw [(by norm_cast : 2 * (m : ℂ) + 2 = ↑(2 * m + 2)), ← Int.cast_neg_natCast, ← Int.cast_ofNat,
        Ne.def, Int.cast_inj]
      apply ne_of_gt
      exact lt_of_le_of_lt (by norm_num : (-n : ℤ) ≤ 0) (by positivity)
    · rw [(by norm_cast : 2 * (m : ℂ) + 2 = ↑(2 * m + 2)), Ne.def, Nat.cast_eq_one]; norm_num
    -- get rid of sine term
    rw [show Complex.sin (↑π * (1 - (2 * ↑m + 2)) / 2) = -(-1 : ℂ) ^ m by
        rw [(by field_simp; ring : (π : ℂ) * (1 - (2 * ↑m + 2)) / 2 = π / 2 - (π * m + π))]
        rw [Complex.sin_pi_div_two_sub, Complex.cos_add_pi, neg_inj]
        rcases Nat.even_or_odd' m with ⟨t, rfl | rfl⟩
        · rw [pow_mul, neg_one_sq, one_pow]
          convert Complex.cos_nat_mul_two_pi t using 2
          push_cast; ring_nf
        · rw [pow_add, pow_one, pow_mul, neg_one_sq, one_pow, one_mul]
          convert Complex.cos_nat_mul_two_pi_add_pi t using 2
          push_cast; ring_nf]
    -- substitute in what we know about zeta values at positive integers
    have step1 := congr_arg ((↑) : ℝ → ℂ) (hasSum_zeta_nat (by norm_num : m + 1 ≠ 0)).tsum_eq
    have step2 := zeta_nat_eq_tsum_of_gt_one (by rw [mul_add]; norm_num : 1 < 2 * (m + 1))
    simp_rw [ofReal_tsum, ofReal_div, ofReal_one, ofReal_pow, ofReal_nat_cast] at step1
    rw [step1, (by norm_cast : (↑(2 * (m + 1)) : ℂ) = 2 * ↑m + 2)] at step2
    rw [step2, mul_div]
    -- now the rest is just a lengthy but elementary rearrangement
    rw [show ((2 * (m + 1))! : ℂ) = Complex.Gamma (2 * m + 2) * (↑(2 * m + 1) + 1) by
        rw [(by push_cast; ring : (2 * m + 2 : ℂ) = ↑(2 * m + 1) + 1),
          Complex.Gamma_nat_eq_factorial, (by ring : 2 * (m + 1) = 2 * m + 1 + 1),
          Nat.factorial_succ, Nat.cast_mul, mul_comm]
        norm_num]
    rw [← div_div, neg_one_mul]
    congr 1
    rw [div_eq_iff (Gamma_ne_zero_of_re_pos _)]
    swap; · rw [(by 

Proof state:
m : ℕ
step2 :
  riemannZeta (2 * ↑m + 2) =
    ↑((-1) ^ (m + 1 + 1) * 2 ^ (2 * (m + 1) - 1) * π ^ (2 * (m + 1)) * ↑(bernoulli (2 * (m + 1)))) / ↑(2 * (m + 1))!
step1 :
  ∑' (a : ℕ), 1 / ↑a ^ (2 * (m + 1)) =
    ↑((-1) ^ (m + 1 + 1) * 2 ^ (2 * (m + 1) - 1) * π ^ (2 * (m + 1)) * ↑(bernoulli (2 * (m + 1)))) / ↑(2 * (m + 1))!
⊢ 2 * ↑m + 2 = ↑(2 * ↑m + 2)

Next tactic:
norm_num
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  

Proof state:
⊢ Tendsto (fun s => (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1)

Next tactic:
unfold riemannCompletedZeta
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  

Proof state:
⊢ Tendsto (fun s => (s - 1) * (riemannCompletedZeta₀ s - 1 / s + 1 / (s - 1))) (𝓝[≠] 1) (𝓝 1)

Next tactic:
simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by 

Proof state:
⊢ 𝓝 1 = 𝓝 (0 - 0 + 1)

Next tactic:
simp
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  

Proof state:
⊢ Tendsto (fun s => (s - 1) * riemannCompletedZeta₀ s - (s - 1) * (1 / s) + (s - 1) * (1 / (s - 1))) (𝓝[≠] 1)
    (𝓝 (0 - 0 + 1))

Next tactic:
refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · 

Proof state:
case refine_1
⊢ Tendsto (fun s => (s - 1) * riemannCompletedZeta₀ s) (𝓝 1) (𝓝 0)

Next tactic:
rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by 

Proof state:
⊢ 𝓝 0 = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1)

Next tactic:
simp
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    

Proof state:
case refine_1
⊢ Tendsto (fun s => (s - 1) * riemannCompletedZeta₀ s) (𝓝 1) (𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))

Next tactic:
apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
  · 

Proof state:
case refine_2
⊢ Tendsto (fun s => (s - 1) * (1 / s)) (𝓝 1) (𝓝 0)

Next tactic:
rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * (1 / 1)))]
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
  · rw [(by 

Proof state:
⊢ 𝓝 0 = 𝓝 ((1 - 1) * (1 / 1))

Next tactic:
simp
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * (1 / 1)))]
    

Proof state:
case refine_2
⊢ Tendsto (fun s => (s - 1) * (1 / s)) (𝓝 1) (𝓝 ((1 - 1) * (1 / 1)))

Next tactic:
exact (((continuous_sub_right _).continuousAt).mul <|
      continuousAt_const.div continuousAt_id one_ne_zero)
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * (1 / 1)))]
    exact (((continuous_sub_right _).continuousAt).mul <|
      continuousAt_const.div continuousAt_id one_ne_zero)
  · 

Proof state:
case refine_3
⊢ Tendsto (fun s => (s - 1) * (1 / (s - 1))) (𝓝[≠] 1) (𝓝 1)

Next tactic:
refine (tendsto_const_nhds.mono_left nhdsWithin_le_nhds).congr' ?_
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * (1 / 1)))]
    exact (((continuous_sub_right _).continuousAt).mul <|
      continuousAt_const.div continuousAt_id one_ne_zero)
  · refine (tendsto_const_nhds.mono_left nhdsWithin_le_nhds).congr' ?_
    

Proof state:
case refine_3
⊢ (fun x => 1) =ᶠ[𝓝[≠] 1] fun s => (s - 1) * (1 / (s - 1))

Next tactic:
refine eventually_nhdsWithin_of_forall (fun s hs ↦ ?_)
/-- The residue of `Λ(s)` at `s = 1` is equal to 1. -/
lemma riemannCompletedZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * riemannCompletedZeta s) (𝓝[≠] 1) (𝓝 1) := by
  unfold riemannCompletedZeta
  simp_rw [mul_add, mul_sub, (by simp : 𝓝 (1 : ℂ) = 𝓝 (0 - 0 + 1))]
  refine ((Tendsto.sub ?_ ?_).mono_left nhdsWithin_le_nhds).add ?_
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * riemannCompletedZeta₀ 1))]
    apply ((continuous_sub_right _).mul differentiable_completed_zeta₀.continuous).tendsto
  · rw [(by simp : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) * (1 / 1)))]
    exact (((continuous_sub_right _).continuousAt).mul <|
      continuousAt_const.div continuousAt_id one_ne_zero)
  · refine (tendsto_const_nhds.mono_left nhdsWithin_le_nhds).congr' ?_
    refine eventually_nhdsWithin_of_forall (fun s hs ↦ ?_)
    

Proof state:
case refine_3
s : ℂ
hs : s ∈ {1}ᶜ
⊢ (fun x => 1) s = (fun s => (s - 1) * (1 / (s - 1))) s

Next tactic:
simpa using (div_self <| sub_ne_zero_of_ne <| Set.mem_compl_singleton_iff.mpr hs).symm
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  

Proof state:
⊢ Tendsto (fun s => (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1)

Next tactic:
suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · 

Proof state:
this : Tendsto (fun s => (s - 1) * (↑π ^ (s / 2) * riemannCompletedZeta s / Complex.Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
⊢ Tendsto (fun s => (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1)

Next tactic:
refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    

Proof state:
this : Tendsto (fun s => (s - 1) * (↑π ^ (s / 2) * riemannCompletedZeta s / Complex.Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
⊢ ∀ (x : ℂ),
    x ≠ 0 →
      (x - 1) * (↑π ^ (x / 2) * riemannCompletedZeta x / Complex.Gamma (x / 2)) = (fun s => (s - 1) * riemannZeta s) x

Next tactic:
intro x hx
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    

Proof state:
this : Tendsto (fun s => (s - 1) * (↑π ^ (s / 2) * riemannCompletedZeta s / Complex.Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
x : ℂ
hx : x ≠ 0
⊢ (x - 1) * (↑π ^ (x / 2) * riemannCompletedZeta x / Complex.Gamma (x / 2)) = (fun s => (s - 1) * riemannZeta s) x

Next tactic:
simp [riemannZeta_def, Function.update_noteq hx]
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    simp [riemannZeta_def, Function.update_noteq hx]
  

Proof state:
case this
⊢ Tendsto (fun s => (s - 1) * (↑π ^ (s / 2) * riemannCompletedZeta s / Complex.Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)

Next tactic:
have h0 : Tendsto (fun s ↦ π ^ (s / 2) : ℂ → ℂ) (𝓝[≠] 1) (𝓝 (π ^ (1 / 2 : ℂ)))
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    simp [riemannZeta_def, Function.update_noteq hx]
  have h0 : Tendsto (fun s ↦ π ^ (s / 2) : ℂ → ℂ) (𝓝[≠] 1) (𝓝 (π ^ (1 / 2 : ℂ)))
  · 

Proof state:
case h0
⊢ Tendsto (fun s => ↑π ^ (s / 2)) (𝓝[≠] 1) (𝓝 (↑π ^ (1 / 2)))

Next tactic:
refine ((continuousAt_id.div_const _).const_cpow ?_).tendsto.mono_left nhdsWithin_le_nhds
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    simp [riemannZeta_def, Function.update_noteq hx]
  have h0 : Tendsto (fun s ↦ π ^ (s / 2) : ℂ → ℂ) (𝓝[≠] 1) (𝓝 (π ^ (1 / 2 : ℂ)))
  · refine ((continuousAt_id.div_const _).const_cpow ?_).tendsto.mono_left nhdsWithin_le_nhds
    

Proof state:
case h0
⊢ ↑π ≠ 0 ∨ id 1 / 2 ≠ 0

Next tactic:
exact Or.inl <| ofReal_ne_zero.mpr pi_ne_zero
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    simp [riemannZeta_def, Function.update_noteq hx]
  have h0 : Tendsto (fun s ↦ π ^ (s / 2) : ℂ → ℂ) (𝓝[≠] 1) (𝓝 (π ^ (1 / 2 : ℂ)))
  · refine ((continuousAt_id.div_const _).const_cpow ?_).tendsto.mono_left nhdsWithin_le_nhds
    exact Or.inl <| ofReal_ne_zero.mpr pi_ne_zero
  

Proof state:
case this
h0 : Tendsto (fun s => ↑π ^ (s / 2)) (𝓝[≠] 1) (𝓝 (↑π ^ (1 / 2)))
⊢ Tendsto (fun s => (s - 1) * (↑π ^ (s / 2) * riemannCompletedZeta s / Complex.Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)

Next tactic:
have h1 : Tendsto (fun s : ℂ ↦ 1 / Gamma (s / 2)) (𝓝[≠] 1) (𝓝 (1 / π ^ (1 / 2 : ℂ)))
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    simp [riemannZeta_def, Function.update_noteq hx]
  have h0 : Tendsto (fun s ↦ π ^ (s / 2) : ℂ → ℂ) (𝓝[≠] 1) (𝓝 (π ^ (1 / 2 : ℂ)))
  · refine ((continuousAt_id.div_const _).const_cpow ?_).tendsto.mono_left nhdsWithin_le_nhds
    exact Or.inl <| ofReal_ne_zero.mpr pi_ne_zero
  have h1 : Tendsto (fun s : ℂ ↦ 1 / Gamma (s / 2)) (𝓝[≠] 1) (𝓝 (1 / π ^ (1 / 2 : ℂ)))
  · 

Proof state:
case h1
h0 : Tendsto (fun s => ↑π ^ (s / 2)) (𝓝[≠] 1) (𝓝 (↑π ^ (1 / 2)))
⊢ Tendsto (fun s => 1 / Complex.Gamma (s / 2)) (𝓝[≠] 1) (𝓝 (1 / ↑π ^ (1 / 2)))

Next tactic:
rw [← Complex.Gamma_one_half_eq]
/-- The residue of `ζ(s)` at `s = 1` is equal to 1. -/
lemma riemannZeta_residue_one : Tendsto (fun s ↦ (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1) := by
  suffices : Tendsto (fun s => (s - 1) *
      (π ^ (s / 2) * riemannCompletedZeta s / Gamma (s / 2))) (𝓝[≠] 1) (𝓝 1)
  · refine this.congr' <| (eventually_ne_nhdsWithin one_ne_zero).mp (eventually_of_forall ?_)
    intro x hx
    simp [riemannZeta_def, Function.update_noteq hx]
  have h0 : Tendsto (fun s ↦ π ^ (s / 2) : ℂ → ℂ) (𝓝[≠] 1) (𝓝 (π ^ (1 / 2 : ℂ)))
  · refine ((continuousAt_id.div_const _).const_cpow ?_).tendsto.mono_left nhdsWithin_le_nhds
    exact Or.inl <| ofReal_ne_zero.mpr pi_ne_zero
  have h1 : Tendsto (fun s : ℂ ↦ 1 / Gamma (s / 2)) (𝓝[≠] 1) (𝓝 (1 / π ^ (1 / 2 : ℂ)))
  · rw [← Complex.Gamma_one_half_eq]
    

Proof state:
case h1
h0 : Tendsto (fun s => ↑π ^ (s / 2)) (𝓝[≠] 1) (𝓝 (↑π ^ (1 / 2)))
⊢ Tendsto (fun s => 1 / Complex.Gamma (s / 2)) (𝓝[≠] 1) (𝓝 (1 / Complex.Gamma (1 / 2)))

Next tactic:
refine (Continuous.tendsto ?_ _).mono_left nhdsWithin_le_nhds