Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (11) — P{ρ(l)≥ε/2}P\{\rho^{(l)} \ge \varepsilon/2\}P{ρ(l)≥ε/2} as an integral of a permutation average

Proved
VapnikChervonenkis.Inequality.eq11_permutation_average

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

exchangeabilitylearning-theoryp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1vc-theory

Let (X,P)(X, P)(X,P) be a probability space and SSS a collection of events, and assume that the semi-sample deviation ρ(l)\rho^{(l)}ρ(l) is measurable for every lll. A permutation TTT of the 2l2l2l positions of a double sample X2l=(x1,…,x2l)X_{2l} = (x_1, \dots, x_{2l})X2l​=(x1​,…,x2l​) produces the rearranged sample TX2lT X_{2l}TX2l​. Let θ(z)=1\theta(z) = 1θ(z)=1 for z≥0z \ge 0z≥0 and θ(z)=0\theta(z) = 0θ(z)=0 for z<0z < 0z<0. Then, for every real ε\varepsilonε and every lll,

P{ρ(l)≥ε2}=∫X2l1(2l)!∑Tθ(ρ(l)(TX2l)−ε2) dP2l,P\Bigl\{\rho^{(l)} \ge \frac{\varepsilon}{2}\Bigr\} = \int_{X^{2l}} \frac{1}{(2l)!} \sum_{T} \theta\Bigl(\rho^{(l)}(T X_{2l}) - \frac{\varepsilon}{2}\Bigr)\, dP^{2l},P{ρ(l)≥2ε​}=∫X2l​(2l)!1​T∑​θ(ρ(l)(TX2l​)−2ε​)dP2l,

the sum running over all (2l)!(2l)!(2l)! permutations TTT.

The identity expresses the invariance of the product measure P2lP^{2l}P2l under rearrangements of the sample; it reduces the estimate of P{ρ(l)≥ε/2}P\{\rho^{(l)} \ge \varepsilon/2\}P{ρ(l)≥ε/2} to a bound on the fraction of rearrangements of one fixed sample.

Formalization Note TX2lT X_{2l}TX2l​ is x ∘ σ for σ : Equiv.Perm (Fin (l + l)), and the average of θ(ρ(l)(TX2l)−ε/2)\theta(\rho^{(l)}(T X_{2l}) - \varepsilon/2)θ(ρ(l)(TX2l​)−ε/2) is the number of permutations with ρ(l)(x∘σ)≥ε/2\rho^{(l)}(x \circ \sigma) \ge \varepsilon/2ρ(l)(x∘σ)≥ε/2 divided by (2l)!(2l)!(2l)!. The left side is a value in [0,∞][0, \infty][0,∞] and the right side the embedding of the real integral. The measurability of ρ(l)\rho^{(l)}ρ(l) is the paper's standing assumption (p. 268).

Preamble
import Mathlib
import Definitions.Def_VapnikChervonenkis_Shared_index
import Definitions.Def_VapnikChervonenkis_Shared_growthFunction
import Definitions.Def_VapnikChervonenkis_Shared_deviation

open MeasureTheory Filter Topology
Formal statement
namespace VapnikChervonenkis.Inequality

/-- **Eq. (11)** (p. 270): by the symmetry of the product measure under permutations `T_i` of
the double sample,
`P{ρ^(l) ≥ ε/2} = ∫ (1/(2l)!) Σ_i θ(ρ^(l)(T_i X_{2l}) − ε/2) dP`, the sum running over all
`(2l)!` permutations; `θ(ρ − ε/2)` is the indicator of `ρ ≥ ε/2`, and `T_i X_{2l}` is
`x ∘ σ`. -/
theorem eq11_permutation_average {X : Type*} [MeasurableSpace X] (P : Measure X)
    [IsProbabilityMeasure P] (S : Set (Set X))
    (hρ : ∀ l, Measurable (Shared.semiSampleDeviation S l)) (ε : ℝ) (l : ℕ) :
    Measure.pi (fun _ : Fin (l + l) => P) {x | ε / 2 ≤ Shared.semiSampleDeviation S l x}
      = ENNReal.ofReal (∫ x, ((Finset.univ.filter (fun σ : Equiv.Perm (Fin (l + l)) =>
            ε / 2 ≤ Shared.semiSampleDeviation S l (x ∘ σ))).card : ℝ) / ((l + l).factorial : ℝ)
          ∂(Measure.pi (fun _ : Fin (l + l) => P))) := by sorry

