Theorem 4:2 — the cd-method reaches the solution in m ≤ n steps
ProvedConjGrad.Termination.cd_terminatesLet be a real symmetric positive definite matrix, let , and let be the solution of . Let , , () be a run of the method of conjugate directions for (with an arbitrary initial estimate and arbitrary initial direction ), and suppose the directions are all nonzero. Then there is an with
In the paper's words, the cd-method is an -step method (): at the -th step the estimate is the desired solution . Applied to the conjugate gradient method through Theorem 5:2, this gives the finite termination of that method.
Formalization Note The hypothesis that are nonzero is implicit in the paper's proof ("the vectors are linearly independent"); without it the statement fails (take ). The solution may be reached before step , after which the remaining directions may still be nonzero; the statement only requires them nonzero, not the residuals.
import Mathlib import Definitions.Def_ConjGrad_Termination_IsCDRun open Matrix
namespace ConjGrad.Termination
/-- Theorem 4:2 (Hestenes–Stiefel 1952, p. 412). The cd-method is an `m`-step method with
`m ≤ n`: for a symmetric positive definite `n × n` matrix `A`, the solution `h` of `Ah = k`,
and every run of the cd-method whose directions `p₀, …, pₙ₋₁` are nonzero, some estimate
`xₘ` with `m ≤ n` equals `h`. -/
theorem cd_terminates {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosDef)
(k h : Fin n → ℝ) (hh : A *ᵥ h = k) (x r p : ℕ → Fin n → ℝ) (hcd : IsCDRun A k x r p)
(hp : ∀ i < n, p i ≠ 0) :
∃ m ≤ n, x m = h := 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 satisfy .
Let , , , for , be sequences in that satisfy all of these conditions:
- for every ;
- for every , where the quotient is if its denominator is ;
- for every and every .
Assume further that for every with , that is, for . Nothing is assumed about for , and and are otherwise arbitrary.
Conclusion. There exists a natural number with such that
The statement only asserts that some such exists. It does not name and does not say what happens to for .
Degenerate cases.
- . The nonzero-direction hypothesis is vacuous, all vectors are empty, the empty matrix satisfies positive definiteness vacuously, and holds trivially, so works.
- . The hypotheses require .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.