Theorem 4:1 — conjugacy and orthogonality relations of the cd-method, (4:3a)–(4:3c) and (4:4)
ProvedConjGrad.Termination.cd_conjugacy_relationsLet be a real symmetric positive definite matrix, let , and let , , () be a run of the method of conjugate directions for : , with , and for . Then
- the directions are mutually conjugate: for (4:3a);
- the residual is orthogonal to : for (4:3b);
- the inner product of with each of is the same (4:3c):
- the step length may be computed from the initial residual, (4:4): with
These relations are the basic properties of the cd-method. In particular (4:4) shows that the estimates can be computed without computing the intermediate residuals.
Formalization Note No direction is assumed nonzero: a zero direction gives a zero step ( in Lean), and all four relations remain true for it. Item 4 is stated as the update of , which is how (4:4) replaces (4:1a).
import Mathlib import Definitions.Def_ConjGrad_Termination_IsCDRun open Matrix
namespace ConjGrad.Termination
/-- Theorem 4:1 (Hestenes–Stiefel 1952, p. 412). For every run of the cd-method with a
symmetric positive definite matrix `A`: (4:3a) the directions are mutually conjugate;
(4:3b) `rᵢ` is orthogonal to `p₀, …, pᵢ₋₁`; (4:3c) `(pᵢ, r₀) = (pᵢ, r₁) = ⋯ = (pᵢ, rᵢ)`;
(4:4) the step may be taken with `aᵢ = (pᵢ, r₀)/(pᵢ, Apᵢ)` in place of (4:1a). -/
theorem cd_conjugacy_relations {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosDef)
(k : Fin n → ℝ) (x r p : ℕ → Fin n → ℝ) (hcd : IsCDRun A k x r p) :
(∀ i j, i ≠ j → p i ⬝ᵥ (A *ᵥ p j) = 0) ∧
(∀ i j, j < i → p j ⬝ᵥ r i = 0) ∧
(∀ i j, j ≤ i → p i ⬝ᵥ r j = p i ⬝ᵥ r 0) ∧
(∀ i, x (i + 1) = x i + ((p i ⬝ᵥ r 0) / (p i ⬝ᵥ (A *ᵥ p i))) • p i) := 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 , and 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 .
The starting estimate and the starting direction are otherwise arbitrary, and directions may be zero.
Conclusion. The theorem asserts all four of the following at once:
- For all with ,
- For all with ,
- For all with ,
- For every ,
again with the quotient read as when .
All indices range over all natural numbers, with no upper bound tied to .
Degenerate cases.
- . Every vector is empty and every dot product is . The only matrix is the empty one, which satisfies the positive-definiteness hypothesis vacuously, and all four conclusions hold trivially.
- . Then , so both step coefficients are and conclusion 4 reads .
- Other hypotheses. The hypotheses are satisfiable for every : for example, take all and constant.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.