# Why does the second derivative of convex function exist almost everywhere?

Let $$f: I\to \mathbb{R}$$ be a convex function.

Why does the second derivative of $$f$$ exist almost everywhere?

By searching I knew that is Alexandrov theorem, but I didn't find the proof...

My try

For $$x_1 where function is defined , we have $$\frac{f(x)-f(x_1)}{x-x_1}\le\frac{f(x_2)-f(x_1)}{x_2-x_1}\le\frac{f(x_2)-f(x)}{x_2-x}$$ Considering $$x_1\to x^-$$ and $$x_2\to x^+$$, we can conclude that $$f_-'(x)$$ and $$f_+'(x)$$ exist and $$f_-'(x)\le f_+'(x)$$. (in this process we only need $$\frac{f(x)-f(x_1)}{x-x_1}\le\frac{f(x_2)-f(x)}{x_2-x}$$)

Considering $$x\to x_1$$ and $$x\to x_2$$, we can conclude that $$f_+'(x_1)\le \frac{f(x_2)-f(x_1)}{x_2-x_1} \le f_-'(x_2)$$

So we get that $$f_-(x)$$ and $$f_+(x)$$ exist and both are monotonically increasing.
In addition, $$f_-'(x)\le f_+'(x)$$.

Because monotone functions only have jump discontinuities and are continuous everywhere except countably many points, we can conclude that $$f'$$ exists everywhere except countably many points.

How to move on? Any hints? Thank you in advance!

• I believe you want to show that the closure of the set of points where $f$ is not differentiable is still countable. Then using the monotonicity of $f'$ you can probably show that $f''$ exists almost everywhere. – SmileyCraft Dec 24 '18 at 15:29
• @SmileyCraft Could you give me some hints about how to show $f''$ exists almost everywhere through using the monotonicity of $f'$? I got stuck on that... – Zero Dec 24 '18 at 15:50
• Have you tried to show already that the closure of the set of points where $f$ is not differentiable is countable? Because then I believe you can find a countable set of open intervals where $f$ is differentiable, such that the union has a countable complement. Using the monotonicity of $f'$ you can show that on every interval the set of points where $f'$ is not differentiable is countable. – SmileyCraft Dec 24 '18 at 15:55
• @SmileyCraft Thank you very much! I just realized that if $f$ is a monotonic function defined on an interval $I$ then $f$ is differentiable almost everywhere on $I$ , from which I can arrive at the conclusion – Zero Dec 24 '18 at 16:04
• This is not correct , convex functions can be nondifferentiable on a dense subset of $R$. – Red shoes Dec 25 '18 at 2:01