Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Inverse-Wishart mean: E (GGT)−1=1k−r−1Ir\mathbb E\,(GG^{\mathsf T})^{-1}=\frac{1}{k-r-1}I_rE(GGT)−1=k−r−11​Ir​ for a Gaussian G∈Rr×kG\in\mathbb R^{r\times k}G∈Rr×k, r≤k−2r\le k-2r≤k−2

Proved
GaussianMatrix.inverse_wishart_mean

by tc · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

gaussian-matrixprobabilityrandom-matrix-theoryrandomized-numerical-linear-algebra

Let G∈Rr×kG\in\mathbb R^{r\times k}G∈Rr×k be a standard Gaussian matrix with r≤k−2r\le k-2r≤k−2. Then every entry of (GGT)−1(GG^{\mathsf T})^{-1}(GGT)−1 is integrable and

E (GGT)−1=1k−r−1 Ir.\mathbb E\,(GG^{\mathsf T})^{-1}=\frac{1}{k-r-1}\,I_r .E(GGT)−1=k−r−11​Ir​.

The matrix W=GGTW=GG^{\mathsf T}W=GGT is Wishart distributed with kkk degrees of freedom and identity scale, and W−1W^{-1}W−1 is inverse-Wishart; this is the classical formula for its mean. Taking the trace gives E∥G†∥F2=Etr⁡(GGT)−1=r/(k−r−1)\mathbb E\|G^{\dagger}\|_F^2=\mathbb E\operatorname{tr}(GG^{\mathsf T})^{-1}=r/(k-r-1)E∥G†∥F2​=Etr(GGT)−1=r/(k−r−1), the quantity governing the expected Frobenius error of the randomized SVD.

Formalization Note. The statement is entrywise: for all i,ji,ji,j, the function G↦((GGT)−1)ijG\mapsto((GG^{\mathsf T})^{-1})_{ij}G↦((GGT)−1)ij​ is integrable under γr,k\gamma_{r,k}γr,k​ and its integral equals (k−r−1)−1(Ir)ij(k-r-1)^{-1}(I_r)_{ij}(k−r−1)−1(Ir​)ij​. Mathlib's inverse is total (000 on the singular null set), which does not affect the integral.

Preamble
import Definitions.Def_GaussianMatrix_basic

open MeasureTheory ProbabilityTheory
open scoped Matrix
Formal statement
namespace GaussianMatrix
theorem inverse_wishart_mean {r k : ℕ} (hrk : r + 2 ≤ k) :
    (∀ i j : Fin r, Integrable (fun G : Fin r → Fin k → ℝ =>
        (Matrix.of G * (Matrix.of G)ᵀ)⁻¹ i j) (gaussianMatrix r k)) ∧
    ∀ i j : Fin r, ∫ G, (Matrix.of G * (Matrix.of G)ᵀ)⁻¹ i j ∂(gaussianMatrix r k)
      = (1 / ((k : ℝ) - r - 1)) * (1 : Matrix (Fin r) (Fin r) ℝ) i j := by sorry
end GaussianMatrix
Source
J. A. Tropp, R. J. Webber, *Randomized algorithms for low-rank matrix approximation: design, analysis, and applications*, 2023, https://arxiv.org/abs/2306.12418 (v1), Appendix B p. 51, Lemma B.2 (Inverse moment bounds), first formula: E(GG∗)−1=1k−r−1I\mathbb E(GG^*)^{-1}=\frac{1}{k-r-1}IE(GG∗)−1=k−r−11​I for r≤k−2r\le k-2r≤k−2.
Read-back

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

Throughout, μr,k\mu_{r,k}μr,k​ denotes the measure called gaussianMatrix r k: the product measure on the function space {0,…,r−1}×{0,…,k−1}→R\{0,\dots,r-1\}\times\{0,\dots,k-1\}\to\mathbb{R}{0,…,r−1}×{0,…,k−1}→R in which every one of the rkrkrk coordinates is an independent standard normal N(0,1)\mathcal N(0,1)N(0,1); it is a probability measure, and a sample GGG is viewed as the real r×kr\times kr×k matrix with entries GijG_{ij}Gij​. Matrix inversion (⋅)−1(\cdot)^{-1}(⋅)−1 is Mathlib's total inverse on square real matrices: it is the usual inverse when the determinant is nonzero and is the zero matrix otherwise.

Statement. Let r,kr,kr,k be natural numbers with r+2≤kr + 2 \le kr+2≤k. Write W=GG⊤W = G G^{\top}W=GG⊤ for the r×rr\times rr×r Gram matrix of a sample GGG. The theorem asserts the conjunction of two claims:

  1. Integrability. For every pair of indices i,j∈{0,…,r−1}i,j\in\{0,\dots,r-1\}i,j∈{0,…,r−1}, the real-valued function G↦(W−1)ijG \mapsto \big(W^{-1}\big)_{ij}G↦(W−1)ij​ is integrable with respect to μr,k\mu_{r,k}μr,k​ (i.e. it is almost-everywhere strongly measurable and ∫∣(W−1)ij∣ dμr,k<∞\int |(W^{-1})_{ij}|\,d\mu_{r,k} < \infty∫∣(W−1)ij​∣dμr,k​<∞).

  2. Value of the mean. For every i,j∈{0,…,r−1}i,j\in\{0,\dots,r-1\}i,j∈{0,…,r−1},

∫(GG⊤)ij−1  dμr,k(G)  =  1k−r−1⋅(Ir)ij,\int \big(G G^{\top}\big)^{-1}_{ij}\;d\mu_{r,k}(G) \;=\; \frac{1}{k - r - 1}\cdot (I_r)_{ij},∫(GG⊤)ij−1​dμr,k​(G)=k−r−11​⋅(Ir​)ij​,

where IrI_rIr​ is the r×rr\times rr×r identity matrix, so the right-hand side is 1k−r−1\frac{1}{k-r-1}k−r−11​ when i=ji=ji=j and 000 when i≠ji\neq ji=j. Here k−r−1k - r - 1k−r−1 is computed in R\mathbb{R}R (after casting the naturals), and since k≥r+2k \ge r+2k≥r+2 this quantity is at least 111, so no division by zero occurs.

Edge cases. The integral is Lean's Bochner integral in R\mathbb{R}R, which returns 000 for a non-integrable integrand; however, part 1 separately asserts integrability, so part 2 is not trivially satisfied by that convention. On the μr,k\mu_{r,k}μr,k​-null set of samples where GG⊤GG^{\top}GG⊤ is singular, (GG⊤)−1(GG^{\top})^{-1}(GG⊤)−1 is the zero matrix. When r=0r = 0r=0 the index set {0,…,r−1}\{0,\dots,r-1\}{0,…,r−1} is empty and both parts are vacuously true (the hypothesis then reads 2≤k2\le k2≤k). The hypothesis r+2≤kr+2\le kr+2≤k is on natural numbers.

Human review
  • Endorsed by Shuze Chen · Oct 9, 2026

    Confirmed by the moderator at approval.

  • Endorsed by tc · Oct 9, 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