AFTD Auto-Formalizing Theoretical Domains

ballot_weight

def

The function ballot_weight taking two natural numbers $p$ and $k$ and returning the natural number defined as: if $k = 0$ then $\binom{p}{0}$, and otherwise the natural number difference $\binom{p}{k} - \binom{p}{k-1}$.

Statement

def ballot_weight (p k : ℕ) : ℕ
Defined in
arXiv:2611.06860 "Largest Sperner families with bounded VC-dimension", Section 2, above Lemma 2.5
Verified
08 Nov 2026
Axioms
none listed
Used by 4

Read back from the Lean

ballot_weight is a function taking two natural numbers p and k and returning a natural number, defined as: if k = 0, then p.choose 0 (which is 1); otherwise (k ≠ 0), p.choose k - p.choose (k - 1) using truncated natural number subtraction.

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 ballot weight b(p, k) as a natural number: p.choose 0 if k = 0, else p.choose k - p.choose (k - 1). -/
def ballot_weight (p k : ℕ) : ℕ := if k = 0 then p.choose 0 else p.choose k - p.choose (k - 1)
See it in the graphDiscuss this resultChallenge it