# Measure Theory/Foundational Properties of Bounded Integrals
## Foundational Properties of Bounded Integrals

In this section we first prove that our definitions are consistent with each other. After all, when we write $\int _{E}\psi$, for a simple function $\psi$ on a finite measure set E, there are now two ways to understand what this means. The first is the definition as the integral of a simple function; the second is the definition of the integral of a bounded measurable function. If these two different definitions gave different values, we would have a problem. Therefore it is good to start by proving that the two are always equal and therefore it doesn't matter which interpretation we use at any moment.
The next thing we prove is that, in a sense, the bounded integrable functions just are the measurable functions. More explicitly, we will show that a function is measurable if and only if its integral "from above" equals the integral "from below". Besides being valuable in itself to help understand integrable functions, it's also a useful tool for later theorems, since it allows us to choose whichever is most convenient at any moment.
After that we prove that the Riemann and length-measure integrals "agree" on a particularly well-behaved class of functions: Those Riemann integrable on a closed and bounded interval.

### Consistency

Let $\psi =\sum _{i=1}^{n}c_{i}\mathbf {1} _{E_{i}}$ be a simple function in canonical form, defined on $E\in {\mathcal {M}}$ with $\lambda (E)<\infty$. Note that every simple function is always bounded. In this subsection, when we write $\int _{E}\psi$ we will assume this is the bounded integral, i.e. $\int _{E}\psi =\sup _{\varphi \leq \psi }\int _{E}\varphi$.

#### Exercise 1. Prove Simple-Bounded Consistency

Prove that $\sum _{i=1}^{n}c_{i}\lambda (E_{i})\leq \int _{E}\psi$ because the left-hand side is a simple function and $\psi \leq \psi$.
Prove that $\sum _{i=1}^{n}c_{i}\lambda (E_{i})\geq \int _{E}\psi$ because the left-hand side is an upper bound on the set of all $\int _{E}\varphi$ where $\varphi \leq \psi$ is a simple function. (Refer to an earlier result about simple functions.)

### Measurable Means Integrable

Usually "integrable" means that, no matter how the area under the curve is approximated, you always get the same answer "in the limit".
For Riemann integrals there are many options about how you perform each approximation: Left endpoints, right endpoints, suprema, infima, or any other point inside the partition cells. A function is integrable if, no matter which is used, the limit of the estimations is the same.
In our setting, we defined the integral "from below" by taking the supremum of all under-estimates of the area. That is to say, for $f:E\to {\mathbb {R}}$ with E and f bounded in the familiar way, and $\varphi$ a simple function,
    $\int _{E}f=\sup _{\varphi \leq f}\int _{E}\varphi$
This was an arbitrary choice, though, we could have used the integral "from above". This would be the infimum of all over-estimates of the area, like so.
    $\inf _{f\leq \psi }\int \psi ,\quad {\text{ where }}\psi {\text{ is simple}}$
Let's say that f is integrable on E when these two are equal. In this section, we will prove that the measurable functions are then precisely the same as the integrable functions.
Assume
* $f:E\to {\mathbb {R}}$ is bounded
* $E\in {\mathcal {M}},{\text{ and }}\lambda (E)<\infty$
Then we will prove that $\inf _{f\leq \psi }\int _{E}\psi =\sup _{\varphi \leq f}\int _{E}\varphi$ if and only if f is measurable.
Since f is bounded we let M be any such bound, $|f|\leq M$.

#### Exercise 2. Use Boundedness to Partition the Range

Fix any $1\leq n$ and for each $-n\leq k\leq n$, define $E_{k}=\left\{x:(k-1){\frac {M}{n}}\leq f(x)\leq k{\frac {M}{n}}\right\}$. This effectively splits the range of f into finer partitions, for each larger n, and the set is the kth preimage, so to speak.
Show that each $E_{k}$ is measurable, disjoint from all the others, and that they have union equal to E.
Infer that $\sum _{k=-n}^{n}\lambda (E_{k})=\lambda (E)$.

#### Exercise 3. Construct Simple Functions

Use the "bottom edge" of each $E_{k}$ to define a simple function $\varphi _{n}\leq f$ and the "top edge" to define a simple function $f\leq \psi$.
Prove that
    $0\leq \inf _{f\leq \psi }\int _{E}\psi -\sup _{\varphi \leq f}\int _{E}\varphi \leq {\frac {M}{n}}\lambda (E)$
