Convergence of CG method I have a question like how can we mathematically prove that for a general matrix  Conjugate Gradient method will always converge within n steps in exact arithmetic ? where n is the size of the matrix.

The CG method, like other Krylov methods, finds a "best" solution to $A x=b$ on successively larger subspaces. In particular, the n'th subspace is $\text{span}(x_0, Ax_0, A^2 x_0, ..., A^n x_0)$, and "best" means the point where the residual is orthogonal to the subspace.
Since you keep adding vectors to your subspace and the full space is finite dimensional, eventually there are only 2 possibilities. Either 
1) the subspace fills up the whole space, in which case the "best" solution corresponds to the true solution, or 
2) at some point $A^{k+1} x_0 \in \text{span}(x_0, Ax_0, A^2 x_0, ..., A^k x_0)$. This might seem bad, but it's actually a "happy coincidence" since it means $\text{span}(x_0, Ax_0, A^2 x_0, ..., A^k x_0)$ is a direct sum of $k$ eigenspaces. Everything that starts in there will stay in there under application of $A$, and everything orthogonal to it will stay orthogonal. (note that $A$ is symmetric so it's eigenvectors are orthogonal) 
If the true solution is in this eigenspace we would have found it, and if it isnt' we can just pick a point orthogonal to the eigenspace and start again, having reduced the problem by $k$ dimensions.
