Extending a compact operator to the entire Hilbert space In a course I'm taking we defined compact operators as a linear mapping $H\rightarrow H$, where $H$ is a Hilbert space, that maps bounded sets to relative compact ones. The lecturer mentioned that the reason we defined it like this and not as  $M\rightarrow H$ with $M\subseteq H$ is that every such compact operator could be extended from $M$ to $H$. In passing he mentioned that this had something to do with the Hahn-Banach theorem.
My questions are: 


*

*What exactly had he meant, how can one construct an extension ? I can't see the connection with said theorem since it involves linear functionals and not maps. 

*Is this extension unique ?

*Is the argument that any such operator defined on a subset can be extend to the whole space even adequate ? I'm thinking that there may be examples operators that are naturally defined only on a subset of $H$ and extending them to $H$ would be inelegant. Could you provide such an example for compact operators ?
(To see what I mean by such an example I'm going to give one for symmetric operators: the differential operator that maps a function from $L^2(\Omega)$ to its second derivative is naturally only  defined in a subset of $L^2(\Omega)$, since second derivatives of $L^2$-functions do not necessarily have to lie in $L^2(\Omega)$ again - now it would be possible to extend this operator to $L^2(\Omega)$ by letting it be $0$ outside its natural domain, since that would preserve symmetry, but it would be inelegant.)

 A: I don't see how the Hahn-Banach theorem is relevant here either.
A natural construction of a compact extension of a compact operator $T\colon M\to H$ to a compact operator $\tilde{T}\colon H\to H$ is to first (if necessary) extend the operator continuously to $\overline{T}\colon \overline{M} \to H$. That extension is unique, and as is also compact (a bounded set in $\overline{M}$ is contained in the closure of a bounded set in $M$, therefore is mapped to a relatively compact set). Then you use the orthogonal decomposition $H = \overline{M} \oplus M^\perp$. The trivial extension defines the operator as $0$ on $M^\perp$, but taking any compact operator $A\colon M^\perp \to H$ yields a compact $\tilde{T}$ by setting
$$\tilde{T}(x) = \overline{T}(P_{\overline{M}}x) + A(P_{M^\perp}x).$$
So such an extension is unique if and only if $M$ is dense.
Since the continuous extension of a continuous operator to the closure of its domain is always possible if the codomain is complete (that is far more general than operators on Hilbert spaces), the orthogonal decomposition in Hilbert spaces guarantees that every continuous linear map from a subspace of a Hilbert space to a complete (Hausdorff) topological vector space can be extended to a continuous linear map defined on the whole space.
Your example of the differential operator is an unbounded (discontinuous) operator. Such operators need not be extensible in a meaningful way to the whole space (it can be extended by taking an algebraic complement of its domain, but such an extension is usually not meaningful), but compact operators are continuous, hence an extension always exists.
