We state and prove a key theorem to build the CG algorithm.

Theorem. As long as we have not converged, then

where

Proof

Step 1 Recall that we search a solution in the Krylov subspace:

This implies that

The steps are conjugate so they must be linearly independent. Since the dimensions of the spaces match, we have

Step 2

by definition of the Krylov subspace. This implies that:

So

Let’s assume that the dimension of is less than .

Then there is a such that We also have that So which is a contradiction. So

We have proved that

unless CG has converged to the exact solution.