# What does it mean for the Hessian of a convex function to be positive semidefinite?

Given a twice-differentiable function $f: \mathbb{R}^n \to \mathbb{R}$, $f$ is convex iff $\nabla ^2 f(x) \succeq 0, \forall x \in \text{dom} f$.

This is the definition given on these sets of notes https://www.seas.ucla.edu/~vandenbe/ee236b/lectures/functions.pdf

But I feel like something is missing in the definition...

What does it mean for $\nabla ^2 f(x) \succeq 0$?

Does it mean:

1. $y^T\nabla ^2 f(x)y \geq 0, \forall y \in \text{dom} f$ or...

2. $y^T\nabla ^2 f(x)y \geq 0, \forall y \in \mathbb{R}^n$

• The latter. $\nabla^2 f(x)$ is some matrix, and this is a condition on that matrix. – Qiaochu Yuan May 22 '17 at 7:09
• Answer 2. The matrix has to be positive semi-definite, and the definition for that applies $\forall y\in \mathcal(R)$ – Evargalo May 22 '17 at 7:10

$$x \succeq y \iff x_i \ge y_i \quad (i \in \{ 1, \dotsc, n \}) \\ X \succeq Y \iff X - Y \text{ is positive semidefinite}$$
The Hessian of a function is a symmetric matrix, and so the usual definition of positive semidefiniteness applies. A symmetric matrix $A\in M_{n\times n}(\mathbb{R})$ is positive semidefinite provided that for all $y\in\mathbb{R^n}$ we have $y^TAy \geq 0$. Replacing $A$ with $\nabla ^2f(x)$ gives us your second definition.