Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 7.8: concentration of the sample covariance matrix

Proved
WirtingerFlow.covariance_concentration

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

gradient-descentnonconvex-optimizationphase-retrievalrandom-matricesspectral-initialization
  1. Gaussian model. For every δ>0\delta>0δ>0 there are constants c(δ)>0c(\delta)>0c(δ)>0 and γ>0\gamma>0γ>0 such that, whenever n≥1n\ge1n≥1 and m≥c(δ) nlog⁡nm\ge c(\delta)\,n\log nm≥c(δ)nlogn, with probability at least 1−2e−γm1-2e^{-\gamma m}1−2e−γm,
∥In−1m∑r=1marar∗∥≤δ,\Big\|I_n-\frac1m\sum_{r=1}^ma_ra_r^*\Big\|\le\delta,​In​−m1​r=1∑m​ar​ar∗​​≤δ,

and on this event

(1−δ)∥h∥2≤1m∑r=1m∣ar∗h∣2≤(1+δ)∥h∥2for all h∈Cn.(1-\delta)\|h\|^2\le\frac1m\sum_{r=1}^m|a_r^*h|^2\le(1+\delta)\|h\|^2\quad\text{for all }h\in\mathbb{C}^n.(1−δ)∥h∥2≤m1​r=1∑m​∣ar∗​h∣2≤(1+δ)∥h∥2for all h∈Cn.
  1. Coded diffraction model. For every δ>0\delta>0δ>0 and every bound MMM there is a constant c(δ)>0c(\delta)>0c(δ)>0 such that, for every admissible law with bound MMM and E∣d∣2=1\mathbb E|d|^2=1E∣d∣2=1, whenever n,L≥1n,L\ge1n,L≥1 and L≥c(δ)log⁡3nL\ge c(\delta)\log^3nL≥c(δ)log3n, the same two conclusions hold (with m=nLm=nLm=nL) with probability at least 1−1/n21-1/n^21−1/n2.

Formalization Note γ\gammaγ is allowed to depend on δ\deltaδ. A constant γ\gammaγ that works for every δ\deltaδ does not exist: 1m∑r∣ar(1)∣2\frac1m\sum_r|a_r(1)|^2m1​∑r​∣ar​(1)∣2 is a Gamma(m,1)/m(m,1)/m(m,1)/m variable, which deviates from 111 by more than δ\deltaδ with probability of order e−mδ2/2e^{-m\delta^2/2}e−mδ2/2. That exceeds 2e−γm2e^{-\gamma m}2e−γm once δ2<2γ\delta^2<2\gammaδ2<2γ, for mmm large.

Preamble
import Mathlib
import Definitions.Def_WirtingerFlow_Basic

open MeasureTheory ProbabilityTheory Complex Matrix
Formal statement
namespace WirtingerFlow

theorem covariance_concentration :
    (∀ δ : ℝ, 0 < δ → ∃ c γ : ℝ, 0 < c ∧ 0 < γ ∧
      ∀ n m : ℕ, 1 ≤ n → 1 ≤ m → c * n * Real.log n ≤ m →
        gaussModel m n {A | ¬ (opNorm (1 - covMat (rows A)) ≤ δ ∧
          ∀ h : Sig n, (1 - δ) * ‖h‖ ^ 2 ≤ 1 / (m : ℝ) * ∑ r, ‖inner ℂ (rows A r) h‖ ^ 2 ∧
            1 / (m : ℝ) * ∑ r, ‖inner ℂ (rows A r) h‖ ^ 2 ≤ (1 + δ) * ‖h‖ ^ 2)} ≤
          ENNReal.ofReal (2 * Real.exp (-γ * m))) ∧
    (∀ δ : ℝ, 0 < δ → ∀ M : ℝ, ∃ c : ℝ, 0 < c ∧
      ∀ ν : Measure ℂ, IsAdmissible ν M → ∫ d, ‖d‖ ^ 2 ∂ν = 1 →
      ∀ n L : ℕ, 1 ≤ n → 1 ≤ L → c * Real.log n ^ 3 ≤ L →
        cdpModel ν L n {d | ¬ (opNorm (1 - covMat (cdpVecs d)) ≤ δ ∧
          ∀ h : Sig n, (1 - δ) * ‖h‖ ^ 2 ≤
              1 / ((L * n : ℕ) : ℝ) * ∑ r, ‖inner ℂ (cdpVecs d r) h‖ ^ 2 ∧
            1 / ((L * n : ℕ) : ℝ) * ∑ r, ‖inner ℂ (cdpVecs d r) h‖ ^ 2 ≤ (1 + δ) * ‖h‖ ^ 2)} ≤
          ENNReal.ofReal (1 / (n : ℝ) ^ 2)) := by sorry

