AFTD Auto-Formalizing Theoretical Domains

factorizationMobiusToTop

def

For a natural number n and a multiset x of natural numbers, factorizationMobiusToTop n x (n first, then x) is the integer defined by recursion on the number of elements of x: it is 1 if x has at most one element; otherwise it is minus the sum, over all multisets y that are factorizations of n (every element greater than 1, product n), are coarsenings of x (IsFactorizationCoarsening x y) and have fewer elements than x, of factorizationMobiusToTop n y. When x is a factorization of n this is the Möbius function μ(x, n) of the poset of factorizations of n ordered by refinement, between x and the top element: the top element is the factorization with at most one factor, and the factorizations strictly above x are exactly its coarsenings with fewer factors. Values at multisets x that are not factorizations of n carry no meaning.

Statement

noncomputable def factorizationMobiusToTop (n : ℕ) (x : Multiset ℕ) : ℤ
Defined in
arXiv:2611.18194 (The Möbius function of factorizations with a simple prime factor), Section 1 and the recursion used in the proof of Theorem 6
Verified
17 Nov 2026
Axioms
none listed
Built on 2
  • IsNatFactorizationA factorization of a natural number n is a multiset of integers greater than 1 whose product is n.
  • IsFactorizationCoarseningA multiset y is a coarsening of a multiset x of positive integers if x can be partitioned into nonempty groups so that y is the multiset…
Used by 5

Read back from the Lean

A recursive definition of factorizationMobiusToTop n x, taking a natural number n : ℕ and a multiset of natural numbers x : Multiset ℕ, and returning an integer ℤ, defined by well-founded recursion on x.card: * If x.card ≤ 1, the value is 1. * Otherwise (when x.card > 1), the value is the negation of the finite sum (finsum) over all multisets y : Multiset ℕ such that: 1. IsNatFactorization n y, 2. IsFactorizationCoarsening x y, and 3. y.card < x.card, of factorizationMobiusToTop n y.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The Möbius function `μ(x, n)` of the poset of factorizations of `n` ordered by refinement, between a factorization `x` and the top element `n`, by its defining recursion: `μ(x, n) = 1` when `x` is the top element and `μ(x, n) = -∑_{x < y ≤ n} μ(y, n)` otherwise. For a factorization `x` of `n`, `x` is the top element exactly when it has at most one factor (`{n}`, or the empty factorization when `n = 1`), and the factorizations strictly above `x` are its coarsenings with fewer factors (a coarsening with as many factors as `x` is `x` itself). -/
noncomputable def factorizationMobiusToTop (n : ℕ) (x : Multiset ℕ) : ℤ :=
  if x.card ≤ 1 then 1
  else -∑ᶠ (y : Multiset ℕ)
      (_ : IsNatFactorization n y ∧ IsFactorizationCoarsening x y ∧ y.card < x.card),
      factorizationMobiusToTop n y
termination_by x.card
See it in the graphDiscuss this resultChallenge it