# Measure Theory/Monotone Functions Differentiable
## Monotone Functions
### Differentiable A.E.

Although a monotonically increasing function might fail to be differentiable at uncountably many points, the next-best thing would be for the set of "failure points" to have measure zero. That is to say, we might instead hope that a monotonically increasing function is differentiable almost everywhere.
Indeed this turns out to be true! However, it will require a significant journey to prove that it is true.
* Exercise 1. Not Just Monotone
* Recall that every function of bounded variation can be decomposed into a difference of two monotonically increasing functions. Now assume that every monotone function is differentiable a.e. Prove that every function of bounded variation is differentiable a.e.
Assume throughout this lesson that $f:[a,b]\to {\mathbb {R}}$ is monotonically increasing on the compact interval [a,b].

### Where the Upper Derivative Is Infinite

One way in which the derivative may fail to exist at x is for $D^{+}f(x)=\infty$. We will prove first that the set of all points at which this happens is null.
To approximate this set, we first define the set $E_{c}=\{x\in (a,b):c\leq D^{+}f(x)\}$, which is effectively the set of points at which the upper-right derivative is "large".
We would like to show that $E_{c}$ becomes small as c becomes large.
In order to do so, we can recall the mean value theorem, which tells us that $f'(x)={\frac {f(b)-f(a)}{b-a}}$ for some x in the interval, if f is differentiable on (a,b). If $c\leq f'(x)$ is a lower bound on this derivative, then $b-a\leq {\frac {1}{c}}(f(b)-f(a))$.
The left-hand side, b-a, is the measure of the set [a,b], which in our setting is like $\lambda (E_{c})$. Inspired by this, we will try to prove
    $\lambda (E_{c})\leq {\frac {1}{c}}(f(b)-f(a))$
Let $\varepsilon \in {\mathbb {R}}^{+}$ and consider the family of all intervals where the inequality holds.
    ${\mathcal {C}}=\{[r,s]\subseteq (a,b):f(s)-f(r)\geq c(s-r),{\text{ and }}r<s\}$
The reason for considering such a collection is that it may be easier to measure, as a collection of intervals, than the more "chaotic" set $E_{c}$. Of course to be "effective" we will need this collection to cover $E_{c}$.
Unfortunately the set ${\mathcal {C}}$ may not cover $E_{c}$, and if you set out to prove that it does, you will notice a difficulty in one step.
However, this difficulty is resolved if, instead of ${\mathcal {C}}$ we let $c'\in (0,c)$ and then define the collection
    ${\mathcal {C}}'=\{[r,s]\subseteq (a,b):f(s)-f(r)\geq c'(s-r)\}$
Then ${\mathcal {C}}'$ is a cover, as you will demonstrate in the exercise below.
Notice that if $x\in E_{c}$ then by definition $c'<c\leq D^{+}f(x)$ which puts some "space" between c' and $D^{-}f(x)$. Therefore there is some $h\in {\mathbb {R}}^{+}$ such that $c'<\sup _{0<t<h}\left\{{\frac {f(x+t)-f(x)}{t}}\right\}$, therefore there is some $0<t<h$ for which $c'<{\frac {f(x+t)-f(x)}{t}}$.
* Exercise 1. The Need for Space
* Use the observations above to prove that, for each $x\in E_{c}$ and for each $\delta \in {\mathbb {R}}^{+}$ there is some $I\in {\mathcal {C}}'$ such that $x\in I$ and $\ell (I)<\delta$. Hint: Consider the interval $[x,x+t]$.
However, there is even a problem with ${\mathcal {C}}'$. This collection will have a ton of pathological overlap between the various intervals which it contains.
Therefore, what we really seek is to select from it some finite, disjoint sub-collection which is close enough to $E_{c}$.

### Vitali Coverings