end WirtingerFlow
Source
Candès, Li and Soltanolkotabi, Phase Retrieval via Wirtinger Flow: Theory and Algorithms, arXiv:1407.1065v3 (2015), Section 7.3, Lemma 7.8, eq. (7.9), p. 22; proof in Appendix A.8, p. 41
Read-back

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

The statement is a conjunction of two independent claims, (I) about the Gaussian model and (II) about the coded diffraction model. Throughout:

  • log⁡\loglog is the natural logarithm.
  • ∥⋅∥\|\cdot\|∥⋅∥ on Cn\mathbb{C}^nCn is the Euclidean norm.
  • ⟨u,v⟩=u∗v=∑tut‾ vt\langle u, v\rangle = u^* v = \sum_t \overline{u_t}\, v_t⟨u,v⟩=u∗v=∑t​ut​​vt​ is conjugate-linear in the first argument.
  • InI_nIn​ is the n×nn\times nn×n identity matrix.
  • For a complex n×nn\times nn×n matrix BBB, ∥B∥op\|B\|_{\mathrm{op}}∥B∥op​ is its spectral (operator) norm as a linear map on Cn\mathbb{C}^nCn with the Euclidean norm.
  • For sampling vectors a1,…,aN∈Cna_1,\dots,a_N \in \mathbb{C}^na1​,…,aN​∈Cn, the sample covariance matrix is S=1N∑rarar∗S = \frac1N \sum_r a_r a_r^*S=N1​∑r​ar​ar∗​, where arar∗a_r a_r^*ar​ar∗​ is the n×nn\times nn×n matrix with (i,j)(i,j)(i,j) entry ar(i) ar(j)‾a_r(i)\,\overline{a_r(j)}ar​(i)ar​(j)​.

For given δ\deltaδ and such vectors, the good event GδG_\deltaGδ​ is the conjunction of:

∥In−S∥op≤δand∀h∈Cn: (1−δ)∥h∥2  ≤  1N∑r∣ar∗h∣2  ≤  (1+δ)∥h∥2.\|I_n - S\|_{\mathrm{op}} \le \delta \qquad\text{and}\qquad \forall h \in \mathbb{C}^n:\ (1-\delta)\|h\|^2 \;\le\; \frac1N\sum_{r} |a_r^* h|^2 \;\le\; (1+\delta)\|h\|^2 .∥In​−S∥op​≤δand∀h∈Cn: (1−δ)∥h∥2≤N1​r∑​∣ar∗​h∣2≤(1+δ)∥h∥2.

Both claims bound the probability of the complement of GδG_\deltaGδ​, meaning the set of samples where at least one of these conditions fails. Probabilities are the product measure evaluated on that set. Note that when δ≥1\delta \ge 1δ≥1 the lower inequality (1−δ)∥h∥2≤⋯(1-\delta)\|h\|^2 \le \cdots(1−δ)∥h∥2≤⋯ holds automatically.

(I) Gaussian model.

Under the Gaussian model, a sample is an m×nm\times nm×n array AAA of independent entries. Each entry is a standard complex Gaussian X+iYX + iYX+iY with X,YX, YX,Y independent N(0,1/2)N(0, 1/2)N(0,1/2), each of variance 1/21/21/2. The sampling vectors a1,…,am∈Cna_1,\dots,a_m \in \mathbb{C}^na1​,…,am​∈Cn are the rows of AAA, and N=mN = mN=m.

The claim: for every real δ>0\delta > 0δ>0 there exist real constants c>0c > 0c>0 and γ>0\gamma > 0γ>0, depending only on δ\deltaδ, such that for all natural numbers n≥1n \ge 1n≥1 and m≥1m \ge 1m≥1 with c nlog⁡n≤mc\, n \log n \le mcnlogn≤m,

