Given a vector $y=(y_k) \in \mathbb{R}^n$, we consider the energy function $$E:\mathbb{R}^n\rightarrow \mathbb{R}^n,\; x \mapsto \sum_{k=1}^{n-1}(x_{k+1} + x_{k−1} − 2x_k)^2,$$
and the set $$C = \{x \in \mathbb{R}^n \text{ s.t } |x_k − y_k| ≤ q, \forall k=1,\ldots,n\},$$ where $q$ is a fixed positive real number.
- Show that $C$ is convex.
- Give an explicit formula for $\pi_C(x)$, the euclidean projection of a vector $x \in \mathbb R^n$ onto $C$.
I have tried to solve this. I proved that the energy function is convex. but somehow i am getting stuck on finding the projection of the vector on set C.