How could one prove the following problem?
Given a vector $\mathbf{y}=\left(y_{k}\right) \in \mathbb{R}^{n},$ we consider the energy function $E: \mathbb{R}^{n} \rightarrow \mathbb{R}$ defined by $$ \forall \mathbf{x}=\left(x_{k}\right) \in \mathbb{R}^{n}, \quad E(\mathbf{x})=\sum_{i=1}^{n-1}\left(x_{k+1}+x_{k-1}-2 x_{k}\right)^{2} $$ and the set $$ C=\left\{\mathbf{x} \in \mathbb{R}^{n}, \forall k \in \mathbb{N}, 1 \leq k \leq n,\left|x_{k}-y_{k}\right| \leq q\right\} $$ where $q$ is a fixed positive real number.
- Compute the gradient of $E$
- Show that $E$ is convex.
- Show that $C$ is convex.
- Give an explicit formula for $\pi_{C}(\mathbf{x}),$ the projection on $C$ of a vector $\mathbf{x} \in \mathbb{R}^{n}$.
Background:
In this project we are given a temperature signal $\mathbf{y}=\left(y_{k}\right) \in \mathbb{R}^{n},$ where $y_{1}, y_{2}, \ldots, y_{n}$ represent the temperature measured at different times. Due to the poor resolution of the measure, the signal is quantized, in the sense that all measured values $y_{k}$ are multiples of $1 / 2 .$ the aim of the project is to build a non-quantized signal $\mathbf{x}=\left(x_{k}\right) \in \mathbb{R}^{n}$ that is smoother than $\mathbf{y}$ and has the property that $\left|x_{k}-y_{k}\right| \leq 1 / 4$ for all $k$ (so that the quantized version of $ \mathbf{x} $ is $ \mathbf{y}$.