Minimizer of a convex function. I found this result on some lectures about optimization:
.
Let $f : X \rightarrow \mathbb{R}$ a differentiable convex function. Then $x$ is a minimizer of $f$ if and only if
$$\langle x'-x,\nabla f(x)\rangle \ge 0 \qquad \forall x'$$
Shouldn't be $\langle x'-x,\nabla f(x)\rangle = 0 \quad \forall x'$, if $x$ is a minimizer of $f$?
 A: I'm assuming here that $\ X\ $ is an open convex subset of some finite dimensional Euclidean space $\ \mathbb{R}^n\ $ (although the result will also hold in more general cases too).
If $\ \left\langle x^\prime -x, \nabla f(x)\right\rangle\ge0\ $ for all $\ x^\prime\ $, then we get $\ \left\langle y, \nabla f(x)\right\rangle\ge0\ $ for any $\ y\ $ by taking $\ x^\prime=y-x\ $, and $\ \left\langle y, \nabla f(x)\right\rangle\le0\ $ by taking $\ x^\prime=-y-x\ $. Hence, the condition $\ \left\langle x^\prime -x, \nabla f(x)\right\rangle\ge0\ $ for all $\ x^\prime\ $ is equivalent to the condition $\ \left\langle y, \nabla f(x)\right\rangle=0\ $ for all $\ y\ $, or, equivalently, $\ \nabla f(x)=0\ $.  For a differentiable convex function, this is a necessary and sufficient for $\ x\ $ to be a minimiser of $\ f\ $.
A: 
Let $f : X \rightarrow \mathbb{R}$ a differentiable convex function. Then $x$ is a minimizer of $f$ if and only if
$$\langle x'-x,\nabla f(x)\rangle \ge 0 \qquad \forall x'$$

Note that this result holds for a general convex set $X$. A proof can be found in this answer.

Shouldn't be $\langle x'-x,\nabla f(x)\rangle = 0 \quad \forall x'$,
if $x$ is a minimizer of $f$?

You were probably thinking about the common optimality condition for unconstrained problem (e.g. when $X=\mathbb{R}^n$), in which case $\nabla f(x) = 0$. It turns out that this result even holds for a general open convex set $X$.
Indeed, if $X$ is open, then for $\epsilon > 0$ small enough, both $x+\epsilon\nabla f(x)$ and $x-\epsilon\nabla f(x)$ belongs to $X$. Replacing $x'$ in $\langle x'-x,\nabla f(x)\rangle \ge 0$ with these two vectors in turn, we obtain $\epsilon \nabla f(x) \ge 0 \ge \epsilon \nabla f(x)$, which means $\nabla f(x) = 0$.
