Let $a\in\mathbb{R}^{d}$ and $K$ be an arbitrary subset of $\mathbb{R}^{d}$. My question is related to the following optimization problem: \begin{equation} \max_{x\in\mathbb{R}^{d}}~a^{\top}x\quad \text{s.t.}~~x\in K \end{equation} Is it true that the solution to the above problem is just the projection of $a$ onto $K$? Does this at least hold under some additional restriction on $K$, like convexity? If yes, how can this be shown?
Related, but unanswered: Maximizing an inner-product over a convex set.