File: Mathlib/NumberTheory/ArithmeticFunction.lean

full_name: ArithmeticFunction
code: /-- An arithmetic function is a function from `ℕ` that maps 0 to 0. In the literature, they are
  often instead defined as functions from `ℕ+`. Multiplication on `ArithmeticFunctions` is by
  Dirichlet convolution. -/
def ArithmeticFunction [Zero R] 
goal: Type u_1

full_name: ArithmeticFunction.zero
code: instance ArithmeticFunction.zero [Zero R] : Zero (ArithmeticFunction R) 
goal: Zero (ArithmeticFunction R)

full_name: instInhabitedArithmeticFunction
code: instance [Zero R] : Inhabited (ArithmeticFunction R) 
goal: Inhabited (ArithmeticFunction R)

full_name: ArithmeticFunction.instFunLikeNat
code: instance : FunLike (ArithmeticFunction R) ℕ R 
goal: FunLike (ArithmeticFunction R) ℕ R

full_name: ArithmeticFunction.toFun_eq
code: @[simp]
theorem toFun_eq (f : ArithmeticFunction R) : f.toFun = f 
goal: f.toFun = ⇑f

full_name: ArithmeticFunction.coe_mk
code: @[simp]
theorem coe_mk (f : ℕ → R) (hf) : @DFunLike.coe (ArithmeticFunction R) _ _ _
    (ZeroHom.mk f hf) = f 
goal: ⇑{ toFun := f, map_zero' := hf } = f

full_name: ArithmeticFunction.map_zero
code: @[simp]
theorem map_zero {f : ArithmeticFunction R} : f 0 = 0 
goal: f 0 = 0

full_name: ArithmeticFunction.coe_inj
code: theorem coe_inj {f g : ArithmeticFunction R} : (f : ℕ → R) = g ↔ f = g 
goal: ⇑f = ⇑g ↔ f = g

full_name: ArithmeticFunction.zero_apply
code: @[simp]
theorem zero_apply {x : ℕ} : (0 : ArithmeticFunction R) x = 0 
goal: 0 x = 0

full_name: ArithmeticFunction.ext
code: @[ext]
theorem ext ⦃f g : ArithmeticFunction R⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: ArithmeticFunction.ext_iff
code: theorem ext_iff {f g : ArithmeticFunction R} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : ℕ), f x = g x

full_name: ArithmeticFunction.one
code: instance one : One (ArithmeticFunction R) 
goal: One (ArithmeticFunction R)

full_name: ArithmeticFunction.one_apply
code: theorem one_apply {x : ℕ} : (1 : ArithmeticFunction R) x = ite (x = 1) 1 0 
goal: 1 x = if x = 1 then 1 else 0

full_name: ArithmeticFunction.one_one
code: @[simp]
theorem one_one : (1 : ArithmeticFunction R) 1 = 1 
goal: 1 1 = 1

full_name: ArithmeticFunction.one_apply_ne
code: @[simp]
theorem one_apply_ne {x : ℕ} (h : x ≠ 1) : (1 : ArithmeticFunction R) x = 0 
goal: 1 x = 0

full_name: ArithmeticFunction.natToArithmeticFunction
code: /-- Coerce an arithmetic function with values in `ℕ` to one with values in `R`. We cannot inline
this in `natCoe` because it gets unfolded too much. -/
@[coe]  -- Porting note: added `coe` tag.
def natToArithmeticFunction [AddMonoidWithOne R] :
    (ArithmeticFunction ℕ) → (ArithmeticFunction R) 
goal: ArithmeticFunction ℕ → ArithmeticFunction R

full_name: ArithmeticFunction.natCoe
code: instance natCoe [AddMonoidWithOne R] : Coe (ArithmeticFunction ℕ) (ArithmeticFunction R) 
goal: Coe (ArithmeticFunction ℕ) (ArithmeticFunction R)

full_name: ArithmeticFunction.natCoe_nat
code: @[simp]
theorem natCoe_nat (f : ArithmeticFunction ℕ) : natToArithmeticFunction f = f 
goal: ↑f = f

full_name: ArithmeticFunction.natCoe_apply
code: @[simp]
theorem natCoe_apply [AddMonoidWithOne R] {f : ArithmeticFunction ℕ} {x : ℕ} :
    (f : ArithmeticFunction R) x = f x 
goal: ↑f x = ↑(f x)

full_name: ArithmeticFunction.ofInt
code: /-- Coerce an arithmetic function with values in `ℤ` to one with values in `R`. We cannot inline
this in `intCoe` because it gets unfolded too much. -/
@[coe]
def ofInt [AddGroupWithOne R] :
    (ArithmeticFunction ℤ) → (ArithmeticFunction R) 
goal: ArithmeticFunction ℤ → ArithmeticFunction R

full_name: ArithmeticFunction.intCoe
code: instance intCoe [AddGroupWithOne R] : Coe (ArithmeticFunction ℤ) (ArithmeticFunction R) 
goal: Coe (ArithmeticFunction ℤ) (ArithmeticFunction R)

full_name: ArithmeticFunction.intCoe_int
code: @[simp]
theorem intCoe_int (f : ArithmeticFunction ℤ) : ofInt f = f 
goal: ↑f = f

full_name: ArithmeticFunction.intCoe_apply
code: @[simp]
theorem intCoe_apply [AddGroupWithOne R] {f : ArithmeticFunction ℤ} {x : ℕ} :
    (f : ArithmeticFunction R) x = f x 
goal: ↑f x = ↑(f x)

full_name: ArithmeticFunction.coe_coe
code: @[simp]
theorem coe_coe [AddGroupWithOne R] {f : ArithmeticFunction ℕ} :
    ((f : ArithmeticFunction ℤ) : ArithmeticFunction R) = (f : ArithmeticFunction R) 
goal: ↑↑f = ↑f

full_name: ArithmeticFunction.natCoe_one
code: @[simp]
theorem natCoe_one [AddMonoidWithOne R] :
    ((1 : ArithmeticFunction ℕ) : ArithmeticFunction R) = 1 
goal: ↑1 = 1

full_name: ArithmeticFunction.intCoe_one
code: @[simp]
theorem intCoe_one [AddGroupWithOne R] : ((1 : ArithmeticFunction ℤ) :
    ArithmeticFunction R) = 1 
goal: ↑1 = 1

full_name: ArithmeticFunction.add
code: instance add : Add (ArithmeticFunction R) 
goal: Add (ArithmeticFunction R)

full_name: ArithmeticFunction.add_apply
code: @[simp]
theorem add_apply {f g : ArithmeticFunction R} {n : ℕ} : (f + g) n = f n + g n 
goal: (f + g) n = f n + g n

full_name: ArithmeticFunction.instAddMonoid
code: instance instAddMonoid : AddMonoid (ArithmeticFunction R) 
goal: AddMonoid (ArithmeticFunction R)

