Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 8.4.5 — even restricted distances outnumber odd ones

Proved
MatousekLP.Codes.even_pairs_ge_odd_pairs

by mikedeng1 · Oct 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

coding-theorycombinatoricsp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Let I⊆{1,…,n}I \subseteq \{1,\dots,n\}I⊆{1,…,n} be a set of indices and C⊆{0,1}nC \subseteq \{0,1\}^nC⊆{0,1}n an arbitrary set of words. Write dHI(w,w′)d_H^I(\mathbf w,\mathbf w')dHI​(w,w′) for the number of indices i∈Ii \in Ii∈I with wi≠wi′w_i \ne w'_iwi​=wi′​. Then

∣{(w,w′)∈C2:dHI(w,w′) odd}∣  ≤  ∣{(w,w′)∈C2:dHI(w,w′) even}∣.\bigl|\{(\mathbf w,\mathbf w') \in C^2 : d_H^I(\mathbf w,\mathbf w') \text{ odd}\}\bigr| \;\le\; \bigl|\{(\mathbf w,\mathbf w') \in C^2 : d_H^I(\mathbf w,\mathbf w') \text{ even}\}\bigr| .​{(w,w′)∈C2:dHI​(w,w′) odd}​≤​{(w,w′)∈C2:dHI​(w,w′) even}​.

Pairs are ordered, and pairs (w,w)(\mathbf w,\mathbf w)(w,w) are included.

This parity statement is the combinatorial core of Delsarte's inequalities: summed over suitable index sets it yields the Krawtchouk constraints of the linear program.

Formalization Note The index set III is a Finset (Fin n) (positions shifted to 0,…,n−10,\dots,n-10,…,n−1).

Preamble
import Mathlib
import Definitions.Def_MatousekLP_Codes_Basic

open Finset
Formal statement
namespace MatousekLP.Codes

/-- Lemma 8.4.5, p. 161: for every set of indices `I` and every `C ⊆ {0,1}^n`, the number of
ordered pairs `(w, w') ∈ C²` with `d_H^I(w, w')` even is at least the number of such pairs with
`d_H^I(w, w')` odd. -/
theorem even_pairs_ge_odd_pairs {n : ℕ} (I : Finset (Fin n)) (C : Finset (Word n)) :
    #{p ∈ C ×ˢ C | Odd (restrictedDist I p.1 p.2)} ≤
      #{p ∈ C ×ˢ C | Even (restrictedDist I p.1 p.2)} := by sorry

end MatousekLP.Codes
Source
Matoušek & Gärtner, Understanding and Using Linear Programming, Springer 2007, p. 161, Lemma 8.4.5
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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