Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1 — Δ^S ≥ Φ(n, i) forces a subsample of size n with index 2^n

Proved
VapnikChervonenkis.GrowthFunction.lemma1_shattered_subsample

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricsp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1sauer-shelahvc-theory

Let XXX be a set, SSS a collection of subsets of XXX, and Φ\PhiΦ the function defined by the recurrence (1). Suppose that for some sample x1,…,xix_1, \dots, x_ix1​,…,xi​ of size iii and some number nnn with 1≤n≤i1 \le n \le i1≤n≤i,

ΔS(x1,…,xi)≥Φ(n,i).\Delta^S(x_1, \dots, x_i) \ge \Phi(n, i).ΔS(x1​,…,xi​)≥Φ(n,i).

Then there exists a subsample xi1,…,xinx_{i_1}, \dots, x_{i_n}xi1​​,…,xin​​ of this sample, with positions i1<⋯<ini_1 < \dots < i_ni1​<⋯<in​, such that

ΔS(xi1,…,xin)=2n,\Delta^S(x_{i_1}, \dots, x_{i_n}) = 2^n ,ΔS(xi1​​,…,xin​​)=2n,

that is, the sets of SSS induce all 2n2^n2n subsamples of xi1,…,xinx_{i_1}, \dots, x_{i_n}xi1​​,…,xin​​.

This is the paper's form of the Sauer–Shelah lemma. Its contrapositive drives Theorem 1: if no subsample of size nnn has index 2n2^n2n, then every sample of size i≥ni \ge ni≥n has index below Φ(n,i)\Phi(n, i)Φ(n,i).

Formalization Note. Samples are functions Fin i → X. The subsample is x ∘ e for a strictly increasing e : Fin n → Fin i, so it consists of nnn distinct positions of the sample (the points at those positions may coincide, in which case its index is below 2n2^n2n). The range 1≤n≤i1 \le n \le i1≤n≤i is part of the hypothesis, as in the paper.

Preamble
import Mathlib
import Definitions.Def_VapnikChervonenkis_Shared_Phi
import Definitions.Def_VapnikChervonenkis_Shared_index
import Definitions.Def_VapnikChervonenkis_Shared_growthFunction
Formal statement
namespace VapnikChervonenkis.GrowthFunction

/-- **Lemma 1** of Vapnik and Chervonenkis (1971), p. 266: if for some sample `x_1, ···, x_i` of
size `i` and some number `n` with `1 ≤ n ≤ i` one has `Δ^S(x_1, ···, x_i) ≥ Φ(n, i)`, then there is
a subsample `x_{i_1}, ···, x_{i_n}` of this sample (positions `i_1 < ··· < i_n`) with
`Δ^S(x_{i_1}, ···, x_{i_n}) = 2^n`. -/
theorem lemma1_shattered_subsample {X : Type*} (S : Set (Set X)) (i n : ℕ) (x : Fin i → X)
    (hn1 : 1 ≤ n) (hni : n ≤ i) (hΔ : Shared.Phi n i ≤ Shared.index S x) :
    ∃ e : Fin n → Fin i, StrictMono e ∧ Shared.index S (x ∘ e) = 2 ^ n := by sorry

end VapnikChervonenkis.GrowthFunction
Source
Vapnik and Chervonenkis, On the Uniform Convergence of Relative Frequencies of Events to Their Probabilities, Theory Probab. Appl. 16 (1971), p. 266, Lemma 1
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting.

  • XXX is an arbitrary type, and SSS is an arbitrary family of subsets of XXX.
  • iii and nnn are natural numbers.
  • x=(x0,…,xi−1)x = (x_0, \dots, x_{i-1})x=(x0​,…,xi−1​) is a sequence of iii points of XXX. Repeated points are allowed.

The quantities involved. Two quantities appear, both defined in separate definitions files that are not shown, so neither can be unfolded here:

  • Φ(n,i)\Phi(n, i)Φ(n,i), a function of two natural numbers;
  • index⁡(S,y)\operatorname{index}(S, y)index(S,y), a quantity attached to SSS and any finite sequence yyy of points of XXX.

The hypothesis compares Φ(n,i)\Phi(n, i)Φ(n,i) with index⁡(S,x)\operatorname{index}(S, x)index(S,x), so the two take values in the same ordered type.

Hypotheses.

  1. 1≤n1 \le n1≤n.
  2. n≤in \le in≤i.
  3. Φ(n,i)≤index⁡(S,x)\Phi(n, i) \le \operatorname{index}(S, x)Φ(n,i)≤index(S,x) (non-strict).

Claim. Under these hypotheses, there exists a strictly increasing map

e:{0,…,n−1}→{0,…,i−1}e : \{0, \dots, n-1\} \to \{0, \dots, i-1\}e:{0,…,n−1}→{0,…,i−1}

such that

index⁡(S,(xe(0),xe(1),…,xe(n−1)))=2n.\operatorname{index}\big(S, (x_{e(0)}, x_{e(1)}, \dots, x_{e(n-1)})\big) = 2^n.index(S,(xe(0)​,xe(1)​,…,xe(n−1)​))=2n.

In words: there are positions e(0)<e(1)<⋯<e(n−1)e(0) < e(1) < \dots < e(n-1)e(0)<e(1)<⋯<e(n−1) in the sequence such that the length-nnn subsequence taken at those positions has index⁡\operatorname{index}index exactly 2n2^n2n. Only existence is asserted, not uniqueness.

Degenerate cases.

  • n≥1n \ge 1n≥1 forces i≥1i \ge 1i≥1: xxx is then non-empty, so XXX must be non-empty for any instance to exist. If XXX is empty, the statement holds vacuously.
  • n=0n = 0n=0: excluded by hypothesis 1.
  • n=in = in=i: the only strictly increasing map is the identity. The claim then becomes: if Φ(i,i)≤index⁡(S,x)\Phi(i, i) \le \operatorname{index}(S, x)Φ(i,i)≤index(S,x), then index⁡(S,x)=2i\operatorname{index}(S, x) = 2^iindex(S,x)=2i.
  • Repeated points: positions are distinct, but the chosen points xe(k)x_{e(k)}xe(k)​ need not be.

Whether hypothesis 3 can ever hold, and so whether the statement has non-vacuous content for given nnn and iii, depends on the definitions of Φ\PhiΦ and index⁡\operatorname{index}index, which are not shown.

Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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