Theorem: Nat.ArithmeticFunction.IsMultiplicative.eq_iff_eq_on_prime_powers
File: Mathlib/NumberTheory/ArithmeticFunction.lean

tactic: constructor
state_before: R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
⊢ f = g ↔ ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)

tactic: intro h
state_before: case mpr
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
⊢ (∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)) → f = g

tactic: ext n
state_before: case mpr
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
⊢ f = g

tactic: by_cases hn : n = 0
state_before: case mpr.h
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
⊢ ↑f n = ↑g n

tactic: rw [multiplicative_factorization f hf hn, multiplicative_factorization g hg hn]
state_before: case neg
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
hn : ¬n = 0
⊢ ↑f n = ↑g n

tactic: refine' Finset.prod_congr rfl _
state_before: case neg
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
hn : ¬n = 0
⊢ (Finsupp.prod (factorization n) fun p k => ↑f (p ^ k)) = Finsupp.prod (factorization n) fun p k => ↑g (p ^ k)

tactic: simp only [support_factorization, List.mem_toFinset]
state_before: case neg
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
hn : ¬n = 0
⊢ ∀ (x : ℕ),
    x ∈ (factorization n).support →
      (fun p k => ↑f (p ^ k)) x (↑(factorization n) x) = (fun p k => ↑g (p ^ k)) x (↑(factorization n) x)

tactic: intro p hp
state_before: case neg
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
hn : ¬n = 0
⊢ ∀ (x : ℕ), x ∈ factors n → ↑f (x ^ ↑(factorization n) x) = ↑g (x ^ ↑(factorization n) x)

tactic: exact h p _ (Nat.prime_of_mem_factors hp)
state_before: case neg
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
hn : ¬n = 0
p : ℕ
hp : p ∈ factors n
⊢ ↑f (p ^ ↑(factorization n) p) = ↑g (p ^ ↑(factorization n) p)

tactic: intro h p i _
state_before: case mp
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
⊢ f = g → ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)

tactic: rw [h]
state_before: case mp
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : f = g
p i : ℕ
a✝ : Prime p
⊢ ↑f (p ^ i) = ↑g (p ^ i)

tactic: rw [hn, ArithmeticFunction.map_zero, ArithmeticFunction.map_zero]
state_before: case pos
R : Type u_1
inst✝ : CommMonoidWithZero R
f : ArithmeticFunction R
hf : IsMultiplicative f
g : ArithmeticFunction R
hg : IsMultiplicative g
h : ∀ (p i : ℕ), Prime p → ↑f (p ^ i) = ↑g (p ^ i)
n : ℕ
hn : n = 0
⊢ ↑f n = ↑g n