Let's say we have a self-adjoint operator acting on an inner product space (real or complex), represented, of course, by a self-adjoint matrix.
I'm looking at the proof for spectral theorem in which you build up a basis out of eigenvectors relying on the fact that the characteristic polynomial will always have roots, both over a real and over a complex field, because eigenvalues of a self-adjoint operator are real.
But what I do not understand is, why do all eigenvalues must necessarily be distinct? How do we conclude that?
After all, spectral theorem says that every self-adjoint operator is always diagonalizable and I know that for a matrix of order $n$ to be diagonalizable, it has to have $n$ distinct eigenvalues.
So, what am I missing here?
Edit: A matrix doesn't have to have n distinct eigenvalues in order to be diagonalizable, but if it does have n distinct eigenvalues it is diagonalizable, guess I was too sloppy and tired to notice such a silly mistake! But I'm leaving the question here ^_^