The following exercise is Problem 1 on Stanford’s Fall 2022 Analysis Qual:
Problem 1: Let be a non-empty compact subset. Show that there exists a Hilbert space
and a self-adjoint bounded linear operator
such that the spectrum of
is exactly
Solution: As with a lot of problems regarding (separable) Hilbert spaces, the prototypical example that one should be working with is Our goal is to make the spectrum of
equal precisely to
that is, make
invertible if and only if
Now, one easy way to make an operator non-invertible is to force it to send non-trivial elements to zero, that is, have a non-empty kernel. However, with
one is working with at most countably many terms – so how does one ensure the kernel is nonempty for all of the (possibly uncountably many) elements of
Well, one doesn’t. Instead, we will approximate all elements of by a countable subset. In fact, since
is compact,
is separable, so by definition, it has a countable dense subset
Let
be an enumeration of elements of
Then, define the operator
by

Claim 1: i.e.
is contained in the spectrum of
This is true since the non-zero element
given by
satisfies
and thus belongs to
so
is not invertible.
Claim 2: This can be seen in two ways. The easy way is to recall that the spectrum of a bounded operator is always compact, so if
then the closure is also contained in the spectrum, i.e.
More explicitly, if one were to attempt to construct an inverse
for
then













Claim 3: This can be seen by directly constructing the inverse
for
as




Remark: The same argument easily extends to showing that for any compact there exists an operator
with