Skip to content

Commit fdc4666

Browse files
committed
refactor(NumberTheory): golf Mathlib/NumberTheory/ArithmeticFunction/Zeta (#38278)
- proves `coe_zeta_mul_comm` directly by reindexing the divisor antidiagonal with `map_swap_divisorsAntidiagonal` - derives `coe_mul_zeta_apply` from `coe_zeta_mul_comm` and `coe_zeta_mul_apply` Extracted from #38144 [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
1 parent 2117d14 commit fdc4666

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

  • Mathlib/NumberTheory/ArithmeticFunction

Mathlib/NumberTheory/ArithmeticFunction/Zeta.lean

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,18 @@ theorem sum_divisorsAntidiagonal_eq_sum_divisors {M} [Semiring R] [AddCommMonoid
7474
∑ i ∈ divisors x, f i := by
7575
simp [← coe_zeta_smul_apply (R := R)]
7676

77+
theorem coe_zeta_mul_comm [Semiring R] {f : ArithmeticFunction R} : ζ * f = f * ζ := by
78+
ext n
79+
simp_rw [mul_apply, natCoe_apply, (cast_commute ..).eq]
80+
rw [sum_divisorsAntidiagonal fun x y ↦ f y * ζ x, sum_divisorsAntidiagonal' fun x y ↦ f x * ζ y]
81+
7782
theorem coe_zeta_mul_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
7883
(ζ * f) x = ∑ i ∈ divisors x, f i :=
7984
coe_zeta_smul_apply
8085

8186
theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
8287
(f * ζ) x = ∑ i ∈ divisors x, f i := by
83-
rw [mul_apply]
84-
trans ∑ i ∈ divisorsAntidiagonal x, f i.1
85-
· refine sum_congr rfl fun i hi => ?_
86-
rcases mem_divisorsAntidiagonal.1 hi with ⟨rfl, h⟩
87-
rw [natCoe_apply, zeta_apply_ne (right_ne_zero_of_mul h), cast_one, mul_one]
88-
· rw [← map_div_right_divisors, sum_map, Function.Embedding.coeFn_mk]
89-
90-
theorem coe_zeta_mul_comm [Semiring R] {f : ArithmeticFunction R} : ζ * f = f * ζ := by
91-
ext x
92-
rw [coe_zeta_mul_apply, coe_mul_zeta_apply]
88+
rw [← coe_zeta_mul_comm, coe_zeta_mul_apply]
9389

9490
theorem zeta_mul_apply {f : ArithmeticFunction ℕ} {x : ℕ} : (ζ * f) x = ∑ i ∈ divisors x, f i := by
9591
rw [← natCoe_nat ζ, coe_zeta_mul_apply]

0 commit comments

Comments
 (0)