Let $A \subset \mathbb{R}^n$ be closed and $d_A(x) = \inf_{a \in A} \|x-a\|$. I need to show that $d_A$ is convex if and only if $A$ is convex.
I have no good ideas in either direction. Can somebody please give me a hint?
For the direction ($\Longleftarrow$), my attempt was:
Let $a_1 := \operatorname*{argmin}_{a \in A} \|x-a\|, a_2 := \operatorname*{argmin}_{a\in A} \|y-a\|$, then:
\begin{align*} d_A(x) &= \inf_{a \in A} \|\lambda x + (1 - \lambda)y - a\| = \inf \|\lambda(x-a) + (1-\lambda) (y-a)\|\\ &\leq \lambda \|x-a_1\| + (1-\lambda)\|y-a_2\| = \lambda d_A(x) + (1-\lambda)d_A(y) \end{align*}
However, I'm not sure whether the inequality in the third step is actually correct.