Theorem 5:5, eq. (5:10) —
ProvedConjGrad.Termination.cg_stepLength_formulasLet be a real symmetric positive definite matrix, let , and let , , be produced by the conjugate gradient method (3:1) started at , with step lengths as in (3:1b). Then for every
The middle expression is the step length (4:1a) of the method of conjugate directions, so this identity is one half of the statement that the cg-method is a cd-method; the last expression is (4:4).
Formalization Note The first equality is the definition of (cgA); the statement asserts the other two. It covers only formula (5:10) of Theorem 5:5; the formulas (5:11) for and the Rayleigh quotient bounds (5:12) are not part of it. After the method reaches the solution both sides are .
import Mathlib import Definitions.Def_ConjGrad_Termination_cgIter open Matrix
namespace ConjGrad.Termination
/-- Theorem 5:5, eq. (5:10) (Hestenes–Stiefel 1952, p. 416). For a symmetric positive
definite `A`, the step length `aᵢ = |rᵢ|²/(pᵢ, Apᵢ)` of the cg-method (3:1b) also equals
`(pᵢ, rᵢ)/(pᵢ, Apᵢ)` and `(pᵢ, r₀)/(pᵢ, Apᵢ)`. -/
theorem cg_stepLength_formulas {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosDef)
(k x₀ : Fin n → ℝ) (i : ℕ) :
cgA A (cgIter A k x₀ i) =
((cgIter A k x₀ i).p ⬝ᵥ (cgIter A k x₀ i).r) /
((cgIter A k x₀ i).p ⬝ᵥ (A *ᵥ (cgIter A k x₀ i).p)) ∧
cgA A (cgIter A k x₀ i) =
((cgIter A k x₀ i).p ⬝ᵥ (cgIter A k x₀ 0).r) /
((cgIter A k x₀ i).p ⬝ᵥ (A *ᵥ (cgIter A k x₀ i).p)) := 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 and fix an index .
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 the fixed , the step length satisfies both
with all quotients read as when their denominator is .
Degenerate cases.
- . By positive definiteness this happens exactly when . Then all three expressions are by the division convention, so the statement holds trivially at that index.
- Arbitrary . The index is any natural number, including values beyond .
- . Everything is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.