= Solution
Choose continuous representatives using <Morrey's inequality>. On the closed unit ball they are uniformly bounded by $C M$ and satisfy
$$
|u_n(x)-u_n(y)|\leq CM|x-y|^{1-d/p}.
$$
The <Arzelà-Ascoli theorem> therefore gives a uniformly convergent subsequence with a continuous limit. For $p=\infty$, use the uniform Lipschitz estimate instead; this part remains valid at that endpoint.
For <weak lower semicontinuity of the Hilbert norm>, weak convergence gives $\langle u_n-\phi,\phi\rangle\to0$, and hence
$$
\|u_n\|^2=\|\phi\|^2+\|u_n-\phi\|^2+o(1).
$$
Taking the lower limit proves $\boxed{\|\phi\|\leq\liminf_n\|u_n\|}$.
For the nonlinear integral, use <local Sobolev compactness gives lower semicontinuity of a nonnegative integral>. Select a subsequence attaining the lower limit of the integrals. The <Rellich-Kondrachov compactness theorem> on successively larger balls gives a diagonal subsequence converging strongly in local <L2 space> to $\phi$. After a further subsequence it converges almost everywhere. Since $1-\cos s\geq0$, the <Fatou lemma> gives
$$
\boxed{\int_{\mathbb R^3}(1-\cos\phi)\,dx\leq\liminf_n\int_{\mathbb R^3}(1-\cos u_n)\,dx.}
$$
Each integral is finite because $0\leq1-\cos s\leq s^2/2$. The argument uses local compactness rather than convexity: $1-\cos s$ is not a convex function on the whole real line.
Back to article page