Pr⁡[ Gδ fails ]  ≤  2e−γm.\Pr\big[\,G_\delta \text{ fails}\,\big] \;\le\; 2 e^{-\gamma m}.Pr[Gδ​ fails]≤2e−γm.

For n=1n = 1n=1 we have log⁡1=0\log 1 = 0log1=0, so the size condition reduces to m≥1m \ge 1m≥1.

(II) Coded diffraction model.

The claim: for every real δ>0\delta > 0δ>0 and every real MMM, there exists a real constant c>0c > 0c>0, depending only on δ\deltaδ and MMM and not on ν\nuν, nnn, or LLL, with the following property. Let ν\nuν be any measure on C\mathbb{C}C satisfying the six conditions below, where d∼νd \sim \nud∼ν:

  1. ν\nuν is a probability measure;
  2. −d-d−d has the same law as ddd;
  3. ∣d∣≤M|d| \le M∣d∣≤M almost surely;
  4. E d=0\mathbb{E}\,d = 0Ed=0;
  5. E d2=0\mathbb{E}\,d^2 = 0Ed2=0;
  6. E∣d∣4=2(E∣d∣2)2\mathbb{E}|d|^4 = 2(\mathbb{E}|d|^2)^2E∣d∣4=2(E∣d∣2)2, together with the normalization E∣d∣2=1\mathbb{E}|d|^2 = 1E∣d∣2=1, so that E∣d∣4=2\mathbb{E}|d|^4 = 2E∣d∣4=2.

Then the conclusion holds for all natural numbers n≥1n \ge 1n≥1 and L≥1L \ge 1L≥1 with c (log⁡n)3≤Lc\,(\log n)^3 \le Lc(logn)3≤L.

The sample is an L×nL\times nL×n array (dℓ(t))(d_\ell(t))(dℓ​(t)), for ℓ∈{0,…,L−1}\ell \in \{0,\dots,L-1\}ℓ∈{0,…,L−1} and t∈{0,…,n−1}t \in \{0,\dots,n-1\}t∈{0,…,n−1}, with i.i.d. entries of law ν\nuν. There are N=LnN = LnN=Ln sampling vectors, indexed by pairs r=(ℓ,k)r = (\ell, k)r=(ℓ,k) with k∈{0,…,n−1}k \in \{0,\dots,n-1\}k∈{0,…,n−1}, and given by

a(ℓ,k)(t)=dℓ(t) e2πikt/n,soa(ℓ,k)∗h=∑t=0n−1dℓ(t)‾ e−2πikt/n ht.a_{(\ell,k)}(t) = d_\ell(t)\, e^{2\pi i k t / n},\qquad\text{so}\qquad a_{(\ell,k)}^* h = \sum_{t=0}^{n-1} \overline{d_\ell(t)}\, e^{-2\pi i k t/n}\, h_t .a(ℓ,k)​(t)=dℓ​(t)e2πikt/n,soa(ℓ,k)∗​h=t=0∑n−1​dℓ​(t)​e−2πikt/nht​.

The normalization in SSS and in the quadratic form is 1Ln\frac{1}{Ln}Ln1​. The conclusion is

Pr⁡[ Gδ fails ]  ≤  1n2.\Pr\big[\,G_\delta \text{ fails}\,\big] \;\le\; \frac{1}{n^2}.Pr[Gδ​ fails]≤n21​.

Edge cases for (II):

  • Vacuous for small MMM. Conditions 3 and 6 force 2=E∣d∣4≤M42 = \mathbb{E}|d|^4 \le M^42=E∣d∣4≤M4. So for M<21/4M < 2^{1/4}M<21/4, including every M≤0M \le 0M≤0, no admissible ν\nuν exists and claim (II) holds vacuously.
  • Trivial at n=1n = 1n=1. For n=1n = 1n=1 the size condition reduces to L≥1L \ge 1L≥1, and the bound 1/n2=11/n^2 = 11/n2=1 is trivial.
Human review
  • Endorsed by Shuze Chen · Nov 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 25, 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