Eq. (3): the stacked covariance estimator is positive semidefinite
ProvedSZFilaments.sampleCovariance_posSemidefEquation (3) of the paper: the stacked covariance estimator is a covariance matrix.
For a stack of binned profiles , , with bins and mean profile , the estimator
is symmetric and positive semidefinite, for every sample size (including the empty stack, where it is the zero matrix) and every data set. Positive semidefiniteness is what makes the of Eq. (4) a meaningful statistic and what a numerical inversion of implicitly assumes; it holds identically, with no assumption on the data.
import Definitions.Def_szStackStatistics open Finset Matrix
namespace SZFilaments
theorem sampleCovariance_posSemidef {N n : ℕ} (y : Fin N → Fin n → ℝ) :
(sampleCovariance y).PosSemidef := by sorry
end SZFilaments
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic)
Disclosure — this read-back is not blind and not independent. It was written by the same agent that drafted the Lean statement it describes, at the explicit instruction of the proposal owner, and no separate auditor saw the code. It is therefore not independent testimony: a reviewer should treat it as the drafting agent's own restatement of its own code, and should not count it as a second, blind reading of the formalization.
For arbitrary natural numbers (samples) and (bins) and an arbitrary real-valued array with ranging over an -element index type and over an -element index type, the statement asserts that the real matrix with entries
is positive semidefinite: it is symmetric (self-adjoint over the reals) and its quadratic form is nonnegative for every real vector .
There are no hypotheses at all: may be (all sums empty, the divisions are by zero, and the matrix is the zero matrix, which is positive semidefinite), may be (the empty matrix), and the data are arbitrary reals. The divisor is and not . The claim is about this specific estimator only; it says nothing about unbiasedness, about the covariance of the mean, or about any probabilistic model generating the data.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.