# Measure Theory/L2 Inner Product, Norm, Space, Distance
## The End?

We started off wanting to interchange the limit and integral. We were thereby sent down a path of inventing a new system of integration, which required a new system of measurement.
It was not easy, but we slayed every dragon and then some. Just when we thought the bad guy was dead, we needed to re-prove the FTC. But now that too is finished.
The course should be finished, right? Why is this here?
Well of course mathematics never ends, and it is standard to discuss $L^{p}$ spaces in a first course on measure theory.
And this is for good reason, too. In this lesson we will see several of the problems which motivate the study of $L^{1}$ and $L^{2}$ in particular. The more general $L^{p}$ spaces are then just a convenient and easy generalization of $L^{1},L^{2}$.

#### Fourier Series

A lot of the story of why we will study what are about to study, originates in Fourier series. As before, the question remains finding conditions in which the Fourier series converges to its function.
It would take too long and be too much of a distraction to trace all of the historical developments. Eventually it became apparent that one could ensure the convergence of a Fourier series to its function, by in some sense measuring "the distance between functions". Then for a sequence of functions, $\langle f_{n}\rangle$, we can define a notion of the sequence converging, if the distances between them goes to 0 in the limit.
Riesz in 1907 realized that a very productive idea would be to define
    $\left(\int _{(a,b)}(f-g)^{2}\right)^{1/2}$
as the distance between the functions f and g.
It is no accident that this looks a whole lot like the Euclidean distance measurement for vectors. For the vectors ${\vec {v}}={\begin{bmatrix}v_{1}\\v_{2}\\\vdots \\v_{n}\end{bmatrix}},{\vec {w}}={\begin{bmatrix}w_{1}\\w_{2}\\\vdots \\w_{n}\end{bmatrix}}$ the distance between them is
    $\left(\sum _{k=1}^{n}(v_{k}-w_{k})^{2}\right)^{1/2}$
In a way, the distance between functions is hardly different from the distance between vectors, but for changing out the sum for the "smooth sum" which is the integral.
In fact one can define a concept even more fundamental than distance, which is a norm. For Euclidean space, the norm is $\|{\vec {v}}\|=\left(\sum _{k=1}^{n}v_{k}^{2}\right)^{1/2}$, which one can think of as measuring "the magnitude of a vector". Then the distance between ${\vec {v}}$ and ${\vec {w}}$ is then the magnitude of the difference,
    $\|{\vec {v}}-{\vec {w}}\|$
In fact, even the distance can itself be defined in terms of a more fundamental object, the inner product. In the context of vectors this is often called the "dot" product.
    ${\vec {v}}\cdot {\vec {w}}=\sum _{k=1}^{n}v_{k}w_{k}$
Then we can use the dot product to express the norm
    $\|{\vec {v}}\|=({\vec {v}}\cdot {\vec {v}})^{1/2}$
Inspired by all of these ideas, we set out a few definitions.

## L$^2$

Definition: inner product, norm, L$^2$(E), distance
Let $E\subseteq {\mathbb {R}}$ and for any two measurable functions $f,g:E\to {\mathbb {R}}$ we define the L$^2$ inner product by
    $\langle f,g\rangle =\int _{E}fg$
if this exists. We define the L$^2$ norm by
    $\|f\|_{2}=\langle f,f\rangle ^{1/2}$
if this exists.
We define the set ${\mathcal {L}}^{2}(E)$ as the set of all functions on E with finite norm,
    ${\mathcal {L}}^{2}(E)=\{f:\|f\|_{2}<\infty \}$
We define $L^{2}(E)$ as the set of equivalence classes of all functions in ${\mathcal {L}}^{2}(E)$ which are equal a.e.
We define the L$^2$ distance between f and g as the norm of the difference,
    $d(f,g)=\|f-g\|_{2}$
* Exercise 1. L$^2$ Makes Sense
* We intend to work with $L^{2}(E)$ because, for most of our purposes, two functions which are equal a.e. are as equal as we need them to be.
* On the other hand, our definitions for the inner product, norm, and distance, are all defined for functions and not equivalence classes of functions -- that is to say, they are defined on ${\mathcal {L}}^{2}(E)$ and not $L^{2}(E)$.
* Write down reasonable definitions for the inner product, norm, and distance on $L^{2}(E)$ and then prove that your definitions are well-defined.
The above exercise essentially shows that we do not usually need to be too concerned about whether we are talking about ${\mathcal {L}}^{2}(E)$ or $L^{2}(E)$, since we can easily relate them to each other.
Therefore in general we will talk about a function, $f\in L^{2}(E)$ and not emphasize that what this really is, is an equivalence class of functions. This will effectively be short-hand for taking a class, and then an arbitrary function from that class. What we show about it will in turn be short-hand for what is true about any function in that class.
In the few moments when this matters, we will point out that we are actually talking about equivalence classes -- but in all other settings, we will ignore this technicality.

## The Goal of This Section

I like to frame every section of this course with some sense of a goal toward which we are striving, as you may have noticed.
The goal of this section is inspired by Fourier series details that we cannot fully describe without getting too distracted. But the bottom line is that we would like to consider a sequence of functions $\langle f_{n}\rangle$. If this sequence of functions becomes "eventually close", then we would like to know that there is a function f to which the sequence converges (pointwise),
    $f_{n}{\overset {p.w.}{\to }}f$
That is to say, we would like to consider any sequence with the following property. For every $\varepsilon \in {\mathbb {R}}^{+}$ there exists a natural number $1\leq N$ such that for all $N\leq m,n$
    $d(f_{m},f_{n})<\varepsilon$
For any such sequence, we would like to know that it pointwise converges to some function f. Moreover, we would like to know some properties that f has, like whether it is measurable, integrable, and so on.

### Cauchy Convergence and Completeness

Notice that the above, if it were stated for sequences of real numbers, would just be the Cauchy condition for sequences of real numbers. Hopefully the reader recalls that, in introductory real analysis, it was a very valuable property for a sequence of real numbers satisfying the Cauchy condition, it to converges to a real number.
This is the so-called "completeness" of the real numbers. Recall that it's a valuable property, and it contrasts with the rational numbers which are not complete: there exist Cauchy sequences of rational numbers which do not converge to any rational number.
The entire conversation about completeness really only makes sense when one has a well-defined set of objects. In introductory analysis we consider the sets of rational and real numbers. Now we are concerned with a set of functions.
From the above considerations, it makes sense to consider the set $L^{2}(E)$ as our set, which now replaces ${\mathbb {Q}}$ and ${\mathbb {R}}$ in earlier discussions about completeness. Since we are interested in Cauchy sequences of functions in $L^{2}(E)$, it is natural to wonder whether such a sequences converges to a function which is in $L^{2}(E)$.
That is to say, the goal of this section is primarily to prove that $L^{2}(E)$ is complete, in the sense described above.