Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Mixed diagonal second moment of the inverse Wishart matrix: E[(W−1)ii(W−1)jj]=(k−r−2)/((k−r)(k−r−1)(k−r−3))\mathbb{E}[(W^{-1})_{ii}(W^{-1})_{jj}] = (k-r-2)/((k-r)(k-r-1)(k-r-3))E[(W−1)ii​(W−1)jj​]=(k−r−2)/((k−r)(k−r−1)(k−r−3)), i≠ji\neq ji=j

Proved
GaussianMatrix.inverse_wishart_diag_prod_moment

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

gaussianinverse-wishartmomentsrandom-matriceswishart

Let r+4≤kr + 4 \le kr+4≤k, let G∈Rr×kG \in \mathbb{R}^{r\times k}G∈Rr×k have independent N(0,1)\mathcal{N}(0,1)N(0,1) entries and W=GG⊤W = GG^\topW=GG⊤. For distinct indices i≠ji \ne ji=j the product (W−1)ii(W−1)jj(W^{-1})_{ii}(W^{-1})_{jj}(W−1)ii​(W−1)jj​ is integrable and

E[(W−1)ii (W−1)jj]  =  k−r−2(k−r)(k−r−1)(k−r−3).\mathbb{E}\big[(W^{-1})_{ii}\,(W^{-1})_{jj}\big] \;=\; \frac{k-r-2}{(k-r)(k-r-1)(k-r-3)}.E[(W−1)ii​(W−1)jj​]=(k−r)(k−r−1)(k−r−3)k−r−2​.

This is the off-diagonal term β\betaβ in E[(tr⁡W−1)2]=∑i,jE[(W−1)ii(W−1)jj]=rα+r(r−1)β\mathbb{E}[(\operatorname{tr} W^{-1})^2] = \sum_{i,j}\mathbb{E}[(W^{-1})_{ii}(W^{-1})_{jj}] = r\alpha + r(r-1)\betaE[(trW−1)2]=∑i,j​E[(W−1)ii​(W−1)jj​]=rα+r(r−1)β, i.e. in the fourth moment E∥G†∥F4\mathbb{E}\|G^\dagger\|_F^4E∥G†∥F4​ of the pseudoinverse. It follows from α=β+2γ\alpha = \beta + 2\gammaα=β+2γ (rotation identity) with α=1/((k−r−1)(k−r−3))\alpha = 1/((k-r-1)(k-r-3))α=1/((k−r−1)(k−r−3)) and γ=1/((k−r)(k−r−1)(k−r−3))\gamma = 1/((k-r)(k-r-1)(k-r-3))γ=1/((k−r)(k−r−1)(k−r−3)).

Formalization Note. Lean's matrix inverse returns 000 on singular input; GG⊤GG^\topGG⊤ is a.s. invertible, so this does not affect the statement. Integrability is part of the conclusion.

Preamble
import Definitions.Def_GaussianMatrix_basic

open MeasureTheory ProbabilityTheory
open scoped Matrix
Formal statement
namespace GaussianMatrix

theorem inverse_wishart_diag_prod_moment {r k : ℕ} (hrk : r + 4 ≤ k) (i j : Fin r) (hij : i ≠ j) :
    Integrable (fun G : Fin r → Fin k → ℝ =>
        (Matrix.of G * (Matrix.of G)ᵀ)⁻¹ i i * (Matrix.of G * (Matrix.of G)ᵀ)⁻¹ j j)
      (gaussianMatrix r k) ∧
    ∫ G, (Matrix.of G * (Matrix.of G)ᵀ)⁻¹ i i * (Matrix.of G * (Matrix.of G)ᵀ)⁻¹ j j
        ∂(gaussianMatrix r k)
      = ((k : ℝ) - r - 2) / (((k : ℝ) - r) * ((k : ℝ) - r - 1) * ((k : ℝ) - r - 3)) := by sorry

end GaussianMatrix
Source
standard fact (second moments of the inverse Wishart matrix): for W∼Wr(k,I)W \sim W_r(k, I)W∼Wr​(k,I), E[(W−1)ij(W−1)kl]=(k−r−2)δijδkl+δikδjl+δilδjk(k−r)(k−r−1)(k−r−3)\mathbb{E}[(W^{-1})_{ij}(W^{-1})_{kl}] = \frac{(k-r-2)\delta_{ij}\delta_{kl} + \delta_{ik}\delta_{jl} + \delta_{il}\delta_{jk}}{(k-r)(k-r-1)(k-r-3)}E[(W−1)ij​(W−1)kl​]=(k−r)(k−r−1)(k−r−3)(k−r−2)δij​δkl​+δik​δjl​+δil​δjk​​; A. K. Gupta and D. K. Nagar, Matrix Variate Distributions, Chapman & Hall/CRC 2000, Thm. 3.4.3; D. von Rosen, Scand. J. Statist. 15 (1988) 97–109; cf. R. J. Muirhead, Aspects of Multivariate Statistical Theory, Wiley 1982, Sec. 3.2 (theorem numbers from memory). This is the case i=j≠k=li=j\ne k=li=j=k=l.

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me