Solution (source code)

= Solution

Let $h=\widehat\theta-\theta^*$. The defining minimum for <graph total variation denoising>, compared with the feasible value $\theta^*$, gives $n^{-1}\|z-h\|_2^2+\lambda\|D\widehat\theta\|_1\leq n^{-1}\|z\|_2^2+\lambda\|D\theta^*\|_1$. Expand the squared <Euclidean norm> and cancel $\|z\|_2^2/n$ to obtain the <basic inequality for a penalized least-squares estimator>:
$$
\boxed{\frac{\|h\|_2^2}{n}\leq\frac2n\langle z,h\rangle+\lambda\|D\theta^*\|_1-\lambda\|D\widehat\theta\|_1.}
$$