The kinds of concern above occurs often enough that it is worth handling generally.
Definition: cover in the sense of Vitali
Let $E\subseteq [a,b]$ be any subset, and ${\mathcal {F}}$ a collection of nondegenerate compact intervals. We say that ${\mathcal {F}}$ covers E in the sense of Vitali if the following two condition is met.
For any $x\in E$ then for every $\delta \in {\mathbb {R}}^{+}$ there exists an interval $I\in {\mathcal {F}}$ such that
1) $x\in I$
2) $\lambda (I)<\delta$.
* Exercise 2. Prove Vitali's Lemma
* Assume E has finite outer-measure and ${\mathcal {F}}$ covers E in the sense of Vitali. Show that for any $\delta \in {\mathbb {R}}^{+}$ there exists a finite disjoint sub-collection $\{I_{1},\dots ,I_{n}\}\subseteq {\mathcal {F}}$ such that
* $\lambda ^{*}\left(E\smallsetminus \bigcup _{k=1}^{n}I_{k}\right)<\delta$
* Here are some guiding steps.
* 1) Let ${\mathcal {O}}$ be an open set such that $E\subseteq {\mathcal {O}}$ and $\lambda ^{*}({\mathcal {O}})<\lambda ^{*}(E)+\delta$. (If it is not clear, then you may want to prove that such a set exists.)
* 2) Construct the collection ${\mathcal {F}}'\subseteq {\mathcal {F}}$ where $I\in {\mathcal {F}}'$ if $I\subseteq {\mathcal {O}}$. Argue that ${\mathcal {F}}'$ also covers E in the sense of Vitali.
* 3) Inductively construct a finite collection of $\{I_{k}\}_{k=1}^{n}\subseteq {\mathcal {F}}'$ by first picking an arbitrary $I=I_{1}\in {\mathcal {F}}'$.
* 4) Next construct, for each $1\leq m$ and collection $\{I_{k}\}_{k=1}^{m}$, the collection of all intervals in ${\mathcal {F}}'$ which are disjoint from all of the intervals so far.
* $\quad {\mathcal {F}}'_{m}=\left\{I\in {\mathcal {F}}':I\cap \bigcup _{k=1}^{m}I_{k}\right\}$
* Also construct the set of all lengths of these intervals in ${\mathcal {F}}'_{m}$ and argue that this is a nonempty set of real numbers bounded above, and therefore has a supremum, call it $s_{m}$. Infer that there is some $I_{m+1}\in {\mathcal {F}}'_{m}$ with $s_{m}/2<\ell (I_{m+1})$.
* 5) For each $1\leq m$ argue that $s_{m+1}<s_{m}/2$.
* 6) The path home should be not very hard to find from here.
* Exercise 3. Explain O
* Explain why the open set ${\mathcal {O}}$ was necessary in the proof above.
* Exercise 4. Actually There's More to Vitali's Lemma
* We have proved Vitali's Lemma for the purposes of proving our theorem about monotone functions. However, there is a further property that this finite collection, $\{I_{k}\}_{k=1}^{n}$, has which may prove useful later. We might as well observe and prove it now, while we're here.
* Prove that $E\subseteq \bigcup _{k=1}^{n}(5*I_{k})$. Recall that the notation $5*I_{k}$ means the interval with the same center as $I_{k}$ but five times the width.
* Suggestions for how to proceed: Let $x\in E$ and of course if $x\in \bigcup _{k=1}^{n}I_{k}$ then the proof is finished.
* 1) Observe that if $E\subseteq \bigcup _{k=1}^{n}I_{k}$ then the proof is finished. Otherwise we only need to consider the case that $x\not \in \bigcup _{k=1}^{n}I_{k}$.
* 2) Infer that there is an $I\in {\mathcal {F}}_{n}'$ with $x\in I$.
* 3) Note that although we only took the intervals $I_{1},\dots ,I_{n}$ in the exercise above, the sequence of intervals continues beyond this. Argue that there must be some $I_{k}$ which intersects I. Hint: If this were false there would be a positive lower bound on the sequence $\langle s_{m}\rangle$. Call N the least index for which $I_{N}$ intersects I.
* 4) Argue that $\ell (I)<2\ell (I_{N})$ and infer that $x\in 5*I_{N}$.

### Finishing the Proof

Returning to the proof from before, use the fact that ${\mathcal {C}}'$ is a Vitali covering to construct a finite disjoint collection of intervals,
    $\{I_{1}=[r_{1},s_{1}],\dots ,I_{n}=[r_{n},s_{n}]\}$
such that $\lambda ^{*}\left(E_{c}\smallsetminus \bigcup _{k=1}^{n}I_{k}\right)<\varepsilon$.
* Exercise 5. Finish the Case for Infinity
* 1. Decompose $E_{c}$ into two parts, the part inside $\bigcup _{k=1}^{n}I_{k}$ and the part outside. Use subadditivity to infer that
* $\lambda (E_{c})<{\frac {1}{c'}}\sum _{k=1}^{n}(f(s_{k})-f(r_{k}))+\varepsilon \leq {\frac {1}{c'}}(f(b)-f(a))+\varepsilon$
* Then let $\varepsilon \to 0$ and $c'\to c$.
* 2. Now use the above, together with the continuity of measure, to conclude that the set of points at which the upper-left derivative is infinite.
* Then argue that the same is true for the lower-right, upper-left, and upper-right derivatives.

### Unequal Derivatives Almost Nowhere

We now go after the other way in which a function might fail to be differentiable, which is for the derivatives to be finite but unequal. Again we will focus initially on the right-handed side but will later generalize to the inequality of any of the derivatives.
That is to say, we will show that $\{x\in (a,b):D_{+}f(x)<D^{+}f(x)\}$ has measure zero. Very similar to the previous proof, we would like to build a countable sequence of sets which approximate this set and then use the continuity of measure at the end.
Just as before, we need a bit of space between the two derivatives (although this time we will look at what happens as the space becomes arbitrarily close to zero). Therefore we will define
    $E_{c,d}=\{x\in (a,b):D_{+}f(x)<c<d<D^{+}f(x)\}$
Let $\varepsilon \in {\mathbb {R}}^{+}$ and we will try to show that $E_{c,d}$ is small.
As in the previous part regarding where the derivatives go to infinity, we will leverage the Vitali Covering Lemma. It will help later if, moreover, this is situated inside of some open set.
* Exercise 6. Find O
* Show that there is an open set ${\mathcal {O}}$ such that $E\subseteq {\mathcal {O}}\subseteq (a,b)$ with the property that $\lambda ^{*}(E_{c,d})<\lambda ^{*}({\mathcal {O}})+\varepsilon$.
* Then define a collection of closed intervals that are each inside of ${\mathcal {O}}$, in a way analogous to what was done for the infinite derivative case. Argue that this is a cover in the sense of Vitali.
* Complete rest of the argument in a way that is strongly parallel to the proof for the case of infinity, until you reach
* $\lambda ^{*}(E_{c,d})\leq {\frac {1}{d}}\sum _{k=1}^{n}(f(s_{k})-f(r_{k}))+\varepsilon$
* and then justify and use the fact that $f(s_{k})-f(r_{k})\leq c\lambda ^{*}(E_{c,d})$.
* The path to the final result should not be very hard (nor very easy!) to find from here. But do your best.