Convex Functions


We’ve learned that convex sets create smooth, well-behaved landscapes for optimization. Now, let’s explore the functions that live on these landscapes: convex functions. These functions are the heart of many optimization techniques because they guarantee no traps, no false minima, and a single, clear path to the best solution.


What Is a Convex Function?

A function is convex if its graph curves upward—like a bowl. The key property of a convex function is that the line segment between any two points on the graph lies above or on the graph itself.

Formally:
A function f:RnR is convex if:

  1. The domain D(f) is a convex set.
  2. For all x,yD(f) and λ[0,1], the function satisfies:
f(λx+(1λ)y)λf(x)+(1λ)f(y)

This means that for any two points x and y, the function value at any weighted average of these points is at most the weighted average of the function values. In other words, the function does not "dip" between two points.

Strictly Convex Functions

A function is strictly convex if the inequality is strict for all distinct xy:

f(λx+(1λ)y)<λf(x)+(1λ)f(y)for all x,y and λ(0,1)

Strict convexity ensures uniqueness of the minimum—there is only ONE lowest point.

Let's compare the formal definitions of convex and strictly convex functions:

So we can observe that strict convexity is a stronger condition than convexity.

Strict convex.png

Geometric Interpretation

This guarantees that there are no multiple minima, which is a key reason why convex functions are fundamental in optimization.

(x, f(x))(y, f(y))f(λx + (1-λ)y)λf(x) + (1-λ)f(y)
this also called sometimes as chord rule.
The red dotted line is the chord between two points on the graph and it lies above the blue part of the graph.

Examples of Convex Functions

Figure 3.2 - Examples of multivariate convex functions.png
Examples of multivariate convex functions

Understanding convex functions is crucial for solving complex optimization problems efficiently! 🚀


Continuity of convex functions

A convex function is automatically continuous if its domain is open:

Theorem: If f is convex and its domain D(f) is open, then f is continuous.

Why is this true?


How to check if a function is convex using derivatives

First-order condition (gradient test)

If f is differentiable, it is convex if and only if:

f(y)f(x)+f(x)T(yx)for all x,y

Figure 3.3.png|600

What does this mean?


Second-order condition (Hessian test)

If f is twice differentiable, it is convex if and only if its Hessian matrix (second derivative) is positive semidefinite:

2f(x)0for all x

Explanation:

So, according to this test, a function f should has nonnegative second derivative (curvature) everywhere!

Bad curvature.png|600
this function is NOT a convex! We need only "+"


What's next?

What's next step of the operation?

After understanding the concept of convex functions, we can move on to exploring new things like: