l3lab/ntp-mathlib huggingface dataset:
instance instMonoid : Monoid (ArithmeticFunction R) :=
  { one := One.one
    mul := Mul.mul
    one_mul := one_smul'
    mul_one := fun f => by
      ext x
      rw [mul_apply]
      by_cases x0 : x = 0
      · simp [x0]
      have h : {(x, 1)} ⊆ divisorsAntidiagonal x := by simp [x0]
      rw [← sum_subset h]
      · simp
      intro y ymem ynmem
      have y2ne : y.snd ≠ 1 := by
        intro con
        cases y; subst con -- porting note: added
        simp only [Con, mem_divisorsAntidiagonal, mul_one, Ne.def] at ymem
        

Proof state:
case mk
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
x0 : ¬x = 0
h : {(x, 1)} ⊆ divisorsAntidiagonal x
fst✝ : ℕ
ynmem : (fst✝, 1) ∉ {(x, 1)}
ymem : fst✝ = x ∧ ¬x = 0
⊢ False

Next tactic:
simp only [mem_singleton, Prod.ext_iff] at ynmem
instance instMonoid : Monoid (ArithmeticFunction R) :=
  { one := One.one
    mul := Mul.mul
    one_mul := one_smul'
    mul_one := fun f => by
      ext x
      rw [mul_apply]
      by_cases x0 : x = 0
      · simp [x0]
      have h : {(x, 1)} ⊆ divisorsAntidiagonal x := by simp [x0]
      rw [← sum_subset h]
      · simp
      intro y ymem ynmem
      have y2ne : y.snd ≠ 1 := by
        intro con
        cases y; subst con -- porting note: added
        simp only [Con, mem_divisorsAntidiagonal, mul_one, Ne.def] at ymem
        simp only [mem_singleton, Prod.ext_iff] at ynmem
        

Proof state:
case mk
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
x0 : ¬x = 0
h : {(x, 1)} ⊆ divisorsAntidiagonal x
fst✝ : ℕ
ymem : fst✝ = x ∧ ¬x = 0
ynmem : ¬(fst✝ = x ∧ True)
⊢ False

Next tactic:
tauto
instance instMonoid : Monoid (ArithmeticFunction R) :=
  { one := One.one
    mul := Mul.mul
    one_mul := one_smul'
    mul_one := fun f => by
      ext x
      rw [mul_apply]
      by_cases x0 : x = 0
      · simp [x0]
      have h : {(x, 1)} ⊆ divisorsAntidiagonal x := by simp [x0]
      rw [← sum_subset h]
      · simp
      intro y ymem ynmem
      have y2ne : y.snd ≠ 1 := by
        intro con
        cases y; subst con -- porting note: added
        simp only [Con, mem_divisorsAntidiagonal, mul_one, Ne.def] at ymem
        simp only [mem_singleton, Prod.ext_iff] at ynmem
        tauto
      

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
x0 : ¬x = 0
h : {(x, 1)} ⊆ divisorsAntidiagonal x
y : ℕ × ℕ
ymem : y ∈ divisorsAntidiagonal x
ynmem : y ∉ {(x, 1)}
y2ne : y.2 ≠ 1
⊢ f y.1 * 1 y.2 = 0

Next tactic:
simp [y2ne]
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
    mul_zero := fun f => by
      ext
      simp only [mul_apply, sum_const_zero, mul_zero, zero_apply]
    left_distrib := fun a b c => by
      

Proof state:
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
a b c : ArithmeticFunction R
⊢ a * (b + c) = a * b + a * c

Next tactic:
ext
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
    mul_zero := fun f => by
      ext
      simp only [mul_apply, sum_const_zero, mul_zero, zero_apply]
    left_distrib := fun a b c => by
      ext
      

Proof state:
case h
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
a b c : ArithmeticFunction R
x✝ : ℕ
⊢ (a * (b + c)) x✝ = (a * b + a * c) x✝

Next tactic:
simp only [← sum_add_distrib, mul_add, mul_apply, add_apply]
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
    mul_zero := fun f => by
      ext
      simp only [mul_apply, sum_const_zero, mul_zero, zero_apply]
    left_distrib := fun a b c => by
      ext
      simp only [← sum_add_distrib, mul_add, mul_apply, add_apply]
    right_distrib := fun a b c => by
      

Proof state:
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
a b c : ArithmeticFunction R
⊢ (a + b) * c = a * c + b * c

Next tactic:
ext
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
    mul_zero := fun f => by
      ext
      simp only [mul_apply, sum_const_zero, mul_zero, zero_apply]
    left_distrib := fun a b c => by
      ext
      simp only [← sum_add_distrib, mul_add, mul_apply, add_apply]
    right_distrib := fun a b c => by
      ext
      

Proof state:
case h
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
a b c : ArithmeticFunction R
x✝ : ℕ
⊢ ((a + b) * c) x✝ = (a * c + b * c) x✝

Next tactic:
simp only [← sum_add_distrib, add_mul, mul_apply, add_apply]
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      

Proof state:
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
f : ArithmeticFunction R
⊢ 0 * f = 0

Next tactic:
ext
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      

Proof state:
case h
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
f : ArithmeticFunction R
x✝ : ℕ
⊢ (0 * f) x✝ = 0 x✝

Next tactic:
simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
    mul_zero := fun f => by
      

Proof state:
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
f : ArithmeticFunction R
⊢ f * 0 = 0

Next tactic:
ext
instance instSemiring : Semiring (ArithmeticFunction R) :=
  -- porting note: I reorganized this instance
  { ArithmeticFunction.instAddMonoidWithOne,
    ArithmeticFunction.instMonoid,
    ArithmeticFunction.instAddCommMonoid with
    zero_mul := fun f => by
      ext
      simp only [mul_apply, zero_mul, sum_const_zero, zero_apply]
    mul_zero := fun f => by
      ext
      

Proof state:
case h
R : Type u_1
inst✝ : Semiring R
src✝² : AddMonoidWithOne (ArithmeticFunction R) := instAddMonoidWithOne
src✝¹ : Monoid (ArithmeticFunction R) := instMonoid
src✝ : AddCommMonoid (ArithmeticFunction R) := instAddCommMonoid
f : ArithmeticFunction R
x✝ : ℕ
⊢ (f * 0) x✝ = 0 x✝

Next tactic:
simp only [mul_apply, sum_const_zero, mul_zero, zero_apply]
instance [CommSemiring R] : CommSemiring (ArithmeticFunction R) :=
  { ArithmeticFunction.instSemiring with
    mul_comm := fun f g => by
      

Proof state:
R : Type u_1
inst✝ : CommSemiring R
src✝ : Semiring (ArithmeticFunction R) := instSemiring
f g : ArithmeticFunction R
⊢ f * g = g * f

Next tactic:
ext
instance [CommSemiring R] : CommSemiring (ArithmeticFunction R) :=
  { ArithmeticFunction.instSemiring with
    mul_comm := fun f g => by
      ext
      

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
src✝ : Semiring (ArithmeticFunction R) := instSemiring
f g : ArithmeticFunction R
x✝ : ℕ
⊢ (f * g) x✝ = (g * f) x✝

Next tactic:
rw [mul_apply, ← map_swap_divisorsAntidiagonal, sum_map]
instance [CommSemiring R] : CommSemiring (ArithmeticFunction R) :=
  { ArithmeticFunction.instSemiring with
    mul_comm := fun f g => by
      ext
      rw [mul_apply, ← map_swap_divisorsAntidiagonal, sum_map]
      

Proof state:
case h
R : Type u_1
inst✝ : CommSemiring R
src✝ : Semiring (ArithmeticFunction R) := instSemiring
f g : ArithmeticFunction R
x✝ : ℕ
⊢ ∑ x in divisorsAntidiagonal x✝,
      f ((Equiv.toEmbedding (Equiv.prodComm ℕ ℕ)) x).1 * g ((Equiv.toEmbedding (Equiv.prodComm ℕ ℕ)) x).2 =
    (g * f) x✝

Next tactic:
simp [mul_comm]
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
  smul_zero r := by
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r : ArithmeticFunction R
⊢ r • 0 = 0

Next tactic:
ext
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
  smul_zero r := by
    ext
    

Proof state:
case h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r : ArithmeticFunction R
x✝ : ℕ
⊢ (r • 0) x✝ = 0 x✝

Next tactic:
simp only [smul_apply, sum_const_zero, smul_zero, zero_apply]
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r : ArithmeticFunction R
x y : ArithmeticFunction M
⊢ r • (x + y) = r • x + r • y

Next tactic:
ext
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    

Proof state:
case h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r : ArithmeticFunction R
x y : ArithmeticFunction M
x✝ : ℕ
⊢ (r • (x + y)) x✝ = (r • x + r • y) x✝

Next tactic:
simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
  smul_zero r := by
    ext
    simp only [smul_apply, sum_const_zero, smul_zero, zero_apply]
  add_smul r s x := by
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r s : ArithmeticFunction R
x : ArithmeticFunction M
⊢ (r + s) • x = r • x + s • x

Next tactic:
ext
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
  smul_zero r := by
    ext
    simp only [smul_apply, sum_const_zero, smul_zero, zero_apply]
  add_smul r s x := by
    ext
    

Proof state:
case h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r s : ArithmeticFunction R
x : ArithmeticFunction M
x✝ : ℕ
⊢ ((r + s) • x) x✝ = (r • x + s • x) x✝

Next tactic:
simp only [add_smul, sum_add_distrib, smul_apply, add_apply]
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
  smul_zero r := by
    ext
    simp only [smul_apply, sum_const_zero, smul_zero, zero_apply]
  add_smul r s x := by
    ext
    simp only [add_smul, sum_add_distrib, smul_apply, add_apply]
  zero_smul r := by
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r : ArithmeticFunction M
⊢ 0 • r = 0

Next tactic:
ext
instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) where
  one_smul := one_smul'
  mul_smul := mul_smul'
  smul_add r x y := by
    ext
    simp only [sum_add_distrib, smul_add, smul_apply, add_apply]
  smul_zero r := by
    ext
    simp only [smul_apply, sum_const_zero, smul_zero, zero_apply]
  add_smul r s x := by
    ext
    simp only [add_smul, sum_add_distrib, smul_apply, add_apply]
  zero_smul r := by
    ext
    

Proof state:
case h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
r : ArithmeticFunction M
x✝ : ℕ
⊢ (0 • r) x✝ = 0 x✝

Next tactic:
simp only [smul_apply, sum_const_zero, zero_smul, zero_apply]
theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i in divisors x, f i := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f : ArithmeticFunction M
x : ℕ
⊢ (↑ζ • f) x = ∑ i in divisors x, f i

Next tactic:
rw [smul_apply]
theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i in divisors x, f i := by
  rw [smul_apply]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f : ArithmeticFunction M
x : ℕ
⊢ ∑ x in divisorsAntidiagonal x, ↑ζ x.1 • f x.2 = ∑ i in divisors x, f i

Next tactic:
trans ∑ i in divisorsAntidiagonal x, f i.snd
theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i in divisors x, f i := by
  rw [smul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.snd
  · 

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f : ArithmeticFunction M
x : ℕ
⊢ ∑ x in divisorsAntidiagonal x, ↑ζ x.1 • f x.2 = ∑ i in divisorsAntidiagonal x, f i.2

Next tactic:
refine' sum_congr rfl fun i hi => _
theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i in divisors x, f i := by
  rw [smul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.snd
  · refine' sum_congr rfl fun i hi => _
    

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f : ArithmeticFunction M
x : ℕ
i : ℕ × ℕ
hi : i ∈ divisorsAntidiagonal x
⊢ ↑ζ i.1 • f i.2 = f i.2

Next tactic:
rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i in divisors x, f i := by
  rw [smul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.snd
  · refine' sum_congr rfl fun i hi => _
    rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
    

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f : ArithmeticFunction M
i : ℕ × ℕ
hi : i ∈ divisorsAntidiagonal (i.1 * i.2)
h : i.1 * i.2 ≠ 0
⊢ ↑ζ i.1 • f i.2 = f i.2

Next tactic:
rw [natCoe_apply, zeta_apply_ne (left_ne_zero_of_mul h), cast_one, one_smul]
theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i in divisors x, f i := by
  rw [smul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.snd
  · refine' sum_congr rfl fun i hi => _
    rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
    rw [natCoe_apply, zeta_apply_ne (left_ne_zero_of_mul h), cast_one, one_smul]
  · 

Proof state:
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f : ArithmeticFunction M
x : ℕ
⊢ ∑ i in divisorsAntidiagonal x, f i.2 = ∑ i in divisors x, f i

Next tactic:
rw [← map_div_left_divisors, sum_map, Function.Embedding.coeFn_mk]
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i in divisors x, f i := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
⊢ (f * ↑ζ) x = ∑ i in divisors x, f i

Next tactic:
rw [mul_apply]
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i in divisors x, f i := by
  rw [mul_apply]
  

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
⊢ ∑ x in divisorsAntidiagonal x, f x.1 * ↑ζ x.2 = ∑ i in divisors x, f i

Next tactic:
trans ∑ i in divisorsAntidiagonal x, f i.1
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i in divisors x, f i := by
  rw [mul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.1
  · 

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
⊢ ∑ x in divisorsAntidiagonal x, f x.1 * ↑ζ x.2 = ∑ i in divisorsAntidiagonal x, f i.1

Next tactic:
refine' sum_congr rfl fun i hi => _
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i in divisors x, f i := by
  rw [mul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.1
  · refine' sum_congr rfl fun i hi => _
    

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
i : ℕ × ℕ
hi : i ∈ divisorsAntidiagonal x
⊢ f i.1 * ↑ζ i.2 = f i.1

Next tactic:
rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i in divisors x, f i := by
  rw [mul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.1
  · refine' sum_congr rfl fun i hi => _
    rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
    

Proof state:
case intro
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
i : ℕ × ℕ
hi : i ∈ divisorsAntidiagonal (i.1 * i.2)
h : i.1 * i.2 ≠ 0
⊢ f i.1 * ↑ζ i.2 = f i.1

Next tactic:
rw [natCoe_apply, zeta_apply_ne (right_ne_zero_of_mul h), cast_one, mul_one]
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i in divisors x, f i := by
  rw [mul_apply]
  trans ∑ i in divisorsAntidiagonal x, f i.1
  · refine' sum_congr rfl fun i hi => _
    rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
    rw [natCoe_apply, zeta_apply_ne (right_ne_zero_of_mul h), cast_one, mul_one]
  · 

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
x : ℕ
⊢ ∑ i in divisorsAntidiagonal x, f i.1 = ∑ i in divisors x, f i

Next tactic:
rw [← map_div_right_divisors, sum_map, Function.Embedding.coeFn_mk]
/-- This is the pointwise product of `ArithmeticFunction`s. -/
def pmul [MulZeroClass R] (f g : ArithmeticFunction R) : ArithmeticFunction R :=
  ⟨fun x => f x * g x, by 

Proof state:
R : Type u_1
inst✝ : MulZeroClass R
f g : ArithmeticFunction R
⊢ (fun x => f x * g x) 0 = 0

Next tactic:
simp
theorem pmul_comm [CommMonoidWithZero R] (f g : ArithmeticFunction R) : f.pmul g = g.pmul f := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
f g : ArithmeticFunction R
⊢ pmul f g = pmul g f

Next tactic:
ext
theorem pmul_comm [CommMonoidWithZero R] (f g : ArithmeticFunction R) : f.pmul g = g.pmul f := by
  ext
  

Proof state:
case h
R : Type u_1
inst✝ : CommMonoidWithZero R
f g : ArithmeticFunction R
x✝ : ℕ
⊢ (pmul f g) x✝ = (pmul g f) x✝

Next tactic:
simp [mul_comm]
@[simp]
theorem pmul_zeta (f : ArithmeticFunction R) : f.pmul ↑ζ = f := by
  

Proof state:
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
⊢ pmul f ↑ζ = f

Next tactic:
ext x
@[simp]
theorem pmul_zeta (f : ArithmeticFunction R) : f.pmul ↑ζ = f := by
  ext x
  

Proof state:
case h
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
x : ℕ
⊢ (pmul f ↑ζ) x = f x

Next tactic:
cases x
@[simp]
theorem pmul_zeta (f : ArithmeticFunction R) : f.pmul ↑ζ = f := by
  ext x
  cases x <;> 

Proof state:
case h.zero
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
⊢ (pmul f ↑ζ) Nat.zero = f Nat.zero

Next tactic:
simp [Nat.succ_ne_zero]
@[simp]
theorem pmul_zeta (f : ArithmeticFunction R) : f.pmul ↑ζ = f := by
  ext x
  cases x <;> 

Proof state:
case h.succ
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
n✝ : ℕ
⊢ (pmul f ↑ζ) (succ n✝) = f (succ n✝)

Next tactic:
simp [Nat.succ_ne_zero]
@[simp]
theorem zeta_pmul (f : ArithmeticFunction R) : (ζ : ArithmeticFunction R).pmul f = f := by
  

Proof state:
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
⊢ pmul (↑ζ) f = f

Next tactic:
ext x
@[simp]
theorem zeta_pmul (f : ArithmeticFunction R) : (ζ : ArithmeticFunction R).pmul f = f := by
  ext x
  

Proof state:
case h
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
x : ℕ
⊢ (pmul (↑ζ) f) x = f x

Next tactic:
cases x
@[simp]
theorem zeta_pmul (f : ArithmeticFunction R) : (ζ : ArithmeticFunction R).pmul f = f := by
  ext x
  cases x <;> 

Proof state:
case h.zero
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
⊢ (pmul (↑ζ) f) Nat.zero = f Nat.zero

Next tactic:
simp [Nat.succ_ne_zero]
@[simp]
theorem zeta_pmul (f : ArithmeticFunction R) : (ζ : ArithmeticFunction R).pmul f = f := by
  ext x
  cases x <;> 

Proof state:
case h.succ
R : Type u_1
inst✝ : NonAssocSemiring R
f : ArithmeticFunction R
n✝ : ℕ
⊢ (pmul (↑ζ) f) (succ n✝) = f (succ n✝)

Next tactic:
simp [Nat.succ_ne_zero]
/-- This is the pointwise power of `ArithmeticFunction`s. -/
def ppow (f : ArithmeticFunction R) (k : ℕ) : ArithmeticFunction R :=
  if h0 : k = 0 then ζ
  else
    ⟨fun x => f x ^ k, by
      -- porting note: added next line
      

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
k : ℕ
h0 : ¬k = 0
⊢ (fun x => f x ^ k) 0 = 0

Next tactic:
dsimp only
/-- This is the pointwise power of `ArithmeticFunction`s. -/
def ppow (f : ArithmeticFunction R) (k : ℕ) : ArithmeticFunction R :=
  if h0 : k = 0 then ζ
  else
    ⟨fun x => f x ^ k, by
      -- porting note: added next line
      dsimp only
      

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
k : ℕ
h0 : ¬k = 0
⊢ f 0 ^ k = 0

Next tactic:
rw [map_zero]
/-- This is the pointwise power of `ArithmeticFunction`s. -/
def ppow (f : ArithmeticFunction R) (k : ℕ) : ArithmeticFunction R :=
  if h0 : k = 0 then ζ
  else
    ⟨fun x => f x ^ k, by
      -- porting note: added next line
      dsimp only
      rw [map_zero]
      

Proof state:
R : Type u_1
inst✝ : Semiring R
f : ArithmeticFunction R
k : ℕ
h0 : ¬k = 0
⊢ 0 ^ k = 0

Next tactic:
exact zero_pow (Nat.pos_of_ne_zero h0)