end VapnikChervonenkis.Inequality
Source
Vapnik and Chervonenkis, On the Uniform Convergence of Relative Frequencies of Events to Their Probabilities, Theory Probab. Appl. 16 (1971), p. 270, Eq. (11) (proof of Theorem 2)
Read-back

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

Setting. XXX is a type with a σ-algebra, PPP is a probability measure on XXX, and SSS is a family of subsets of XXX. No measurability of the members of SSS is assumed. P2lP^{2l}P2l is the product measure on X2lX^{2l}X2l, the space of 2l2l2l-tuples indexed by {0,…,2l−1}\{0,\dots,2l-1\}{0,…,2l−1}. ρl(y)\rho_l(y)ρl​(y) is Shared.semiSampleDeviation S l, a real-valued function of y∈X2ly \in X^{2l}y∈X2l. It comes from an external definitions bundle that is not shown. For a permutation σ\sigmaσ of {0,…,2l−1}\{0,\dots,2l-1\}{0,…,2l−1}, the tuple y∘σy \circ \sigmay∘σ is the rearranged tuple (yσ(0),…,yσ(2l−1))(y_{\sigma(0)}, \dots, y_{\sigma(2l-1)})(yσ(0)​,…,yσ(2l−1)​).

Hypotheses.

  1. For every l∈Nl \in \mathbb{N}l∈N, ρl:X2l→R\rho_l : X^{2l} \to \mathbb{R}ρl​:X2l→R is measurable.
  2. ε\varepsilonε is an arbitrary real number: it may be zero or negative.
  3. l∈Nl \in \mathbb{N}l∈N is arbitrary, and may be 000.

Conclusion. For y∈X2ly \in X^{2l}y∈X2l, let

N(y)=#{σ∈Sym(2l):ρl(y∘σ)≥ε2}N(y) = \#\bigl\{\sigma \in \mathrm{Sym}(2l) : \rho_l(y\circ\sigma) \ge \tfrac{\varepsilon}{2}\bigr\}N(y)=#{σ∈Sym(2l):ρl​(y∘σ)≥2ε​}

be the number of permutations whose rearranged tuple meets the threshold. Then

P2l{y:ρl(y)≥ε2}  =  ofReal⁡ ⁣(∫X2lN(y)(2l)! dP2l(y)).P^{2l}\bigl\{y : \rho_l(y) \ge \tfrac{\varepsilon}{2}\bigr\} \;=\; \operatorname{ofReal}\!\left( \int_{X^{2l}} \frac{N(y)}{(2l)!}\, dP^{2l}(y) \right).P2l{y:ρl​(y)≥2ε​}=ofReal(∫X2l​(2l)!N(y)​dP2l(y)).

Here ofReal⁡\operatorname{ofReal}ofReal converts a real number to [0,∞][0,\infty][0,∞], sending negative reals to 000. The integral is a real-valued (Bochner) integral. By convention it equals 000 whenever the integrand is not integrable, and the statement does not separately assert that the integrand is integrable. The integrand always lies in [0,1][0,1][0,1].

Degenerate cases.

  • l=0l = 0l=0. X0X^{0}X0 has a single point (the empty tuple), P0P^{0}P0 puts mass 111 on it, Sym(0)\mathrm{Sym}(0)Sym(0) has one element, and 0!=10! = 10!=1. Both sides equal 111 if ρ0(empty tuple)≥ε/2\rho_0(\text{empty tuple}) \ge \varepsilon/2ρ0​(empty tuple)≥ε/2, and 000 otherwise.
  • Values of ε\varepsilonε. Because ε\varepsilonε is unrestricted, the statement also covers values where the event may be all of X2lX^{2l}X2l; this depends on the unseen ρ\rhoρ.
  • Unsatisfiable hypothesis. If the measurability hypothesis cannot hold for the unseen ρ\rhoρ, the statement is vacuous.
  • Non-integrable integrand. If the integrand failed to be integrable, the right side would be 000, and the statement would then assert that the event on the left has measure 000.
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