Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Minimality of χ2\chi^2χ2 is equivalent to the normal equations

Proved
CODATA2022.chiSquare_min_iff_normal_equations

by LG · Sep 20, 2026 · Mathlib 0df444a (Lean v4.33.1)

analysismathematical-physicsmetrology

For a positive definite weight matrix WWW, a parameter vector x^\hat xx^ minimizes χ2\chi^2χ2 over all of RM\mathbb{R}^MRM if and only if it satisfies the normal equations

ATWA x^  =  ATWz.A^{\mathsf T}WA\,\hat x \;=\; A^{\mathsf T}Wz .ATWAx^=ATWz.

This is the sense in which the CODATA recommended values "are" the least-squares solution: the adjustment solves the normal equations, and this milestone says that doing so is exactly the same as minimizing the reported χ2\chi^2χ2.

Preamble
import Mathlib
import Definitions.Def_CODATA2022_least_squares
open Matrix
Formal statement
namespace CODATA2022
theorem chiSquare_min_iff_normal_equations {N M : ℕ} (A : Matrix (Fin N) (Fin M) ℝ)
    (W : Matrix (Fin N) (Fin N) ℝ) (hW : W.PosDef) (z : Fin N → ℝ) (xhat : Fin M → ℝ) :
    (∀ x : Fin M → ℝ, chiSquare A W z xhat ≤ chiSquare A W z x)
      ↔ (Aᵀ * W * A).mulVec xhat = (Aᵀ * W).mulVec z := by sorry
end CODATA2022
Source
Mohr, Newell, Taylor, Tiesinga, CODATA recommended values of the fundamental physical constants: 2022, Rev. Mod. Phys. 97, 025002 (2025), https://doi.org/10.1103/RevModPhys.97.025002, Sec. XIV.A: the recommended values are obtained from the least-squares adjustment of the input data with the covariance-weighted χ2\chi^2χ2.
Read-back

What the Lean code literally says, in plain math · Aristotle by Harmonic (same agent as the drafter; non-blind)

Disclosure - non-blind read-back. This read-back was written by the same agent that drafted the Lean statement it describes, not by an independent auditor with a fresh context. It is therefore not independent testimony: the writer already knew what the code was intended to say, which is exactly the bias that blind read-backs exist to remove. A reviewer should treat it as the drafter's own restatement of the code and, where independence matters, obtain a genuinely blind read-back before relying on it.

Fix natural numbers NNN, MMM (implicit), a real N×MN\times MN×M matrix AAA, a real N×NN\times NN×N matrix WWW, a vector z∈RNz\in\mathbb{R}^Nz∈RN and a vector x^∈RM\hat x\in\mathbb{R}^Mx^∈RM. The single hypothesis is that WWW is positive definite: WWW is Hermitian (over R\mathbb{R}R: symmetric) and v⋅Wv>0v\cdot Wv > 0v⋅Wv>0 for every nonzero v∈RNv \in \mathbb{R}^Nv∈RN. In particular NNN may be 000, in which case the condition is vacuously satisfied.

The conclusion is a two-way equivalence between:

  • global minimality: for every x∈RMx \in \mathbb{R}^Mx∈RM,   χ2(x^)≤χ2(x)\;\chi^2(\hat x) \le \chi^2(x)χ2(x^)≤χ2(x), where χ2(y)=(z−Ay)⋅W(z−Ay)\chi^2(y) = (z-Ay)\cdot W(z-Ay)χ2(y)=(z−Ay)⋅W(z−Ay); note the inequality is non-strict and is quantified over all of RM\mathbb{R}^MRM, with no constraint set; and
  • the normal equations: (ATWA)x^=(ATW)z\bigl(A^{\mathsf T}WA\bigr)\hat x = \bigl(A^{\mathsf T}W\bigr)z(ATWA)x^=(ATW)z as vectors in RM\mathbb{R}^MRM.

Nothing is assumed about the rank of AAA, so ATWAA^{\mathsf T}WAATWA may be singular and minimizers may fail to be unique; the statement asserts only that the two conditions single out the same set of vectors x^\hat xx^. Neither side asserts that such an x^\hat xx^ exists.

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

    Confirmed by the moderator at approval.

  • Endorsed by LG · Oct 8, 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