I'm struggling with the following proof and hope some of you can help me:
By $H$ we denote a real Hilbert space and let be $T: H \rightarrow H$ be a compact, self-adjoint and linear operator.
(i) Show that $R(x):= \frac{(Tx,x)_H}{(x,x)_H}$ attains its maximum, i.e. there exists $x^* \in H$ s.t. $R(x^*)$ is maximal and $||x^*||_H=1$.
(ii) Furthermore, I am looking for a counter-example, that this doesn't work for non-compact operators.
So we are asked to show that $\exists x^* \in H~ \textit{s.t.}~ \forall x \in H: R(x) \leq R(x_0)$.
I've had several approaches, but all of them ended in a dead-end. The main problem was, that I couldn't draw the conclusion by using the compactness of $T$, which should be crucial for that problem (at least in my opinion). But I couldn't find a counter example, with a non-compact operator that doesn't satisfy the statement (that's why I ask question (ii) - maybe this helps me to get a better "feeling" for the problem). Therefore, the possibly most promising try was to define a maximising sequence $(x_n)_{n\in\mathbb{N}} \subseteq H$, $x_n \rightarrow x^*$. My idea was to somehow use that for every bounded sequence $(x_n)_{n\in\mathbb{N}}$ there exists a subsequence $(x_{n_k})_{k\in\mathbb{N}}$ such that $Tx_{n_k}$ converges. Furthermore, there is a statement that if $u_n \rightarrow_w u$ then for a compact operator $T$ holds: $Tu_n \rightarrow Tu$, which might be helpful.
Furthermore, since $||x^*||_H = 1$, I can assume that $\forall n \in \mathbb{N}: ||x_n||_H = 1$, which would give me the required boundedness.
Unfortunately, I wasn't able to prove the statement by using these ideas. Is my approach promising, or did I miss something crucial? How can I prove the statement? I would be grateful for any help!
I will assume that $H$ is separable so that the closed unit ball is a compact metric space in the weak topology. [Please see the remark at the end of the answer].
Let $A$ be the supremum of the real numbers $\frac {\langle Tx , x \rangle} {\|x\|^{2}}$. Then there exists a sequence $x_n$ such that $\frac {\langle Tx_n , x_n \rangle} {\|x_n\|^{2}} \to A$. Let $y_n=\frac {x_n} {\|x_n\|}$. Then $\langle Ty_n , y_n \rangle \to A$. Since $(y_n)$ is bounded and $T$ is compact there is subsequence $y_{n_k}$ converging weakly such that $T(y_{n_k})$ converges to some point $y$ in the norm. Now $|\langle Ty_{n_k} , y_{n_k} \rangle -\langle Ty , y \rangle| = |\langle Ty_{n_k} , y_{n_k} \rangle -\langle Ty , y_{n_k} \rangle |+ |\langle Ty , y_{n_k} \rangle -\langle Ty , y \rangle|$. Can you check that both the terms here tend to $0$? It follows now that $\langle Ty , y \rangle=A$.
An example where the value $A$ is not attained is the shift operator on $\ell^{2}$ defined by $T(a_n)=(0,a_1,a_2,...)$. Here $A=1$ by Cauchy -Schwarz inequality and using the condition for equality in Cauchy -Schwarz inequality we can see that the value $A=1$ is never attained.
PS The separability assumption can easily be dispensed with by restricting our attention to the closed subspace spaned by $(x_n)$.