Eq. (7): the Hartlap correction rescales the chi-squared
ProvedSZFilaments.chiSquaredHartlap_eq_scaledEquation (7) of the paper: the Hartlap correction rescales the chi-squared.
The paper corrects the bias of the inverse of an estimated covariance by the factor of Hartlap, Simon & Schneider (2007), writing
For every number of sub-samples , every number of bins , every matrix and every profile , this equals
that is, the correction is a pure rescaling of the uncorrected statistic of Eq. (4) by the Hartlap factor. In particular the corrected statistic is nonnegative exactly when the factor and the uncorrected statistic have the same sign, which for and a positive definite means it is nonnegative.
import Definitions.Def_szStackStatistics open Finset Matrix
namespace SZFilaments
theorem chiSquaredHartlap_eq_scaled {n : ℕ} (Nsub : ℕ) (C : Matrix (Fin n) (Fin n) ℝ)
(ybar : Fin n → ℝ) :
chiSquaredHartlap Nsub C ybar
= (((Nsub : ℝ) - (n : ℝ) - 2) / ((Nsub : ℝ) - 1)) * chiSquared C ybar := 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 an arbitrary natural number , an arbitrary natural number , an arbitrary real matrix and an arbitrary real vector , the statement asserts the identity
with and cast to real numbers before the subtractions and the nonsingular inverse (the zero matrix when is singular).
There are no hypotheses: in particular is allowed, in which case both sides are because the factor involves division by zero, and is allowed, in which case the common factor is negative. The claim is the distributivity of the scalar factor over the double sum — an algebraic identity — and asserts nothing about the sign, the statistical validity, or the bias correction the factor is meant to implement.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.