Theorem: EulerProduct.eulerProduct_hasProd
File: Mathlib/NumberTheory/EulerProduct/Basic.lean

tactic: let F : ℕ → R := fun n ↦ ∑' e, f (n ^ e)
state_before: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
⊢ HasProd (fun p => ∑' (e : ℕ), f (↑p ^ e)) (∑' (n : ℕ), f n)
state_after: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
⊢ HasProd (fun p => ∑' (e : ℕ), f (↑p ^ e)) (∑' (n : ℕ), f n)

tactic: change HasProd (F ∘ Subtype.val) _
state_before: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
⊢ HasProd (fun p => ∑' (e : ℕ), f (↑p ^ e)) (∑' (n : ℕ), f n)
state_after: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
⊢ HasProd (F ∘ Subtype.val) (∑' (n : ℕ), f n)

tactic: rw [hasProd_subtype_iff_mulIndicator,
  show Set.mulIndicator (fun p : ℕ ↦ Irreducible p) =  {p | Nat.Prime p}.mulIndicator from rfl,
  HasProd, Metric.tendsto_atTop]
state_before: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
⊢ HasProd (F ∘ Subtype.val) (∑' (n : ℕ), f n)
state_after: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
⊢ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (∏ b ∈ n, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε

tactic: intro ε hε
state_before: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
⊢ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (∏ b ∈ n, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε
state_after: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
⊢ ∃ N, ∀ n ≥ N, dist (∏ b ∈ n, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε

tactic: obtain ⟨N₀, hN₀⟩ := norm_tsum_factoredNumbers_sub_tsum_lt hsum.of_norm hf₀ hε
state_before: R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
⊢ ∃ N, ∀ n ≥ N, dist (∏ b ∈ n, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε
state_after: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
⊢ ∃ N, ∀ n ≥ N, dist (∏ b ∈ n, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε

tactic: refine ⟨range N₀, fun s hs ↦ ?_⟩
state_before: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
⊢ ∃ N, ∀ n ≥ N, dist (∏ b ∈ n, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε
state_after: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
s : Finset ℕ
hs : s ≥ range N₀
⊢ dist (∏ b ∈ s, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε

tactic: have : ∏ p ∈ s, {p | Nat.Prime p}.mulIndicator F p = ∏ p ∈ s.filter Nat.Prime, F p :=
  prod_mulIndicator_eq_prod_filter s (fun _ ↦ F) _ id
state_before: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
s : Finset ℕ
hs : s ≥ range N₀
⊢ dist (∏ b ∈ s, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε
state_after: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
s : Finset ℕ
hs : s ≥ range N₀
this : ∏ p ∈ s, {p | Nat.Prime p}.mulIndicator F p = ∏ p ∈ filter Nat.Prime s, F p
⊢ dist (∏ b ∈ s, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε

tactic: rw [this, dist_eq_norm, prod_filter_prime_tsum_eq_tsum_factoredNumbers hf₁ hmul hsum,
  norm_sub_rev]
state_before: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
s : Finset ℕ
hs : s ≥ range N₀
this : ∏ p ∈ s, {p | Nat.Prime p}.mulIndicator F p = ∏ p ∈ filter Nat.Prime s, F p
⊢ dist (∏ b ∈ s, {p | Nat.Prime p}.mulIndicator F b) (∑' (n : ℕ), f n) < ε
state_after: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
s : Finset ℕ
hs : s ≥ range N₀
this : ∏ p ∈ s, {p | Nat.Prime p}.mulIndicator F p = ∏ p ∈ filter Nat.Prime s, F p
⊢ ‖∑' (n : ℕ), f n - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε

tactic: exact hN₀ s fun p hp ↦ hs <| mem_range.mpr <| lt_of_mem_primesBelow hp
state_before: case intro
R : Type u_1
inst✝¹ : NormedCommRing R
inst✝ : CompleteSpace R
f : ℕ → R
hf₁ : f 1 = 1
hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n
hsum : Summable fun x => ‖f x‖
hf₀ : f 0 = 0
F : ℕ → R := fun n => ∑' (e : ℕ), f (n ^ e)
ε : ℝ
hε : ε > 0
N₀ : ℕ
hN₀ : ∀ (s : Finset ℕ), N₀.primesBelow ≤ s → ‖∑' (m : ℕ), f m - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
s : Finset ℕ
hs : s ≥ range N₀
this : ∏ p ∈ s, {p | Nat.Prime p}.mulIndicator F p = ∏ p ∈ filter Nat.Prime s, F p
⊢ ‖∑' (n : ℕ), f n - ∑' (m : ↑(factoredNumbers s)), f ↑m‖ < ε
state_after: no goals