If $H$ is a Hilbert space, we have the Hilbert Projection Theorem, which tells us that given a nonempty, closed, convex subset $K \subset H$, and a point $x \in H$, there is a unique point $y \in K$ which minimizes $\lVert x-y \rVert$.
In the $L^{p}(X,\mathcal{X},\mu)$ spaces, for $1 < p < \infty$, we get the same result, even though these are not Hilbert spaces for $p\neq 2$ (assuming that $(X,\mathcal{X})$ is sufficiently non-trivial). This can be proved using the Hanner inequalities.
I am interested in the case of $L^1$ or $L^\infty$. It is easy to construct examples where distance minimizers (in some closed, convex, nonempty subset) exist, but they are not unique. However, I am wondering whether or not existence can fail as well. I have thought about this a fair bit, and tried searching online, but I could not resolve this question.
Can anyone share any insight? Thanks.
Here is an example in $L^1[0,1]$. Let $K$ be the set of functions $f\in L^1[0,1]$ such that $\int_0^1 xf(x)\,dx=0$. This is a closed subspace of $L^1$. Consider the distance from $g(x)=1$ to $K$. For any $f\in K$ we have $$ \left|\int_0^1 x(f(x)-1)\,dx \right| = \int_0^1 x\,dx =\frac12 \tag{1} $$ Since $x<1$ a.e., it follows that $$ \int_0^1 |f(x)-1|\,dx > \int_0^1 x|f(x)-1|\,dx \ge \frac12 \tag{2} $$ On the other hand, the sequence $$ f_n(x) = 1 - \frac{n^2}{2n-1}\chi_{[1-1/n,1]} \tag{3} $$ belongs to $K$ and satisfies $\|f_n-g\|_{L^1}\to \frac12$. Therefore, $\operatorname{dist}(g,K)=1/2$ and this distance is not attained.
I don't have an explicit example in $L^\infty$, but since $L^\infty$ contains an isometric copy of every separable Banach space, one can use an isometric embedding $\phi : L^1\to L^\infty$ to produce an implicit example: $\phi(g)$ and $\phi(K)$. Since $K$ is a complete metric space, its image $\phi(K)$ is a closed subspace of $L^\infty$.