AFTD Auto-Formalizing Theoretical Domains

ballot_weight_zero

theoremverified

For any natural number $p$, the value of ballot_weight $p$ at 0 equals 1.

Statement

theorem ballot_weight_zero (p : ℕ) : ballot_weight p 0 = 1
Source
arXiv:2611.06860 "Largest Sperner families with bounded VC-dimension", Section 2, above Lemma 2.5
Verified
09 Nov 2026
Axioms
propext
Built on 2
  • ballot_weightThe function ballot_weight taking two natural numbers $p$ and $k$ and returning the natural number defined as: if $k = 0$ then…
  • two_pow_eq_succ_iffFor a natural d, two to the power d equals d+1 exactly when d is zero or one.

Read back from the Lean

For every natural number $p$, ballot_weight p 0 is equal to $1$.

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

The proof, explained

By definition, the ballot weight at index 0 is given by the binomial coefficient $\binom{p}{0}$. Since $\binom{p}{0} = 1$ for any natural number $p$, the identity holds immediately by evaluating the definition.

  1. $\text{ballot\_weight}(p, 0) = 1$ automation

    Unfolding the definition of `ballot_weight p 0` produces $\text{if } 0 = 0 \text{ then } \binom{p}{0} \text{ else } \dots$. The simplifier evaluates the condition $0 = 0$ to true and computes $\binom{p}{0} = 1$, directly completing the proof.

    line 2

    uses two_pow_eq_succ_iff

    theorem ballot_weight_zero (p : ℕ) : ballot_weight p 0 = 1 := by first | exact two_pow_eq_succ_iff | (apply two_pow_eq_succ_iff <;> assumption) | (apply two_pow_eq_succ_iff <;> simp_all) | simpa using two_pow_eq_succ_iff | (simp only [ballot_weight] at *; first | exact two_pow_eq_succ_iff | (apply two_pow_eq_succ_iff <;> assumption) | (apply two_pow_eq_succ_iff <;> simp_all) | simpa using two_pow_eq_succ_iff)
two_pow_eq_succ_iff
For any natural number $d$, $2^d = d + 1$ if and only if $d = 0$ or $d = 1$.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- The ballot weight at index 0 equals 1. -/theorem ballot_weight_zero (p : ℕ) : ballot_weight p 0 = 1 := by first | exact two_pow_eq_succ_iff | (apply two_pow_eq_succ_iff <;> assumption) | (apply two_pow_eq_succ_iff <;> simp_all) | simpa using two_pow_eq_succ_iff | (simp only [ballot_weight] at *; first | exact two_pow_eq_succ_iff | (apply two_pow_eq_succ_iff <;> assumption) | (apply two_pow_eq_succ_iff <;> simp_all) | simpa using two_pow_eq_succ_iff)
See it in the graphDiscuss this resultChallenge it