Theorem 5:1, eq. (5:3d) — and for
ProvedConjGrad.Termination.cg_residual_AdirectionLet be a real symmetric positive definite matrix, let , and let , be the residuals and directions produced by the conjugate gradient method (3:1) started at . Then
These relations complete the induction by which the paper proves Theorem 5:1, and they give the alternative formula (3:2b) for .
Formalization Note The statement is for all indices; after the method reaches the solution the residuals and directions are .
import Mathlib import Definitions.Def_ConjGrad_Termination_cgIter open Matrix
namespace ConjGrad.Termination
/-- Theorem 5:1, eq. (5:3d) (Hestenes–Stiefel 1952, p. 414). For a symmetric positive
definite `A`, the cg-method (3:1) satisfies `(rᵢ, Apᵢ) = (pᵢ, Apᵢ)`, and `(rᵢ, Apⱼ) = 0`
whenever `i ≠ j` and `i ≠ j + 1`. -/
theorem cg_residual_Adirection {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosDef)
(k x₀ : Fin n → ℝ) :
(∀ i, (cgIter A k x₀ i).r ⬝ᵥ (A *ᵥ (cgIter A k x₀ i).p) =
(cgIter A k x₀ i).p ⬝ᵥ (A *ᵥ (cgIter A k x₀ i).p)) ∧
(∀ i j, i ≠ j → i ≠ j + 1 → (cgIter A k x₀ i).r ⬝ᵥ (A *ᵥ (cgIter A k x₀ j).p) = 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. The theorem asserts both of the following:
- For every ,
- For all with and ,
Part 2 excludes only two cases: , and (the direction immediately before the residual). In particular it includes , so it asserts . It also includes every and every .
Degenerate cases.
- Unbounded indices. All natural-number indices are covered, including those beyond .
- . All dot products are and both parts hold trivially.
- . All and are , and every equation reads .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.