whence we obtain the desired result.

#### Exercise 4. If Integrable then Measurable

Now suppose $\sup _{\varphi \leq f}\int _{E}\varphi =\inf _{f\leq \psi }\int _{E}\psi$.
Use this to construct a sequence of simple functions $\varphi _{n}\leq f\leq \psi _{n}$ such that for each n
    $\int _{E}\psi _{n}-\int _{E}\varphi _{n}<{\frac {1}{n}}$
Taking infima and suprema pointwise, construct functions $g,h$ such that
    $\varphi _{n}\leq g\leq f\leq h\leq \psi _{n}$

#### Exercise 5. Measure the Difference of Simple Functions

We would like to prove that $g=h$ but unfortunately this may not be true. You can even guess why: just imagine that they are equal everywhere except at a single isolated point. The integral would come out the same, and satisfy all of the conditions that we've named.
But this gives a clue as to what we might be able to prove instead. Rather than prove that they are equal everywhere, can we prove that they are equal almost everywhere? Given some of our earlier results about measurable functions, this would be enough to prove that f is measurable.
First, prove that if $g(x)\neq h(x)$ then $g(x)<h(x)$.
Next define
    $\Delta =\{x:g(x)<h(x)\}$
the set of differences, which we would like to prove has measure zero.
Intuitively, wherever there is a point of difference, it should be surrounded by a lot more points where there is no difference -- and this should remain true as you "zoom in on it". For instance, if there were a solid interval on which $g(x)<h(x)$ then the integral at the start would not be equal.
So in order to zoom in, for each positive rational $\nu \in \mathbb {Q} ^{+}$, we may define
    $\Delta _{\nu }=\{x:\nu <h(x)-g(x)\}$
1. Show that $\Delta _{\nu }\subseteq \{x:\nu <\psi _{n}(x)-\varphi _{n}(x)\}$ for every $1\leq n$.
2. Show that $\lambda (\{x:\nu <\psi _{n}(x)-\varphi _{n}(x)\})<{\frac {1}{n\nu }}$.
Hint: Call this set F. Use $\int _{E}\psi _{n}-\int _{E}\varphi _{n}<{\frac {1}{n}}$, and the inequality preserving property of simple integrals.
You will probably want the lemma $\int _{F}\nu =\nu \lambda (F)$ because $\nu$ is constant.
And also prove as a lemma $\int _{F}(\psi _{n}-\varphi _{n})\leq \int _{E}(\psi _{n}-\varphi _{n})$ which should follow quickly from $0\leq \psi _{n}-\varphi _{n}$ and $\int _{F}(\psi _{n}-\varphi _{n})=\int _{E}(\psi _{n}-\varphi _{n})\mathbf {1} _{F}$.
3. Infer the desired result.

### If Riemann then Length-measure

Let $[a,b]\subseteq {\mathbb {R}}$ be a closed and bounded interval, and $f:[a,b]\to {\mathbb {R}}$ a Riemann integrable function. We will now prove that f is therefore measurable and the length-measure integral $\int _{[a,b]}f$ equals the Riemann integral $\int _{a}^{b}f\ dx$.

#### Exercise 6. Steps Are Simple

Use the fact that every step function is a simple function to prove that
    ${\underline {\int }}_{a}^{b}f\ dx\leq \sup _{\varphi \leq f}\int _{[a,b]}\varphi$
where ${\underline {\int }}_{a}^{b}f\ dx$ is the lower Darboux integral.
Complete the rest of the proof by using the fact that, since we assume f is Riemann integrable then the lower and upper Darboux integrals are equal.

### "Get Your Hands Dirty" Exercises

Here are some exercises which are meant to not take too much time, and are designed to just get you working with the relevant concepts.

#### Exercise 7. Integrate on a Null Set

Let $E\in {\mathcal {M}}$ with $\lambda (E)=0$. Prove that $\int _{E}f=0$ no matter which bounded measurable function $f:E\to {\mathbb {R}}$ is used.
Use this to infer that $\int _{\mathbb {Q}}1=0$.

#### Exercise 8. Integrate x-squared

Compute $\int _{[0,1]}x^{2}$.