Given the fuction $f: R^n \times R^n \longrightarrow R$ defined by $$f(x, y): = \frac{1}{2} \| x - y \|^2_2$$ Is $f$ a convex function?
My take:
I know norm functions are convex and so I will show that the Hessian is positive semi definite.
Let $\frac{1}{2} \| x - y \|^2_2 = \frac{1}{2} \| 1^\top x - 1^\top y \|^2_2$ so that
$\nabla h(x) = (1^\top x - 1^\top y)$ and
$\nabla^2 h(x) = 1^\top \succeq 0$
I am not sure whether my steps are legit. Any help will be apprciated.
I don't really know what you did there, but it should be convex, in fact:
for all $t\in [0,1]$ and since the real plane is convex, $$f(t(x_1,y_1)+(1-t)(x_2,y_2))=f(tx_1+(1-t)x_2,ty_1+(1-t)y_2)=$$ $$= \frac{1}{2}||t(x_1-y_1)+(1-t)(x_2-y_2)||_2^2 \le$$ $$\le \frac{1}{2}||t(x_1-y_1)||_2^2 + ||(1-t)(x_2-y_2)||_2^2=$$ $$= \frac{1}{2}t^2||x_1-y_1||_2^2 + \frac{1}{2}(1-t)^2||x_2-y_2||_2^2\le$$ and since $0\le t,(1-t)\le 1$ we obtain the definition of convexity of a function: $$\le \frac{1}{2}t||x_1-y_1||_2^2 + \frac{1}{2}(1-t)||x_2-y_2||_2^2=$$ $$= tf(x_1,y_1) + (1-t)f(x_2,y_2)$$ Hope there are no mistakes.