Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 8.4.7 — Delsarte's matrix M~=∑iy~iMi\tilde M = \sum_i \tilde y_i M_iM~=∑i​y~​i​Mi​ is positive semidefinite

Proved
MatousekLP.Codes.delsarte_psd

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

coding-theoryp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1semidefinite

Let C⊆{0,1}nC \subseteq \{0,1\}^nC⊆{0,1}n be a code, let M0,…,MnM_0,\dots,M_nM0​,…,Mn​ be the 2n×2n2^n\times 2^n2n×2n matrices with (Mi)v,w=1(M_i)_{\mathbf v,\mathbf w} = 1(Mi​)v,w​=1 if dH(v,w)=id_H(\mathbf v,\mathbf w) = idH​(v,w)=i and 000 otherwise, and let

y~i=∣{(w,w′)∈C2:dH(w,w′)=i}∣2n(ni),i=0,…,n.\tilde y_i = \frac{|\{(\mathbf w,\mathbf w') \in C^2 : d_H(\mathbf w,\mathbf w') = i\}|}{2^n\binom ni}, \qquad i = 0,\dots,n.y~​i​=2n(in​)∣{(w,w′)∈C2:dH​(w,w′)=i}∣​,i=0,…,n.

Then the matrix

M~=∑i=0ny~iMi\tilde M = \sum_{i=0}^n \tilde y_i M_iM~=i=0∑n​y~​i​Mi​

is positive semidefinite.

This is Delsarte's original insight; diagonalizing M~\tilde MM~ in the Hadamard basis turns it into the Krawtchouk inequalities of the linear program, and replacing it by a semidefinite condition is the starting point of Schrijver's stronger bounds.

Formalization Note Positive semidefiniteness is Mathlib's Matrix.PosSemidef for real matrices: symmetric, with zTM~z≥0\mathbf z^T \tilde M \mathbf z \ge 0zTM~z≥0 for every real vector z\mathbf zz indexed by the words.

Preamble
import Mathlib
import Definitions.Def_MatousekLP_Codes_Basic
import Definitions.Def_MatousekLP_Codes_BoseMesner

open Finset
Formal statement
namespace MatousekLP.Codes

/-- Lemma 8.4.7, p. 165: for every code `C ⊆ {0,1}^n`, the `2^n × 2^n` matrix
`M̃ = ∑_{i=0}^n ỹ_i M_i` is positive semidefinite. -/
theorem delsarte_psd {n : ℕ} (C : Finset (Word n)) : (Mtilde C).PosSemidef := by sorry

end MatousekLP.Codes
Source
Matoušek & Gärtner, Understanding and Using Linear Programming, Springer 2007, p. 165, Lemma 8.4.7
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