Theorem. A twice continuous differentiable function $f:\mathbb{ R } ^n \mathbb{ R } ightarrow \mathbb{ R } $ is convex if and only if ∇2f(x)⪰0 for x∈Rn.
Proof. We use that fact that f is convex iff f(y)≥f(x)+∇f(x)T(y−x) for all y,x∈Rn.
If: For x,y∈Rn, exists z=λx+(1−λ)y, where λ∈[0,1], such that (by Taylor series expansion and Lagrange reminder)
Since ∇2f(x) is continuous, ∀ϵ>0,∃δ>0, such that ∀z∈B(x,δ), it holds that
∥∇2f(z)−∇2f(x)∥F≤ϵ2/n4
where ∥A∥F≐Tr(ATA) for A∈Rn×n. Note that ∥A∥F≤ϵ2/n4 implies that Ai,j≥−ϵ/n2.
Without lose of generality, suppose that s≐y−x is a unit vector. Then x+δs∈B(x,δ), and z∈[x,x+δs]⊂B(x,δ) (where [x,x+δs] is the line segment between x and x+δs). It follows: