Theorem 5:1, eq. (5:3a) — the cg residuals are mutually orthogonal
ProvedConjGrad.Termination.cg_residuals_orthogonalLet be a real symmetric positive definite matrix, let , and let be the residuals produced by the conjugate gradient method (3:1) started at . Then
Mutual orthogonality of the residuals is what bounds the number of nonzero residuals by the dimension .
Formalization Note The statement is for all indices. After the method reaches the solution the residuals are (see the definition of the iteration), so the relation continues to hold trivially.
import Mathlib import Definitions.Def_ConjGrad_Termination_cgIter open Matrix
namespace ConjGrad.Termination
/-- Theorem 5:1, eq. (5:3a) (Hestenes–Stiefel 1952, p. 414). For a symmetric positive
definite `A`, the residuals `r₀, r₁, …` of the cg-method (3:1) are mutually orthogonal:
`(rᵢ, rⱼ) = 0` for `i ≠ j`. -/
theorem cg_residuals_orthogonal {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosDef)
(k x₀ : Fin n → ℝ) :
∀ i j, i ≠ j → (cgIter A k x₀ i).r ⬝ᵥ (cgIter A k x₀ j).r = 0 := by sorry
end ConjGrad.Termination
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let and let be a real matrix that is positive definite in this sense:
- is symmetric, ;
- for every nonzero .
Here . Let be arbitrary.
The iteration. Let be the sequence defined recursively as follows. Start with
Then, for every ,
Every quotient with a zero denominator is , and the recursion never stops.
Conclusion. For all with ,
The indices are unbounded: the claim covers all pairs of distinct natural numbers, including indices greater than .
Degenerate cases.
- . All vectors are empty and the claim holds trivially.
- . Then , and the recursion with the zero-quotient convention keeps every , so the claim holds.
- Zero quotients. Whenever a residual vanishes, the zero-quotient convention governs the steps that follow it, and the claim is asserted for those steps as well.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.