l3lab/ntp-mathlib huggingface dataset:
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  

Proof state:
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
⊢ (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))

Next tactic:
induction' N with N ih
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · 

Proof state:
case zero
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
⊢ (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow zero, ∑' (n : ℕ), f (p ^ n))

Next tactic:
rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    

Proof state:
case zero
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
⊢ (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) 1

Next tactic:
exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · 

Proof state:
case succ
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
⊢ (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow (succ N), ∑' (n : ℕ), f (p ^ n))

Next tactic:
rw [primesBelow_succ]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    

Proof state:
case succ
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
⊢ (Summable fun m => ‖f ↑m‖) ∧
    HasSum (fun m => f ↑m)
      (∏ p in if Nat.Prime N then insert N (primesBelow N) else primesBelow N, ∑' (n : ℕ), f (p ^ n))

Next tactic:
split_ifs with hN
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · 

Proof state:
case pos
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ x in insert N (primesBelow N), ∑' (n : ℕ), f (x ^ n))

Next tactic:
constructor
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · 

Proof state:
case pos.left
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun m => ‖f ↑m‖

Next tactic:
simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        

Proof state:
case pos.left
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => ‖f (N ^ x.1) * f ↑x.2‖

Next tactic:
refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        

Proof state:
case pos.left
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => ‖f (N ^ x.1)‖ * ‖f ↑x.2‖

Next tactic:
apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖)
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          

Proof state:
case pos.left.hf
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => ‖‖f (N ^ x)‖‖

Next tactic:
simp_rw [norm_norm]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          

Proof state:
case pos.left.hg
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => ‖‖f ↑x‖‖

Next tactic:
simp_rw [norm_norm]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          simp_rw [norm_norm]
        

Proof state:
case pos.left.hf
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => ‖f (N ^ x)‖
case pos.left.hg
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => ‖f ↑x‖

Next tactic:
exacts [hsum hN, ih.1]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          simp_rw [norm_norm]
        exacts [hsum hN, ih.1]
      · 

Proof state:
case pos.right
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ HasSum (fun m => f ↑m) (∏ x in insert N (primesBelow N), ∑' (n : ℕ), f (x ^ n))

Next tactic:
simp_rw [Finset.prod_insert (not_mem_primesBelow N),
                 ← (equivProdNatSmoothNumbers hN).hasSum_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          simp_rw [norm_norm]
        exacts [hsum hN, ih.1]
      · simp_rw [Finset.prod_insert (not_mem_primesBelow N),
                 ← (equivProdNatSmoothNumbers hN).hasSum_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        

Proof state:
case pos.right
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ HasSum (fun x => f (N ^ x.1) * f ↑x.2) ((∑' (n : ℕ), f (N ^ n)) * ∏ x in primesBelow N, ∑' (n : ℕ), f (x ^ n))

Next tactic:
apply (hsum hN).of_norm.hasSum.mul ih.2
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          simp_rw [norm_norm]
        exacts [hsum hN, ih.1]
      · simp_rw [Finset.prod_insert (not_mem_primesBelow N),
                 ← (equivProdNatSmoothNumbers hN).hasSum_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        apply (hsum hN).of_norm.hasSum.mul ih.2
        -- `exact summable_mul_of_summable_norm (hsum hN) ih.1` gives a time-out
        

Proof state:
case pos.right
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : Nat.Prime N
⊢ Summable fun x => f (N ^ x.1) * f ↑x.2

Next tactic:
convert summable_mul_of_summable_norm (hsum hN) ih.1
/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p in N.primesBelow, ∑' (n : ℕ), f (p ^ n)) := by
  induction' N with N ih
  · rw [smoothNumbers_zero, primesBelow_zero, Finset.prod_empty]
    exact ⟨(Set.finite_singleton 1).summable (‖f ·‖), hf₁ ▸ hasSum_singleton 1 f⟩
  · rw [primesBelow_succ]
    split_ifs with hN
    · constructor
      · simp_rw [← (equivProdNatSmoothNumbers hN).summable_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        refine Summable.of_nonneg_of_le (fun _ ↦ norm_nonneg _) (fun _ ↦ norm_mul_le ..) ?_
        apply summable_mul_of_summable_norm (f := fun (x : ℕ) ↦ ‖f (N ^ x)‖)
          (g := fun (x : N.smoothNumbers) ↦ ‖f x.val‖) <;>
          simp_rw [norm_norm]
        exacts [hsum hN, ih.1]
      · simp_rw [Finset.prod_insert (not_mem_primesBelow N),
                 ← (equivProdNatSmoothNumbers hN).hasSum_iff, Function.comp_def,
                 equivProdNatSmoothNumbers_apply', map_prime_pow_mul hmul hN]
        apply (hsum hN).of_norm.hasSum.mul ih.2
        -- `exact summable_mul_of_summable_norm (hsum hN) ih.1` gives a time-out
        convert summable_mul_of_summable_norm (hsum hN) ih.1
    · 

Proof state:
case neg
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖
N : ℕ
ih : (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p in primesBelow N, ∑' (n : ℕ), f (p ^ n))
hN : ¬Nat.Prime N
⊢ (Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ x in primesBelow N, ∑' (n : ℕ), f (x ^ n))

Next tactic:
rwa [smoothNumbers_succ hN]
/-- The following statement says that summing over `N`-smooth numbers
for large enough `N` gets us arbitrarily close to the sum over all natural numbers
(assuming `f` is norm-summable and `f 0 = 0`; the latter since `0` is not smooth). -/
lemma norm_tsum_smoothNumbers_sub_tsum_lt (hsum : Summable f) (hf₀ : f 0 = 0)
    {ε : ℝ} (εpos : 0 < ε) :
    ∃ N₀ : ℕ, ∀ N ≥ N₀, ‖(∑' m : ℕ, f m) - (∑' m : N.smoothNumbers, f m)‖ < ε := by
  

Proof state:
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : Summable f
hf₀ : f 0 = 0
ε : ℝ
εpos : 0 < ε
⊢ ∃ N₀, ∀ N ≥ N₀, ‖∑' (m : ℕ), f m - ∑' (m : ↑(smoothNumbers N)), f ↑m‖ < ε

Next tactic:
obtain ⟨N₀, hN₀⟩ :=
    summable_iff_nat_tsum_vanishing.mp hsum (Metric.ball 0 ε) <| Metric.ball_mem_nhds 0 εpos
/-- The following statement says that summing over `N`-smooth numbers
for large enough `N` gets us arbitrarily close to the sum over all natural numbers
(assuming `f` is norm-summable and `f 0 = 0`; the latter since `0` is not smooth). -/
lemma norm_tsum_smoothNumbers_sub_tsum_lt (hsum : Summable f) (hf₀ : f 0 = 0)
    {ε : ℝ} (εpos : 0 < ε) :
    ∃ N₀ : ℕ, ∀ N ≥ N₀, ‖(∑' m : ℕ, f m) - (∑' m : N.smoothNumbers, f m)‖ < ε := by
  obtain ⟨N₀, hN₀⟩ :=
    summable_iff_nat_tsum_vanishing.mp hsum (Metric.ball 0 ε) <| Metric.ball_mem_nhds 0 εpos
  

Proof state:
case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : Summable f
hf₀ : f 0 = 0
ε : ℝ
εpos : 0 < ε
N₀ : ℕ
hN₀ : ∀ t ⊆ {n | N₀ ≤ n}, ∑' (n : ↑t), f ↑n ∈ Metric.ball 0 ε
⊢ ∃ N₀, ∀ N ≥ N₀, ‖∑' (m : ℕ), f m - ∑' (m : ↑(smoothNumbers N)), f ↑m‖ < ε

Next tactic:
simp_rw [mem_ball_zero_iff] at hN₀
/-- The following statement says that summing over `N`-smooth numbers
for large enough `N` gets us arbitrarily close to the sum over all natural numbers
(assuming `f` is norm-summable and `f 0 = 0`; the latter since `0` is not smooth). -/
lemma norm_tsum_smoothNumbers_sub_tsum_lt (hsum : Summable f) (hf₀ : f 0 = 0)
    {ε : ℝ} (εpos : 0 < ε) :
    ∃ N₀ : ℕ, ∀ N ≥ N₀, ‖(∑' m : ℕ, f m) - (∑' m : N.smoothNumbers, f m)‖ < ε := by
  obtain ⟨N₀, hN₀⟩ :=
    summable_iff_nat_tsum_vanishing.mp hsum (Metric.ball 0 ε) <| Metric.ball_mem_nhds 0 εpos
  simp_rw [mem_ball_zero_iff] at hN₀
  

Proof state:
case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, Coprime m n → f (m * n) = f m * f n
hsum : Summable f
hf₀ : f 0 = 0
ε : ℝ
εpos : 0 < ε
N₀ : ℕ
hN₀ : ∀ t ⊆ {n | N₀ ≤ n}, ‖∑' (n : ↑t), f ↑n‖ < ε
⊢ ∃ N₀, ∀ N ≥ N₀, ‖∑' (m : ℕ), f m - ∑' (m : ↑(smoothNumbers N)), f ↑m‖ < ε

Next tactic:
refine ⟨N₀, fun N hN₁ ↦ ?_⟩