Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§4.1, eq. (3) — truncated inclusion–exclusion identity

Proved
EqualSubsetSum.Faster.eq_3

by Shuze Chen · Nov 10, 2026 · Mathlib 0df444a (Lean v4.33.1)

equal-subset-sumexponential-algorithmsp2o-gran-per-chapterp2o-plan-paperp2o-v1

For integers c≥1c\ge1c≥1 and d≥0d\ge0d≥0, Pascal's rule makes the partial sums telescope:

∑q=0d(−1)q(cq)=(−1)d(c−1d).\sum_{q=0}^{d}(-1)^q\binom cq=(-1)^d\binom{c-1}{d}.q=0∑d​(−1)q(qc​)=(−1)d(dc−1​).

Hence, for even ddd,

fd(c):=∑q=0d(−1)q(cq)={1,c=0,0,1≤c≤d,(c−1d),c>d.f_d(c):=\sum_{q=0}^{d}(-1)^q\binom cq=\begin{cases}1,&c=0,\\0,&1\le c\le d,\\ \binom{c-1}{d},&c>d.\end{cases}fd​(c):=q=0∑d​(−1)q(qc​)=⎩⎨⎧​1,0,(dc−1​),​c=0,1≤c≤d,c>d.​

It is the identity behind the upper partner counts U(a)U(a)U(a) of the detector.

Differences from the source: none.

Preamble
import Mathlib
import Definitions.Def_EqualSubsetSum_Faster_Detector
Formal statement
namespace EqualSubsetSum.Faster

/-- §4.1, eq. (3) (p. 22). For `c ≥ 1` the partial sums `∑_{q=0}^{d} (-1)^q (c choose q)`
telescope to `(-1)^d (c-1 choose d)`; hence for even `d`, `f_d(c)` is `1` if `c = 0`, `0` if
`1 ≤ c ≤ d`, and `(c-1 choose d)` if `c > d`. -/
theorem eq_3 :
    (∀ d c : ℕ, 1 ≤ c → truncAlt d c = (-1) ^ d * ((c - 1).choose d : ℤ)) ∧
    (∀ d c : ℕ, Even d →
        truncAlt d c = if c = 0 then 1 else if c ≤ d then 0 else ((c - 1).choose d : ℤ)) := by sorry

end EqualSubsetSum.Faster
Source
Cheshm Jahan, Keshavarz Hedayati, Safari, Shahrezaei, Faster Equal-Subset-Sum via Truncated Inclusion–Exclusion, STOC 2027 submission (manuscript, sha256 7ad8c8b2…61dacd1), p. 22, §4.1, eq. (3)
Human review
  • Endorsed by Community (Bot) · Nov 11, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Shuze Chen · Nov 11, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me