full_name: ArithmeticFunction.instAddMonoidWithOne
code: instance instAddMonoidWithOne [AddMonoidWithOne R] : AddMonoidWithOne (ArithmeticFunction R) 
goal: AddMonoidWithOne (ArithmeticFunction R)

full_name: ArithmeticFunction.instAddCommMonoid
code: instance instAddCommMonoid [AddCommMonoid R] : AddCommMonoid (ArithmeticFunction R) 
goal: AddCommMonoid (ArithmeticFunction R)

full_name: ArithmeticFunction.instNeg
code: instance [NegZeroClass R] : Neg (ArithmeticFunction R) 
goal: Neg (ArithmeticFunction R)

full_name: ArithmeticFunction.instAddGroup
code: instance [AddGroup R] : AddGroup (ArithmeticFunction R) 
goal: AddGroup (ArithmeticFunction R)

full_name: ArithmeticFunction.instAddCommGroup
code: instance [AddCommGroup R] : AddCommGroup (ArithmeticFunction R) 
goal: AddCommGroup (ArithmeticFunction R)

full_name: ArithmeticFunction.instSMul
code: /-- The Dirichlet convolution of two arithmetic functions `f` and `g` is another arithmetic function
  such that `(f * g) n` is the sum of `f x * g y` over all `(x,y)` such that `x * y = n`. -/
instance : SMul (ArithmeticFunction R) (ArithmeticFunction M) 
goal: SMul (ArithmeticFunction R) (ArithmeticFunction M)

full_name: ArithmeticFunction.smul_apply
code: @[simp]
theorem smul_apply {f : ArithmeticFunction R} {g : ArithmeticFunction M} {n : ℕ} :
    (f • g) n = ∑ x ∈ divisorsAntidiagonal n, f x.fst • g x.snd 
goal: (f • g) n = ∑ x ∈ n.divisorsAntidiagonal, f x.1 • g x.2

full_name: ArithmeticFunction.instMul
code: /-- The Dirichlet convolution of two arithmetic functions `f` and `g` is another arithmetic function
  such that `(f * g) n` is the sum of `f x * g y` over all `(x,y)` such that `x * y = n`. -/
instance [Semiring R] : Mul (ArithmeticFunction R) 
goal: Mul (ArithmeticFunction R)

full_name: ArithmeticFunction.mul_apply
code: @[simp]
theorem mul_apply [Semiring R] {f g : ArithmeticFunction R} {n : ℕ} :
    (f * g) n = ∑ x ∈ divisorsAntidiagonal n, f x.fst * g x.snd 
goal: (f * g) n = ∑ x ∈ n.divisorsAntidiagonal, f x.1 * g x.2

full_name: ArithmeticFunction.mul_apply_one
code: theorem mul_apply_one [Semiring R] {f g : ArithmeticFunction R} : (f * g) 1 = f 1 * g 1 
goal: (f * g) 1 = f 1 * g 1

full_name: ArithmeticFunction.natCoe_mul
code: @[simp, norm_cast]
theorem natCoe_mul [Semiring R] {f g : ArithmeticFunction ℕ} :
    (↑(f * g) : ArithmeticFunction R) = f * g 
goal: ↑(f * g) = ↑f * ↑g

full_name: ArithmeticFunction.intCoe_mul
code: @[simp, norm_cast]
theorem intCoe_mul [Ring R] {f g : ArithmeticFunction ℤ} :
    (↑(f * g) : ArithmeticFunction R) = ↑f * g 
goal: ↑(f * g) = ↑f * ↑g

full_name: ArithmeticFunction.mul_smul'
code: theorem mul_smul' (f g : ArithmeticFunction R) (h : ArithmeticFunction M) :
    (f * g) • h = f • g • h 
goal: (f * g) • h = f • g • h

full_name: ArithmeticFunction.one_smul'
code: theorem one_smul' (b : ArithmeticFunction M) : (1 : ArithmeticFunction R) • b = b 
goal: 1 • b = b

full_name: ArithmeticFunction.instMonoid
code: instance instMonoid : Monoid (ArithmeticFunction R) 
goal: Monoid (ArithmeticFunction R)

full_name: ArithmeticFunction.instSemiring
code: instance instSemiring : Semiring (ArithmeticFunction R) 
goal: Semiring (ArithmeticFunction R)

full_name: ArithmeticFunction.instCommSemiring
code: instance [CommSemiring R] : CommSemiring (ArithmeticFunction R) 
goal: CommSemiring (ArithmeticFunction R)

full_name: ArithmeticFunction.instCommRing
code: instance [CommRing R] : CommRing (ArithmeticFunction R) 
goal: CommRing (ArithmeticFunction R)

full_name: ArithmeticFunction.instModule
code: instance {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] :
    Module (ArithmeticFunction R) (ArithmeticFunction M) 
goal: Module (ArithmeticFunction R) (ArithmeticFunction M)

full_name: ArithmeticFunction.zeta
code: /-- `ζ 0 = 0`, otherwise `ζ x = 1`. The Dirichlet Series is the Riemann `ζ`.  -/
def zeta : ArithmeticFunction ℕ 
goal: ArithmeticFunction ℕ

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_zeta_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "ζ" => ArithmeticFunction.zeta
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_termζ_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "ζ" => ArithmeticFunction.zeta
goal: Lean.Macro

full_name: ArithmeticFunction.zeta._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_zeta_1
code: @[inherit_doc]
scoped[ArithmeticFunction.zeta] notation "ζ" => ArithmeticFunction.zeta
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.zeta._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_zeta_termζ_1
code: @[inherit_doc]
scoped[ArithmeticFunction.zeta] notation "ζ" => ArithmeticFunction.zeta
goal: Lean.Macro

full_name: ArithmeticFunction.zeta_apply
code: @[simp]
theorem zeta_apply {x : ℕ} : ζ x = if x = 0 then 0 else 1 
goal: ArithmeticFunction.zeta x = if x = 0 then 0 else 1

full_name: ArithmeticFunction.zeta_apply_ne
code: theorem zeta_apply_ne {x : ℕ} (h : x ≠ 0) : ζ x = 1 
goal: ArithmeticFunction.zeta x = 1

full_name: ArithmeticFunction.coe_zeta_smul_apply
code: theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i ∈ divisors x, f i 
goal: (↑ArithmeticFunction.zeta • f) x = ∑ i ∈ x.divisors, f i

full_name: ArithmeticFunction.coe_zeta_mul_apply
code: theorem coe_zeta_mul_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (↑ζ * f) x = ∑ i ∈ divisors x, f i 
goal: (↑ArithmeticFunction.zeta * f) x = ∑ i ∈ x.divisors, f i

full_name: ArithmeticFunction.coe_mul_zeta_apply
code: theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i ∈ divisors x, f i 
goal: (f * ↑ArithmeticFunction.zeta) x = ∑ i ∈ x.divisors, f i

