Solution (source code)

= Solution

Suppose $K$ is a <compact operator> and $f_n\rightharpoonup f$. The <Uniform boundedness principle> makes $(f_n)$ bounded. If $Kf_n$ did not converge in norm to $Kf$, some subsequence would stay a fixed positive distance away. Compactness provides a further norm-convergent subsequence, say to $g$. On the other hand, for every $h$, $\langle Kf_n,h\rangle=\langle f_n,K^*h\rangle\to\langle Kf,h\rangle$, so its norm limit must be $Kf$, a contradiction.

Conversely, if $K$ sends every weakly convergent sequence to a norm-convergent sequence, take any sequence in the closed <unit ball>. Weak compactness of that ball supplies a weakly convergent subsequence, whose images converge in norm by hypothesis. Thus every sequence in the image has a convergent subsequence in $H$. Its closure is also sequentially compact: approximate its $n$th member by an image point within $1/n$. Since $H$ is a <metric space>, that closure is compact. We conclude
$$
\boxed{K\text{ compact}\iff f_n\rightharpoonup f\Longrightarrow\|Kf_n-Kf\|\to0.}
$$
This is the principle that <compact operators send weak convergence to norm convergence>.