# Why is the set of subgradients a convex set?

I'm struggling to understand an example we were given. The problem description is:

Let $f$ be a convex function in $E^n$. Prove that the set of subgradients of $f$ in a given point form a ... convex set.

I have the solution, but don't really understand it. According to my intuition, the set of subgradients form a non-convex set of the points in areas marked $y$ in the following picture:

What am I missing here? Thanks.

-

## 1 Answer

Your intuition is wrong. Do you know the definition of subgradient?

In your picture, the subgradients are not the points in the region of the plane marked $y$, they are the slopes of the lines through $(x_0, f(x_0))$ in that region.

-
Alright, so the convexity is due to an individual straight line being convex? Ie. the object we're inspecting here are the lines, not the plane. Am I understanding this correctly? –  tsiki Dec 21 '12 at 14:10
The "objects" are the slopes of the lines. The convexity is due to the fact that the constraints on the slopes are linear inequalities, and the solution sets of linear inequalities are convex. –  Robert Israel Dec 21 '12 at 19:41