full_name: ArithmeticFunction.zeta_mul_apply
code: theorem zeta_mul_apply {f : ArithmeticFunction ℕ} {x : ℕ} : (ζ * f) x = ∑ i ∈ divisors x, f i 
goal: (ArithmeticFunction.zeta * f) x = ∑ i ∈ x.divisors, f i

full_name: ArithmeticFunction.mul_zeta_apply
code: theorem mul_zeta_apply {f : ArithmeticFunction ℕ} {x : ℕ} : (f * ζ) x = ∑ i ∈ divisors x, f i 
goal: (f * ArithmeticFunction.zeta) x = ∑ i ∈ x.divisors, f i

full_name: ArithmeticFunction.pmul
code: /-- This is the pointwise product of `ArithmeticFunction`s. -/
def pmul [MulZeroClass R] (f g : ArithmeticFunction R) : ArithmeticFunction R 
goal: ArithmeticFunction R

full_name: ArithmeticFunction.pmul_apply
code: @[simp]
theorem pmul_apply [MulZeroClass R] {f g : ArithmeticFunction R} {x : ℕ} : f.pmul g x = f x * g x 
goal: (f.pmul g) x = f x * g x

full_name: ArithmeticFunction.pmul_comm
code: theorem pmul_comm [CommMonoidWithZero R] (f g : ArithmeticFunction R) : f.pmul g = g.pmul f 
goal: f.pmul g = g.pmul f

full_name: ArithmeticFunction.pmul_assoc
code: lemma pmul_assoc [CommMonoidWithZero R] (f₁ f₂ f₃ : ArithmeticFunction R) :
    pmul (pmul f₁ f₂) f₃ = pmul f₁ (pmul f₂ f₃) 
goal: (f₁.pmul f₂).pmul f₃ = f₁.pmul (f₂.pmul f₃)

full_name: ArithmeticFunction.pmul_zeta
code: @[simp]
theorem pmul_zeta (f : ArithmeticFunction R) : f.pmul ↑ζ = f 
goal: f.pmul ↑ArithmeticFunction.zeta = f

full_name: ArithmeticFunction.zeta_pmul
code: @[simp]
theorem zeta_pmul (f : ArithmeticFunction R) : (ζ : ArithmeticFunction R).pmul f = f 
goal: (↑ArithmeticFunction.zeta).pmul f = f

full_name: ArithmeticFunction.ppow
code: /-- This is the pointwise power of `ArithmeticFunction`s. -/
def ppow (f : ArithmeticFunction R) (k : ℕ) : ArithmeticFunction R 
goal: ArithmeticFunction R

full_name: ArithmeticFunction.ppow_zero
code: @[simp]
theorem ppow_zero {f : ArithmeticFunction R} : f.ppow 0 = ζ 
goal: f.ppow 0 = ↑ArithmeticFunction.zeta

full_name: ArithmeticFunction.ppow_apply
code: @[simp]
theorem ppow_apply {f : ArithmeticFunction R} {k x : ℕ} (kpos : 0 < k) : f.ppow k x = f x ^ k 
goal: (f.ppow k) x = f x ^ k

full_name: ArithmeticFunction.ppow_succ'
code: theorem ppow_succ' {f : ArithmeticFunction R} {k : ℕ} : f.ppow (k + 1) = f.pmul (f.ppow k) 
goal: f.ppow (k + 1) = f.pmul (f.ppow k)

full_name: ArithmeticFunction.ppow_succ
code: theorem ppow_succ {f : ArithmeticFunction R} {k : ℕ} {kpos : 0 < k} :
    f.ppow (k + 1) = (f.ppow k).pmul f 
goal: f.ppow (k + 1) = (f.ppow k).pmul f

full_name: ArithmeticFunction.pdiv
code: /-- This is the pointwise division of `ArithmeticFunction`s. -/
def pdiv [GroupWithZero R] (f g : ArithmeticFunction R) : ArithmeticFunction R 
goal: ArithmeticFunction R

full_name: ArithmeticFunction.pdiv_apply
code: @[simp]
theorem pdiv_apply [GroupWithZero R] (f g : ArithmeticFunction R) (n : ℕ) :
    pdiv f g n = f n / g n 
goal: (f.pdiv g) n = f n / g n

full_name: ArithmeticFunction.pdiv_zeta
code: /-- This result only holds for `DivisionSemiring`s instead of `GroupWithZero`s because zeta takes
values in ℕ, and hence the coercion requires an `AddMonoidWithOne`. TODO: Generalise zeta -/
@[simp]
theorem pdiv_zeta [DivisionSemiring R] (f : ArithmeticFunction R) :
    pdiv f zeta = f 
goal: f.pdiv ↑ArithmeticFunction.zeta = f

full_name: ArithmeticFunction.prodPrimeFactors
code: /-- The map $n \mapsto \prod_{p \mid n} f(p)$ as an arithmetic function -/
def prodPrimeFactors [CommMonoidWithZero R] (f : ℕ → R) : ArithmeticFunction R 
goal: ArithmeticFunction R

full_name: ArithmeticFunction.bigproddvd
code: /-- `∏ᵖ p ∣ n, f p` is custom notation for `prodPrimeFactors f n` -/
scoped syntax (name := bigproddvd) "∏ᵖ " extBinder " ∣ " term ", " term:67 : term
goal: Lean.ParserDescr

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_bigproddvd_1
code: macro_rules (kind := bigproddvd)
  | `(∏ᵖ $x:ident ∣ $n, $r) => `(prodPrimeFactors (fun $x ↦ $r) $n)
goal: Lean.Macro

full_name: ArithmeticFunction.prodPrimeFactors_apply
code: @[simp]
theorem prodPrimeFactors_apply [CommMonoidWithZero R] {f : ℕ → R} {n : ℕ} (hn : n ≠ 0) :
    ∏ᵖ p ∣ n, f p = ∏ p ∈ n.primeFactors, f p 
goal: (ArithmeticFunction.prodPrimeFactors fun p => f p) n = ∏ p ∈ n.primeFactors, f p

full_name: ArithmeticFunction.IsMultiplicative
code: /-- Multiplicative functions -/
def IsMultiplicative [MonoidWithZero R] (f : ArithmeticFunction R) : Prop 
goal: Prop

full_name: ArithmeticFunction.IsMultiplicative.map_one
code: @[simp, arith_mult]
theorem map_one {f : ArithmeticFunction R} (h : f.IsMultiplicative) : f 1 = 1 
goal: f 1 = 1

full_name: ArithmeticFunction.IsMultiplicative.map_mul_of_coprime
code: @[simp]
theorem map_mul_of_coprime {f : ArithmeticFunction R} (hf : f.IsMultiplicative) {m n : ℕ}
    (h : m.Coprime n) : f (m * n) = f m * f n 
goal: f (m * n) = f m * f n

full_name: ArithmeticFunction.IsMultiplicative.map_prod
code: theorem map_prod {ι : Type*} [CommMonoidWithZero R] (g : ι → ℕ) {f : ArithmeticFunction R}
    (hf : f.IsMultiplicative) (s : Finset ι) (hs : (s : Set ι).Pairwise (Coprime on g)) :
    f (∏ i ∈ s, g i) = ∏ i ∈ s, f (g i) 
goal: f (∏ i ∈ s, g i) = ∏ i ∈ s, f (g i)

full_name: ArithmeticFunction.IsMultiplicative.map_prod_of_prime
code: theorem map_prod_of_prime [CommSemiring R] {f : ArithmeticFunction R}
    (h_mult : ArithmeticFunction.IsMultiplicative f)
    (t : Finset ℕ) (ht : ∀ p ∈ t, p.Prime) :
    f (∏ a ∈ t, a) = ∏ a ∈ t, f a 
goal: f (∏ a ∈ t, a) = ∏ a ∈ t, f a

full_name: ArithmeticFunction.IsMultiplicative.map_prod_of_subset_primeFactors
code: theorem map_prod_of_subset_primeFactors [CommSemiring R] {f : ArithmeticFunction R}
    (h_mult : ArithmeticFunction.IsMultiplicative f) (l : ℕ)
    (t : Finset ℕ) (ht : t ⊆ l.primeFactors) :
    f (∏ a ∈ t, a) = ∏ a ∈ t, f a 
goal: f (∏ a ∈ t, a) = ∏ a ∈ t, f a

full_name: ArithmeticFunction.IsMultiplicative.natCast
code: @[arith_mult]
theorem natCast {f : ArithmeticFunction ℕ} [Semiring R] (h : f.IsMultiplicative) :
    IsMultiplicative (f : ArithmeticFunction R) 
goal: (↑f).IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.intCast
code: @[arith_mult]
theorem intCast {f : ArithmeticFunction ℤ} [Ring R] (h : f.IsMultiplicative) :
    IsMultiplicative (f : ArithmeticFunction R) 
goal: (↑f).IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.mul
code: @[arith_mult]
theorem mul [CommSemiring R] {f g : ArithmeticFunction R} (hf : f.IsMultiplicative)
    (hg : g.IsMultiplicative) : IsMultiplicative (f * g) 
goal: (f * g).IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.pmul
code: @[arith_mult]
theorem pmul [CommSemiring R] {f g : ArithmeticFunction R} (hf : f.IsMultiplicative)
    (hg : g.IsMultiplicative) : IsMultiplicative (f.pmul g) 
goal: (f.pmul g).IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.pdiv
code: @[arith_mult]
theorem pdiv [CommGroupWithZero R] {f g : ArithmeticFunction R} (hf : IsMultiplicative f)
    (hg : IsMultiplicative g) : IsMultiplicative (pdiv f g) 
goal: (f.pdiv g).IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.multiplicative_factorization
code: /-- For any multiplicative function `f` and any `n > 0`,
we can evaluate `f n` by evaluating `f` at `p ^ k` over the factorization of `n` -/
nonrec  -- Porting note: added
theorem multiplicative_factorization [CommMonoidWithZero R] (f : ArithmeticFunction R)
    (hf : f.IsMultiplicative) {n : ℕ} (hn : n ≠ 0) :
    f n = n.factorization.prod fun p k => f (p ^ k) 
goal: f n = n.factorization.prod fun p k => f (p ^ k)

full_name: ArithmeticFunction.IsMultiplicative.iff_ne_zero
code: /-- A recapitulation of the definition of multiplicative that is simpler for proofs -/
theorem iff_ne_zero [MonoidWithZero R] {f : ArithmeticFunction R} :
    IsMultiplicative f ↔
      f 1 = 1 ∧ ∀ {m n : ℕ}, m ≠ 0 → n ≠ 0 → m.Coprime n → f (m * n) = f m * f n 
goal: f.IsMultiplicative ↔ f 1 = 1 ∧ ∀ {m n : ℕ}, m ≠ 0 → n ≠ 0 → m.Coprime n → f (m * n) = f m * f n

full_name: ArithmeticFunction.IsMultiplicative.eq_iff_eq_on_prime_powers
code: /-- Two multiplicative functions `f` and `g` are equal if and only if
they agree on prime powers -/
theorem eq_iff_eq_on_prime_powers [CommMonoidWithZero R] (f : ArithmeticFunction R)
    (hf : f.IsMultiplicative) (g : ArithmeticFunction R) (hg : g.IsMultiplicative) :
    f = g ↔ ∀ p i : ℕ, Nat.Prime p → f (p ^ i) = g (p ^ i) 
goal: f = g ↔ ∀ (p i : ℕ), Nat.Prime p → f (p ^ i) = g (p ^ i)

full_name: ArithmeticFunction.IsMultiplicative.prodPrimeFactors
code: @[arith_mult]
theorem prodPrimeFactors [CommMonoidWithZero R] (f : ℕ → R) :
    IsMultiplicative (prodPrimeFactors f) 
goal: (ArithmeticFunction.prodPrimeFactors f).IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.prodPrimeFactors_add_of_squarefree
code: theorem prodPrimeFactors_add_of_squarefree [CommSemiring R] {f g : ArithmeticFunction R}
    (hf : IsMultiplicative f) (hg : IsMultiplicative g) {n : ℕ} (hn : Squarefree n) :
    ∏ᵖ p ∣ n, (f + g) p = (f * g) n 
goal: (ArithmeticFunction.prodPrimeFactors fun p => (f + g) p) n = (f * g) n

full_name: ArithmeticFunction.IsMultiplicative.lcm_apply_mul_gcd_apply
code: theorem lcm_apply_mul_gcd_apply [CommMonoidWithZero R] {f : ArithmeticFunction R}
    (hf : f.IsMultiplicative) {x y : ℕ} :
    f (x.lcm y) * f (x.gcd y) = f x * f y 
goal: f (x.lcm y) * f (x.gcd y) = f x * f y

full_name: ArithmeticFunction.id
code: /-- The identity on `ℕ` as an `ArithmeticFunction`.  -/
nonrec  -- Porting note (#11445): added
def id : ArithmeticFunction ℕ 
goal: ArithmeticFunction ℕ

full_name: ArithmeticFunction.id_apply
code: @[simp]
theorem id_apply {x : ℕ} : id x = x 
goal: ArithmeticFunction.id x = x

full_name: ArithmeticFunction.pow
code: /-- `pow k n = n ^ k`, except `pow 0 0 = 0`. -/
def pow (k : ℕ) : ArithmeticFunction ℕ 
goal: ArithmeticFunction ℕ

full_name: ArithmeticFunction.pow_apply
code: @[simp]
theorem pow_apply {k n : ℕ} : pow k n = if k = 0 ∧ n = 0 then 0 else n ^ k 
goal: (ArithmeticFunction.pow k) n = if k = 0 ∧ n = 0 then 0 else n ^ k

full_name: ArithmeticFunction.pow_zero_eq_zeta
code: theorem pow_zero_eq_zeta : pow 0 = ζ 
goal: ArithmeticFunction.pow 0 = ArithmeticFunction.zeta

full_name: ArithmeticFunction.sigma
code: /-- `σ k n` is the sum of the `k`th powers of the divisors of `n` -/
def sigma (k : ℕ) : ArithmeticFunction ℕ 
goal: ArithmeticFunction ℕ

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_termσ_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "σ" => ArithmeticFunction.sigma
goal: Lean.Macro

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_sigma_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "σ" => ArithmeticFunction.sigma
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.sigma._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_sigma_termσ_1
code: @[inherit_doc]
scoped[ArithmeticFunction.sigma] notation "σ" => ArithmeticFunction.sigma
goal: Lean.Macro

full_name: ArithmeticFunction.sigma._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_sigma_1
code: @[inherit_doc]
scoped[ArithmeticFunction.sigma] notation "σ" => ArithmeticFunction.sigma
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.sigma_apply
code: theorem sigma_apply {k n : ℕ} : σ k n = ∑ d ∈ divisors n, d ^ k 
goal: (ArithmeticFunction.sigma k) n = ∑ d ∈ n.divisors, d ^ k

full_name: ArithmeticFunction.sigma_apply_prime_pow
code: theorem sigma_apply_prime_pow {k p i : ℕ} (hp : p.Prime) :
    σ k (p ^ i) = ∑ j in .range (i + 1), p ^ (j * k) 
goal: (ArithmeticFunction.sigma k) (p ^ i) = ∑ j ∈ Finset.range (i + 1), p ^ (j * k)

full_name: ArithmeticFunction.sigma_one_apply
code: theorem sigma_one_apply (n : ℕ) : σ 1 n = ∑ d ∈ divisors n, d 
goal: (ArithmeticFunction.sigma 1) n = ∑ d ∈ n.divisors, d

full_name: ArithmeticFunction.sigma_one_apply_prime_pow
code: theorem sigma_one_apply_prime_pow {p i : ℕ} (hp : p.Prime) :
    σ 1 (p ^ i) = ∑ k in .range (i + 1), p ^ k 
goal: (ArithmeticFunction.sigma 1) (p ^ i) = ∑ k ∈ Finset.range (i + 1), p ^ k

full_name: ArithmeticFunction.sigma_zero_apply
code: theorem sigma_zero_apply (n : ℕ) : σ 0 n = (divisors n).card 
goal: (ArithmeticFunction.sigma 0) n = n.divisors.card

full_name: ArithmeticFunction.sigma_zero_apply_prime_pow
code: theorem sigma_zero_apply_prime_pow {p i : ℕ} (hp : p.Prime) : σ 0 (p ^ i) = i + 1 
goal: (ArithmeticFunction.sigma 0) (p ^ i) = i + 1

full_name: ArithmeticFunction.zeta_mul_pow_eq_sigma
code: theorem zeta_mul_pow_eq_sigma {k : ℕ} : ζ * pow k = σ k 
goal: ArithmeticFunction.zeta * ArithmeticFunction.pow k = ArithmeticFunction.sigma k

full_name: ArithmeticFunction.isMultiplicative_one
code: @[arith_mult]
theorem isMultiplicative_one [MonoidWithZero R] : IsMultiplicative (1 : ArithmeticFunction R) 
goal: ArithmeticFunction.IsMultiplicative 1

full_name: ArithmeticFunction.isMultiplicative_zeta
code: @[arith_mult]
theorem isMultiplicative_zeta : IsMultiplicative ζ 
goal: ArithmeticFunction.zeta.IsMultiplicative

full_name: ArithmeticFunction.isMultiplicative_id
code: @[arith_mult]
theorem isMultiplicative_id : IsMultiplicative ArithmeticFunction.id 
goal: ArithmeticFunction.id.IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.ppow
code: @[arith_mult]
theorem IsMultiplicative.ppow [CommSemiring R] {f : ArithmeticFunction R} (hf : f.IsMultiplicative)
    {k : ℕ} : IsMultiplicative (f.ppow k) 
goal: (f.ppow k).IsMultiplicative

full_name: ArithmeticFunction.isMultiplicative_pow
code: @[arith_mult]
theorem isMultiplicative_pow {k : ℕ} : IsMultiplicative (pow k) 
goal: (ArithmeticFunction.pow k).IsMultiplicative

full_name: ArithmeticFunction.isMultiplicative_sigma
code: @[arith_mult]
theorem isMultiplicative_sigma {k : ℕ} : IsMultiplicative (σ k) 
goal: (ArithmeticFunction.sigma k).IsMultiplicative

full_name: ArithmeticFunction.cardFactors
code: /-- `Ω n` is the number of prime factors of `n`. -/
def cardFactors : ArithmeticFunction ℕ 
goal: ArithmeticFunction ℕ

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_cardFactors_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "Ω" => ArithmeticFunction.cardFactors
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_termΩ_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "Ω" => ArithmeticFunction.cardFactors
goal: Lean.Macro

full_name: ArithmeticFunction.Omega._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_cardFactors_1
code: @[inherit_doc]
scoped[ArithmeticFunction.Omega] notation "Ω" => ArithmeticFunction.cardFactors
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.Omega._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_Omega_termΩ_1
code: @[inherit_doc]
scoped[ArithmeticFunction.Omega] notation "Ω" => ArithmeticFunction.cardFactors
goal: Lean.Macro

full_name: ArithmeticFunction.cardFactors_apply
code: theorem cardFactors_apply {n : ℕ} : Ω n = n.primeFactorsList.length 
goal: ArithmeticFunction.cardFactors n = n.primeFactorsList.length

full_name: ArithmeticFunction.cardFactors_zero
code: lemma cardFactors_zero : Ω 0 = 0 
goal: ArithmeticFunction.cardFactors 0 = 0

full_name: ArithmeticFunction.cardFactors_one
code: @[simp] theorem cardFactors_one : Ω 1 = 0 
goal: ArithmeticFunction.cardFactors 1 = 0

full_name: ArithmeticFunction.cardFactors_eq_one_iff_prime
code: @[simp]
theorem cardFactors_eq_one_iff_prime {n : ℕ} : Ω n = 1 ↔ n.Prime 
goal: ArithmeticFunction.cardFactors n = 1 ↔ Nat.Prime n

full_name: ArithmeticFunction.cardFactors_mul
code: theorem cardFactors_mul {m n : ℕ} (m0 : m ≠ 0) (n0 : n ≠ 0) : Ω (m * n) = Ω m + Ω n 
goal: ArithmeticFunction.cardFactors (m * n) = ArithmeticFunction.cardFactors m + ArithmeticFunction.cardFactors n

full_name: ArithmeticFunction.cardFactors_multiset_prod
code: theorem cardFactors_multiset_prod {s : Multiset ℕ} (h0 : s.prod ≠ 0) :
    Ω s.prod = (Multiset.map Ω s).sum 
goal: ArithmeticFunction.cardFactors s.prod = (Multiset.map (⇑ArithmeticFunction.cardFactors) s).sum

full_name: ArithmeticFunction.cardFactors_apply_prime
code: @[simp]
theorem cardFactors_apply_prime {p : ℕ} (hp : p.Prime) : Ω p = 1 
goal: ArithmeticFunction.cardFactors p = 1

full_name: ArithmeticFunction.cardFactors_apply_prime_pow
code: @[simp]
theorem cardFactors_apply_prime_pow {p k : ℕ} (hp : p.Prime) : Ω (p ^ k) = k 
goal: ArithmeticFunction.cardFactors (p ^ k) = k

full_name: ArithmeticFunction.cardDistinctFactors
code: /-- `ω n` is the number of distinct prime factors of `n`. -/
def cardDistinctFactors : ArithmeticFunction ℕ 
goal: ArithmeticFunction ℕ

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_termω_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "ω" => ArithmeticFunction.cardDistinctFactors
goal: Lean.Macro

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_cardDistinctFactors_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "ω" => ArithmeticFunction.cardDistinctFactors
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.omega._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_cardDistinctFactors_1
code: @[inherit_doc]
scoped[ArithmeticFunction.omega] notation "ω" => ArithmeticFunction.cardDistinctFactors
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.omega._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_omega_termω_1
code: @[inherit_doc]
scoped[ArithmeticFunction.omega] notation "ω" => ArithmeticFunction.cardDistinctFactors
goal: Lean.Macro

full_name: ArithmeticFunction.cardDistinctFactors_zero
code: theorem cardDistinctFactors_zero : ω 0 = 0 
goal: ArithmeticFunction.cardDistinctFactors 0 = 0

full_name: ArithmeticFunction.cardDistinctFactors_one
code: @[simp]
theorem cardDistinctFactors_one : ω 1 = 0 
goal: ArithmeticFunction.cardDistinctFactors 1 = 0

full_name: ArithmeticFunction.cardDistinctFactors_apply
code: theorem cardDistinctFactors_apply {n : ℕ} : ω n = n.primeFactorsList.dedup.length 
goal: ArithmeticFunction.cardDistinctFactors n = n.primeFactorsList.dedup.length

full_name: ArithmeticFunction.cardDistinctFactors_eq_cardFactors_iff_squarefree
code: theorem cardDistinctFactors_eq_cardFactors_iff_squarefree {n : ℕ} (h0 : n ≠ 0) :
    ω n = Ω n ↔ Squarefree n 
goal: ArithmeticFunction.cardDistinctFactors n = ArithmeticFunction.cardFactors n ↔ Squarefree n

full_name: ArithmeticFunction.cardDistinctFactors_apply_prime_pow
code: @[simp]
theorem cardDistinctFactors_apply_prime_pow {p k : ℕ} (hp : p.Prime) (hk : k ≠ 0) :
    ω (p ^ k) = 1 
goal: ArithmeticFunction.cardDistinctFactors (p ^ k) = 1

full_name: ArithmeticFunction.cardDistinctFactors_apply_prime
code: @[simp]
theorem cardDistinctFactors_apply_prime {p : ℕ} (hp : p.Prime) : ω p = 1 
goal: ArithmeticFunction.cardDistinctFactors p = 1

full_name: ArithmeticFunction.moebius
code: /-- `μ` is the Möbius function. If `n` is squarefree with an even number of distinct prime factors,
  `μ n = 1`. If `n` is squarefree with an odd number of distinct prime factors, `μ n = -1`.
  If `n` is not squarefree, `μ n = 0`. -/
def moebius : ArithmeticFunction ℤ 
goal: ArithmeticFunction ℤ

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_termμ_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "μ" => ArithmeticFunction.moebius
goal: Lean.Macro

full_name: ArithmeticFunction._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_moebius_1
code: @[inherit_doc]
scoped[ArithmeticFunction] notation "μ" => ArithmeticFunction.moebius
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.Moebius._aux_Mathlib_NumberTheory_ArithmeticFunction___unexpand_ArithmeticFunction_moebius_1
code: @[inherit_doc]
scoped[ArithmeticFunction.Moebius] notation "μ" => ArithmeticFunction.moebius
goal: Lean.PrettyPrinter.Unexpander

full_name: ArithmeticFunction.Moebius._aux_Mathlib_NumberTheory_ArithmeticFunction___macroRules_ArithmeticFunction_Moebius_termμ_1
code: @[inherit_doc]
scoped[ArithmeticFunction.Moebius] notation "μ" => ArithmeticFunction.moebius
goal: Lean.Macro

full_name: ArithmeticFunction.moebius_apply_of_squarefree
code: @[simp]
theorem moebius_apply_of_squarefree {n : ℕ} (h : Squarefree n) : μ n = (-1) ^ cardFactors n 
goal: ArithmeticFunction.moebius n = (-1) ^ ArithmeticFunction.cardFactors n

full_name: ArithmeticFunction.moebius_eq_zero_of_not_squarefree
code: @[simp]
theorem moebius_eq_zero_of_not_squarefree {n : ℕ} (h : ¬Squarefree n) : μ n = 0 
goal: ArithmeticFunction.moebius n = 0

full_name: ArithmeticFunction.moebius_apply_one
code: theorem moebius_apply_one : μ 1 = 1 
goal: ArithmeticFunction.moebius 1 = 1

full_name: ArithmeticFunction.moebius_ne_zero_iff_squarefree
code: theorem moebius_ne_zero_iff_squarefree {n : ℕ} : μ n ≠ 0 ↔ Squarefree n 
goal: ArithmeticFunction.moebius n ≠ 0 ↔ Squarefree n

full_name: ArithmeticFunction.moebius_eq_or
code: theorem moebius_eq_or (n : ℕ) : μ n = 0 ∨ μ n = 1 ∨ μ n = -1 
goal: ArithmeticFunction.moebius n = 0 ∨ ArithmeticFunction.moebius n = 1 ∨ ArithmeticFunction.moebius n = -1

full_name: ArithmeticFunction.moebius_ne_zero_iff_eq_or
code: theorem moebius_ne_zero_iff_eq_or {n : ℕ} : μ n ≠ 0 ↔ μ n = 1 ∨ μ n = -1 
goal: ArithmeticFunction.moebius n ≠ 0 ↔ ArithmeticFunction.moebius n = 1 ∨ ArithmeticFunction.moebius n = -1

full_name: ArithmeticFunction.moebius_sq_eq_one_of_squarefree
code: theorem moebius_sq_eq_one_of_squarefree {l : ℕ} (hl : Squarefree l) : μ l ^ 2 = 1 
goal: ArithmeticFunction.moebius l ^ 2 = 1

full_name: ArithmeticFunction.abs_moebius_eq_one_of_squarefree
code: theorem abs_moebius_eq_one_of_squarefree {l : ℕ} (hl : Squarefree l) : |μ l| = 1 
goal: |ArithmeticFunction.moebius l| = 1

full_name: ArithmeticFunction.moebius_sq
code: theorem moebius_sq {n : ℕ} :
    μ n ^ 2 = if Squarefree n then 1 else 0 
goal: ArithmeticFunction.moebius n ^ 2 = if Squarefree n then 1 else 0

full_name: ArithmeticFunction.abs_moebius
code: theorem abs_moebius {n : ℕ} :
    |μ n| = if Squarefree n then 1 else 0 
goal: |ArithmeticFunction.moebius n| = if Squarefree n then 1 else 0

full_name: ArithmeticFunction.abs_moebius_le_one
code: theorem abs_moebius_le_one {n : ℕ} : |μ n| ≤ 1 
goal: |ArithmeticFunction.moebius n| ≤ 1

full_name: ArithmeticFunction.moebius_apply_prime
code: theorem moebius_apply_prime {p : ℕ} (hp : p.Prime) : μ p = -1 
goal: ArithmeticFunction.moebius p = -1

full_name: ArithmeticFunction.moebius_apply_prime_pow
code: theorem moebius_apply_prime_pow {p k : ℕ} (hp : p.Prime) (hk : k ≠ 0) :
    μ (p ^ k) = if k = 1 then -1 else 0 
goal: ArithmeticFunction.moebius (p ^ k) = if k = 1 then -1 else 0

full_name: ArithmeticFunction.moebius_apply_isPrimePow_not_prime
code: theorem moebius_apply_isPrimePow_not_prime {n : ℕ} (hn : IsPrimePow n) (hn' : ¬n.Prime) :
    μ n = 0 
goal: ArithmeticFunction.moebius n = 0

full_name: ArithmeticFunction.isMultiplicative_moebius
code: @[arith_mult]
theorem isMultiplicative_moebius : IsMultiplicative μ 
goal: ArithmeticFunction.moebius.IsMultiplicative

full_name: ArithmeticFunction.IsMultiplicative.prodPrimeFactors_one_add_of_squarefree
code: theorem IsMultiplicative.prodPrimeFactors_one_add_of_squarefree [CommSemiring R]
    {f : ArithmeticFunction R} (h_mult : f.IsMultiplicative) {n : ℕ} (hn : Squarefree n) :
    ∏ p ∈ n.primeFactors, (1 + f p) = ∑ d ∈ n.divisors, f d 
goal: ∏ p ∈ n.primeFactors, (1 + f p) = ∑ d ∈ n.divisors, f d

full_name: ArithmeticFunction.IsMultiplicative.prodPrimeFactors_one_sub_of_squarefree
code: theorem IsMultiplicative.prodPrimeFactors_one_sub_of_squarefree [CommRing R]
    (f : ArithmeticFunction R) (hf : f.IsMultiplicative) {n : ℕ} (hn : Squarefree n) :
    ∏ p ∈ n.primeFactors, (1 - f p) = ∑ d ∈ n.divisors, μ d * f d 
goal: ∏ p ∈ n.primeFactors, (1 - f p) = ∑ d ∈ n.divisors, ↑(ArithmeticFunction.moebius d) * f d

full_name: ArithmeticFunction.moebius_mul_coe_zeta
code: @[simp]
theorem moebius_mul_coe_zeta : (μ * ζ : ArithmeticFunction ℤ) = 1 
goal: ArithmeticFunction.moebius * ↑ArithmeticFunction.zeta = 1

full_name: ArithmeticFunction.coe_zeta_mul_moebius
code: @[simp]
theorem coe_zeta_mul_moebius : (ζ * μ : ArithmeticFunction ℤ) = 1 
goal: ↑ArithmeticFunction.zeta * ArithmeticFunction.moebius = 1

full_name: ArithmeticFunction.coe_moebius_mul_coe_zeta
code: @[simp]
theorem coe_moebius_mul_coe_zeta [Ring R] : (μ * ζ : ArithmeticFunction R) = 1 
goal: ↑ArithmeticFunction.moebius * ↑ArithmeticFunction.zeta = 1

full_name: ArithmeticFunction.coe_zeta_mul_coe_moebius
code: @[simp]
theorem coe_zeta_mul_coe_moebius [Ring R] : (ζ * μ : ArithmeticFunction R) = 1 
goal: ↑ArithmeticFunction.zeta * ↑ArithmeticFunction.moebius = 1

full_name: ArithmeticFunction.instInvertibleNatToArithmeticFunctionZeta
code: instance : Invertible (ζ : ArithmeticFunction R) 
goal: Invertible ↑ArithmeticFunction.zeta

full_name: ArithmeticFunction.zetaUnit
code: /-- A unit in `ArithmeticFunction R` that evaluates to `ζ`, with inverse `μ`. -/
def zetaUnit : (ArithmeticFunction R)ˣ 
goal: (ArithmeticFunction R)ˣ

full_name: ArithmeticFunction.coe_zetaUnit
code: @[simp]
theorem coe_zetaUnit : ((zetaUnit : (ArithmeticFunction R)ˣ) : ArithmeticFunction R) = ζ 
goal: ↑ArithmeticFunction.zetaUnit = ↑ArithmeticFunction.zeta

full_name: ArithmeticFunction.inv_zetaUnit
code: @[simp]
theorem inv_zetaUnit : ((zetaUnit⁻¹ : (ArithmeticFunction R)ˣ) : ArithmeticFunction R) = μ 
goal: ↑ArithmeticFunction.zetaUnit⁻¹ = ↑ArithmeticFunction.moebius

full_name: ArithmeticFunction.sum_eq_iff_sum_smul_moebius_eq
code: /-- Möbius inversion for functions to an `AddCommGroup`. -/
theorem sum_eq_iff_sum_smul_moebius_eq [AddCommGroup R] {f g : ℕ → R} :
    (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, μ x.fst • g x.snd = f n 
goal: (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, ArithmeticFunction.moebius x.1 • g x.2 = f n

full_name: ArithmeticFunction.sum_eq_iff_sum_mul_moebius_eq
code: /-- Möbius inversion for functions to a `Ring`. -/
theorem sum_eq_iff_sum_mul_moebius_eq [Ring R] {f g : ℕ → R} :
    (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, (μ x.fst : R) * g x.snd = f n 
goal: (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, ↑(ArithmeticFunction.moebius x.1) * g x.2 = f n

full_name: ArithmeticFunction.prod_eq_iff_prod_pow_moebius_eq
code: /-- Möbius inversion for functions to a `CommGroup`. -/
theorem prod_eq_iff_prod_pow_moebius_eq [CommGroup R] {f g : ℕ → R} :
    (∀ n > 0, ∏ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∏ x ∈ n.divisorsAntidiagonal, g x.snd ^ μ x.fst = f n 
goal: (∀ n > 0, ∏ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, ∏ x ∈ n.divisorsAntidiagonal, g x.2 ^ ArithmeticFunction.moebius x.1 = f n

full_name: ArithmeticFunction.prod_eq_iff_prod_pow_moebius_eq_of_nonzero
code: /-- Möbius inversion for functions to a `CommGroupWithZero`. -/
theorem prod_eq_iff_prod_pow_moebius_eq_of_nonzero [CommGroupWithZero R] {f g : ℕ → R}
    (hf : ∀ n : ℕ, 0 < n → f n ≠ 0) (hg : ∀ n : ℕ, 0 < n → g n ≠ 0) :
    (∀ n > 0, ∏ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∏ x ∈ n.divisorsAntidiagonal, g x.snd ^ μ x.fst = f n 
goal: (∀ n > 0, ∏ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, ∏ x ∈ n.divisorsAntidiagonal, g x.2 ^ ArithmeticFunction.moebius x.1 = f n

full_name: ArithmeticFunction.sum_eq_iff_sum_smul_moebius_eq_on
code: /-- Möbius inversion for functions to an `AddCommGroup`, where the equalities only hold on a
well-behaved set. -/
theorem sum_eq_iff_sum_smul_moebius_eq_on [AddCommGroup R] {f g : ℕ → R}
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) :
    (∀ n > 0, n ∈ s → (∑ i ∈ n.divisors, f i) = g n) ↔
      ∀ n > 0, n ∈ s → (∑ x ∈ n.divisorsAntidiagonal, μ x.fst • g x.snd) = f n 
goal: (∀ n > 0, n ∈ s → ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, n ∈ s → ∑ x ∈ n.divisorsAntidiagonal, ArithmeticFunction.moebius x.1 • g x.2 = f n

full_name: ArithmeticFunction.sum_eq_iff_sum_smul_moebius_eq_on'
code: theorem sum_eq_iff_sum_smul_moebius_eq_on' [AddCommGroup R] {f g : ℕ → R}
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) (hs₀ : 0 ∉ s) :
    (∀ n ∈ s, (∑ i ∈ n.divisors, f i) = g n) ↔
     ∀ n ∈ s, (∑ x ∈ n.divisorsAntidiagonal, μ x.fst • g x.snd) = f n 
goal: (∀ n ∈ s, ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n ∈ s, ∑ x ∈ n.divisorsAntidiagonal, ArithmeticFunction.moebius x.1 • g x.2 = f n

full_name: ArithmeticFunction.sum_eq_iff_sum_mul_moebius_eq_on
code: /-- Möbius inversion for functions to a `Ring`, where the equalities only hold on a well-behaved
set. -/
theorem sum_eq_iff_sum_mul_moebius_eq_on [Ring R] {f g : ℕ → R}
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) :
    (∀ n > 0, n ∈ s → (∑ i ∈ n.divisors, f i) = g n) ↔
      ∀ n > 0, n ∈ s →
        (∑ x ∈ n.divisorsAntidiagonal, (μ x.fst : R) * g x.snd) = f n 
goal: (∀ n > 0, n ∈ s → ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, n ∈ s → ∑ x ∈ n.divisorsAntidiagonal, ↑(ArithmeticFunction.moebius x.1) * g x.2 = f n

full_name: ArithmeticFunction.prod_eq_iff_prod_pow_moebius_eq_on
code: /-- Möbius inversion for functions to a `CommGroup`, where the equalities only hold on a
well-behaved set. -/
theorem prod_eq_iff_prod_pow_moebius_eq_on [CommGroup R] {f g : ℕ → R}
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) :
    (∀ n > 0, n ∈ s → (∏ i ∈ n.divisors, f i) = g n) ↔
      ∀ n > 0, n ∈ s → (∏ x ∈ n.divisorsAntidiagonal, g x.snd ^ μ x.fst) = f n 
goal: (∀ n > 0, n ∈ s → ∏ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, n ∈ s → ∏ x ∈ n.divisorsAntidiagonal, g x.2 ^ ArithmeticFunction.moebius x.1 = f n

full_name: ArithmeticFunction.prod_eq_iff_prod_pow_moebius_eq_on_of_nonzero
code: /-- Möbius inversion for functions to a `CommGroupWithZero`, where the equalities only hold on
a well-behaved set. -/
theorem prod_eq_iff_prod_pow_moebius_eq_on_of_nonzero [CommGroupWithZero R]
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) {f g : ℕ → R}
    (hf : ∀ n > 0, f n ≠ 0) (hg : ∀ n > 0, g n ≠ 0) :
    (∀ n > 0, n ∈ s → (∏ i ∈ n.divisors, f i) = g n) ↔
      ∀ n > 0, n ∈ s → (∏ x ∈ n.divisorsAntidiagonal, g x.snd ^ μ x.fst) = f n 
goal: (∀ n > 0, n ∈ s → ∏ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, n ∈ s → ∏ x ∈ n.divisorsAntidiagonal, g x.2 ^ ArithmeticFunction.moebius x.1 = f n

full_name: Nat.card_divisors
code: theorem _root_.Nat.card_divisors {n : ℕ} (hn : n ≠ 0) :
    n.divisors.card = n.primeFactors.prod (n.factorization · + 1) 
goal: n.divisors.card = ∏ x ∈ n.primeFactors, (n.factorization x + 1)

full_name: ArithmeticFunction.card_divisors
code: @[deprecated (since := "2024-06-09")] theorem card_divisors (n : ℕ) (hn : n ≠ 0) :
    n.divisors.card = n.primeFactors.prod (n.factorization · + 1) 
goal: n.divisors.card = ∏ x ∈ n.primeFactors, (n.factorization x + 1)

full_name: Nat.sum_divisors
code: theorem _root_.Nat.sum_divisors {n : ℕ} (hn : n ≠ 0) :
    ∑ d ∈ n.divisors, d = ∏ p ∈ n.primeFactors, ∑ k ∈ .range (n.factorization p + 1), p ^ k 
goal: ∑ d ∈ n.divisors, d = ∏ p ∈ n.primeFactors, ∑ k ∈ Finset.range (n.factorization p + 1), p ^ k

full_name: Nat.Coprime.card_divisors_mul
code: theorem card_divisors_mul {m n : ℕ} (hmn : m.Coprime n) :
    (m * n).divisors.card = m.divisors.card * n.divisors.card 
goal: (m * n).divisors.card = m.divisors.card * n.divisors.card

full_name: Nat.Coprime.sum_divisors_mul
code: theorem sum_divisors_mul {m n : ℕ} (hmn : m.Coprime n) :
    ∑ d ∈ (m * n).divisors, d = (∑ d ∈ m.divisors, d) * ∑ d ∈ n.divisors, d 
goal: ∑ d ∈ (m * n).divisors, d = (∑ d ∈ m.divisors, d) * ∑ d ∈ n.divisors, d