Minimality of is equivalent to the normal equations
ProvedCODATA2022.chiSquare_min_iff_normal_equationsFor a positive definite weight matrix , a parameter vector minimizes over all of if and only if it satisfies the normal equations
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 .
import Mathlib import Definitions.Def_CODATA2022_least_squares open Matrix
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 CODATA2022Read-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 , (implicit), a real matrix , a real matrix , a vector and a vector . The single hypothesis is that is positive definite: is Hermitian (over : symmetric) and for every nonzero . In particular may be , in which case the condition is vacuously satisfied.
The conclusion is a two-way equivalence between:
- global minimality: for every , , where ; note the inequality is non-strict and is quantified over all of , with no constraint set; and
- the normal equations: as vectors in .
Nothing is assumed about the rank of , so 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 . Neither side asserts that such an exists.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.