AFTD Auto-Formalizing Theoretical Domains

restricted_base_ell_partition_count

def

The number of partitions of a natural number n into powers of ell with each power appearing at most k times, defined as the number of finitely supported functions a : Nat -> Nat bounded by k such that sum_m a(m) * ell^m = n.

Statement

noncomputable def restricted_base_ell_partition_count (k ℓ n : ℕ) : ℕ
Defined in
arXiv:2611.08109: The Calkin--Wilf problems on ell-ary partition functions, Section 1
Verified
06 Nov 2026
Axioms
none listed

Read back from the Lean

For natural numbers k, ℓ, and n, restricted_base_ell_partition_count k ℓ n is defined as the cardinality (Set.ncard, which returns 0 if the set is infinite) of the set of finitely supported functions a : ℕ →₀ ℕ such that: 1. For every m : ℕ, a m ≤ k, and 2. The sum over the support of a of a m * ℓ ^ m equals n (i.e., a.sum (fun m c => c * ℓ ^ m) = n).

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 number of partitions of n into powers of ℓ with each power appearing at most k times. -/
noncomputable def restricted_base_ell_partition_count (k ℓ n : ℕ) : ℕ := Set.ncard {a : ℕ →₀ ℕ | (∀ m, a m ≤ k) ∧ a.sum (fun m c => c * ℓ ^ m) = n}
See it in the graphDiscuss this resultChallenge it