We wish to prove that if $f : K \to \Bbb R$ is a $\mathcal C^2$, convex function on a convex domain $K \subset \Bbb R^n$, then it has a positive semidefinite Hessian matrix on every point $x \in K$.
To do this, I have a proof by contradiction: we assume there's a point $\bar x \in K$ where the Hessian is not positive semidefinite. That should mean $$ \exists y \in \Bbb R^n : y^T \nabla^2f(\bar x) y < 0 $$ but then instead the proof seems to go on implying that $\bar x^T\nabla^2f(\bar x)\bar x < 0$, while this does not seem true in general.
Or is it?
And hence how would you write such a proof (by contradiction)?
I think the problem is a subtle issue with the meaning of "positive semidefinite Hessian matrix on every point $x \in K$".
The actual theorem should be:
So that the definiteness condition is stated for $K$. Now the negation of this fact is precisely that there exists an $\bar x \in K$ such that $$ \exists y \in K, \quad y^T\nabla^2(\bar x)y < 0. $$