AFTD Auto-Formalizing Theoretical Domains

partition_number

def

The function partition_number maps an integer m : ℤ to an integer in ℤ: if 0 ≤ m, it returns the cardinality Nat.card of the type of partitions of m.toNat (Nat.Partition m.toNat) coerced to ℤ; otherwise (if m < 0), it returns 0.

Statement

noncomputable def partition_number (m : ℤ) : ℤ
Defined in
arXiv:2610.01747 Section 6.1
Verified
27 Oct 2026
Axioms
none listed
Used by 3

Read back from the Lean

The function partition_number maps an integer $m$ to an integer: if $0 \le m$, it evaluates to the cardinality (as a natural number, cast to $\mathbb{Z}$) of the type Nat.Partition m.toNat of integer partitions of $m$; otherwise (if $m < 0$), it evaluates to $0$.

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 unrestricted integer partition function p(m), mapping ℤ to ℤ, with p(m) = 0 for m < 0. -/
noncomputable def partition_number (m : ℤ) : ℤ := if 0 ≤ m then (Nat.card (Nat.Partition m.toNat) : ℤ) else 0
See it in the graphDiscuss this resultChallenge it