We showed that all convex functions are continuous. Now let’s assume that we’ve got one that’s differentiable too. Actually, this isn’t a very big imposition. It turns out that a result called Rademacher’s Theorem will tell us that any Lipschitz function is differentiable “almost everywhere”.
Okay, so what does differentiability mean? Remember our secant-slope function:
Differentiability says that as we shrink the interval down to a single point the function has a limit, and that limit is .
So now take . We can pick a between them and points and so that . Now we compare slopes to find
so as we let approach and approach we find
And so the derivative of must be nondecreasing.
Let’s look at the statement a little more closely. We can expand this out to say
which we can rewrite as . That is, while the function lies below any of its secants it lies above any of its tangents. In particular, if we have a local minimum where then , and the point is also a global minimum.
If the derivative is itself differentiable, then the differential mean-value theorem tells us that since is nondecreasing. This leads us back to the second derivative test to distinguish maxima and minima, since a function is convex near a local minimum.