\documentclass[12pt]{article}%{amsart}
\usepackage{multirow,amssymb,amsmath,amsthm,color,xcolor,framed,graphicx,sidecap,fp}

\textwidth5.8in
\textheight8.75in \oddsidemargin.25in \topmargin0in

%\renewcommand{\baselinestretch}{2.0}
%\newsavebox\thmbox

\newcount\cnt \cnt=1
\newcount\ccnt \ccnt=0
\newdimen\xpos
\newdimen\xlen
\newcount\cnti
\makeatletter
\def\onestep#1{\advance\ccnt by1 }
%%%%%%%%%%%% main macro %%%%%%%%%%%%%%%%%%%
% get a string composed with 0 and  1.  If 1 a line is drawn.
% The string  is stored in \tmp
% the length of the string is  stored in \ccnt
\def\scan#1#2\end{%
\def\aux{#1}%
\ifx\aux\empty
\else
  \ifnum #1=1
    \ifnum\ccnt=0  \def\tmp{101}%
    \else
       \expandafter\def\expandafter\tmp\expandafter{\tmp 101}%
    \fi
    \else
       \expandafter\def\expandafter\tmp\expandafter{\tmp 000}%
  \fi
  \def\aux{#2}%
  \onestep{#1}%
  \ifx\aux\empty
  \else
     \scan#2\end
  \fi
\fi
\gdef\compteur{\the\ccnt}%
}%
%%%%%%%%%%%%% draw a line %%%%%%%%%%%%%%%%%%
\def\scandraw#1#2\end{%
\def\aux{#1}%
\ifnum #1=1
     \put(\strip@pt\xpos,0){\line(1,0){\strip@pt\xlen}}%
      \advance\xpos by \xlen
  \else
      \advance\xpos by \xlen
\fi
\def\aux{#2}%
\ifx\aux\empty
\else
   \scandraw#2\end
\fi
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\cantor#1#2{%
\xpos=0pt \xlen=#2
\noexpand\def\tmp{1}
\ifnum #1>1
  \cnti=1
  \loop
    \ccnt=0
    \expandafter\scan \tmp\end
    \advance\cnti by 1 %
    \ifnum \cnti<#1
  \repeat
   \FPeval{\tmpxlen}{\strip@pt\xlen/(3*\compteur)}%
   \xlen=\tmpxlen pt
\fi
\begin{picture}(0,15)
 \expandafter\scandraw \tmp\end
\end{picture}
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother








\newtheorem{theorem}{Theorem}[section]
\newtheorem*{theorem0}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem*{lemma0}{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}

\newtheoremstyle{mydefinition}{}{}{\normalfont}{0pt}{\scshape}{.}{.5em}{}

\theoremstyle{mydefinition}
\newtheorem{definition}[theorem]{Definition}

\newtheoremstyle{myexercise}{}{}{\footnotesize\normalfont}{0pt}{\footnotesize\scshape}{.}{.5em}{}

\definecolor{exclr}{rgb}{1,1,0.8}
\theoremstyle{myexercise}
\newtheorem{exercise}{Exercise}

\newtheoremstyle{myexample}{}{}{\small\normalfont}{0pt}{\small\scshape}{.}{.5em}{}

\theoremstyle{myexample}
\newtheorem{example}{Example}

\def\card{{\rm card}}
%\setlength{\leftbarwidth}{5pt}
%\setlength{\leftbarsep}{8pt}

%\newcommand*{\leftbarcolorcmd}{\color{leftbarcolor}}% as a command to be more flexible
%\colorlet{leftbarcolor}{blue}


%\theoremstyle{mydefinition}
%\theoremstyle{definition}{}{}{\normalfont}{0pt}{\scshape}{.}{.5em}{}
%\newtheorem{definition}[theorem]{Definition}

\definecolor{defclr}{rgb}{0.85,0.95,1}
\newcommand{\mydefinition}[1]{\noindent\colorbox{defclr}{\parbox{\textwidth}{\begin{definition}{#1}\end{definition}}}\smallskip}

\definecolor{tmclr}{rgb}{1,0.9,0.9}
\newcommand{\mylemma}[1]{\noindent\colorbox{tmclr}{\parbox{\textwidth}{\begin{lemma}{#1}\end{lemma}}}\smallskip}
\newcommand{\mytheorem}[1]{\noindent\colorbox{tmclr}{\parbox{\textwidth}{\begin{theorem}{#1}\end{theorem}}}}
\newcommand{\mycorollary}[1]{\noindent\colorbox{tmclr}{\parbox{\textwidth}{\begin{corollary}{#1}\end{corollary}}}\smallskip}
\newcommand{\myproposition}[1]{\noindent\colorbox{tmclr}{\parbox{\textwidth}{\begin{proposition}{#1}\end{proposition}}}\smallskip}

\definecolor{exclr}{rgb}{1,1,0.7}
\newcommand{\myexercise}[1]{\noindent\colorbox{exclr}{\parbox{\textwidth}{\begin{exercise}{#1}\end{exercise}}}}

\definecolor{exaclr}{rgb}{0.8,1,0.8}
\newcommand{\myexample}[1]{\noindent\colorbox{exaclr}{\parbox{\textwidth}{\begin{example}{#1}\end{example}}}}

\definecolor{barclr}{rgb}{1,0.6,0.4}

\renewenvironment{leftbar}[1][\hsize]
{%
\def\FrameCommand
{%

    {\hspace{-2pt}\color{barclr}\vrule width 1pt}%
    \hspace{3pt}%must no space.
    \fboxsep=\FrameSep%\colorbox{lightgray}%
}%
\MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}%
}
{\endMakeFramed}
\setlength{\FrameSep}{0pt}


%\newcommand{\myproof}[1]{\textcolor[gray]{0.7}{\begin{leftbar}{\noindent\textcolor{black}{\colorbox{prfclr}%
%{\parbox{\textwidth}{\emph{Proof}. {#1} \qed\medskip}}}}\end{leftbar}}}

\newcommand{\myproof}[1]{\begin{leftbar}\noindent%\colorbox{prfclr}%
\emph{Proof}. {\small {#1}} \qed\medskip\end{leftbar}}

\definecolor{topclr}{rgb}{1,0.9,0.7}
\newcommand{\topic}[2]{\medskip\noindent\colorbox{topclr}{\parbox{\textwidth}{\textbf{#1}.
{#2}}}\medskip}

\def\note{\noindent$\ \ \bullet$~}

\def\tab{{~~~~~}}

\def\IR{{\mathbb R}}
\def\IN{{\mathbb N}}
\def\IZ{{\mathbb Z}}
\def\IQ{{\mathbb Q}}
\def\IC{{\mathbb C}}
\def\IF{{\mathbb F}}
\def\IM{{\mathbb M}}
\def\IP{{\mathbb P}}
\def\la{{\langle}}
\def\ra{{\rangle}}
\def\cO{{\mathcal O}}
\def\bi{{\mathbf i}}
\def\muo{{\mu}^\ast}
\def\mui{{\mu}_\ast}
\def\fB{{\mathfrak B}}
\def\fC{{\mathfrak C}}
\def\fE{{\mathfrak E}}
\def\fF{{\mathfrak F}}
\def\fG{{\mathfrak G}}
\def\fL{{\mathfrak L}}
\def\fM{{\mathfrak M}}
\def\fN{{\mathfrak N}}
\def\fU{{\mathfrak U}}
\def\cE{{\mathcal E}}
\def\cF{{\mathcal F}}
\def\cL{{\mathcal L}}
\def\cM{{\mathcal M}}
\def\cN{{\mathcal N}}
\def\cJ{{\mathcal J}}
\def\cJu{\bar{\mathcal J}}
\def\cJl{\underline{\mathcal J}}
\def\bm{{\mathbf m}}
\def\bf{{\mathbf f}}
\def\bg{{\mathbf g}}
\def\Area{{\rm Area}}

\def\beq{\begin{equation}}
\def\eeq{\end{equation}}

\def\pt{{$\bullet$~}}
\def\ptt{{$\circ$~}}
\def\pttt{{$\diamond$~}}
\def\num[#1]{{\textbf{(#1)}~}}
\def\tab{{~~~~~}}
\def\fsigma{{\emph{$\sigma$}}}
\def\intmu[#1][#2]{{\int_{#1}#2\,d\mu}}
\def\intm[#1][#2]{{\int_{#1}#2\,d\textbf{m}}}
\def\intphi[#1][#2]{{\int_{#1}#2\,d\varphi}}
\def\re{{\texttt{Re}\,}}
\def\im{{\texttt{Im}\,}}
\def\Arrow{{ ~~ \Longrightarrow ~~ }}
\def\ArrowN[#1]{{\stackrel{\rm #1}{\Arrow}}}
\def\EqN[#1]{{ \ \stackrel{\rm #1}{=} \ }}
\def\LEqN[#1]{{ \stackrel{\rm #1}{\leq} }}
\def\GEqN[#1]{{ \stackrel{\rm #1}{\geq} }}
\def\snote[#1]{{\begin{scriptsize}#1\end{scriptsize}}}
\def\ForAll[#1]{{ ~\snote[($\forall #1$)]}}
\def\GotoInf[#1]{{ ~\snote[($#1 \to \infty$)]}}

\makeatletter
\renewcommand{\section}{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\large\bfseries}}
\renewcommand{\subsection}[1]{\@startsection{subsection}{2}{\z@}%
    {-2.5ex\@plus -1ex \@minus -.2ex}%
    {-.0em}
    {\reset@font\bfseries}{\!\!#1}{$ $}}
\makeatother


\numberwithin{equation}{section}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}

\begin{document}

\begin{center}
{\Large \textbf{Real Analysis}} \\
{Dr Nikolai Chernov}
\end{center}

\section*{Introduction}


To compute a definite integral $\int_a^b f(x) \, dx$ in calculus, we
divide the interval $I=[a,b]$ into small subintervals $I_1,\ldots,I_n$
are approximate
$$
   \int_a^b f(x) \, dx \approx \sum_{i=1}^n f(x_i)\, |I_i|,
$$
where $|I_i|$ denotes the length of $I_i$ and $x_i$ is any point in
$I_i$. The limit, as the lengths of $I_i$'s approach zero, gives the
exact value of $\int_a^b f(x) \, dx$.

In mechanics, $f(x)$ is the density (mass per unit length) of a rod
$[a,b]$ and the definite integral $\int_a^b f(x) \, dx$ is the total
mass of the rod. In probability theory, $f(x)$ is the density of a
probability distribution and $\int_a^b f(x) \, dx$ is the total
probability of the interval $[a,b]$.

Similarly, to compute a double integral $\iint_R f(x,y)\, dx\, dy$ over
a rectangle $R=[a_1,b_1]\times [a_2,b_2]$ we partition $R$ into small
subrectangles $R_1,\ldots,R_n$ and approximate
$$
   \iint_R f(x,y) \, dx\, dy \approx \sum_{i=1}^n f(x_i,y_i)\, \Area(R_i),
$$
where $(x_i,y_i) \in R_i$. If $f(x,y)$ is the density (mass per unit
area) of a rectangular plate $R$, then the definite integral $\iint_R
f(x,y)\, dx\, dy$ is the total mass of the plate. If $f(x,y)$ is the
density of a probability distribution, then $\iint_R f(x,y)\, dx\, dy$
is the total probability of the rectangle $R$.

In the studies of probabilities, we often need to replace a 1D interval
or 2D rectangle with other objects that can be more complicated. So it
becomes necessary to generalize the notion of definite integral.

What is common between the above two examples? A function $f$ has a
domain $D$ (an interval or a rectangle) that can be divided into
smaller pieces $D_i$, and each piece is measured by a positive number
(its length or area), the smaller the piece the smaller its measure.
The measure of the whole domain $D$ is the sum of measures of its
pieces, i.e.,
$$
        \mu(D) = \sum_{i=1}^n \mu(D_i)
$$
where $\mu$ denotes that measure (the length or area). Then the
integral can be approximated by
$$
           \sum_{i=1}^n f(z_i)\, \mu(D_i)
$$
where $z_i$ is a point in $D_i$.

The purpose of Real Analysis is to develop a machinery (a theoretical
apparatus) for integrating functions on arbitrary domains. We will
generalize the ``length of a line interval'' and the ``area of a
rectangle'' to an abstract notion of a ``measure of an arbitrary set''.
And we will learn how to integrate functions on arbitrary domains.

The following chart summarizes the basic goals and terms of Real
Analysis:

\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline  1D & 2D & & General \\
\hline\hline  Interval $I$ & Rectangle $R$ & $\Longrightarrow$ & Space $X$ \\
     \hline   Length & Area & $\Longrightarrow$ & Measure $\mu$ \\
   \hline Integral & Double integral & \multirow{2}{*}{$\Longrightarrow$} & Lebesgue integral \\
        $\int_a^bf\, dx$ & $\iint_R f(x,y)\, dx\, dy$ &  & $\int_X f\, d\mu$\\ \hline
\end{tabular}\vspace*{0.2cm}
\end{center}

The theory of (abstract) measures and Lebesgue integration provides
a solid foundation for modern Probability Theory. A good knowledge
of Real Analysis is an absolute must for anyone who plans to do
research in Dynamical Systems or Mathematical Physics.

\newpage

\tableofcontents

\newpage

%*****************************************************************************

\section{Lebesgue measure in $\IR$ and $\IR^2$: basic constructions}
\label{SecLMR2}

\mydefinition{An \textbf{interval} $I \subset \IR$ is a set of the form
$[a,b]$ or $[a,b)$ or $(a,b]$ or $(a,b)$, where $a \leq b$ are real
numbers. Its length is $|I| = b-a$.}

\noindent $\ \ $\pt Including or excluding the endpoints of the
interval does not affect its length. \medskip

\noindent $\ \,$\pt {\small Notation: $A\uplus B$ always means
\emph{disjoint union} of two sets $A$ and $B$, i.e., such that
$A\cap B=\emptyset$. Furthermore, $\uplus_{n=1}^{\infty} A_n$ always
means the union of pairwise disjoint sets $A_n$, i.e., such that
$A_n\cap A_m=\emptyset$ for all $m\neq n$.}

\mylemma{If $I = \uplus_{n=1}^N I_n$, then $|I| = \sum_{n=1}^N
|I_n|$.\label{LmIn}}

\myproof{If $N=2$ and $c$ is the common endpoint of $I_1$ and $I_2$,
then $|I_1|+|I_2|=(b-c)+(c-a)=b-a=|I|$. For $N\geq 2$ use induction.}

\mydefinition{A (linear) \textbf{elementary set} is a finite union
of disjoint intervals, i.e., $J = \uplus_{n=1}^N I_n$. The total
length of $J$ is $|J| = \sum_{n=1}^N |I_n|$.}

\pt $I_n$ are not necessarily adjacent intervals, there may be gaps
in between.

\mydefinition{A \textbf{rectangle} $R \subset \IR^2$ is a set of the
form $R = I_1 \times I_2$, where $I_1, I_2$ are intervals. The area
of a rectangle is $\Area(R) = |I_1| \times |I_2|$.}

\pt We only consider rectangles with two horizontal and two vertical
sides.

\pt Including or excluding the sides of the rectangles does not
affect their areas.

\mylemma{If $R = \uplus_{n=1}^N R_n$, then $\Area(R) = \sum_{n=1}^N
\Area(R_n)$. \label{LmRRR}}

\myproof{For $N=2$ the proof is a trivial calculation. For $N\geq 2$
we first need to extend the sides of $R_n$'s so that they run
completely across $R$ (see Fig.~\ref{Fig1}). This causes
partitioning of some of the $R_n$'s into smaller rectangles, which
can be done one by one and using the already proved version of the
lemma for $N=2$. In the end we get a partition of $R$ by $k_1\geq 1$
vertical lines and $k_2\geq 1$ horizontal lines (like a grid). Now
the proof is a simple calculation using Lemma~\ref{LmIn}.}

\begin{SCfigure*}[5][h] \label{Fig1}
  \centering
  \includegraphics[width=1.6in]{Fig1.eps}
  \caption{{\small A partition of a rectangle into smaller rectangles (solid lines).
Inner sides are extended (dashed lines) so that they run completely
across $R$ (from top to bottom and from left to right).}}
\end{SCfigure*}

\mydefinition{A (planar) \textbf{elementary set} is a finite union of
disjoint rectangles, i.e.\ $B = \uplus_{i=1}^n R_i$. The area of an
elementary set is $\Area (B) = \sum_{i=1}^n \Area (R_i)$. }

\mytheorem{{\rm (a)} The length of a linear elementary set does not
depend on how it is partitioned into disjoint intervals.\\
{\rm (b)} The area of a planar elementary set does not depend on how it
is partitioned into disjoint rectangles.}

\myproof{We prove part (b). Let $B = \cup_{i=1}^n R_i$ and $B =
\cup_{j=1}^m R_j'$ be two partitions of an elementary set $B$ into
rectangles. Note that for each pair $i,j$ the intersection $R_{ij} =
R_i \cap R_j'$ is a rectangle (which maybe empty). Now by
Lemma~\ref{LmRRR}
$$
  \sum_{i=1}^n\Area(R_i)\stackrel{\ref{LmRRR}}{=}\sum_{i=1}^n\sum_{j=1}^m\Area(R_{ij})=
  \sum_{j=1}^m\sum_{i=1}^n\Area(R_{ij})\stackrel{\ref{LmRRR}}{=}\sum_{j=1}^m\Area(R_{j}').
$$
The easier part (a) is left as an exercise.}

\mycorollary{\label{CrBBB} {\rm (a)} If $J=\uplus_{i=1}^n J_i$ is a
finite union of disjoint linear elementary sets, then $|J| =
\sum_{i=1}^n
|J_i|$.\\
{\rm (b)} If $B=\uplus_{i=1}^n B_i$ is a finite union of disjoint
planar elementary sets, then $\Area(B) = \sum_{i=1}^n \Area(B_i)$.}

\mytheorem{Finite unions, intersections and differences of elementary
sets are elementary sets.\label{TmR2ring}}

\myproof{A direct inspection. We omit details.}

\pt A countable union of elementary sets is not necessarily an
elementary set.

\myexercise{Show that the open disk $x^2+y^2<1$ is a countable union
of planar elementary sets. Show that the closed disk $x^2+y^2\leq 1$
is a countable intersection of planar elementary sets.}

\newpage

\mydefinition{A \textbf{ring} is a nonempty collection of subsets of a
set $X$ closed under finite unions, intersections and differences.}

\myexample{Linear elementary sets $J\subset \IR$ make a ring. Planar
elementary sets $B\subset \IR^2$ make a ring.}

\mydefinition{An \textbf{algebra} is a ring containing $X$ itself.}

\myexample{\label{ExIntAlg} Linear elementary sets $J\subset \IR$ do
not make an algebra. If we consider all finite unions of
\underline{finite intervals} and \underline{infinite intervals}, then
we will get an algebra. (An infinite interval is a set $[a,\infty)$ or
$(a,\infty)$ or $(-\infty,a]$ or $(-\infty,a)$, where $a\in \IR^1$. The
real line $\IR^1$ itself is also an infinite interval.)}

\mytheorem{\label{TmFinCover} {\rm (a)} If a linear elementary set $J$
is covered by intervals $I_1,\ldots,I_n$, i.e., $J \subset \cup_{i=1}^n
I_i$, then $|J| \leq \sum_{i=1}^n |I_i|$.\\ {\rm (b)} If a planar
elementary set $B$ is covered by rectangles $R_1,\ldots,R_n$, i.e., $B
\subset \cup_{i=1}^n R_i$, then $\Area (B) \leq \sum_{i=1}^n \Area
(R_i)$.}

\myproof{We prove (b). By Theorem~\ref{TmR2ring}, $R_1'=B\cap R_1$ and
$R_i' = B\cap(R_i\setminus \cup_{j=1}^{i-1} R_j)$ are elementary sets.
Obviously, $R_i' \subset R_i$, hence $\Area(R_i') \leq \Area(R_i)$.
Since $R_i'$ are disjoint and $B=\uplus_{i=1}^n R_i'$, we have
$$
  \Area(B) \stackrel{\ref{CrBBB}{\rm (b)}}{=} \sum_{i=1}^n \Area (R_i')
  \leq \sum_{i=1}^n \Area (R_i).
$$
The easier part (a) is left as an exercise.}

\newpage

Next we generalize the concepts of length in $\IR^1$ and area in
$\IR^2$. This can be done in parallel, as above, but for the sake of
brevity we only do it for the 2D case (i.e., for the area in $\IR^2$).
The conversion of all our definitions and theorems to the simpler 1D
case is left as an exercise.

For convenience, we want to avoid infinite areas at early stages of
our constructions. In this chapter we just fix a large finite
rectangle $X \subset \IR^2$ and only consider subsets $A\subset X$.
Note that elementary sets $B\subset X$ make an algebra (because $X$
is an elementary set).

\mydefinition{\label{Defouter} The \textbf{outer measure} of a set $A
\subset X$ is
$$
   \muo(A) =\inf \sum_{i=1}^{\infty} \Area (R_i)
$$
where the infimum is taken over all countable covers of $A$ by
rectangles, i.e., such that $A \subset \cup_{i=1}^{\infty} R_i$.}

\pt $\muo(A)\leq \Area(X)$ {\footnotesize (we can use countable
cover $\{X, \emptyset,\emptyset, \ldots\}$)}

\pt $\muo(B) \leq \Area (B)$ {\footnotesize (if $B = \uplus_{i=1}^n
R_i$, then we can use countable cover $\{R_1,\ldots,R_n,
\emptyset,\emptyset, \ldots\}$)} \medskip

The following theorem is the first non-trivial fact of Real Analysis:

\mytheorem{For any elementary set $B \subset X$ we have $\muo(B) =
\Area (B)$. \label{TmTopol}}

\myproof{Suppose, by way of contradiction, that $\muo(B) < \Area
(B)$. Let $\delta = \Area(B) - \muo(B) >0$. There is a countable
cover of $B$ by rectangles $B \subset \cup_{i=1}^{\infty} R_i$ such
that $\sum_{i=1}^{\infty} \Area (R_i) < \Area(B) - \delta/2$.

{\footnotesize
\begin{lemma0} For any rectangle $R$ and any
$\varepsilon>0$ there is an \textbf{open} covering rectangle $R'
\supset R$ such that $\Area(R'\setminus R)< \varepsilon$ and a
\textbf{closed} subrectangle $R'' \subset R$ such that
$\Area(R\setminus R'')< \varepsilon$. Similar statements hold for
elementary sets. {\rm (Proof is a simple exercise in topology, it is
omitted.)}
\end{lemma0}}

Thus we can find a closed elementary subset $B'\subset B$ with
$\Area(B')> \Area(B)-\delta/4$. For each $R_i$ we can find an open
covering rectangle $R_i' \supset R_i$ such that $\Area(R_i') <
\Area(R_i) + \delta/2^{i+2}$. Now
$$
  \sum_{i=1}^{\infty} \Area (R_i') < \sum_{i=1}^{\infty} \Area (R_i) +
  \delta/4 < \Area(B').
$$
Since $B'$ is compact and covered by a countable union of open sets
$R_i'$, there exists a finite subcover, i.e., $B' \subset
\cup_{i=1}^{n} R_i'$ for some $n<\infty$. Then according to
Theorem~\ref{TmFinCover} $\sum_{i=1}^{n} \Area (R_i') \geq
\Area(B')$, a contradiction.}

\newpage

\mytheorem{If $A_1 \subset A_2$, then $\muo(A_1) \leq
\muo(A_2)$.\label{TmAinA}}

\myproof{Any countable cover of $A_1$ by rectangles is also a cover
for $A_2$.}

\mytheorem{\label{Tmsubadd}If $A \subset \cup_{i=1}^{n} A_i$, then
$\muo(A) \leq \sum_{i=1}^{n} \muo(A_i)$. This property is called
\underline{subadditivity}.}

\myproof{We can combine countable covers of $A_1,\ldots,A_n$ into one
countable cover of $A$. (Recall that a finite union of countable sets
is countable.)}

\mytheorem{\label{Tmsigsubadd}If $A \subset \cup_{i=1}^{\infty}
A_i$, then $\muo(A) \leq \sum_{i=1}^{\infty} \muo(A_i)$. This
property is called \underline{$\sigma$-subadditivity}.}

\myproof{We can combine countable covers of $A_1,A_2,\ldots$ into one
countable cover of $A$. (Recall that a countable union of countable
sets is countable.)}

\mycorollary{If $B \subset \cup_{i=1}^{\infty} B_i$, where $B$ and all
$B_i$'s are elementary sets, then $\Area(B) \leq \sum_{i=1}^{\infty}
\Area(B_i)$.\label{CrBBBsigsubadd}}

\myproof{Combine Theorems~\ref{Tmsigsubadd} and \ref{TmTopol}.}

\mydefinition{\label{Defmui} The \textbf{inner measure} of a set $A
\subset X$ is
$$
   \mui(A) = \Area (X) - \muo(A^c)
$$
where $A^c = X \setminus A$ is the complement of
$A$.}

\mytheorem{For any set $A\subset X$ we have $0 \leq \mui(A) \leq
\muo(A) \leq \Area (X)$. \label{Tmmuimuo}}

\myproof{The only non-trivial claim here is $\mui(A) \leq \muo(A)$.
By Definition~\ref{Defmui}, this is equivalent to $\Area (X) -
\muo(A^c) \leq \muo(A)$, i.e., $\muo(A) + \muo(A^c) \geq \Area (X)$,
and this follows from Theorem~\ref{Tmsubadd}.}

\mydefinition{\label{Defmeasuable} A set $A \subset X$ is
\textbf{measurable} if $\mui(A) = \muo(A)$; then its \textbf{Lebesgue
measure} is defined by $\bm(A) = \mui(A) = \muo(A)$.}

\mylemma{\label{LmAAc}A set $A \subset X$ is measurable if and only if
$$
   \muo(A) + \muo(A^c) = \Area (X).
$$}

\myproof{By Definition~\ref{Defmui}, the relation $\mui(A) =
\muo(A)$ is equivalent to $\Area (X) - \muo(A^c) = \muo(A)$, which
is the same as $\muo(A) + \muo(A^c) = \Area (X)$.}

\pt The symmetry of the above relation implies that
$$
   A\ \text{ is measurable}\ \Leftrightarrow \ A^c\ \text{ is measurable}
$$

\mytheorem{Every elementary set $B \subset X$ is measurable and its
Lebesgue measure is equal to its area, i.e.\ $\bm(B) = \Area (B)$.}

\myproof{If $B$ is an elementary set, then $B^c = X\setminus B$ is
also an elementary set. Now the result follows from
Theorem~\ref{TmTopol}, Corollary~\ref{CrBBB}, and
Lemma~\ref{LmAAc}.}

\pt An empty set is measurable and $\bm (\emptyset) =0$.

\myexercise{Prove that every countable set $A \subset X$ is measurable
and $\bm (A)=0$.}

\myexercise{Let $A \subset X$ consist of points $(x,y)$ such that
either $x$ or $y$ is a rational number. Is $A$ measurable? What is
its Lebesgue measure?}

\mylemma{\label{LmADB} For any two sets $A_1, A_2 \subset X$ we have
$$|\muo(A_1) - \muo(A_2)| \leq \muo(A_1 \Delta A_2)$$}

\pt The sets $A_1$ and $A_2$ here are not necessarily measurable.

\myproof{Recall that $A_1 \Delta A_2= (A_1\setminus A_2) \cup
(A_2\setminus A_1)$. By Theorems~\ref{Tmsubadd} and \ref{TmAinA}
$$
 \muo(A_1)\leq
 \muo(A_1\cap A_2)+\muo(A_1\setminus A_2)\leq
 \muo(A_2)+\muo(A_1\Delta A_2)
$$
Similarly, $\muo(A_2)\leq \muo(A_1)+\muo(A_1\Delta A_2)$.}

\newpage

\mytheorem{{\rm (Approximation)} A set $A \subset X$ is measurable
if and only if for any $\varepsilon>0$ there exists an elementary
set $B \subset X$ such that $\muo(A \Delta B) < \varepsilon$.
\label{TmAppr}}

\pt In this case we also have $|\bm(A) - \Area(B)| \leq
\varepsilon$, by Lemma~\ref{LmADB}.

\myproof{``$\Leftarrow$'': Note that $A^c \Delta B^c = A\Delta B$,
hence
$$\muo(A^c \Delta B^c) = \muo(A \Delta B) < \varepsilon.$$ Due to
Lemma~\ref{LmADB} $$|\muo(A) -\Area(B)| <
\varepsilon\quad\text{and}\quad |\muo(A^c) -\Area(B^c)| <
\varepsilon.$$ By Corollary~\ref{CrBBB}, $\Area (B) + \Area (B^c) =
\Area (X)$. Hence
$$
   |\muo(A) + \muo(A^c) - \Area (X)| \leq |\muo(A) -\Area(B)|
   +|\muo(A^c) -\Area(B^c)|<2\varepsilon.
$$
Since this is true for any $\varepsilon>0$, we must have $\muo(A) +
\muo(A^c) = \Area (X)$. Lemma~\ref{LmAAc} now implies that $A$ is a
measurable set.\medskip

``$\Rightarrow$'': If $A\subset X$ is measurable, then so is $A^c$. Let
$\varepsilon>0$. We can choose a countable cover $\cup_{i=1}^{\infty}
R_i \supset A$ so that $\sum_i\Area(R_i) < \muo(A) + \varepsilon$.
Similarly, we can choose a countable cover $\cup_{j=1}^{\infty} R_j'
\supset A^c$ so that $\sum_j \Area(R_j') < \muo(A^c) + \varepsilon$.
Note that
\beq  \label{AppP2}
   \sum_{i=1}^{\infty}\Area(R_i) + \sum_{j=1}^{\infty}\Area(R_j')
   < \muo(A)+\muo(A^c)+2\varepsilon = \Area (X)+2\varepsilon.
\eeq
Define $B = \cup_{i=1}^N R_i$ where $N$ is chosen so that $\sum_{i>N}
\Area(R_i) < \varepsilon$.
%Similarly, define $B' = \cup_{j=1}^{N'}R_j'$ where $N'$ is chosen so that $\sum_{j=N'+1}^{\infty} \Area(R_j')< \varepsilon$.
Denote $T= \cup_{i>N} R_i$ (the ``tail''). Note that $\muo(T) \leq
\sum_{i>N} \Area(R_i) <\varepsilon$.

Now $A\Delta B=(A\setminus B) \cup (B\setminus A)$. It is easy  to
check that
$$
  A\setminus B \subset T \quad\text{and}\quad
  B\setminus A\subset S\colon =\cup_{j=1}^{\infty}(B\cap R_j').
$$
To estimate $\muo(S)$ note that
$$
   X = \bigl(\cup_{i=1}^{\infty}R_i\bigr) \cup \bigl(\cup_{j=1}^{\infty}R_j'\setminus B\bigr),
$$
and all the sets in this formula are elementary sets. Thus by
Corollary~\ref{CrBBBsigsubadd}
\beq  \label{AppP1}
   \sum_{i=1}^{\infty}\Area(R_i) + \sum_{j=1}^{\infty}\Area(R_j'\setminus
   B) \geq \Area (X).
\eeq
Subtracting \eqref{AppP1} from \eqref{AppP2} gives
$$
   \sum_{j=1}^{\infty}\Area(R_j') - \sum_{j=1}^{\infty}\Area(R_j'\setminus
   B) =\sum_{j=1}^{\infty}\Area(R_j'\cap B) < 2\varepsilon,
$$
which shows that $\muo(S)<2\varepsilon$. Therefore
$$
   \muo(A \Delta B)\leq \muo(T)+\muo(S)<\varepsilon+2\varepsilon
   =3\varepsilon.
$$
Since $\varepsilon>0$ is arbitrary, the theorem is proved.}

\mytheorem{Finite unions, intersections and differences of measurable
sets are measurable. \label{Tmmeasfin}}

\myproof{Routine verification by approximation
(Theorem~\ref{TmAppr}).}

\mytheorem{{\rm (Additivity)} If $A_1, \ldots, A_n$ are disjoint
measurable sets, then $\bm \bigl( \uplus_{i=1}^n A_i \bigr) =
\sum_{i=1}^n \bm(A_i)$. \label{TmAddM}}

\myproof{Again, by approximation (Theorem~\ref{TmAppr}).}

\mytheorem{Countable unions and countable intersections of measurable
sets are measurable.\label{TmAAA}}

\myproof{Let $A=\cup_{i=1}^{\infty}A_i$ be a countable union of
measurable sets $A_1,A_2,\ldots$. Define $A_i' = A_i \setminus
\cup_{j=1}^{i-1}A_i$, then $A=\uplus_{i=1}^{\infty} A_i'$ is a disjoint
union of sets that are measurable by Theorem~\ref{Tmmeasfin}. Moreover,
$$\sum_{i=1}^n \bm(A_i') \leq \muo(A)<\infty,$$ so the series
$\sum_{i=1}^{\infty} \bm(A_i')$ converges. Let $\varepsilon>0$. Choose
$N$ so that $\sum_{i>N} \bm(A_i') < \varepsilon$. If we denote
$T=\cup_{i>N}A_i'$, then by Theorem~\ref{Tmsigsubadd}
$$
  \muo(T)\leq \sum_{i>N} \muo(A_i') = \sum_{i>N} \bm(A_i') <
  \varepsilon.
$$
The set $A^\diamond = \cup_{i=1}^{N}A_i$ is measurable (by
Theorem~\ref{Tmmeasfin}), so it can be approximated by an elementary
set $B$ such that $\muo(A^\diamond \Delta B) < \varepsilon$. Now
$$
   \muo(A \Delta B) \leq \muo(A^\diamond \Delta B)
   +\muo(T)<2\varepsilon.
$$
Since $\varepsilon>0$ is arbitrary, the set $A$ is measurable by
Theorem~\ref{TmAppr}. Lastly, countable intersections are
complements of countable unions.}

\myexercise{Prove that every open set $A \subset X$ is measurable
(hint: represent it by a countable union of rectangles). Prove that
every closed set is measurable, too.}

\newpage

\mytheorem{{\rm ($\sigma$-additivity)} If $A_1,A_2,\ldots$ are
disjoint measurable sets, then $\bm \bigl( \uplus_{i=1}^{\infty} A_i
\bigr) = \sum_{i=1}^{\infty} \bm(A_i)$. \label{Tmsigadd}}

\myproof{Note that $A=\uplus_{i=1}^{\infty} A_i$ is a measurable set
by Theorem~\ref{TmAAA}. Thus by Theorem~\ref{Tmsigsubadd}
$$
   \bm(A) = \muo(A) \leq \sum_{i=1}^{\infty} \muo(A_i)
   =\sum_{i=1}^{\infty} \bm(A_i).
$$
On the other hand, for every $n\geq 1$ we have $\uplus_{i=1}^nA_i
\subset A$, therefore
$$
   \sum_{i=1}^n\bm(A_i)\stackrel{\ref{TmAddM}}{=}
   \bm\bigl(\uplus_{i=1}^nA_i\bigr)
   =\muo\bigl(\uplus_{i=1}^nA_i\bigr)
   \stackrel{\ref{TmAinA}}{\leq} \muo(A)=\bm(A).
$$
This implies $\bm(A) = \sum_{i=1}^{\infty} \bm(A_i)$, as claimed.}

\mytheorem{{\rm (Continuity - I)} Let $A_1 \supset A_2 \supset \cdots
\supset A_n \supset \cdots$ be a sequence of measurable sets (called
\emph{monotonically decreasing sequence}). Then $\lim_{n \to \infty}
\bm(A_n) = \bm(A)$, where $A = \cap_{n=1}^{\infty} A_n$.
\label{TmConI}}

\myproof{Let $A_i'=A_i\setminus A_{i+1}$ for all $i\geq 1$.
Obviously, $A_n = A\uplus(\uplus_{i=n}^{\infty}A_i')$, hence by
Theorem~\ref{Tmsigadd}
$$
   \bm(A_n) = \bm(A) + \sum_{i=n}^{\infty} \bm(A_i')
$$
Since the series converges, its tail tends to zero as $n\to\infty$.}

\mytheorem{{\rm (Continuity - II)} Let $A_1 \subset A_2 \subset \cdots
\subset A_n \subset \cdots$ be a sequence of measurable sets (called
\emph{monotonically increasing sequence}). Then $\lim_{n \to \infty}
\bm(A_n) = \bm(A)$, where $A = \cup_{n=1}^{\infty}
A_n$.\label{TmConII}}

\myproof{Let $A_1'=A_1$ and $A_i'=A_i\setminus A_{i-1}$ for all
$i\geq 2$. Obviously, $A = \uplus_{i=1}^{\infty}A_i'$, hence by
Theorem~\ref{Tmsigadd}
$$
   \bm(A_n) = \sum_{i=1}^{n} \bm(A_i')\quad\text{and}\quad
   \bm(A) = \sum_{i=1}^{\infty} \bm(A_i')
$$
Now the sum of the series is the limit of its partial sums, thus
$\bm(A_n) \to \bm(A)$.}

\newpage


%*****************************************************************************

\section{Lebesgue measure in $\IR$ and $\IR^2$: some extra facts}

First we extend the Lebesgue measure from one large rectangle $X$ to
the entire plane $\IR^2$:


\mydefinition{\label{DefLMinf} A set $A\subset\IR^2$ is measurable if
and only if $A \cap X$ is measurable for every rectangle $X \subset
\IR^2$. Its measure is
$$
  \bm (A) = \lim_{n\to \infty} \bm (A\cap X_n),
$$
where $X_n = [-n,n] \times [-n,n]$ is a growing sequence of
rectangles. }

\pt The value of $\bm (A)$ does not depend on the particular growing
sequence of rectangles.

\topic{Alternative definition}{We can pave the plane $\IR^2$ with
rectangles
$$
   X_{ij} = \{(x,y)\colon i\leq x<i+1,\ \ j\leq y<j+1\}
$$
and define
$$
  \bm (A) = \sum_{i,j} \bm (A\cap X_{ij}).
$$
}

\pt The value of $\bm (A)$ does not depend on a particular pavement
of $\IR^2$ by rectangles.

\pt Most of the theorems we proved in Chapter~\ref{SecLMR2} remain
valid for the Lebesgue measure over the entire plane $\IR^2$.

\pt $\bm(A)$ may be infinite, i.e., $\bm(A)=\infty$ for some
measurable sets $A\subset \IR^2$.

\mytheorem{The Lebesgue measure is translationally invariant, i.e.\
if $A \subset \IR^2$ is measurable and $a \in \IR^2$, then the set
$$
    A+a = \{x+a \colon x\in A\}
$$
is measurable and $\bm (A+a) = \bm (A)$.}

\myproof{If $R$ is a rectangle, then $R+a$ is a rectangle, too, and
$\Area(R+a)=\Area(R)$, so all our constructions are invariant under
translations.}

\topic{Lebesgue measure in $\IR$}{This can be constructed in $\IR$ by
using intervals (and their length) instead of rectangles (and area).
The Lebesgue measure in $\IR$ is translationally invariant, too, i.e.\
if $A$ is a measurable set and $a \in \IR$, then the set $A+a = \{x+a
\colon x\in A\}$ is also measurable and $\bm (A+a) = \bm (A)$.}

\newpage

Next we describe the collection of measurable sets in $\IR$ and
$\IR^2$.

\mydefinition{Let $X$ be a set. A \textbf{$\sigma$-algebra} is an
algebra of subsets of $X$ closed under countable unions and
intersections.}

The following lemma presents a minimal set of conditions that we
need to verify in order to show that a given collection of sets is a
$\sigma$-algebra:

\mylemma{\label{Lmsigmin} A non-empty collection $\fM$ of subsets of
$X$ is a $\sigma$-algebra if two conditions hold:\\
$\phantom{m}\quad$ {\rm (i)} $A\in \fM \Longrightarrow A^c\in\fM$,
where $A^c=X\setminus A$;\\ $\phantom{m}\quad$ {\rm (ii)}
$A_1,A_2,\ldots \in \fM \Longrightarrow
\cup_{i=1}^{\infty}A_i\in\fM$.\\
In other words, a $\sigma$-algebra is any non-empty collection of
subsets of $X$ closed under complementation and countable unions.}

\myproof{A straightforward verification.}

\mydefinition{Measurable sets in $\IR^1$ make a $\sigma$-algebra called
\textbf{Lebesgue $\sigma$-algebra} (over a line). Measurable sets in
$\IR^2$ make a $\sigma$-algebra called \textbf{Lebesgue
$\sigma$-algebra} (over a plane).}

\topic{Some measurable sets}{Recall that open sets in $\IR$ and $\IR^2$
are measurable. Thus closed sets are measurable, too. Any countable
intersection of open sets (called $G_\delta$ in topology) is
measurable. Any countable union of closed sets (called $F_\sigma$ in
topology) is measurable. In particular, the set of rational numbers in
$\IR$ is measurable. So is the set of irrational numbers.}

\pt The above list of measurable sets is far from complete. The
collection of measurable sets is very rich, as we will see shortly.

\topic{Cantor set}{An interesting example of a measurable set is the
middle-third Cantor set $C$. It is a subset of the unit interval $[0,1]
\subset \IR$ that has many useful properties. It is constructed
beginning with closed unit interval $(C_0=[0,1])$, removing the middle
third open interval
$$
   C_1=C_0 \setminus (\tfrac 13,\tfrac 23) = [0,\tfrac 13]\cup[\tfrac 23,1],
$$
then recursively removing the middle third intervals from each
remaining closed interval:
$$
   C_2=C_1 \setminus \bigl[(\tfrac 19,\tfrac 29) \cup (\tfrac 79,\tfrac 89)\bigr],
   \quad \text{etc.}
$$
This results in a decreasing sequence of sets $C_0 \supset C_1
\supset
C_2 \supset \cdots$ shown here:\\
~$C_0$ ~~\linethickness{3mm}\cantor{1}{360pt}\\
~$C_1$ ~~\linethickness{3mm}\cantor{2}{360pt}\\
~$C_2$ ~~\linethickness{3mm}\cantor{3}{360pt}\\
~$C_3$ ~~\linethickness{3mm}\cantor{4}{360pt}\\
~$C_4$ ~~\linethickness{3mm}\cantor{5}{360pt}\\
~$C_5$ ~~\linethickness{3mm}\cantor{6}{360pt}\\
~~$\vdots$\\

A general formula for the set $C_n$ is
$$
   C_n=\frac{C_{n-1}}{3}\biguplus\Big(\frac{2}{3}+\frac{C_{n-1}}{3}\Big),
$$
so that $C_n$ is a disjoint union of two copies of $C_{n-1}$ compressed
by factor $\frac 13$.\medskip

The Cantor set is the limit of this procedure, it is defined by
$$
   C=\lim_{n \to \infty}C_n = \cap_{n=0}^{\infty} C_n
$$
We record the following properties of $C_n$'s and $C$:
\begin{itemize}
\item At each step we remove open intervals, so each $C_n$ is a
    closed set
\item The Cantor set $C$ is a closed set (being an intersection of
    closed sets)
\item Each $C_n$ is a linear elementary set (a finite union of
    intervals)
\item The length of $C_n$ is decreased by factor $\frac 23$ at each
    step: $|C_n|=\tfrac 23 |C_{n-1}|$
\item The length of $C_n$ is, by induction, $|C_n| = (\tfrac 23)^n$
\item By Continuity-I (Theorem~\ref{TmConI}), $\bm(C)
    =\lim\limits_{n\to\infty}\bm(C_n)=\lim\limits_{n\to\infty}(\tfrac 23)^n=0$
\end{itemize}
}

\newpage

\mytheorem{If $A \subset X$ is measurable and $\bm(A) = 0$, then every
subset $A' \subset A$ is measurable and $\bm(A')=0$.}

\myproof{By Theorem~\ref{TmAinA}, $\muo(A') \leq \muo(A)=\bm(A)=0$,
hence $\muo(A')=0$. Now by Theorem~\ref{Tmmuimuo}, $0\leq
\mui(A')\leq\muo(A')$=0, hence $\mui(A')=0$.}

\topic{Ternary description of the Cantor set}{The ternary number system
has base $3$ and uses three digits: $0$, $1$, and $2$. Points $x\in
(0,1)$ are described in the ternary system by $x=.d_1d_2d_3\cdots$
where $d_i$'s are ternary digits ($0$, $1$, $2$). For example,
$$
  \tfrac 13 = (.1000000\cdots)_{\rm ternary},\qquad
  \tfrac 12 = (.1111111\cdots)_{\rm ternary}.
$$
If $x\in (0,\tfrac 13)$, then $d_1=0$; if $x\in (\tfrac 13,\tfrac 23)$,
then $d_1=1$; if $x\in (\tfrac 23, 1)$, then $d_1=2$.\medskip

Thus at Step 1 in the construction of the Cantor set we remove all the
numbers with $d_1=1$. Similarly, at Step 2 we remove all the numbers
with $d_2=1$, etc. Thus eventually we remove \underline{all} the
numbers $x\in (0,1)$ whose ternary representation $x=.d_1d_2d_3\cdots$
contains at least one 1.\medskip

The Cantor set $C$ consists exactly of the numbers $x\in (0,1)$ whose
ternary representation $x=.d_1d_2d_3\cdots$ do not include $1$'s, i.e.,
consist of 0's and 2's only.\medskip

Note: the number $x=\frac 13$ does belong to the Cantor set, even
though its ternary representation $(.1000000\cdots)_{\rm ternary}$
given above contains a 1. Why? Because this number has \underline{two}
ternary representations; the other one is
$$
  \tfrac 13 = (.0222222222\cdots)_{\rm ternary}.
$$
which has no 1's in it. \medskip

Thus the description of the Cantor set should be as follows: $x\in C$
if and only if $x$ can be represented in the ternary system by a
sequence of zeros and twos.\medskip

Which numbers $x\in (0,1)$ have multiple ternary representations?
Only rational numbers $x=\frac{m}{3^n}$ where $n\geq 1$ and $1\leq
m\leq 3^n-1$. These number have exactly two ternary representations,
one ends with zeros and the other ends with twos.
\medskip

A question arises: how many numbers are in the Cantor set $C$?
Obviously, the endpoints of the intervals making $C_n$ will remain
in $C$. Those are rational numbers $x=\frac{m}{3^n}$ where $n\geq 1$
and $1\leq m\leq 3^n-1$.  But there are many more numbers in $C$, as
we will see later.
 }

\newpage

We recall some basic definitions and facts from set theory:

\topic{Cardinality}{Two sets $A$ and $B$ have the same cardinality
if there is a bijection $\varphi \colon A \leftrightarrow B$. We
write $\card(A)=\card(B)$.\medskip

A set $A$ has cardinality smaller than that of $B$,
$\card(A)<\card(B)$, if there is an injection $\varphi \colon A \to
B$ but not vice versa. }

\pt For finite sets $A$ and $B$, the relation $\card(A)=\card(B)$
holds if and only if they have the same number of elements.

\pt `Same cardinality' is an equivalence relations. Thus all sets of
the same cardinality make an (equivalence) class.

The following two theorems are cited without proof:

\mytheorem{For any two sets $A$ and $B$ there is either an injection
$A \to B$, or an injection $B\to A$, or both.}

\mytheorem{{\rm (Cantor-Bernstein-Schroeder)} If there is an
injection $A \to B$ \emph{and} an injection $B \to A$, then there is
a bijection $A \leftrightarrow B$, i.e., $\card(A)=\card(B)$.}

\pt Thus, for any two sets $A$ and $B$ there are three
possibilities:
$$\card(A)=\card(B)\quad\text{or}\quad
\card(A)>\card(B)\quad\text{or}\quad\card(A)<\card(B)$$

\pt Recall: $\card(\IN) = \card(\IZ) = \card(\IQ)$ and $\card(\IN) <
\card(\IR)$.

\topic{Finite and countable cardinalities}{For a finite set $A$ of
$n$ elements, we simply put $\card(A)=n$. For the set of integers
$\IN$, we put $\card(\IN) = \aleph_0$ (`aleph-null'). Then any
countable set has cardinality $\aleph_0$, in particular, $\card(\IZ)
= \card(\IQ) = \aleph_0$.}

\pt Any countable union of countable sets is countable.

\topic{Continuum}{The cardinality of $\IR$ is denoted by $\fC$ and is
called \emph{continuum}. We have $\card(I) = \fC$ for any interval $I
\subset \IR$ of positive length. We have $\card(\IR^n) = \fC$ for every
$n \geq 1$. We also have $\aleph_0 < \fC$.}

\topic{Continuum hypothesis}{It states that there is no set $A$ such
that $\aleph_0 < \card(A) < \fC$. In particular, it implies that every
subset of $\IR$ is either finite or countable or has the same
cardinality as $\IR$ itself. The continuum hypothesis cannot be proved
or disproved if one uses standard mathematical axioms. Thus it may (or
may not) be adopted as an independent axiom. We do not assume it for
the purposes of our course.}

\newpage

\topic{Power set}{For any set $A$, the \emph{power set} (or
\emph{powerset}) of $A$, denoted by $2^A$, is the set of all subsets of
$A$. Note: if $\card(A)=n < \infty$, then $\card(2^A) = 2^n$.}

\mytheorem{{\rm (Cantor)} For any set $A$ we have $\card(A) <
\card(2^A)$.}

\myproof{It is enough to show that no function $f\colon A \to 2^A$
can be surjective. That is, given a function $f\colon A \to 2^A$, we
need to prove the existence of at least one subset $B\subset A$ that
$B\neq f(a)$ for any $a\in A$. Such a subset is given by the
following construction:
$$
  B=\{b\in A\colon b\notin f(b)\}.
$$
If $B =f(a)$ for some $a\in A$, then both relations $a\in B$ and
$a\notin B$ would contradict the definition of $B$.}

\topic{Generalized continuum hypothesis}{It states that for any set
$A$ there is no set $B$ such that $\card(A) < \card(B) <
\card(2^A)$. This implies that cardinalities make a simple sequence:
\begin{itemize} \item[] $\aleph_0$ (the set $\IN$ and other countable sets),
\item[] $\aleph_1$ (the set $2^{\IN}$), \item[] $\aleph_2$ (the set
$2^{2^{\IN}}$), etc. \end{itemize} This hypothesis cannot be proved
or disproved either. We do not assume it for the purposes of our
course.}

\newpage

\topic{Equivalence of $\IR$ and $2^{\IN}$}{The set $2^{\IN}$ can be
identified with the set of all infinite sequences of zeros and ones.
Indeed, for any subset $A\subset \IN$ we construct a unique sequence
$a_1,a_2,\ldots$ such that $a_n=1$ if $n\in A$ and $a_n=0$ if $n\notin
A$. For example, the set of all even numbers is represented by the
sequence
$$
   \{0\ 1\ 0\ 1\ 0\ 1\ 0\ 1\ 0\ 1\ 0\ 1\ \cdots\}.
$$
The set of all prime numbers is represented by the sequence
$$
   \{1\ 1\ 1\ 0\ 1\ 0\ 1\ 0\ 0\ 0\ 1\ 0\ \cdots\}.
$$
On the other hand, the sequences of zeros and ones code real numbers in
the interval $[0,1]$, because every $x\in [0,1]$ has a binary
representation $x=.a_1a_2\ldots$, where $a_n$'s are zeros and ones. For
example,
$$
  \tfrac 34 = (.11000000\cdots)_{\rm binary},\qquad
  \tfrac 13 = (.01010101010\cdots)_{\rm binary}.
$$
Thus the set $2^{\IN}$ can be bijectively mapped onto $[0,1]$, hence it
its cardinality is $\fC$.}

\myexercise{Let $\fU$ denote the set of all open subsets $U \subset
\IR$. Prove that $\card(\fU) = \fC$. Do the same for open sets in
$\IR^2$. Hint: use a countable basis for the respective topology.}

\topic{Cardinality of the Cantor set}{Recall that the Cantor set
consists of numbers $x\in [0,1]$ whose ternary representation
$x=0.b_1b_2\ldots$ does not contain ones, i.e., it consists of zeros
and twos only. Thus the Cantor set can be bijectively mapped onto
$2^{\IN}$, hence its cardinality is $\fC$.\medskip

Recall that the Cantor set has Lebesgue measure zero, $\bm(C)=0$. This
suggests that the Cantor set is ``tiny'' or ``slim''. But it has the
same cardinality as $\IR$.}

\myexercise{Let $\fL$ denote the set of all Lebesgue measurable sets
(in $\IR$). Prove that $\card(\fL) > \fC$, in fact $\card(\fL) =
\card(2^{\IR})$. (Hint: use the Cantor set and the Cantor theorem).}

\newpage

We see that the collection of all measurable sets has the same
cardinality as the collection of all subsets of $\IR$. It is not clear
yet if there are any non-measurable sets at all.

\mytheorem{There exists a non-measurable set $V\subset \IR$.}

\myproof{The set $V$ is called Vitali set. Its construction is not so
simple.

We say that two real numbers $x,y\in\IR$ are rationally equivalent if
$x-y\in\IQ$, i.e., they differ by a rational number. One can check
directly that this is an equivalence relation. Each equivalence class
is countable and can be thought of as a ``shifted copy'' of the set of
rational numbers. The collection of the classes is uncountable, its
cardinality is $\fC$.

Each equivalence class is dense, so they all intersect the unit
interval $[0,1]$. We want to choose one (arbitrary) representative from
each equivalence class in $[0,1]$. The chosen numbers make a set (a
subset of $[0,1]$). This is \textbf{Vitali set}, denoted by $V$. Note
that $V\subset [0,1]$, and for each equivalence class $C\subset \IR$
the intersection $V\cap C$ consists of a single point. Note that for
any $x,y\in V$ the difference $x-y$ is irrational (otherwise these two
points would belong to the same class).

Next we argue that the Vitali set cannot be measurable. Let
$r_1,r_2,\ldots$ denote all rational number in $[-1,1]$. From the
construction of $V$ it follows that the translated sets $V_i=V+r_i$ are
pairwise disjoint. Further note that
$$
   [0,1]\subset \uplus_{i=1}^{\infty} V_i \subset [-1,2].
$$
(To see the first inclusion, consider any real number $x\in [0,1]$ and
let $v$ be the representative in $V$ for the equivalence class
containing $x$; then $x-v=r$ for some rational number $r\in [-1,1]$.)

Now suppose $V$ is measurable. Its measure $\bm(V)$ is a nonnegative
real number. All the ``shifted'' copies of $V$, i.e., the sets $V_i = V
+ r_i$, are measurable, too, and their measure is the same as that of
$V$, i.e., $\bm(V_i)=\bm(V)$, due to the translation invariance. This
implies
$$
   \bm([0,1])=1\leq \sum_{i=1}^{\infty}\bm(V_i) \leq 3=\bm([-1,2]).
$$
But the infinite sum in the middle can only be zero (if $\bm(V)=0$) or
infinity (if $\bm(V)>0$), a contradiction.}

\newpage

The construction of the Vitali set $V$ looks simple enough, but it
touches upon a subtle and controversial issue in mathematical logic
-- Axiom of Choice. Indeed, how can we choose exactly
\underline{one} representative from each equivalence class? Is there
a rule? An algorithm? There are uncountably many classes out there,
so no formal procedure can handle all of them.

\topic{Axiom of Choice}{It asserts that such a selection is always
possible. This principle does not follow from other, standard
logical axioms, so it has to be adopted as a separate one. Axiom of
Choice was formally introduced by Zermelo in 1904. Although
originally controversial, it is now used by most mathematicians
without reservation, and it is included in the standard form of
axiomatic set theory. However, there are branches of mathematics
where the Axiom of Choice is avoided.}

If we do not adopt the Axiom of Choice, there would be no way to
construct non-measurable sets or even prove their existence. Then we
could just suppose that all sets $A\subset \IR$ are
measurable...\medskip

For the purposes of this course we adopt the Axiom of Choice and
hence admit the existence of non-measurable sets.

\newpage

\topic{Lebesgue measure in $\IR^k$, $k\geq 3$}{We have constructed the
Lebesgue measure in $\IR$ and $\IR^2$. Our construction easily extends
to $\IR^k$ for $k \geq 3$. In $\IR^3$, for example, the Lebesgue
measure generalizes \textbf{volume}, and instead of intervals or
rectangles, we have to use rectangular boxes. All the basic facts for
the Lebesgue measure $\bm$ remain valid in spaces $\IR^k$, $k\geq 3$.}


Interestingly, though, the are new examples of non-measurable sets in
$\IR^3$ due to the striking fact known as \textbf{Banach--Tarski
paradox}:

\mytheorem{{\rm (Banach--Tarski)} Given a solid ball in $\IR^3$, there
exists a decomposition of the ball into a finite number of
non-overlapping pieces (i.e., subsets), which can then be put back
together in a different way to yield two identical copies of the
original ball. The reassembly process involves only moving the pieces
around and rotating them, without changing their shape or size.}

\begin{figure}[h]
\centering
\includegraphics[width=3in]{Banach-Tarski_Paradox.eps}
\caption{Banach--Tarski paradox illustrated}\label{FigBTP}
\end{figure}

This is often stated, colloquially, as ``a pea can be chopped up and
reassembled into the Sun''.

Now suppose the Lebesgue measure $\bm$ in $\IR^3$ is not only
translation invariant but also rotation invariant (which is a
reasonable assumption). Then if the above pieces of the ball were all
measurable, we would immediately arrive at a contradiction with the
additivity of the measure, because the volume of the original ball
\emph{doubles} after the reassembly.

To resolve the contradiction, we either have to assume that the
Lebesgue measure in $\IR^3$ is \emph{not} rotation invariant or admit
that some of the above pieces of the ball are not measurable. Thus the
existence of non-measurable sets becomes a more pressing issue in
$\IR^3$ than it was in $\IR$.

For the purposes of this course we assume that the Lebesgue measure
$\bm$ is rotation invariant in both $\IR^2$ and $\IR^3$, though we
will hardly need this.

\newpage

%*****************************************************************************

\section{General measures} \label{ChGM}

\mydefinition{A set $X$ with a $\sigma$-algebra $\fM$ of its subsets is
called a \textbf{measurable space}. Sets $A \in \fM$ are said to be
\textbf{measurable}.}

\myexample{For any set $X$, there are two trivial $\sigma$-algebras.
One is \emph{minimal}, it consists of the sets $X$ and $\emptyset$
only. The other is \emph{maximal}, it contains all the subsets of $X$.
The latter is denoted by $2^X$.}

\mydefinition{Let $(X,\fM)$ be a measurable space. A \textbf{measure}
is a function $\mu$, defined on $\fM$, whose range is $[0,\infty]$ and
which is $\sigma$-additive. The latter means that for any sequence of
disjoint measurable sets $A_1,A_2,\ldots \in \fM$ we have
$$
  \mu\bigl(\uplus_{n=1}^{\infty}A_n\bigr) =\sum_{n=1}^{\infty} \mu(A_n).
$$
Note that $\uplus_{n=1}^{\infty}A_n \in \fM$ because $\fM$ is a
$\sigma$-algebra.

To avoid trivialities, we shall also assume that $\mu(A)<\infty$ for at
least one $A \in \fM$. A measurable space with a measure is called a
\textbf{measure space}.}

\myproposition{\label{Prmeassimple} Let $(X,\fM,\mu)$ be a measure
space. Then
\begin{itemize}\item[{\rm (a)}]
$\mu(\emptyset)=0$. \item[{\rm (b)}] For any finite collection of
disjoint measurable sets $A_1,\ldots,A_n \in \fM$ and
$A=\uplus_{i=1}^n A_i$ we have $\mu(A) =\sum_{i=1}^n
\mu(A_i)$.\item[{\rm (c)}] For every measurable sets $A \subset B$
we have $\mu(A) \leq \mu(B)$.\end{itemize}}

\myproof{(a): Let $A\in \fM$ be such that $\mu(A)<\infty$. Then the
sets $A_1=A$, $A_2=\emptyset$, $A_3=\emptyset,\ldots$ are disjoint
and $\uplus_{n=1}^{\infty} A_n = A$. By the $\sigma$-additivity
$$
   \mu(A) = \mu(A) + \mu(\emptyset) + \mu(\emptyset) + \cdots
$$
which implies $\mu(\emptyset)=0$. Note: without assuming that $\exists
A\in\fM\colon \mu(A)<\infty$ the claim (a) is false: there exists a
(trivial) measure $\mu$ such that $\forall A\in \fM \colon
\mu(A)=\infty$.

(b) Given $A_1,\ldots,A_n \in \fM$, define $A_{n+1}=A_{n+2}=
\cdots=\emptyset$, then by the $\sigma$-additivity we have
$$
   \mu\bigl(\uplus_{i=1}^n A_i\bigr) = \mu\bigl(\uplus_{i=1}^{\infty} A_i\bigr) =
   \sum_{i=1}^{\infty} \mu(A_i) = \sum_{i=1}^{n} \mu(A_i)
$$
the last identity is based on the fact $\mu(\emptyset)=0$ proven in
(a).

(c) Due to (b) we have $\mu(B) = \mu(A) + \mu(B\setminus A)$ and
$\mu(B\setminus A) \geq 0$. }

\myexercise{Let $X = \{1,2,3\}$. Construct all $\sigma$-algebras of
$X$.}

\topic{Finite and countable spaces}{If $X$ is finite or countable, we
will always use the maximal $\sigma$-algebra $2^X$. In that case for
any measure $\mu$ on $(X,2^X)$
$$
   A=\{x_1,x_2,\ldots\}
   \quad\Longrightarrow\quad
   \mu(A) = \mu(\{x_1\}) + \mu(\{x_2\}) + \cdots
$$
Thus any measure $\mu$ on $(X, 2^X)$ is determined by its values
$\mu(\{x\})$ on one-point sets $\{x\}, x\in X$. One-point sets are also
called \textbf{singletons}. }

\topic{Restriction of a measure}{Let $E\in\fM$ be a measurable set. One
can check, by direct inspection, that the collection
$$
   \fM_E = \{A\cap E\colon A\in \fM\}
$$
is a $\sigma$-algebra over $E$. Note that $\fM_E \subset \fM$, thus
$\mu(B)$ is defined for every $B\in \fM_E$. It is now easy to see that
the restriction of $\mu$ to $\fM_E$ is a measure.}

\mytheorem{Let $\{\fM_\alpha\}$ be an arbitrary collection of
$\sigma$-algebras of a set $X$. Then their intersection $\cap_\alpha
\fM_\alpha$ is a $\sigma$-algebra of $X$ as well.}

\myproof{Direct inspection. Note that the collection of
$\sigma$-algebras here may be finite, countable, or uncountable; its
cardinality is not essential.}

\mytheorem{Let $\fG$ be any collection of subsets of $X$. Then there
exists a unique $\sigma$-algebra $\fM^\ast \supset \fG$ such that for
any other $\sigma$-algebra $\fM \supset \fG$ we have $\fM^\ast \subset
\fM$. (In other words, $\fM^\ast$ is the minimal $\sigma$-algebra
containing $\fG$.)}

\myproof{The $\sigma$-algebra $\fM^\ast$ is the intersection of all
$\sigma$-algebras containing $\fG$.}

\mydefinition{We say that the minimal $\sigma$-algebra $\fM^\ast$
containing the given collection $\fG$ is \textbf{generated} by $\fG$.
We also denote it by $\fM(\fG)$.}

\myexercise{Let $X = [0,1]$ and $\fG$ consist of all one-point sets,
i.e.\ $\fG = \bigl\{ \{x\}, x\in X \bigr\}$. Describe the
$\sigma$-algebra $\fM(\fG)$.}

It is interesting to compare the notion of $\sigma$-algebra with
topology. The standard topology in $\IR$ is not a $\sigma$-algebra.
On the other hand, the $\sigma$-algebra in the previous exercise is
not a topology.

\mydefinition{Let $X$ be a topological space. The $\sigma$-algebra
$\fM$ generated by the collection of all open subsets $U \subset X$ is
called the \textbf{Borel} $\sigma$-algebra. Its members are called
\textbf{Borel sets}.}

\pt We can take complements, so all closed sets are Borel sets.

\pt We can take countable intersections, so all $G_\delta$ sets are
Borel sets.

\pt We can take countable unions, so all $F_\sigma$ sets are Borel
sets.

\myexample{In $\IR$, every countable set is Borel. The Cantor set is
Borel. In fact, virtually any set that can be precisely described is
Borel. It is hard to find any specific non-Borel set.}

\myexercise{\label{ExRatInt} Show that the Borel $\sigma$-algebra in
$\IR$ is generated by the collection of all intervals $(r_1,r_2)$ with
rational endpoints $r_1,r_2 \in \IQ$. }

\topic{Borel $\sigma$-algebra in $\IR$}{It contains many more sets than
just open, closed, $G_{\delta}$, and $F_{\sigma}$ sets. If we take
countable unions of $G_\delta$ sets, we will get new sets that are also
Borel. If we take countable intersections of $F_\sigma$ sets, we will
get new sets that are also Borel. Then we can take countable unions and
countable intersections of those new sets, and get some more new sets,
all of which will be Borel, too. This process will never stop. Its full
description requires the so called \emph{transfinite recursion} which
is beyond the scope of this course.}

Recall that the collection of open sets in $\IR$ has cardinality $\fC$.
So does the collection of closed sets. Constructing new sets by
countable unions and intersections will not increase the cardinality of
the collection, so the collection of all $G_{\delta}$ and $F_{\sigma}$
sets still has cardinality $\fC$. Further steps in the above process
will not increase the cardinality of the collection either. This leads
to the following theorem (its formal proof is omitted):

\mytheorem{The cardinality of the Borel $\sigma$-algebra of $\IR$ is
$\fC$, i.e.\ continuum.}

\myexercise{Show that every Borel set in $\IR$ is Lebesgue measurable,
but not vice versa.}

\myexercise{[Bonus] Does there exist an infinite $\sigma$-algebra which
has only countably many members?}

\newpage

\mydefinition{Let $(X,\fM)$ be a measurable space. For any $X \in \fM$,
define $\mu(A)=\infty$ if $A$ is an infinite set, and $\mu(A)=\,{\rm
card}(A)$ if $A$ is finite. Then $\mu$ is called \textbf{counting
measure}.}

\mydefinition{Let $(X,\fM)$ be a measurable space and $x\in X$. The
measure $\delta_x$ defined by
$$
     \delta_x(A)=\left\{\begin{array}{ll} 1 & {\rm if}\ \ x\in A\\
     0 & {\rm otherwise}\end{array}\right .
$$
is called the \textbf{delta-measure} or the \textbf{Dirac measure}
(concentrated at $x$).}

\mytheorem{\label{TmSigsubadd} {\rm ($\sigma$-subadditivity)} Let
$A_1,A_2,\ldots \in \fM$ be measurable sets. Then
$$
   \mu\Bigl(\cup_{i=1}^{\infty}A_i\Bigr) \leq \sum_{i=1}^{\infty} \mu(A_i)
$$
}

\myproof{Define $A_1'=A_1$ and $A_i' = A_i \setminus (A_1\cup\cdots\cup
A_{i-1})$ for $i\geq 2$. Note the following:\medskip

\pt $A_i'$ are disjoint sets;\medskip

\pt $A_i' \subset A_i$ for each $i\geq 1$; therefore $\mu(A_i') \leq
\mu(A_i)$ by Proposition~\ref{Prmeassimple}(c);\medskip

\pt $\cup_{i=1}^{\infty}A_i = \cup_{i=1}^{\infty}A_i'$.\medskip

\noindent Now
$$
   \mu\Bigl(\cup_{i=1}^{\infty}A_i\Bigr) =
    \mu\Bigl(\cup_{i=1}^{\infty}A_i'\Bigr)
   =\sum_{i=1}^{\infty} \mu(A_i')
   \leq\sum_{i=1}^{\infty} \mu(A_i)
$$
}

\mytheorem{\label{tmCIa} {\rm (Continuity - I)} Let $A_1 \supset A_2
\supset \cdots \supset A_n \supset \cdots$ be a sequence of measurable
sets, and $\mu(A_1)<\infty$. Then $\lim_{n \to \infty} \mu(A_n) =
\mu(A)$, where $A = \cap_{n=1}^{\infty} A_n$.}

\myproof{Similar to Theorem~\ref{TmConI}.}

\mytheorem{\label{tmCIIa} {\rm (Continuity - II)} Let $A_1 \subset
A_2 \subset \cdots \subset A_n \subset \cdots$ be a sequence of
measurable sets. Then $\lim_{n \to \infty} \mu(A_n) = \mu(A)$, where
$A = \cup_{n=1}^{\infty} A_n$.}

\myproof{Similar to Theorem~\ref{TmConII}.}

\myexercise{Show that the assumption $\mu(A_1) <\infty$ in
Theorem~\ref{tmCIa} is indispensable. Hint: consider the counting
measure on $\IN$ and take sets $A_n = \{n,n+1,\ldots\}$.}

In many cases $\sigma$-algebras tend to be rather large, an explicit
definition (or description) of $\mu(A)$ for all $A \in \fM$ is often an
impossible task. It is common to define $\mu(A)$ on a smaller
collection of sets, $\fE$, and extend it to $\fM(\fE)$ automatically by
referring to general theorems.

\mydefinition{A \textbf{semi-algebra} is a nonempty collection $\fE$ of
subsets of $X$ with two properties: (i) it is closed under
intersections; i.e.\ if $A,B \in \fE$, then $A \cap B \in \fE$; and
(ii) if $A \in \fE$, then $A^c = \cup_{i=1}^n A_i$, where each $A_i \in
\fE$ and $A_1, \ldots, A_n$ are pairwise disjoint subsets of $X$.}

\myexample{The collection of all finite and infinite intervals in $\IR$
(cf.\ Example~\ref{ExIntAlg}) make a semi-algebra.}

\myexercise{Let $X \subset \IR^2$ be a rectangle. Verify that the
collection of all subrectangles $R \subset X$ is a semi-algebra.}

\mytheorem{\label{TmExt} {\rm (Extension)} Let $\fE$ be a semi-algebra
of $X$. Let $\nu$ be a function on $\fE$, whose range is $[0,\infty)$
and which is $\sigma$-additive, i.e.\ for any $A \in \fE$ such that $A
= \uplus_{i=1}^\infty A_i$ for some $A_i\in \fE$, we have $\mu(A) =
\sum_{i=1}^\infty \mu(A_i)$. Then there is a unique measure $\mu$ on
the $\sigma$-algebra $\fM (\fE)$ that agrees with $\nu$ on $\fE$, i.e.\
$\mu(A) = \nu(A)$ for all $A\in \fE$.}

We accept this theorem without proof. Its proof is basically the
repetition of our construction of the Lebesgue measure in $\IR^2$.

\mycorollary{\label{crLLL} Let $X \subset \IR^2$ be a rectangle. There
is a unique measure $\mu$ on the Borel $\sigma$-algebra over $X$ such
that for every subrectangle $R \subset X$ we have $\mu(R)=\Area(R)$.}

The following useful theorem is also given without proof:

\mytheorem{\label{TmAgree} Let $(X,\fM)$ be a measurable space and
$\fE$ a collection of subsets of $X$ that generates $\fM$, i.e. such
that $\fM (\fE)= \fM$. Suppose two measures, $\mu_1$ and $\mu_2$, agree
on $\fE$, i.e.\ $\mu_1(A)=\mu_2(A)$ for all $A\in \fE$, and
$\mu_1(X)=\mu_2(X)$. Then $\mu_1=\mu_2$.}

\newpage

Note: for any measure space $(X,\fM,\mu)$ and a real number $c>0$ we
can define a new measure $\nu$ on $\fM$ by $\nu(A) = c\mu(A)$ for all
$A\in \fM$.

\mytheorem{\label{Tmcmu} Let $\mu$ be a translation invariant measure
defined on the Borel $\sigma$-algebra over $\IR$. Assume that $\mu(I)
<\infty$ for at least one interval $I\neq\emptyset$. Then there exists
a constant $c\geq 0$ such that $\mu(E) = c\bm(E)$ for every Borel set
$E$; here $\bm$ is the Lebesgue measure.}

\myproof{Due to the translation invariance, all singletons have the
same measure, i.e., $\mu(\{x\})=\mu(\{y\})$ for all $x,y\in\IR$. If,
$\mu(\{x\})>0$ for any (and then for all) $x\in\IR$, then the measure
of every infinite set would be infinite, which contradicts the
assumption $\mu(I)<\infty$. Thus all singletons have measure zero,
hence for every $a<b$ we have $\mu((a,b) = \mu([a,b))= \mu((a,b]) =
\mu([a,b])$.

Now let $\mu(I) <\infty$ for a nonempty interval $(a,b)$. Note that
$\IR = \uplus_{n=-\infty}^{\infty}(a+n|I|,b+n|I|]$. If $\mu(I)=0$, then
$\mu(\IR)=0$, hence $\mu(A)=0\cdot \bm(A)$ for any Borel set, and the
theorem follows with $c=0$.

If $\mu(I)>0$, then $\mu(\IR)=\infty$. In this case we put
$c=\mu(I)/|I|$. Divide $I$ into $k\geq 2$ intervals $\{I_i\}$ of equal
length. They also have equal $\mu$ measure due to the translation
invariance, hence
$$
   \mu(I_i) = \mu(I)/k = c|I|/k = c|I_i|.
$$
Next for any interval $J\subset \IR$ of length $|J|=\frac{m}{k}|I|$, we
can represent $J=\uplus_{j=1}^m J_j$ where $|J_j| = |I|/k$ and obtain
$$
   \mu(J) = m\mu(J_1) = mc|J_1| = c|J|.
$$
Thus the measure $c^{-1}\mu$ agrees with the Lebesgue measure on all
intervals with rational lengths. Lastly we use the result of
Exercise~\ref{ExRatInt} and Theorem~\ref{TmAgree}.
 }

\myexercise{Extend this theorem to $\IR^2$: show that if $\mu$ is a
translation invariant measure defined on the Borel $\sigma$-algebra
over $\IR^2$ such that $\mu(R) <\infty$ for at least one rectangle
$R\neq\emptyset$, then there exists a constant $c\geq 0$ such that
$\mu(E) = c\bm(E)$ for every Borel set $E$.}

\newpage

Lastly, given a measure $\mu$ on a $\sigma$-algebra $\fM$, is often
convenient to complete it in the way we constructed the Lebesgue
measure.

\mydefinition{A measure $\mu$ on a measurable space $(X,\fM)$ is said
to be \textbf{complete} if every subset of any set of measure zero is
measurable, i.e., if for any set $A\in \fM$ such that $\mu(A)=0$ and
any subset $B \subset A$ we have $B\in \fM$ (in this case obviously
$\mu(B)=0$).}

\mydefinition{Sets of measure zero are called \textbf{null sets}. Their
complements are called \textbf{full measure sets}.}

\pt A set $A$ is of full measure iff $\mu(A^c)=0$.

\pt It is incorrect to say that $A$ is of full measure iff
$\mu(A)=\mu(X)$. (This statement is true only if $\mu(X)<\infty$.)

\mytheorem{{\rm (Completion)} Let $(X, \fM, \mu)$ be a measure space.
Then
$$
   \bar{\fM} = \{A\cup E\colon A\in
   \fM,\ \ E \subset N
   \ \text{for some null set}\ N\}
$$
is a $\sigma$-algebra. For every $B = A \cup E$ as above define
$\bar{\mu} (B) = \mu(A)$. Then $\bar{\mu}$ is a complete measure on
$(X, \bar{\fM})$. Moreover, if $\mu^\ast$ is another complete measure
that agrees with $\mu$ on $\fM$, then $\mu^\ast$ coincides with
$\bar{\mu}$ on $\bar{\fM}$.}

\myproof{Basically, it is a direct inspection.}

\mydefinition{$\bar{\mu}$ is called the \textbf{completion} of $\mu$.}

The completion of the measure constructed in Corollary~\ref{crLLL} is
exactly the Lebesgue measure on $X \subset \IR^2$.

\newpage

%********************************************************************

\section{Measurable functions}

Recall: given two topological spaces $X$ and $Y$, a function $f \colon
X \to Y$ is said to be continuous iff for any open set $V \subset Y$
its preimage $f^{-1} (V)\subset X$ is open, too.

\pt The \textbf{preimage} (also called inverse image) is defined by
$$f^{-1}(V) =\{x\in X\colon f(x)\in V\}.$$

\mydefinition{ Let $(X,\fM)$ be a measurable space and $Y$ a
topological space. A function $f\colon X \to Y$ is said to be a
\textbf{measurable function} iff for any open set $V \subset Y$ its
preimage is measurable, i.e.\ $f^{-1} (V) \in \fM$.}

\pt The most interesting functions for us are real-valued ($Y=\IR$) and
complex-valued ($Y=\IC$).

\mytheorem{Let $(X,\fM)$ be a measurable space and $Y,Z$ topological
spaces. If $f\colon X \to Y$ is measurable and $g \colon Y \to Z$ is
continuous, then their composition $g \circ f \colon X \to Z$ is
measurable.}

\myproof{For any open set $V\subset Z$ the set $g^{-1}(V) \subset Y$ is
open, hence the set $f^{-1}(g^{-1}(V)) = (g \circ f)^{-1} (V) \subset
X$ is measurable (i.e., belongs in $\fM$).}

Recall that in any topological space we have the Borel $\sigma$-algebra
generated by open sets.

\mydefinition{\label{DefBMF} Let $X,Y$ be topological spaces. A
function $f\colon X \to Y$ is said to be a \textbf{Borel function} iff
for any open set $V \subset Y$ its preimage $f^{-1} (V)\subset X$ is a
Borel set.}

\myproposition{Continuous functions are Borel functions.}

\pt There are many Borel functions that are not continuous.

\mydefinition{Given a subset $A \subset X$ the function
$$
   \chi_A (x) = \left\{ \begin{array}{cc}
   1 & \text{if}\ \ x \in A\\
   0 & \text{if} \ \ x \notin A \end{array}\right .
$$
is called the \textbf{characteristic function} of $A$ (or the
\textbf{indicator} of $A$).}

\myexercise{Prove that $A \in \fM$ if and only if $\chi_A$ is
measurable.}

\newpage

\myexample{\label{ExDir} Let $X=\IR$ with $\fM$ being Borel
$\sigma$-algebra. The function $f = \chi_{\IQ}$ (the indicator of the
set of rational numbers) is known as \textbf{Dirichlet function}. It is
discontinuous ar every point $x\in\IR$. At the same time it is a Borel
function.}

In fact, virtually every function that can be precisely described is
Borel. It is hard to find any specific non-Borel function.

\mytheorem{\label{TmXYZ} Let $(X,\fM)$ be a measurable space and
$f\colon X \to Y$ a function. Then  \begin{itemize} \item[\rm (a)] $\fG
= \{E\subset Y\colon f^{-1}(E) \in \fM\}$ is a $\sigma$-algebra in $Y$;
\item[\rm (b)] if $Y$ is a topological space and $f$ measurable, then
$f^{-1}(E) \in \fM$ for any Borel set $E \subset Y$; \item[\rm (c)]
If $Y$ and $Z$ are topological spaces, $f\colon X \to Y$ is
measurable and $g \colon Y \to Z$ is a Borel function, then $g \circ
f \colon X \to Z$ is measurable.
\end{itemize}
}

\myproof{Note that set-theoretic operations are preserved under inverse
functions. That is, if $f\colon X \to Y$ is a function, then for any
sets $A,B\in Y$ we have
\begin{align*}
   f^{-1}(A\cup B) &=f^{-1}(A) \cup f^{-1}(B)\\
   f^{-1}(A\cap B) &= f^{-1}(A) \cap f^{-1}(B)\\
   f^{-1}(A\setminus B) &= f^{-1}(A) \setminus f^{-1}(B)\\
   f^{-1}(A^c) &= (f^{-1}(A))^c.
\end{align*}
Similar identities hold for countable unions and intersections:
\begin{align*}
   f^{-1}\bigl(\cup_{n=1}^{\infty} A_n\bigr) &=\cup_{n=1}^{\infty} f^{-1}(A_n)\\
   f^{-1}\bigl(\cap_{n=1}^{\infty} A_n\bigr) &=\cap_{n=1}^{\infty} f^{-1}(A_n).
\end{align*}
Prove of (a): by direct inspection
\begin{align*}
  A_1,A_2,\ldots \in\fG \quad&\Longrightarrow\quad
  f^{-1}(A_1),f^{-1}(A_2),\ldots \in \fM\\
  &\Longrightarrow\quad
  f^{-1}(\cup_n A_n)=\cup_n f^{-1}(A_n) \in \fM\\
  &\Longrightarrow\quad
  \cup_n A_n\in \fG.
\end{align*}
Similarly,
$$
  A\in \fG \ \ \Longrightarrow\ \
  f^{-1}(A)\in \fM \ \ \Longrightarrow\ \
  f^{-1}(A^c) =(f^{-1}(A))^c \in \fM \ \ \Longrightarrow\ \
  A^c \in \fG.
$$
Lastly we apply Lemma~\ref{Lmsigmin}. \medskip

\noindent Proof of (b): the collection  $\fG = \{E\subset Y\colon
f^{-1}(E) \in \fM\}$ is a $\sigma$-algebra (by (a)) and it contains all
open sets. Hence it contains the Borel $\sigma$-algebra.
\medskip

\noindent Proof of (c): for any open set $V\subset Z$ the set
$g^{-1}(V) \subset Y$ is Borel, hence (by (b)) the set
$f^{-1}(g^{-1}(V)) = (g \circ f)^{-1} (V) \subset X$ is measurable,
i.e., belongs in $\fM$.}

\newpage


\mydefinition{\textbf{Extended real line}, denoted by $[-\infty,
\infty]$, is $\IR\cup\{\infty\}\cup \{-\infty\}$. The topology in
$[-\infty, \infty]$ is generated by standard open intervals $(a,b)
\subset \IR$ and the following ``infinite intervals'': $(a, \infty]$
and $[-\infty, b)$ for all $a,b\in \IR$. Any function $f \colon X \to
[-\infty, \infty]$ is called an \textbf{extended real-valued
function}.}


\mytheorem{\label{Tmmeas0x} Let $(X,\fM)$ be a measurable space and
$f\colon X \to [-\infty, \infty]$. Then $f$ is measurable iff $f^{-1}
\bigl( [-\infty, x) \bigr)$ is a measurable set for every $x \in \IR$.}

\myproof{By Theorem~\ref{TmXYZ}(a) the collection $\fG = \{E\subset
Y\colon f^{-1}(E) \in \fM\}$ is a $\sigma$-algebra containing all open
infinite intervals $[-\infty, x)$. Now we just need to check that these
intervals generate the Borel $\sigma$-algebra in $[-\infty, \infty]$,
i.e., applying countable unions/intersections and complements produces
all other open intervals in $[-\infty, x)$. This is a routine exercise
in topology.}

\myexercise{\label{Exmeas0x} In the context of the previous theorem,
prove that $f$ is measurable iff $f^{-1} \bigl( [-\infty, x] \bigr)$ is
a measurable set for every $x \in \IR$.}

\myexercise{In the context of the previous theorem, prove that $f$ is
measurable iff $f^{-1} \bigl( [-\infty, x) \bigr)$ is a measurable set
for every rational $x \in \IQ$.}

\myexercise{\label{Exf<g} Let $(X,\fM)$ be a measurable space and
$f\colon X \to [-\infty, \infty]$ and $g\colon X \to [-\infty, \infty]$
two measurable functions. Prove that the sets
$$
   \{x\colon f(x)<g(x)\}
   \qquad\text{and}\qquad
   \{x\colon f(x)=g(x)\}
$$
are measurable.}

\myexercise{ Show that the function $f\colon \IR \to \IR$ defined by
$$
   f (x) = \left\{ \begin{array}{cc}
   x & \text{if}\ \ x \in \IQ\\
   0 & \text{if} \ \ x \notin \IQ \end{array}\right .
$$
is a Borel function.}

\myexercise{ Show that the function $f\colon \IR \to \IR$ defined by
$$
   f (x) = \left\{ \begin{array}{cc}
   \sin (1/x) & \text{if}\ \ x \neq 0 \\
   0 & \text{if} \ \ x =0 \end{array}\right .
$$
is a Borel function. }


\myexercise{[Bonus] Let $f\colon \IR \to \IR$ be a monotonically
increasing function, i.e.\ $f(x_1) \leq f(x_2)$ for $x_1 \leq x_2$.
Show that $f$ is a Borel function. }

\newpage
\mytheorem{Let $(X,\fM)$ be a measurable space and $u\colon X \to \IR$
and $v\colon X \to \IR$ two functions. Then $f=(u,v)\colon X\to \IR^2$
is measurable if and only if both $u$ and $v$ are measurable.}

\myproof{ If $f$ is measurable, then for any open set $V\subset \IR$ we
have $u^{-1}(V) = f^{-1}(V\times \IR) \in \fM$ because $V\times \IR$ is
open in $\IR^2$. Similarly $v^{-1}(V) = f^{-1}(\IR \times V) \in \fM$.

If $u$ and $v$ are measurable, then for any open intervals $I,J\subset
\IR$ we have $f^{-1}(I\times J) = u^{-1}(I)\cap v^{-1}(J) \in \fM$ (as
the intersection of two measurable sets). The sets $I\times J$ generate
the Borel $\sigma$-algebra in $\IR^2$, thus our result follows from
Theorem~\ref{TmXYZ}(a).}

\mycorollary{Let $(X,\fM)$ be a measurable space, $u\colon X \to \IR$
and $v\colon X \to \IR$ two measurable functions, and $\Phi\colon \IR^2
\to \IR$ a continuous function. Then the composition $\Phi(u(x),v(x))
\colon X \to \IR$ is a measurable function. In particular, $u+v$,
$u-v$, and $uv$ are measurable functions.}

\mycorollary{Let $(X,\fM)$ be a measurable space and $u\colon X \to
\IR$ and $v\colon X \to \IR$ two functions. Then $f(x) = u(x) + \bi
v(x)$ is a measurable function from $X$ to $\IC$ if and only if both
$u(x)$ and $v(x)$ are measurable functions.}

\mycorollary{ \label{tm|f|} Let $(X,\fM)$ be a measurable space and
$f\colon X \to \IC$ and $g\colon X \to \IC$ two measurable functions.
Then $|f|$, $f+g$, $f-g$, and $fg$ are measurable functions. }

\mytheorem{{\rm (Polar factorization)} Let $(X,\fM)$ be a measurable
space and $f\colon X \to \IC$ a measurable function. Then $f=g|f|$,
where $g \colon X \to \IC$ is a measurable function such that $|g|=1$.}

\myproof{The set $E=f^{-1}(\{0\})$ is measurable. Note that $h(z) =
z/|z|$ is a continuous function from $\IC\setminus \{0\}$ to $\IC$,
thus the function $h\circ f$ is measurable on $X \setminus E$. Define
$g$ as follows: $g=h\circ f$ on $X\setminus E$ and $g=1$ on $E$.}

\newpage

\topic{Arithmetic in $[-\infty,\infty]$}{Arithmetic operations in the
extended real line $[-\infty,\infty]$ are defined in an obvious way:
\begin{itemize} \item $a+\infty = \infty$ for any $a\in (-\infty,\infty]$,
\item $a+(-\infty) = -\infty$ for any $a\in [-\infty,\infty)$,
\item $a\cdot \infty = \infty$ for every $a\in (0,\infty]$,
\item $a\cdot \infty = -\infty$ for every $a\in [-\infty,0)$,
    etc.\end{itemize}

The sum $\infty + (-\infty)$ is not
    defined. Most importantly, we put
    $$0\cdot\infty=0$$
}

\topic{Limits in $[-\infty,\infty]$}{The
    set $[-\infty,\infty]$ is naturally ordered, any subset $A
    \subset [-\infty,\infty]$ obviously has $\inf A$ a $\sup A$.
    The convergence of sequences in $[-\infty,\infty]$ is defined
    by using its topology. For any sequence $\{a_n\}$ in
    $[-\infty,\infty]$ we naturally define $\liminf a_n$ and
    $\limsup a_n$:
\beq \label{limsup}
  \limsup_{n\to\infty} a_n = \inf \{b_1,b_2,\ldots\},\qquad
  b_n = \sup\{a_n,a_{n+1},\ldots\}.
\eeq
(Here $\inf$ can be replaced with $\lim$, because $b_1\geq b_2\geq
\cdots$ is a monotonically decreasing sequence, hence it has a limit.)
}

\myproposition{\label{Prlimsupinf} For any sequence of numbers
$a_1,a_2,\ldots \in [-\infty, \infty]$ we have \begin{itemize}
\item[\rm (a)] $\limsup_{n\to\infty} (-a_n) = -\liminf_{n\to\infty}
    a_n$. \item[\rm (b)] $\limsup_{n\to\infty} (a_n+b_n) \leq
    \limsup_{n\to\infty} a_n+\limsup_{n\to\infty} b_n$. \item[\rm (c)]
    $\liminf_{n\to\infty} (a_n+b_n) \geq
    \liminf_{n\to\infty} a_n+\liminf_{n\to\infty} b_n$. \item[\rm (d)]
    $\lim_{n\to\infty} a_n$ exists if and only if $\limsup_{n\to\infty} a_n =
    \liminf_{n\to\infty}
    a_n$, in which case $\lim_{n\to\infty} a_n$ equals to both $\limsup_{n\to\infty}
    a_n$ and $\liminf_{n\to\infty}
    a_n$. \end{itemize}
    }

\newpage

\mytheorem{Let $(X,\fM)$ be a measurable space and $f_n\colon X \to
[-\infty,\infty]$ measurable functions. Then
$$
  g=\sup_{n\geq 1} f_n
  \qquad{\rm and}\qquad
  h=\limsup_{n\to\infty} f_n
$$
are measurable functions. (Similarly for $\inf f_n$ and $\liminf f_n$.)
}

\myproof{For any $c\in \IR$ we have
$$
   \{x\colon g(x)>c\} = \cup_{n=1}^{\infty}\{x\colon f_n(x)>c\},
$$
hence $g$ is measurable (cf.\ Theorem~\ref{Tmmeas0x} and
Exercise~\ref{Exmeas0x}). Similarly, $\inf f_n$ is a measurable
function. The function $\limsup f_n$ can be expressed as a combination
of $\sup$'s and $\inf$'s due to \eqref{limsup}.}

\mycorollary{ \label{Crflimmeas} Let $(X,\fM)$ be a measurable space
and $f_n\colon X \to [-\infty,\infty]$ measurable functions. If the
limit
$$
  g(x)=\lim_{n\to\infty} f_n(x)
$$
exists for every $x\in X$, then $g$ is a measurable function.}

\mycorollary{ \label{crf+-} Let $(X,\fM)$ be a measurable space and
$f,g\colon X \to [-\infty,\infty]$ are measurable functions. Then
$$
  \max\{ f(x),g(x)\}
  \qquad{\rm and}\qquad
  \min\{ f(x),g(x)\}
$$
are measurable functions. Also,
$$
  f^+(x) = \max\{ f(x),0\}
  \qquad{\rm and}\qquad
  f^-(x) = -\min\{ f(x),0\}
$$
are measurable functions.}

\newpage

\mydefinition{The functions
$$
  f^+(x) = \max\{ f(x),0\}
  \qquad{\rm and}\qquad
  f^-(x) = -\min\{ f(x),0\}
$$
are called
\textbf{positive and negative parts} of $f$, respectively.}

\pt For any function $f\colon X\to [-\infty,\infty]$
\beq \label{f+f-}
  f=f^+-f^-
  \qquad\text{and}\qquad
  |f|=f^++f^-.
\eeq

\mytheorem{ If $f=g-h$ and $g\geq 0$, $h\geq 0$, then $f^+\leq g$ and
$f^-\leq h$. }

\pt In other words, $f^+$ and $f^-$ are the ``most economical''
nonnegative functions whose difference is the given function $f$.

\myproof{If $f(x)\geq 0$ then $$f^-(x)=0\leq h(x)\quad\text{and}\quad
f^+(x)=f(x)=g(x)-h(x)\leq g(x)$$If $f(x)\leq 0$ then $$f^+(x)=0\leq
g(x)\quad\text{and}\quad f^-(x)=-f(x)=h(x)-g(x)\leq h(x)$$ }

\newpage

\mydefinition{A function $f\colon X \to Y$ is a \textbf{simple
function} iff its range $f(X)$ is finite. }

\myproposition{If $s \colon X \to \IR$ is a measurable simple function
whose (distinct) values are $\alpha_1, \ldots, \alpha_n$, then it can
be represented by
$$
  s = \sum_{i=1}^n \alpha_i \, \chi_{A_i}
$$
where $A_i = s^{-1} (\{\alpha_i\})$ are disjoint measurable sets such
that $X = \uplus_{i=1}^n A_i$.}

\mytheorem{\label{Tmflims} Let $(X,\fM)$ be a measurable space and
$f\colon X \to [0,\infty]$ a measurable function. Then there exist
simple functions $s_n \colon X \to \IR$ such that
$$
   0\leq s_1\leq s_2\leq\cdots \leq f
$$
and $s_n(x) \to f(x)$ as $n\to \infty$ for every $x \in X$. }

\myproof{ (i) Special case: $X=[0,\infty]$ and $f(x)=x$. Define simple
functions by
$$
  \varphi_n = \sum_{j=1}^{n2^n}\frac{j-1}{2^n}\, \chi_{E_j}+n\chi_{[n,\infty]}
$$
where
$$
   E_j = \Bigl[\frac{j-1}{2^n},\frac{j}{2^n}\Bigr)
$$
Intuitively, we divide the interval $[0,n)$ into small pieces so that
each subinterval $[k,k+1)$ of length one is divided into $2^n$ pieces,
and treat the remaining infinite interval $[n,\infty]$ as one piece.
The total number of pieces is $n2^n+1$. The function $\varphi_n$
collapses each piece into its left endpoint. It is easy to check that
$\forall x\in [0,\infty]$
\beq \label{varphi}
   0\leq \varphi_1(x)\leq \varphi_2(x)\leq\cdots \leq x,
   \qquad \lim_{n\to\infty}\varphi_n(x) = x.
\eeq

\medskip\noindent (ii) General case: we define simple functions by $s_n =
\varphi_n\circ f$. They are measurable due to Theorem~\ref{TmXYZ}(c).
They are simple because $s_n(X) \subset \varphi_n(X)$, which is a
finite set. For any $x\in X$ we rewrite \eqref{varphi} as follows:
$$
   0\leq \varphi_1(f(x))\leq \varphi_2(f(x))\leq\cdots \leq f(x),
   \qquad \lim_{n\to\infty}\varphi_n(f(x)) = f(x).
$$
Now replacing $\varphi_n(f(x))$ with $s_n(x)$ we get
$$
   0\leq s_1(x)\leq s_2(x)\leq\cdots \leq f(x),
   \qquad \lim_{n\to\infty} s_n(x) = f(x),
$$
as desired. }

\newpage

%****************************************************************************

\section{Lebesgue integration of real-valued nonnegative functions}
\label{ChLIpos}

\mydefinition{\label{DefLIX} Let $(X,\fM,\mu)$ be a measure space and
$s \colon X \to [0, \infty)$ a nonnegative measurable simple function
represented by
\beq \label{simple}
  s = \sum_{i=1}^n \alpha_i \, \chi_{A_i}.
\eeq
Then we define the \textbf{Lebesgue integral} of $s$ over $X$ by
\beq \label{LIsimple}
   \int_X s \, d\mu = \sum_{i=1}^n \alpha_i \, \mu(A_i).
\eeq
}

\pt It is possible that for some $i$ we have $\alpha_i =0$ and
$\mu(A_i)=\infty$. In this case we use the rule $0 \cdot \infty =0$.

\myproposition{The formula \eqref{LIsimple} holds whether the values
$\alpha_1,\ldots,\alpha_n$ are distinct or not.}

\myproof{In \eqref{simple} it is usually assumed that the values
$\alpha_1,\ldots,\alpha_n$ are distinct. However, if they are not, we
can simply ``lump together'' the subsets $A_i$'s on which $s$ takes the
same values. For example, if $\alpha_i=\alpha_j$ for some $i\neq j$,
then
$$
   \alpha_i\mu(A_i)+\alpha_j\mu(A_j) = \alpha_i(\mu(A_i)+\mu(A_j))
   = \alpha_i \mu(A_i\cup A_j),
$$
and note that $s(x)=\alpha_i$ for all $x\in A_i\cup A_j$. So we can
replace the two terms $\alpha_i\mu(A_i)$ and $\alpha_j\mu(A_j)$ in
\eqref{LIsimple} with one, $\alpha_i \mu(A_i\cup A_j)$, and the sum
\eqref{LIsimple} will have $n-1$ terms total. Repeating this lumping
process, in less than $n$ steps we will get a sum where all the
$\alpha_i$'s are distinct. }

\mydefinition{\label{DefLIE} In the context of Definition~\ref{DefLIX},
for any $E \in \fM$ we define the \textbf{Lebesgue integral} of $s$
over $E$ by
$$
   \int_E s \, d\mu = \sum_{i=1}^n \alpha_i \, \mu(A_i \cap E).
$$
}

Alternatively, we can restrict the function $s$ and measure $\mu$ to
$E$ (as described in Chapter~\ref{ChGM}) and define $\int_E s \, d\mu$
as in Definition~\ref{DefLIX}. These two definitions of $\int_X s\,
d\mu$ agree, as one can check by direct inspection.

\myproposition{\label{PrLIverysimple} We have \begin{itemize}\item[{\rm
(a)}] $\int_E s\, d\mu \in [0,\infty]$ for any such $s\colon X\to
[0,\infty]$.\item[{\rm (b)}] If $\mu(E)=0$, then $\int_E s\, d\mu
=0$.\item[{\rm (c)}] If $s\equiv c \geq 0$ is a constant function, then
$\int_E c\, d\mu = c\, \mu(E)$.\item[{\rm (d)}] $\int_E 0\, d\mu = 0$,
even if $\mu(E)=\infty$.\item[{\rm (e)}] For any set $A\in\fM$ we have
$\int_X \chi_A\, d\mu = \mu(A)$.\end{itemize} }

\myproof{Direct inspection.}

\mylemma{\label{Lms+t} Let  $s,t \colon X \to [0, \infty)$ be two
simple functions. Then
$$
   \int_E (s+t) \, d\mu = \int_E s \, d\mu + \int_E t \, d\mu.
$$
}

\myproof{Let
$$
   s = \sum\limits_{i=1}^{n}\alpha_{i}\chi_{A_i}
    \qquad t = \sum_{j=1}^{m}\beta_{j}\chi_{B_j}
    \qquad \text{note:}\quad
   X = \uplus_{i=1}^n A_i = \uplus_{j=1}^m B_i
$$
Now denote $E_{i,j} = A_i \cap B_j \cap E$, so that $E = \uplus_{i,j}
E_{i,j}$. Note that
$$
  A_i\cap E = \uplus_j E_{i,j}\qquad
  B_j\cap E = \uplus_i E_{i,j}
$$
On each $E_{i,j}$ we have $s=\alpha_i$ and $t=\beta_j$, hence $s+t =
\alpha_i+ \beta_j$. Thus $s+t$ is a simple function given by
$$
  s+t = \sum_{i,j} (\alpha_i+\beta_j)\chi_{E_{i,j}}
$$
Therefore
\begin{align*}
  \int_E (s+t) \, d\mu &= \sum_{i,j}(\alpha_i+\beta_j)\mu(E_{i,j})\\
   &= \sum_{i,j}\alpha_i\mu(E_{i,j})+\sum_{i,j}\beta_j\mu(E_{i,j})\\
   &= \sum_{i}\alpha_i\sum_j\mu(E_{i,j})+\sum_{j}\beta_j\sum_i\mu(E_{i,j})\\
   &= \sum_{i}\alpha_i\mu(A_i\cap E)+\sum_{j}\beta_j\mu(B_j\cap E)\\
  &= \int_E s \, d\mu + \int_E t \, d\mu
\end{align*}
The lemma is proved. }

\mycorollary{If $0\leq s\leq t$ are two simple functions, then $\int_E
s \, d\mu \leq \int_E t \, d\mu$.}

\myproof{The difference $u=t-s$ is also a nonnegative simple function,
hence
$$
   \int_E t\, d\mu =\int_E (s+u)\, d\mu
   \stackrel{\ref{Lms+t}}{=} \int_E s\, d\mu + \int_E u\, d\mu \geq \int_E s\, d\mu
$$
because $\int_E u\, d\mu \geq 0$ according to
Proposition~\ref{PrLIverysimple}(a).}


\mydefinition{\label{DefLI} Let $(X,\fM,\mu)$ be a measure space and $f
\colon X \to [0, \infty]$ a nonnegative measurable function (possibly
taking value $+\infty$). Then for any $E \in \fM$ we define the
\textbf{Lebesgue integral}
$$
   \int_E f \, d\mu = \sup_{s \in L_f} \int_E s\, d\mu,
$$
where
$$
   L_f = \big\{s\colon X \to [0,\infty)\ \ \text{measurable simple},
   \ \ 0\leq s \leq f\big\}.
$$
Note that $L_f \neq \emptyset$ as it always contains the function
$s\equiv 0$. }

\myexercise{Verify that for simple functions Definitions~\ref{DefLIE}
and \ref{DefLI} agree.}

\newpage

\mytheorem{\label{TmBasLI}{\rm (Basic properties of the Lebesgue
integral)} Let $f,g \colon X \to [0,\infty]$ be measurable functions
and $A,B,E \in \fM$ measurable sets. Then
\begin{itemize}
\item[\rm (a)] if $f \leq g$, then $\int_E f\, d\mu \leq \int_E g\,
d\mu$;
\item[\rm (b)] if $A \subset B$, then $\int_A f\, d\mu \leq \int_B f\,
d\mu$;
\item[\rm (c)] for any constant $c \geq 0$ we have $\int_A cf\, d\mu
= c\int_A f\, d\mu$;
\item[\rm (d)] if $\mu(E) = 0$, then $\int_E f\, d\mu
= 0$, even if $f \equiv \infty$;
\item[\rm (e)] $\int_E f\, d\mu = \int_X \chi_E f \, d\mu$.
\item[\rm (f)] if $\int_X f\, d\mu < \infty$, then  $\mu\{x\colon
    g(x)=\infty\} = 0$.
\end{itemize}
}

\myproof{
\begin{tabbing}
\textbf{(a)}~ \= \+
 For any simple function $s$ we have $s \in L_f$~~$\Rightarrow$~~$s \leq f \leq g$~~$\Rightarrow$~~$s \in L_g$ \\[4pt]
    $\Arrow L_f \subset L_g$ \\[4pt]
    $\Arrow \sup\limits_{s \in L_f}\big\{ \intmu[E][s] \big\}  \leq  \sup\limits_{t \in L_g}\big\{ \intmu[E][t] \big\}$ \\[2pt]
    $\Arrow \intmu[E][f] \leq \intmu[E][g]$
\end{tabbing}

\begin{tabbing}
\textbf{(b)}~ \= \+
\pt $A \subset B$~~ $\Rightarrow$~~ $A_k \cap A \subset A_k \cap B$~~
                    $\Rightarrow$~~ $\mu(A_k \cap A)  \leq  \mu(A_k \cap B)$\ForAll[k] \\[6pt]
\pt $s \in L_f$~~\= $\Rightarrow$~~ $\intmu[A][s]$  $=      \sum\limits_{k=1}^{n}\alpha_{k}\mu(A_k \cap A)$
                                                    $\leq   \sum\limits_{k=1}^{n}\alpha_{k}\mu(A_k \cap B)$
                                                    $=      \intmu[B][s]$ \\[3pt]
                \>  $\Rightarrow$~~ $\intmu[A][s]$  $\leq   \intmu[B][s]$ \\[12pt]
\pt $\intmu[A][s] \leq \intmu[B][s]$\ForAll[s \in L_f] $\Arrow$ $\intmu[A][f] \leq \intmu[B][f]$
\end{tabbing}

\begin{tabbing}
\textbf{(c)}~ \= \+
\pt if $c = 0$, then\\[2pt]
    \tab $\int_A 0 \cdot f\, d\mu = \int_A 0\, d\mu = 0 = 0 \cdot \int_A f\, d\mu$ \\[12pt]
\pt if $f=s=\sum_{k=1}^n\alpha_k\chi_{A_k}$ is simple, then\\
    \tab $\int_A cf\, d\mu = \sum\limits_{k=1}^n c\alpha_k \, \mu (A_k\cap A) =
            c\sum\limits_{k=1}^n \alpha_k \, \mu (A_k\cap A) = c\int_A f\, d\mu$ \\[8pt]
\pt if $c\neq 0$ and $f$ is not simple, then\\[2pt]
    \tab\ptt $s \in L_{cf}$~~$\Leftrightarrow$~~$\frac{1}{c}s \in L_f$ \\[6pt]
    \tab\ptt $\intmu[A][cf]$ \= $= \sup\limits_{s \in L_{cf}}\big\{ \intmu[A][s] \big\}$
                                $= \sup\limits_{\frac{1}{c}s \in L_f}\big\{ \intmu[A][s] \big\}$ \\[2pt]
                            \>  $= \sup\limits_{\frac{1}{c}s \in L_f}\big\{ c\intmu[A][\frac{1}{c}s] \big\}$
                                $= c \sup\limits_{\frac{1}{c}s \in L_f}\big\{ \intmu[A][\frac{1}{c}s] \big\}$ \\[2pt]
                            \>  $= c \sup\limits_{t \in L_f}\big\{ \intmu[A][t] \big\}$
                                $= c\intmu[A][f]$
\end{tabbing}

\begin{tabbing}
\textbf{(d)}~ \= \+
\pt $\mu(E)=0  \Arrow  \mu(A_k \cap E) = 0$\ForAll[k] \\[10pt]
\pt $s \in L_f$ \= $\Arrow \mu(A_k \cap E) = 0$\ForAll[k]\\[2pt]
                \> $\Arrow \intmu[E][s] = \sum\limits_{k=1}^{n}\alpha_{k}\mu(A_k \cap E)
                                        = \sum\limits_{k=1}^{n}\alpha_{k} \cdot 0
                                        = 0 $ \\[2pt]
                \> $\Arrow \intmu[E][f] = \sup\limits_{s \in L_f}\big\{ \intmu[E][s] \big\}
                                        = \sup\limits_{s \in L_f}\{0\}
                                        = 0 $
\end{tabbing}

\begin{tabbing}
\textbf{(e)}~ \= \+
\num[i] $s = \sum\limits_{k=1}^{n}\alpha_{k}\chi_{A_k}$ \=
        $\Arrow \chi_{E}s   = \sum\limits_{k=1}^{n}\alpha_{k}\chi_{A_k}\chi_{E}
                            = \sum\limits_{k=1}^{n}\alpha_{k}\chi_{A_k \cap E} $ \\
    \>  $\Arrow \intmu[X][\chi_{E}s]    = \sum\limits_{k=1}^{n}\alpha_{k}\mu(A_k \cap E)
                                        = \intmu[E][s] $ \\[8pt]

\num[ii] Note that~~$s\in L_{\chi_E f}\ \Leftrightarrow \ s=\chi_E\tilde{s}$ ~~ \snote[(for some $\tilde{s}\in L_f$)] \\[12pt]

\pt $\intmu[X][\chi_{E}f]$  \=  $=$             $\sup\limits_{s \in L_{\chi_{E}f}}\big\{ \intmu[X][s] \big\}$
                                $\EqN[(ii)]$    $\sup\limits_{\tilde{s} \in L_{f}}\big\{ \intmu[X][\chi_{E}\tilde{s}] \big\}$ \\[3pt]
                            \>  $\EqN[(i)]$~    $\sup\limits_{\tilde{s} \in L_{f}}\big\{ \intmu[E][\tilde{s}] \big\}$
                                $=$             $\intmu[E][f]$
\end{tabbing}
\textbf{(f)} First, the set $E=\{x\colon
f(x)=\infty\}=f^{-1}(\{\infty\})$ is measurable. For any $N>0$ we have
$f \geq N\chi_E$, thus by Parts (a) and (c) $$\int_X f\, d\mu \geq
\int_X N\chi_E\, d\mu =N\mu(E).$$ If $\mu(E)>0$, then (because our $N$
is arbitrary) we would have $\int_X f\, d\mu =\infty$. This
contradiction proves (f).
 }

\myexercise{Let $x_0 \in X$ and $\mu = \delta_{x_0}$ the
$\delta$-measure. Assume that $\{x_0\} \in \fM$. Show that for every
measurable function $f \colon X \to [0, \infty]$ we have
$$
   \int_X f \, d\mu = f(x_0).
$$}

\myexercise{\label{ExLIcount} Let $X = \IN$ and $\mu$ the counting
measure on the $\sigma$-algebra $\fM = 2^{\IN}$. Show that for every
function $f \colon X \to [0, \infty]$ we have
$$
   \int_X f \, d\mu = \sum_{n=1}^\infty f(n).
$$
}

\newpage

\mytheorem{\label{Tmphimeasure} Let $(X,\fM,\mu)$ be a measure space
and $s \colon X \to [0, \infty)$ a nonnegative measurable simple
function. Then
$$
   \varphi(E) = \int_E s\, d\mu
$$
is a measure on $\fM$.}

\myproof{Let $s = \sum\limits_{k=1}^n \alpha_k \chi_{A_k}$. Then for
any $E \in \fM$ we have $
\varphi(E)=\sum\limits_{k=1}^{n}\alpha_{k}\mu(A_k \cap E) $.
\begin{tabbing}
    \num[i] First, $\varphi(\emptyset)$ $= \sum\limits_{k=1}^n \alpha_k
\mu(A_k \cap \emptyset)$
                             $= \sum\limits_{k=1}^n \alpha_k
\mu(\emptyset)$
                             $= \sum\limits_{k=1}^n \alpha_k \cdot 0$
                             $= 0$\\[16pt]

\num[ii] Second, let $E = \uplus_{n=1}^{\infty}E_n$ where $E, E_n \in \fM$\ForAll[n \in \IN]. Then \\[4pt]
    \tab $\varphi(E)$   \=  $= \varphi\big(
\uplus_{m=1}^{\infty}E_m \big)$
                            $= \sum\limits_{k=1}^{n}\alpha_{k}\mu\big(
A_k \cap \uplus_{m=1}^{\infty} E_m \big)$
                            \\[4pt]
                        \>  $= \sum\limits_{k=1}^{n}\alpha_{k}\mu\big(
\uplus_{m=1}^{\infty} (A_k \cap E_m) \big) $
                            $= \sum\limits_{k=1}^{n}\big( \alpha_{k}\sum\limits_{m=1}^{\infty}\mu(A_k \cap E_m) \big)$ \\[4pt]
                        \>  $= \sum\limits_{m=1}^{\infty}\big(
\sum\limits_{k=1}^{n}\alpha_{k}\mu(A_k \cap E_m) \big)$
                            $= \sum\limits_{m=1}^{\infty}\big( \intmu[E_m][s] \big)$ \\[4pt]
                        \>  $= \sum\limits_{m=1}^{\infty}\varphi(E_m) $
                            \tab \snote[(i.e. \fsigma-additive)]
\end{tabbing}
}

\newpage

\mytheorem{{\rm (Lebesgue's Monotone Convergence)} Let $(X,\fM,\mu)$ be
a measure space and $\{f_n\}$ a sequence of
measurable functions on $X$. Suppose that\\
{\rm (a)} $0\leq f_1(x) \leq f_2(x) \leq \cdots \leq \infty$ for
every $x
\in X$;\\
{\rm (b)} $f_n(x) \to f(x)$ as $n \to \infty$ for every $x \in X$.\\
Then $f$ is measurable and
$$
   \int_X f_n \, d\mu \to \int_X f \, d\mu
   \qquad {\rm as}\ \ n \to \infty.
$$

This can be written as
$$
  \lim_{n\to\infty} \int_X f_n \, d\mu
  = \int_X \lim_{n\to\infty}f_n \, d\mu.
$$
}

\myproof{By Corollary~\ref{Crflimmeas}, the limit function $f$ is
measurable,
thus $\int_X f \, d\mu$ exists.\\
By Theorem~\ref{TmBasLI}(a), $\intmu[X][f_{n}]  \leq
\intmu[X][f_{n+1}]$, so the integrals $\intmu[X][f_{n}]$ make a
monotonically increasing sequence. Thus
$$
   \exists \alpha \in [0,\infty]\colon\ \ \intmu[X][f_{n}] \to \alpha
   \qquad\text{as}\ \ n\to\infty
$$
We need to show:~~~(i)~$\alpha \leq \int_{X}f\,d\mu$~~~~~(ii)~$\alpha \geq \int_{X}f\,d\mu$ \\
\begin{tabbing}
\num[i] By Theorem~\ref{TmBasLI}(b):
$f_{n} \leq f$~~$\Rightarrow$~~$\intmu[X][f_{n}] \leq \intmu[X][f]$ \ForAll[n>0] \\[4pt]
    \tab $\Arrow \alpha \leq \intmu[X][f]$~~~(i) \\[14pt]
\num[ii] Let $s \in L_{f}$ and $0<c<1$. Consider the sets
$E_{n} = \{x : f_{n} \geq cs(x) \}$~~~\snote[($n=1,2,...$)] \\[4pt]
    \tab\tab\num[\small a] each $E_{n}$ is measurable \tab\snote[(by Exercise~\ref{Exf<g})]\\[4pt]
    \tab\tab\num[\small b] For $x \in E_{n}$:~~~
        $cs(x) \leq f_{n}(x) \leq f_{n+1}(x) \ \Rightarrow \ x \in E_{n+1}$ \ForAll[n>0] \\[4pt]
        \tab\tab\tab $\Arrow E_{n} \subset E_{n+1}$ \ForAll[n>0] \\[4pt]
        \tab\tab\tab $\Arrow E_{1} \subset E_{2} \subset ...$ \tab\snote[(increasing sequence)]\\[2pt]
    \tab\tab\num[\small c] We claim that $X=\cup_{n=1}^{\infty} E_n$. Let $x\in X$.\\[4pt]
      \tab\tab\tab\ptt $f(x)=0\ \ \Rightarrow \ \ s(x)=0,\ f_n(x)=0$ \ForAll[n>0] $\ \ \Rightarrow\ \ x\in E_n$ \ForAll[n>0]\\
      \tab\tab\tab\ptt $f(x)>0\ \ \Rightarrow \ \ cs(x)<f(x)$ \snote[(since $c<1$)] $
      \ \ \Rightarrow\ \ cs(x)<f_n(x)$ \snote[(for some $n$)]\\
      \tab\tab\tab\tab\tab\tab$\ \ \Rightarrow\ \ x\in E_n$ \snote[(for some $n$)] $\Rightarrow\ \ x\in \cup_{n=1}^{\infty} E_n$\\
    \tab\tab\num[\small d]\ptt For each $n \geq 1$:\\
            \tab\tab\tab\tab    $\alpha$ \= ~$\geq$~~
$\intmu[X][f_{n}]$
                                $\stackrel{\rm \ref{TmBasLI}(b)}{\geq}$
$\intmu[E_{n}][f_{n}]$
                                $\stackrel{\rm \ref{TmBasLI}(e)}{=}$        $\intmu[X][f_{n}\chi_{E_n}]$ \\[4pt]
                            \>  $\stackrel{\rm \ref{TmBasLI}(a)}{\geq}$
$\intmu[X][cs\chi_{E_n}]$
                                $\stackrel{\rm \ref{TmBasLI}(e)}{\geq}$
$\intmu[E_n][cs]$
                                $\stackrel{\rm \ref{TmBasLI}(c)}{=}$        $c \intmu[E_n][s]$ \\[5pt]
                            \>  ~$=$~~                      $c
\varphi(E_n)$
                                    ~~~\snote[(where we denote $\varphi(E_n) = \int_{E_n}s\,d\mu$)]\\[8pt]
            \tab\tab\tab $\Arrow \alpha \geq c\varphi(E_n)$
                                ~~\snote[(Note: $\varphi$ is a measure by Theorem~\ref{Tmphimeasure})]\\[12pt]
        \tab\tab\tab\ptt By (a), (b), (c), and Continuity-II (Theorem~\ref{tmCIIa}):\\[6pt]
            \tab\tab\tab\tab $\varphi(E_n) \to \varphi(X) = \intmu[E_n][s]$ \GotoInf[n] \\[4pt]
            \tab\tab\tab\tab $\Arrow \alpha \geq c\varphi(E_n) \to c\intmu[X][s]$ \GotoInf[n]\\[4pt]
            \tab\tab\tab\tab $\Arrow \alpha$~~$\geq$~~$c \intmu[X][s]$ \\[12pt]
    \tab\ Thus,~~$\alpha \geq c\intmu[X][s]$\ForAll[s \in L_f, \ c<1]~~
\=
            $\stackrel{c \to 1}{\Longrightarrow}$~~ $\alpha \geq \intmu[X][s]$ \ForAll[s \in L_f] \\[4pt]
        \>  $\Longrightarrow$~~                     $\alpha \geq \intmu[X][f]$~~~({\rm ii})
\end{tabbing}
By (i) and (ii),~~  $\intmu[X][f_n] \to \alpha = \intmu[X][f]$
\GotoInf[n]
}


\mytheorem{\label{TmLIadd} {\rm (Additivity)} Let $(X,\fM,\mu)$ be a
measure space and $f,g \colon X \to [0, \infty]$ two nonnegative
measurable functions. Then
$$
   \int_X (f+g) \, d\mu = \int_X f \, d\mu + \int_X g \, d\mu.
$$
}

\myproof{Recall that for simple functions the additivity was proved in
Lemma~\ref{Lms+t}. General functions $f$ and $g$ can be approximated by
simple functions due to Theorem~\ref{Tmflims}:
$$
  0\leq s_1\leq s_2\leq \cdots \leq f, \qquad s_n\to f
$$
$$
  0\leq t_1\leq t_2\leq \cdots \leq g, \qquad t_n\to g
$$
Note that $s_n+t_n$ is a simple function for each $n\geq 1$, and
$$
  0\leq (s_1+t_1)\leq (s_2+t_2)\leq \cdots \leq (f+g), \qquad (s_n+t_n)\to (f+g)
$$
Now we have by Lebesgue's Monotone Convergence Theorem
\begin{align*}
  \int_X (s_n+t_n)\, d\mu &\stackrel{\ref{Lms+t}}{=}
  \int_X s_n\, d\mu+\int_X t_n\, d\mu\\
  \downarrow\qquad &\qquad\quad \downarrow\qquad\qquad\downarrow\\
  \int_X (f+g)\, d\mu &=
  \int_X f\, d\mu+\int_X g\, d\mu\\
\end{align*}
The additivity theorem is proved. }

\mycorollary{\label{CrLinLI} Combining with Theorem~\ref{TmBasLI}(c) we
obtain the \textbf{linearity} for the Lebesgue integral: for any
nonnegative measurable functions $f,g \colon X \to [0, \infty]$ and any
nonnegative constants $c,d\geq 0$
$$
  \int_X (cf+dg) \, d\mu = c\int_X f \, d\mu + d\int_X g \, d\mu.
$$
}

\mytheorem{\label{TmSumInt} Let $(X,\fM,\mu)$ be a measure space and
$f_n \colon X \to [0, \infty]$ a sequence of nonnegative measurable
functions on $X$ and
$$
   f(x) = \sum_{n=1}^\infty f_n(x)
   \quad {\rm for}\ {\rm every}\ \ x \in X.
$$
Then $f$ is measurable and
$$
   \int_X f\, d\mu = \sum_{n=1}^{\infty}
   \int_X f_n \, d\mu.
$$
{\rm (That is, summation and integration ``commute'' for nonnegative
functions.)} }

\myproof{ Denote $g_{N} = \sum_{n=1}^{N}f_{n}$. By induction,
Theorem~\ref{TmLIadd} extends to finite sums, hence
$$
  \int_X g_N\, d\mu = \sum_{n=1}^N \int_X f_n\, d\mu
$$
Note that $g_1\leq g_2\leq \cdots $ and $g_N \to f$ as $N\to\infty$.
Now
$$
     \sum_{n=1}^{\infty}
   \int_X f_n \, d\mu = \lim_{N\to\infty}\sum_{n=1}^N \int_X f_n\, d\mu
    =\lim_{N\to\infty} \int_X g_N\,d\mu = \int_X f\, d\mu
$$
(the last identity follows from Lebesgue's Monotone Convergence
Theorem). }

\mycorollary{\label{Crsumsumaa} If $a_{ij} \geq 0$ for all $i,j
=1,2,\ldots$, then
$$
   \sum_{i=1}^{\infty} \sum_{j=1}^{\infty} a_{ij} =
   \sum_{j=1}^{\infty} \sum_{i=1}^{\infty} a_{ij}.
$$
}

\myproof{Let $( X, \fM, \mu ) = ( \IN, 2^{\IN}, \mu)$, where $\mu$ is
the counting measure. For each $i\geq 1$ define a function $f_i\colon
\IN\to [0,\infty)$ by $f_i(j)=a_{ij}$ for all $j\in\IN$. Then by
Exercise~\ref{ExLIcount} $\int_{\IN} f_i\, d\mu =
\sum_{j=1}^{\infty}a_{ij}$. Therefore
$$
   \sum_{i=1}^{\infty} \sum_{j=1}^{\infty} a_{ij} =
   \sum_{i=1}^{\infty} \int_{\IN} f_i\, d\mu
   \stackrel{\ref{TmSumInt}}{=}
   \int_{\IN} \Bigl(\sum_{i=1}^{\infty} f_i\Bigr)\, d\mu=
   \sum_{j=1}^{\infty} \sum_{i=1}^{\infty} a_{ij}.
$$
in the end we used the result of Exercise~\ref{ExLIcount} once again.}

\pt Without assumption $a_{ij} \geq 0$ Corollary~\ref{Crsumsumaa}
fails. As we remember from calculus, the sum of an infinite series may
depend on the order in which its terms are added.

\topic{Motivating example}{Let \begin{itemize} \item $(X,\fM,\mu)$ a
measure space \item $f_n \colon X \to [0, \infty]$ nonnegative
measurable functions \item $f_n(x) \to f(x)$, as $n\to\infty$, for
every $x\in X$ (i.e., $f_n$ converge to $f$
\emph{pointwise})\end{itemize}  Here is a big question:\medskip

\centerline{\framebox{Is it true that $\int f_n\, d\mu \to \int f\,
d\mu$?}}\medskip

Suppose for example that $X=[0,1]$, $\mu=\bm$ is the Lebesgue measure,
and $f(x)\equiv 1$, so that $\int_{[0,1]} f\, d\bm = 1$. Let
$\varepsilon>0$. The pointwise convergence means that for every $x\in
[0,1]$ there is $N_x$ such that $|f_n(x)-f(x)|<\varepsilon$ for all
$n\geq N_x$. So if we wait long enough, then the current value $f_n(x)$
will be almost equal to the limit value $f(x)=1$. Of course the waiting
period $N_x$ depends on $x\in [0,1]$, but the longer we wait the more
and more points $x\in [0,1]$ will have the above property
$|f_n(x)-f(x)|<\varepsilon$. If we wait long enough, then those points
will make an overwhelming majority in $[0,1]$, i.e., the set of points
$A=\{x\in [0,1]\colon |f_n(x)-f(x)|<\varepsilon\}$ will have measure
$\bm(A)>1-\varepsilon$ for sufficiently large $n$. And then
$$
  \int_{[0,1]} f_n\,d\bm \geq \int_{A} f_n\,d\bm
  \geq \int_{A} (1-\varepsilon) \,d\bm = (1-\varepsilon) \bm(A)
  > (1-\varepsilon)^2.
$$
Thus the limit value of the integral \underline{cannot be smaller} than
one:
$$
  \liminf_{n\to\infty} \int_{[0,1]} f_n\,d\bm \geq 1 = \int_{[0,1]} f\,d\bm.
$$
But \underline{can it be larger} than one? Yes!\medskip

Suppose $f_n(x) = 1 + n\chi_{(0,\frac 1n)}$. This function takes a
constant value, 1, everywhere except a small open interval $(0,\frac
1n)$, on which its value is big (equal to $1+n$). Then $\int_{[0,1]}
f_n\,d\bm = 2$ for every $n\geq 1$, but the limit function is still
$f(x) \equiv 1$ and its integral still equals 1. We can say that the
``mass'' of each function $f_n$ equals 2, but only half of that
``mass'' reaches the limit function $f$; the other half ``escapes
through holes'' or ``falls through cracks''. The role of ``holes'' or
``cracks'' is played by the vanishing intervals $(0,\frac 1n)$. }

\newpage

\mytheorem{{\rm (Fatou's Lemma)} Let $(X,\fM,\mu)$ be a measure space
and $f_n \colon X \to [0, \infty]$ a sequence of nonnegative measurable
functions on $X$. Then
$$
   \int_X \Bigl(\liminf_{n\to\infty}
   f_n \Bigr)\, d\mu \leq \liminf_{n\to\infty}
   \int_X f_n \, d\mu.
$$
}

\myproof{Recall that (cf.~\eqref{limsup})
$$
  \liminf_{n \to \infty}f_n = \lim_{n \to \infty}g_n,
  \qquad g_n = \inf\{f_{n},f_{n+1},...\}.
$$
Note that $g_1 \leq g_2 \leq \ldots$ is a monotonically increasing
sequence, hence by Lebesgue Monotone Convergence Theorem
$$
   \lim_{n \to \infty}\intmu[X][g_n]= \intmu[X][(\lim_{n \to \infty}g_n)]=
    \intmu[X][(\liminf_{n \to \infty}f_n)].
$$
Also note that $g_n \leq f_n$ for each $n=1,2,\ldots$, hence
\begin{align*}
   &\ArrowN[\ref{TmBasLI}(a)]   \intmu[X][g_n] \leq \intmu[X][f_n] \\
   &\Arrow  \liminf_{n \to \infty}\intmu[X][g_n] \leq \liminf_{n \to \infty}\intmu[X][f_n] \\
   &\ArrowN[\ref{Prlimsupinf}(d)]  \lim_{n \to \infty}\intmu[X][g_n] \leq \liminf_{n \to \infty}\intmu[X][f_n]\\
   &\Arrow  \intmu[X][(\liminf_{n \to \infty}f_n)] \leq \liminf_{n \to \infty}\intmu[X][f_n]
\end{align*}
}

\myexercise{Let $E \subset X$ be such that $\mu(E)>0$ and $\mu(E^c)>0$.
Put $f_n =\chi_E$ if $n$ is odd and $f_n = 1-\chi_E$ if $n$ is even.
What is the relevance of this example to Fatou's lemma?}

\myexercise{ Construct an example of a sequence of nonnegative
measurable functions $f_n \colon X \to [0,\infty)$ such that
$f(x)=\lim_{n\to\infty} f_n(x)$ exists pointwise, but
$$
   \int_X f\, d\mu < \liminf_{n\to\infty} \int_X f_n \, d\mu.
$$
}

\mytheorem{ Let $(X,\fM,\mu)$ be a measure space and $f \colon X \to
[0, \infty]$ a nonnegative measurable function on $X$ . Then
$$
   \varphi(E) = \int_E f\, d\mu
$$
is a measure on $\fM$. Furthermore,
$$
   \int_X g\, d\varphi = \int_X gf\, d\mu
$$
for every nonnegative measurable function $g$ on $X$. }

$\bullet$ The last identity allows us to write $d\varphi = f\,
d\mu$, rather informally.

\myproof{First we prove that $\varphi$ is a measure:
$$
   \varphi(\emptyset) = \intmu[\emptyset][f] \ \EqN[\ref{TmBasLI}(d)] \ 0.
$$
Let $E = \uplus_{n=1}^{\infty}E_n$ for some $E, E_n \in \fM$. Then
\begin{align*}
   \varphi(E)&= \intmu[E][f]\ \EqN[\ref{TmBasLI}(e)]\ \intmu[X][\chi_{E}f]=\intmu[X][\chi_{\uplus_{n}E_n}f]\\
   &=\intmu[X][\Bigl( \sum_{n=1}^{\infty}\chi_{E_n} \Bigr) f]=\intmu[X][\Bigl(
    \sum_{n=1}^{\infty}\chi_{E_n} f \Bigr)]\EqN[\ref{TmSumInt}]\sum_{n=1}^{\infty}\intmu[X][\chi_{E_n}f]\\
    &\EqN[\ref{TmBasLI}(e)]\sum_{n=1}^{\infty} \intmu[E_n][f]=\sum_{n=1}^{\infty}\varphi(E_n).
\end{align*}
Next we prove that $\intphi[X][g] = \intmu[X][gf]$. First suppose $g =
s = \sum_{i=1}^{m}\alpha_{i}\chi_{A_i}$ is a simple function. Then
\begin{align*}
  \intphi[X][s] &\stackrel{\ref{CrLinLI}}{=}
  \sum_{i=1}^{m}\alpha_{i}\varphi(A_i) = \sum_{i=1}^{m}\alpha_{i}\intmu[A_i][f]\\
        &\EqN[\ref{TmBasLI}(c)] \sum_{i=1}^{m}\intmu[A_i][\alpha_{i}f]
        \EqN[\ref{TmBasLI}(e)] \sum_{i=1}^{m}\intmu[X][\alpha_{i}\chi_{A_i}f]\\
        &\EqN[\ref{TmLIadd}] \intmu[X][\bigg(\sum_{i=1}^{m}\alpha_{i}\chi_{A_i}f \bigg)]
        =\intmu[X][sf].
\end{align*}
Now let $g \geq 0$ be arbitrary measurable function. By
Theorem~\ref{Tmflims}, $g$ can be approximated by simple functions
$$
   0\leq s_1 \leq s_2 \leq \cdots \leq g, \qquad s_n\to g,
$$
hence by Lebesgue's Monotone Convergence Theorem
$$
   \intmu[X][s_{n}f] = \int_X s_n\, d\varphi \to \int_X g\, d\varphi.
$$
On the other hand, since $f\geq 0$, we have
$$
   0\leq s_1f \leq s_2f \leq \cdots \leq gf, \qquad s_nf\to gf,
$$
hence again by Lebesgue's Monotone Convergence Theorem
$$
  \intmu[X][s_{n}f] \to \intmu[X][gf].
$$
Thus we conclude $$\intphi[X][g] = \intmu[X][gf]$$ proving the theorem.
}

\mycorollary{\label{CrAB} Let $(X,\fM,\mu)$ be a measure space and $f
\colon X \to [0, \infty]$ a nonnegative measurable function on $X$ .
Then for every $A,B \in \fM$, $A\cap B = \emptyset$
$$
   \int_{A\uplus B} f\, d\mu =
   \int_A f\, d\mu + \int_B f\, d\mu.
$$
}

So far we have only used Lebesgue integral for nonnegative
functions. In the next chapter we define Lebesgue integral for
general real-valued and complex-valued functions.

\newpage

%****************************************************************************

\section{Lebesgue integration for real- and complex-valued functions}
\label{ChLIall}

\mydefinition{\label{DefL1} We say that a measurable function
$f\colon X\to\IR$ or $f\colon X\to\IC$ is \textbf{Lebesgue
integrable} if
$$
    \int_X |f|\, d\mu <\infty.
$$
The set of all integrable functions is denoted by $L^1_{\mu}(X)$. }

$\bullet$ The function $|f|$ is measurable due to
Corollary~\ref{tm|f|}.

$\bullet$ The above integral is defined since $|f| \geq 0$; its
value is either a nonnegative finite number or infinity.

Recall that for a real-valued function $f\colon X\to \IR$ we have
$|f|= f^+ + f^-$, where $f^+\geq 0$ and $f^-\geq 0$; see
\eqref{f+f-}. Thus

\mylemma{For any real-valued measurable function $f\colon X\to \IR$
$$
    \int_X |f|\, d\mu  = \int_X f^+\, d\mu + \int_X f^-\, d\mu.
$$
The integral on the left is finite if and only if both integrals on the
right are finite:
$$
   \int_X |f|\, d\mu<\infty \quad\Longleftrightarrow\qquad
   \int_X f^+\, d\mu<\infty \quad\text{and}\quad\int_X f^-\, d\mu<\infty.
$$
 }

\mydefinition{\label{DefLIreal} Let $f\colon X\to \IR$ be an integrable
real-valued function. Then its \textbf{Lebesgue integral} over any
measurable set $E\in\fM$ is defined by
$$
    \int_E f\, d\mu = \int_E f^+\,d\mu-\int_Ef^-\,d\mu
$$
(Recall: $f=f^+-f^-$, due to Eq.~\eqref{f+f-}.)}

\newpage

\mylemma{For any complex-valued measurable function $f\colon X\to \IC$
denote by $u=\,\re\, f$ and $v=\,\im\, f$ its real and imaginary parts,
so that $f = u+\bi v$. Then
$$
    \max\{|u|,|v|\} \leq |f| \leq |u|+|v|
$$
Therefore, $f$ is integrable if and only if both $u$ and $v$ are
integrable:
$$
   \int_X |f|\, d\mu<\infty \quad\Longleftrightarrow\qquad
   \int_X |u|\, d\mu<\infty \quad\text{and}\quad\int_X |v|\, d\mu<\infty.
$$
 }

\mydefinition{\label{DefLIcomplex} Let $f\colon X\to \IC$ be an
integrable complex-valued function. Let $u=\,\re\, f$ and $v=\,\im\, f$
are its real and imaginary parts, so that $f = u+\bi v$. Then the
\textbf{Lebesgue integral} of $f$ over any measurable set $E\in\fM$ is
defined by
$$
    \int_E f\, d\mu = \int_E u\,d\mu
    + \bi \int_E v\,d\mu.
$$
}

\pt In other words, we integrate the real part and the imaginary
part separately:
\beq  \label{reim}
  \re\int_E f\,d\mu = \int_E \re\, f \, d\mu
  \quad\text{and}\quad
  \im\int_E f\,d\mu = \int_E \im\, f \, d\mu.
\eeq

$\bullet$ The integral of a real-valued function is a (finite) real
number.

$\bullet$ The integral of a complex-valued function is a (finite)
complex number.

\newpage

\topic{Two types of Lebesgue integrals?}{For nonnegative measurable
functions $f\colon X\to [0,\infty]$ we have defined the Lebesgue
integral $\int_X f\, d\mu$ twice: in Definition~\ref{DefLIE} and here
in Definition~\ref{DefLIreal}. Do these definitions agree? Not quite.
\medskip

By Definition~\ref{DefLIE}, the integral $\int_X f\, d\mu$ is always
defined, though its value may be finite or infinite. When its value is
finite, then by Definition~\ref{DefLIreal} (note that $f=f^+$ in this
case) $f$ is integrable and its integral is the same as the one due to
Definition~\ref{DefLIE}. In this sense our definitions agree.
\medskip

However, if the value of  $\int_X f\, d\mu$ by
Definition~\ref{DefLIE} is infinite, then by
Definition~\ref{DefLIreal} the function $f$ is \underline{not
integrable}, so the integral $\int_X f\, d\mu$ is \underline{not
defined}. Thus the new Definition~\ref{DefLIreal} is just a
restriction of the old Definition~\ref{DefLIE} to the category of
functions whose integral is finite.\medskip

This little disagreement will not cause us trouble. (In fact, with
the following extension, Definition~\ref{DefLIreal} will fully agree
with Definition~\ref{DefLIE}.)}

\topic{Possible extension of Definition~\ref{DefLIreal}}{If one of
the integrals $\int_E f^+\,d\mu$ and $\int_Ef^-\,d\mu$ is infinite,
but the other finite, the formula in Definition~\ref{DefLIreal}
still makes sense. Precisely,
$$
  \int_E f^+\,d\mu = \infty,\quad \int_Ef^-\,d\mu<\infty
  \quad\Longrightarrow\quad \int_Ef\,d\mu = \infty
$$
and
$$
  \int_E f^+\,d\mu < \infty,\quad \int_Ef^-\,d\mu=\infty
  \quad\Longrightarrow\quad \int_Ef\,d\mu = -\infty
$$
Occasionally, such extensions are used, and we will need them in
Chapter~\ref{ChLp}.\medskip

Note though that if both integrals $\int_E f^+\,d\mu$ and
$\int_Ef^-\,d\mu$ are infinite, then the formula in
Definition~\ref{DefLIreal} makes no sense, because $\infty-\infty$ is
not defined. }

\mylemma{Let $f\in L^1_{\mu}(X)$. If $A\cap B=\emptyset$ are disjoint
measurable sets, then
$$
  \int_{A\cup B}f\,d\mu = \int_Af\, d\mu+\int_Bf\,d\mu.
$$}

\myproof{We just need to break down all the three integral into $\re f$
and $\im f$, and then integrate the positive and negative parts
separately applying Corollary~\ref{CrAB}.}

\mytheorem{\label{TmLIlin}{\rm (Linearity)} Let $f,g \in L^1_{\mu}(X)$
and $\alpha,\beta \in \IC$. Then
$$
   \int_X (\alpha f+\beta g)\, d\mu = \alpha\int_Xf\,d\mu
   +\beta\int_Xg\,d\mu.
$$
In particular, $\alpha f+\beta g \in L^1_{\mu}(X)$. }

\pt Note: the proof is tricky!

\myproof{First we show that $\alpha f+\beta g$ is integrable. By
standard triangle inequality
$$
   |\alpha f+\beta g| \leq |\alpha|\,|f| + |\beta|\,|g|
$$
therefore due to Theorem~\ref{TmBasLI}(a,c) and Theorem~\ref{TmLIadd}
$$
   \int_X|\alpha f+\beta g|\,d\mu \leq
   |\alpha|\int_X|f|\,d\mu + |\beta|\int_X|g|\,d\mu<\infty.
$$
Next it is enough to prove two facts:
\beq \label{IIsum}
   \int_X (f+g)\, d\mu = \int_Xf\,d\mu+\int_Xg\,d\mu
\eeq
and
\beq \label{IIfac}
   \int_X (\alpha f)\, d\mu = \alpha\int_Xf\,d\mu
\eeq
the combination of which readily implies our theorem.

First we prove \eqref{IIsum}. Since we integrate the real part and
imaginary part separately, and since $\re(f+g)=\re f+\re g$ and $\im
(f+g)= \im f+\im g$, it will be enough to treat real valued functions
$f,g\colon X\to \IR$ only.

Next, it is tempting to break down each real-valued function into its
positive and negative parts. However, this will not work, because
$(f+g)^+ \neq f^+ + g^+$ and $(f+g)^- \neq f^- + g^-$, generally
speaking.

We use a different trick. Denote $h=f+g$, then
$$
   h^+-h^- = (f^+-f^-)+(g^+-g^-)
   \quad\Longrightarrow\quad
   h^++f^-+g^- = h^-+f^++g^+.
$$
Now on each side of the last equation we have a sum of nonnegative
functions, thus we can use Theorem~\ref{TmLIadd} to get
$$
   \int_X h^+\,d\mu +\int_X f^-\,d\mu +\int_X g^-\,d\mu =
   \int_X h^-\,d\mu +\int_X f^+\,d\mu +\int_X g^+\,d\mu.
$$
Rearranging these integrals gives
$$
   \int_X h^+\,d\mu -\int_X h^-\,d\mu =
    \int_X f^+\,d\mu -\int_X f^-\,d\mu +\int_X g^+\,d\mu -\int_X g^-\,d\mu.
$$
Using Definition~\ref{DefLIreal} gives
$$
   \int_X h\,d\mu =
    \int_X f\,d\mu +\int_X g\,d\mu,
$$
which proves \eqref{IIsum}.

Now we prove \eqref{IIfac}. Suppose first that $\alpha\geq 0$ and
$f=f^+-f^-$ is a real-valued function. Then $(\alpha f)^+ = \alpha f^+$
and $(\alpha f)^- = \alpha f^-$, hence
$$
   \int_X (\alpha f)\, d\mu = \int_X (\alpha f)^+\, d\mu-\int_X (\alpha f)^-\, d\mu
   \stackrel{\ref{TmBasLI}(c)}{=}
   \alpha\int_X f^+\, d\mu-\alpha\int_X f^-\, d\mu=\alpha\int_Xf\,d\mu
$$
If $\alpha<0$, then $(\alpha f)^+ = -\alpha f^-$ and $(\alpha f)^- =
-\alpha f^+$, hence
$$
   \int_X (\alpha f)\, d\mu = \int_X (\alpha f)^+\, d\mu-\int_X (\alpha f)^-\, d\mu
   \stackrel{\ref{TmBasLI}(c)}{=}
   -\alpha\int_X f^-\, d\mu+\alpha\int_X f^+\, d\mu=\alpha\int_Xf\,d\mu
$$
Thus we proved \eqref{IIfac} for any real $\alpha$ and any real-valued
function $f$. To handle complex constants $\alpha=a+\bi b$ and
complex-valued functions $f=u +\bi v$, note that
$$
  \alpha f = (au-bv) + \bi (av+bu),
$$
hence by Definition~\ref{DefLIcomplex}
$$
  \int_X (\alpha f)\, d\mu = \int_X (au-bv)\,d\mu + \bi \int_X (av+bu)\,d\mu,
$$
and now we can use the already proved linearity for real-valued
functions.
 }

\myexercise{\label{ExIleqI} Let $f,g \in L^1_{\mu}(X)$ be real-valued
functions and $f\leq g$. Show that
$$
   \int_X f\, d\mu \leq \int_X g\, d\mu.
$$
}

\myexercise{Let $f_n \colon X\to [0,\infty]$ be a sequence of
measurable functions such that $f_1 \geq f_2 \geq \cdots \geq 0$ and
$\lim_{n\to\infty} f_n(x) = f(x)$ for every $x\in X$. Suppose $f_1\in
L^1_{\mu}(X)$. Show that
$$
   \lim_{n\to\infty}
   \int_X f_n \, d\mu=\int_X f \, d\mu.
$$
}

\newpage

\mytheorem{\label{TmITI} {\rm (Integral triangle inequality)} If $f \in
L^1_{\mu}(X)$ is a real-valued or complex-valued function, then
$$
   \Bigl|\int_X f\, d\mu\Bigr|\leq \int_X|f|\,d\mu.
$$
}

\pt The analogy with the triangle inequality is clear if we replace
integration with summation.

\myproof{Case 1: $f:X \to [ -\infty, \infty ]$ is a real-valued
function with possible infinite values. Then
\begin{align*}
    \Big|\intmu[X][f] \Big| &= \Big|    \intmu[X][f^+]-\intmu[X][f^-] \Big|\\
    &\leq \Big| \intmu[X][f^+] \Big| + \Big| \intmu[X][f^-] \Big|
   \qquad\text{\footnotesize (By triangle inequality for real numbers)}\\
    &\leq \intmu[X][f^+]         +       \intmu[X][f^-]
   \qquad\text{\footnotesize (Because $f^+\geq 0$ and $f^-\geq 0$)}\\
    &=\intmu[X][(f^+ + f^-)]
   \qquad\text{\footnotesize (By Theorem~\ref{TmLIadd})}\\
    &=\intmu[X][|f|]
   \qquad\text{\footnotesize (by Eq.~\eqref{f+f-})}
\end{align*}
Case 2: $f:X \to \IC$ is a complex-valued function with finite
values. Then
$$
   \intmu[X][f] \in \IC
  \qquad \Longrightarrow\qquad \exists \theta \in [0,2\pi)\colon
  \quad\intmu[X][f] = e^{\bi \theta}\, \Big| \intmu[X][f]
   \Big|.
$$
Therefore
\begin{align*}
    \Big|\intmu[X][f] \Big| &= e^{-\bi \theta}\intmu[X][f]\\
    &=  \intmu[X][e^{-\bi \theta}f]
   \qquad\text{\footnotesize (By Linearity, Theorem~\ref{TmLIlin})}\\
    &= \re\intmu[X][e^{-\bi \theta}f]
   \qquad\text{\footnotesize (Because it is a real number)}\\
    &= \intmu[X][\re \bigl(e^{-\bi \theta}f\bigr)]
   \qquad\text{\footnotesize (By Eq.~\eqref{reim})}\\
    &\leq \intmu[X][|f|]
   \qquad\text{\footnotesize (Because $\re (z) \leq |z|$ for any $z\in\IC$)}
\end{align*}
Note: in the last step we also used the result of
Exercise~\ref{ExIleqI}. }

\newpage

\mytheorem{\label{TmLDC} {\rm (Lebesgue's Dominated Convergence)} Let
$f_n \colon X\to \IC$ be a sequence of measurable functions such that
$$
  \lim_{n\to\infty} f_n(x) = f(x)
  \qquad \forall x\in X
$$
Suppose there exists $g\in L^1_{\mu}(X)$ such that
$$
   |f_n(x)|\leq g(x)\qquad
   \forall x\in X,\ \  \forall n=1,2,\ldots
$$
i.e., the functions $f_n(x)$ are \emph{dominated} by $g(x)$. Then
\begin{itemize}\item[\rm (a)] $f\in L^1_{\mu}(X)$ \item[\rm (b)]
$   \lim_{n\to\infty} \int_X|f_n-f|\,d\mu =0 $
\item[\rm (c)] $ \lim_{n\to\infty} \int_X f_n \, d\mu=\int_X f \,
    d\mu.$
\end{itemize}
}

\myproof{(a) The limit $f(x)$ of measurable functions $f_n(x)$ is
measurable by Corollary~\ref{Crflimmeas}. By standard calculus rules we
also have $|f(x)| \leq g(x)$, hence
$$
  \int_X |f(x)|\, d\mu \stackrel{\ref{TmBasLI}{\rm (a)}}\leq \int_X g(x)\, d\mu <\infty
$$
therefore $f\in L^1_\mu(X)$.\medskip

\noindent (b) Similarly to Part (a), for every $n\geq 0$,
$$
  |f_n - f| \leq |f_n| + |f|\leq 2g
    \qquad \Longrightarrow\qquad
  |f_n-f| \in L^1_{\mu}(X).
$$
Note also that $$2g-|f_n - f| \geq 0,$$ thus Fatou's lemma will apply
to these functions. We also have
$$
   \lim_{n \to \infty}(2g-|f_n-f|)=2g-\lim_{n \to \infty}|f_n-f|=2g,
$$
therefore
\begin{align*}
   \intmu[X][2g]
   &= \intmu[X][\lim_{n \to \infty}(2g-|f_n-f|)]\\
   &= \intmu[X][\liminf_{n \to \infty}(2g-|f_n-f|)]
   \qquad\text{\footnotesize (By Proposition~\ref{Prlimsupinf}(d))}\\
    &\leq \liminf_{n \to \infty}\intmu[X][(2g-|f_n-f|)]
   \qquad\text{\footnotesize (By Fatou's Lemma)}\\
    &=\liminf_{n \to \infty}\big( \intmu[X][2g]-\intmu[X][|f_n-f|] \big)
   \qquad\text{\footnotesize (By Linearity, \ref{TmLIlin})}\\
    &=\intmu[X][2g]-\limsup_{n \to \infty}\intmu[X][|f_n-f|]
   \qquad\text{\footnotesize (By Proposition~\ref{Prlimsupinf}(a))}.
\end{align*}
Canceling $\intmu[X][2g]$ gives
$$
   \limsup_{n \to \infty}\intmu[X][|f_n-f|] \leq 0.
$$
Since this is a sequence of nonnegative numbers, this relation is only
possible if
$$
   \lim_{n \to \infty}\intmu[X][|f_n-f|] = 0.
$$

\noindent (c) Using the linearity and the integral triangle inequality
$$
  0 \leq    \Big|\intmu[X][f_n]-\intmu[X][f]\Big| \stackrel{\ref{TmLIlin}}{=}
  \Big|\intmu[X][(f_n-f)]\Big|
        \stackrel{\ref{TmITI}}{\leq}    \intmu[X][\big|f_n-f\big|] \to 0
$$
where in the end we used Part (b). }

\mycorollary{If $f\in L^1_{\mu}(X)$ and $E_1\supset E_2\supset \cdots$
is a sequence of measurable sets such that $\mu(E_n)\to 0$ as
$n\to\infty$, then $\int_{E_n} f\, d\mu \to 0$ as $n\to\infty$.}

\myproof{Denote $E = \cap_{n=1}^{\infty}E_n$. By Continuity-I
(Theorem~\ref{tmCIa}) we have $$\mu(E)=\lim_{n\to\infty}\mu(E_n)=0.$$
Consider functions $f_n = \chi_{E_n}f$ for all $n\geq 1$. By direct
inspection
$$
 \lim_{n \to\infty}f_{n}(x) = \bar{f}(x)
 \colon= \left\{ \begin{array}{cl}   0 & x \notin E \\   f(x) & x \in E   \end{array}\right.
$$
Also note that $|f_n|\leq |f|\in L^1_{\mu}(X)$, hence by Lebesgue's
Dominated Convergence Theorem
$$
  \int_{E_n} f\, d\mu \stackrel{\ref{TmBasLI}{\rm (e)}}{=}
  \int_X f_n\, d\mu \stackrel{\ref{TmLDC}}{\to} \int_X \bar{f}\, d\mu
$$
as $n\to\infty$, and
$$
\int_X \bar{f}\, d\mu
  \stackrel{\ref{CrAB}}=
   \int_{X\setminus E} 0\, d\mu + \int_E f\, d\mu = 0,
$$
where the first integral is $0\cdot\mu(X\setminus E)=0$, and the second
is zero due to Theorem~\ref{TmBasLI}.}

\newpage

%************************************************************************

\section{Role of sets of measure zero (null sets)}


Let $(X,\fM,\mu)$ be a measure space and $Y$ a topological space.

\mydefinition{Let $P(x)$ be a property which a point $x \in X$ may
or may not have. We say that $P$ holds \textbf{almost everywhere
(a.e.)} on a set $E \subset X$ if there exists $N \subset X$,
$\mu(N)=0$, such that $P$ holds at every $x \in E \setminus N$.}

\mydefinition{Given two measurable functions $f,g\colon X\to Y$, we
say that $f=g$ a.e.\ if $\mu\{x\in X\colon f(x)\neq g(x)\}=0$.}

\pt $f=g$ a.e.\ is an equivalence relation.

\mydefinition{We say that a sequence of measurable functions
$f_n(x)$ converges a.e.\ to a limit function $f(x)$ if $\mu\{x\in
X\colon f_n(x) \nrightarrow f(x)\}=0$.}

A general philosophy of Real Analysis is that sets of measure zero are
negligible, what happens in those sets is insignificant. In many
instances null sets are handled somewhat casually or ignored
altogether.

\newpage

\mytheorem{\label{TmIfg0} Let $f,g\colon X\to [-\infty,\infty]$ or
$f,g\colon X\to\IC$ be two measurable functions. If $f = g$ a.e., then
$\int_E f\, d\mu = \int_E g\,d\mu$ for any $E \in \fM$.}

\pt In this theorem, either both integrals exist ($\Rightarrow$
equal) or both fail to exist.

\myproof{Denote $N = \{ x \colon \ f(x) \neq g(x) \}$. By our
assumption, $\mu(N)=0$.\medskip

\noindent Case 1: $f,g\colon X \to [0,\infty]$ are nonnegative
functions (with possible infinite values). We decompose $E$ as $E =
(E\setminus N) \uplus (E \cap N)$. Note that $\mu(E \cap N) \leq
\mu(N)=0$. Therefore
\begin{align*}
  \int_E f\, d\mu &\stackrel{\ref{CrAB}}= \int_{E\setminus N}f\,d\mu+\int_{E\cap N}f\,d\mu\\
  \int_E g\, d\mu &\stackrel{\ref{CrAB}}= \int_{E\setminus N}g\,d\mu+\int_{E\cap N}g\,d\mu.
\end{align*}
The integrals over $E\setminus N$ are equal because $f=g$ on
$E\setminus N$. The integrals over $E\cap N$ are both equal to zero,
because $\mu(E \cap N)=0$; cf.\ Theorem~\ref{TmBasLI}(d).
\medskip

\noindent Case 2: $f,g\colon X \to [-\infty,\infty]$ are real-valued
functions (with possible infinite values). By direct inspection, if
$f(x)=g(x)$, then $f^+(x)=g^+(x)$ and $f^-(x)=g^-(x)$. Therefore
$f^+=g^+$ a.e.\ and $f^-=g^-$ a.e. Now by Case 1
$$
  \int_E f\, d\mu = \int_E f^+\, d\mu - \int_E f^-\, d\mu
  =\int_E g^+\, d\mu - \int_E g^-\, d\mu =\int_E g\, d\mu.
$$
\noindent Case 3: $f,g\colon X \to \IC$ are complex-valued functions
with finite values. Again, by direct inspection, if $f(x)=g(x)$, then
$\re f(x)= \re g(x)$ and $\im f(x)=\im g(x)$. Therefore $\re f=\im g$
a.e.\ and $\re f=\im g$ a.e. Now by Case 2
$$
  \int_E f\, d\mu = \int_E \re f\, d\mu +\bi \int_E \im f\, d\mu
  =\int_E \re g\, d\mu +\bi \int_E \im g\, d\mu =\int_E g\, d\mu.
$$
}

\pt In plain words: a function $f$ can be modified arbitrarily on a set
of measure zero, and this will not affect the value of its integral
(over any set $E$).

\newpage

Therefore, for the purpose of integration we do not even have to define
a function $f$ on the whole space $X$; it is enough to define it on a
set of full measure. We will say that such functions are defined
\emph{almost everywhere}.

\mydefinition{Let $(X,\fM,\mu)$ be a measure space and $Y$ a
topological space. We say that a function $f$ with values in $Y$ is
\textbf{measurable and a.e.\ defined} on $X$ if there exists $N\subset
X$ with $\mu(N)=0$, such that $f$ is defined on $X \setminus N$ and for
every open set $V \subset Y$ we have $f^{-1}(V) \setminus N \in \fM$. }

\pt The function $f$ in the above definition may also be defined on $N$
or on any part of $N$.

\myexercise{ Let $f$ be a function as above. Fix a $y\in Y$ and
define
$$
   \tilde{f}(x) = \left\{ \begin{array}{cc}
   f(x) & \text{if}\ \ x \in X\setminus N\\
   y & \text{if} \ \ x \in N \end{array}\right ..
$$
Show that $\tilde{f} \colon X \to Y$ is measurable. }

\myexercise{ Let $f$ be a function as above and $\mu$ a complete
measure. Let $g\colon X\to Y$ be an arbitrary (not necessarily
measurable) function. Define
$$
   \tilde{f}(x) = \left\{ \begin{array}{cc}
   f(x) & \text{if}\ \ x \in X\setminus N\\
   g(x) & \text{if} \ \ x \in N \end{array}\right ..
$$
Show that $\tilde{f} \colon X \to Y$ is measurable. }

\newpage

\myproposition{\label{PrNNN} {\rm (a)} Let $N_1,N_2,\ldots$ be null
sets. Then $N=\cup_{i=1}^{\infty}N_i$ is a null set.\\{\rm (b)} Let
$A_1,A_2,\ldots$ be full measure sets. Then $A=\cap_{i=1}^{\infty}A_i$
is a full measure set.}

\myproof{(a) By the $\sigma$-subadditivity (Theorem~\ref{TmSigsubadd})
$$
  \mu\Bigl(\cup_{i=1}^{\infty}N_i\Bigr)\leq
  \sum_{i=1}^{\infty} \mu(N_i) = \sum_{i=1}^{\infty} 0 = 0,
$$
hence $\mu(N)=0$.\\
(b) Note that $A_i^c$ are null sets. Now
$$
   A^c = \Bigl(\cap_{i=1}^{\infty}A_i\Bigr)^c = \cup_{i=1}^{\infty}A_i^c
$$
which is a null set due to Part (a). }

\pt If $f_1,f_2,\ldots$ are measurable and a.e.\ defined functions,
then there exists a full measure set $A\subset X$ on which \emph{all}
of these functions are defined.

\topic{``Almost everywhere'' principle}{The convergence theorems proven
in Chapters~\ref{ChLIpos}--\ref{ChLIall} can be extended to functions
defined a.e., and the assumptions made on those functions only need to
hold a.e. For example, in Lebesgue's Monotone and Dominated Convergence
Theorems we only need to assume that $f_n \to f$ a.e., $|f_n(x)| \leq
g(x)$ a.e., etc. In Theorem~\ref{TmSumInt}, we only need to assume that
$f(x) = \sum_{n=1}^\infty f_n(x)$ a.e., etc. }

\newpage

\mytheorem{\label{TmSumBC} Let $\{f_n\}$ be a sequence of complex
measurable functions defined a.e.\ on $X$ and
$$
   \sum_{n=1}^{\infty} \int_X |f_n|\, d\mu < \infty.
$$
Then the series $f(x) =\sum_{n=1}^{\infty} f_n(x)$ converges for a.e.\
$x\in X$ and
$$
   \sum_{n=1}^{\infty} \int_X f_n\, d\mu = \int_X f\, d\mu.
$$
}

\myproof{For each $n\geq 1$ the function $f_n$ is supposed to be
defined on a full measure set, call it $S_n$. Then \emph{all} these
functions are defined on the intersection $S =\cap_{n=1}^{\infty} S_n$,
and $S$ is  a full measure set due to Proposition~\ref{PrNNN}(b).

For each $x\in S$ denote $\varphi(x) = \sum_{n=1}^{\infty}
|f_n(x)|$. By Theorem~\ref{TmSumInt} we have
$$
  \int_S \varphi\, d\mu = \int_S\sum_{n=1}^{\infty} |f_n|\,d\mu
  \stackrel{\ref{TmSumInt}}{=}\sum_{n=1}^{\infty} \int_S|f_n|\,d\mu <\infty.
$$
(note: here we can integrate over $X$, instead of $S$, due to
Theorem~\ref{TmIfg0}).

According to Theorem~\ref{TmBasLI}(f), $E = \{x\in S\colon
\varphi(x)<\infty\}$ is a full measure set. For every $x\in E$ we have
$\sum_{n=1}^{\infty} |f_n(x)| = \varphi(x) < \infty$, in particular,
the series $\sum_{n=1}^{\infty} f_n(x)$ converges absolutely. Therefore
$f(x) = \sum_{n=1}^{\infty} f_n(x)$ is well defined (and finite) for
each $x\in E$. Also, $f$ is measurable on $E$, as it is the limit of
measurable functions $g_N(x) = \sum_{n=1}^{N} f_n(x)$, as $N\to
\infty$. To summarize: $f$ is a measurable function defined almost
everywhere.

Next, by the triangle inequality
$$
  |f(x)| = \biggl|\sum_{n=1}^{\infty} f_n(x)\biggr| \leq
  \sum_{n=1}^{\infty} |f_n(x)| = \varphi(x).
$$
Since $\int_X \varphi\, d\mu<\infty$, this implies $f \in
L^1_{\mu}(X)$.

Now again we need functions $g_N(x) = \sum_{n=1}^{N} f_n(x)$. By the
triangle inequality
$$
  |g_N(x)| = \biggl|\sum_{n=1}^{N} f_n(x)\biggr| \leq
  \sum_{n=1}^{N} |f_n(x)| \leq \sum_{n=1}^{\infty} |f_n(x)| =
  \varphi(x),
$$
so $g_N$'s are dominated by the integrable function $\varphi$. Also
note that $$g_N(x)= \sum_{n=1}^{N} f_n(x) \to \sum_{n=1}^{\infty}
f_n(x) = f(x)$$ for all $x\in E$.

Now by Lebesgue's Dominated Convergence Theorem
$$
  \sum_{n=1}^{N} \int_X f_n\, d\mu
  \stackrel{\ref{TmLIlin}}{=}
   \int_X \sum_{n=1}^{N} f_n\, d\mu
  =\int_X g_N\, d\mu \to \int_X f\, d\mu
$$
as $N\to\infty$, proving the theorem. }


\mycorollary{\label{CrBC} {\rm (Borel-Cantelli Lemma)} If $E_k \in \fM$
and $\sum_{k=1}^{\infty} \mu(E_k)<\infty$, then almost every $x \in X$
belongs to finitely many of the sets $E_k$.}

\pt Actually, Borel-Cantelli Lemma consists of two parts. Above is its
\emph{easier} part. Its harder part is involves probabilistic notion of
independence which is beyond the scope of this course.

\myproof{Just apply Theorem~\ref{TmSumBC} to functions $f_n =
\chi_{E_n}$.}

\myexercise{ In the above corollary, let $A$ be the set of points which
belong to infinitely many of the sets $E_k$. Show that
$$
     A = \cap_{n=1}^{\infty} \cup_{k=n}^{\infty} E_k.
$$
Use this fact to prove the corollary without any reference to
integration. Hint: use Theorem~\ref{TmSigsubadd}. }

\newpage

\mydefinition{A sequence $f_n$ of functions $X \to \IC$ converges to a
function $f\colon X\to \IC$ \textbf{uniformly on} $X$ if for any
$\varepsilon>0$ there exists $N>0$ such that for all $n>N$
$$
   \sup_{x\in X}|f_n(x)-f(x)|<\varepsilon.
$$
Equivalently, $ \sup_{x\in X}|f_n(x)-f(x)|\to 0$ as $n\to \infty$.}

\pt Uniform convergence implies pointwise convergence, but not vice
versa.

\myexample{Let $X=(0,1)$. Functions $f_n(x) = x^n$ converge, as
$n\to\infty$, to the function $f(x)=0$ pointwise, but not uniformly.}

\myexercise{ Suppose $\mu(X) < \infty$. Let $f_n\in L^1_{\mu}(X)$ be
complex measurable functions uniformly converging to a function $f\in
L^1_{\mu}(X)$. Prove that
\beq \label{Exuniform}
  \lim_{n\to\infty} \int_Xf_n\,d\mu
  = \int_Xf\,d\mu.
\eeq
Show that the assumption $\mu(X) < \infty$ cannot be omitted, i.e.,
give an example of a sequence of functions $f_n\in L^1_{\mu}(X)$
uniformly converging to a function $f\in L^1_{\mu}(X)$ such that
\eqref{Exuniform} fails.}

\mydefinition{A sequence $f_n$ of functions $X \to \IC$ converges to
a function $f\colon X\to \IC$ \textbf{in measure} if for any
$\varepsilon>0$ and $\delta>0$ there exists $N>0$ such that for all
$n>N$
$$
   \mu\{x\in X\colon |f_n(x)-f(x)|>\varepsilon\}<\delta.
$$
Equivalently, $\mu\{x\in X\colon |f_n(x)-f(x)|>\varepsilon\}\to 0$
as $n\to \infty$.}

\pt Convergence in measure is, generally, weaker than the pointwise
convergence.

\myexercise{Suppose $\mu(X) < \infty$ and $f_n$ are measurable
functions defined a.e.\ on $X$. Prove that if $f_n \to f$ a.e.\ on
$X$, then $f_n\to f$ in measure. What happens if $\mu(X) = \infty$?
}

\myexample{\label{ExSR} (Amazing shrinking sliding rectangles)
Suppose $X=[0,1]$ and $\bm$ is the Lebesgue measure. Let $f_n =
\chi_{[\frac{j}{2^k},\frac{j+1}{2^k}]}$, where $k=[\log_2 n]$ and
$j=n-2^k$. The first nine terms of this sequence are
$$
  \chi_{[0,1]},\ \ \chi_{[0,\frac 12]},
  \ \ \chi_{[\frac 12,1]},\ \ \chi_{[0,\frac 14]},
  \ \ \chi_{[\frac 14,\frac 12]},\ \ \chi_{[\frac 12,\frac 34]}
  \ \ \chi_{[\frac 34,1]},\ \ \chi_{[0,\frac 18]},\ \ \chi_{[\frac 18,\frac 14]}
$$
The graphs of these functions are vertical rectangles of the same
height ($=1$) but decreasing widths ($=\tfrac{1}{2^k}$), and their
bases keep sliding along the interval $[0,1]$ as $n$ increases, from
left to right. The bases of these rectangles cover the interval $[0,1]$
over and over again, infinitely many times.

This sequence converges to the zero function $f\equiv 0$ in measure,
because
$$
  \bm\bigl(x\colon \{|f_n(x)-f(x)|>\varepsilon\}\bigr)
  =\frac{1}{2^k} \to 0\quad{\rm as}\ \ n\to\infty
$$
but $f_n(x)$ has no limit, as $n\to\infty$ for any point $x\in [0,1]$.}

\myexercise{ Prove that if $f_n \to f$ in measure, then there is a
subsequence $\{f_{n_k}\}$ of $\{f_n\}$ such that $f_{n_k}\to f$ a.e. on
$X$. Hint: use Corollary~\ref{CrBC}.}

\myexercise{[Bonus] Suppose $f\in L^1_{\mu}(X)$. Prove that $\forall
\varepsilon>0$ $\exists \delta>0$ such that $\int_E|f|\,
d\mu<\varepsilon$ whenever $\mu(E)<\delta$. \label{Einteps} }

\newpage

Our next general goal is to show that the values of the integrals for a
function $f$ over different sets $E\in \fM$ give plenty of information
about $f$ itself.

\mytheorem{\label{TmInt=0} Let $(X,\fM,\mu)$ be a measure space.
\begin{itemize}
\item[\rm (a)] If $f\colon X \to [0,\infty]$ is measurable, $E\in
\fM$, and $\int_E f\, d\mu=0$, then $f=0$ a.e.\ on $E$; \item[\rm
(b)] If $f\in L^1_{\mu}(X)$ and $\int_E f\,d\mu=0$ for every $E \in
\fM$, then $f=0$ a.e.\ on $X$;
\end{itemize}
}

\myproof{(a) We need to prove that $\mu(S)=0$, where
$$
  S=\{x\in E\colon f(x)>0\} = f^{-1}((0,\infty]) \cap E.
$$
Note that $S = \cup_{n\geq 1}S_n$, where
$$
  S_n=\{x\in E\colon f(x)>1/n\} = f^{-1}((1/n,\infty]) \cap E
$$
and $S_1\subset S_2 \subset \cdots$. Thus by Continuity-II
(Theorem~\ref{tmCIIa}) we have $\mu(S) = \lim_{n\to\infty} \mu(S_n)$.
If $\mu(S)>0$, then $\mu(S_n)>0$ for some $n$, and then
$$
  \int_E f\,d\mu \stackrel{\ref{TmBasLI}{\rm(b)}}{\geq} \int_{S_n} f\, d\mu
  \stackrel{\ref{TmBasLI}{\rm(a)}}\geq \int_{S_n}\tfrac 1n\,d\mu = \tfrac 1n\, \mu(S_n)>0,
$$
a contradiction. Thus $\mu(S)=0$ as claimed.\medskip

\noindent (b) If $f\colon X\to \IC$ is a complex-valued function, then
\begin{align*}
  \intmu[E][f] = 0 &\Arrow \intmu[E][\re f] + \bi\intmu[E][\im f]=0 \\
   &\Arrow \intmu[E][\re f]=0\quad\text{and}\quad \intmu[E][\im f]=0
\end{align*}
thus it is enough to prove the claim for real-valued functions $f\colon
X\to \IR$. Denote
\begin{align*}
   E_1 &= \{x\colon f(x) \geq 0\} = f^{-1}([0,\infty))\\
   E_2 &= \{x\colon f(x) \leq 0\} = f^{-1}((-\infty,0])
\end{align*}
Since $\int_{E_1} f\,d\mu=0$ by our assumption, Part (a) implies $f=0$
a.e.\ on $E_1$. Similarly, $\int_{E_2} f\,d\mu=0$ by our assumption,
then $\int_{E_2} (-f)\,d\mu=0$, and again Part (a) implies $f=0$ a.e.\
on $E_2$. Thus $f=0$ a.e.\ on $E_1\cup E_2=X$. }

\mycorollary{If $f\in L^1_{\mu}(X)$ and
$$
   \Bigl|\int_X f\, d\mu\Bigr| = \int_X|f|\,d\mu,
$$
then there exists a constant $\theta\in [0,2\pi)$ such that
$f=e^{\bi\theta}|f|$ a.e.\ on $X$. }

\myproof{Recall: in the proof os Theorem~\ref{TmITI} we showed that
$\exists \theta\in [0,2\pi)$ such that
\begin{align*}
    \Big|\intmu[X][f] \Big|
    &= \intmu[X][\re \bigl(e^{-\bi \theta}f\bigr)]\\
    &\leq \intmu[X][|f|]
\end{align*}
and mentioned that $|f|-\re \bigl(e^{-\bi \theta}f\bigr) \geq 0$. Now
due to our assumption
$$
  \int_X \Bigl(|f| -\re\bigl(e^{-\bi \theta}f\bigr)\Bigr)\, d\mu = 0
$$
thus $$|f|-\re \bigl(e^{-\bi \theta}f\bigr) = 0\qquad \text{a.e.}$$
This also implies that $\im \bigl(e^{-\bi \theta}f\bigr) = 0$ a.e.
Therefore $|f| = e^{-\bi \theta}f$ a.e.
 }

\myexercise{\label{Exf==0} (a) Let $f \colon X \to (0, \infty]$ and
$\mu(E)>0$. Show that $\int_E f\, d\mu>0$.\\
(b) Let $f,g \in L^1_{\mu}(X)$ be real-valued functions and $f < g$.
Assume $\mu(X)>0$. Show that
$$
   \int_E f\, d\mu < \int_E g\, d\mu.
$$
}

\newpage

\mydefinition{Let $(X,\fM,\mu)$ be a measure space and $f\colon X\to
\IC$ a measurable function. The \textbf{average value} of $f(x)$ over a
set $E\in\fM$ is
$$
   A_E(f)=\frac{1}{\mu(E)}\int_E f\, d\mu
$$
provided the integral exists and $\mu(E) \in (0,\infty)$. }

\mylemma{\label{LmAv} {\rm (a)} If $f\colon X\to\IR$ is a real-valued
function and
$m\leq f(x)\leq M$ for all $x\in E$, then $m\leq A_E(f) \leq M$;\\
{\rm (b)} If $f\colon X\to\IC$ is a complex-valued function and
$f(x)\in R$ for all $x\in E$, where $R\subset \IC$ is a closed
rectangular domain with horizontal and vertical sides, then $A_E(f) \in
R$. }

\myproof{ (a) By Theorem~\ref{TmBasLI}(a), $m\mu(E)\leq \int_E f(x)\,d\mu\leq M\mu(E)$.\\
(b) just apply Part (a) to $\re f$ and $\im f$ separately.}


\mytheorem{ Let $(X,\fM,\mu)$ be a measure space and $\mu(X) < \infty$.
Let $f\in L^1_{\mu}(X)$ and $S\subset \IC$ a closed set. Suppose for
every $E \in \fM$ with $\mu(E)>0$ we have $A_E(f) \in S$. Then $f(x)
\in S$ a.e.\ on $X$. }

\myproof{For any closed rectangle $R \subset \IC\setminus S$ let $E_R
=\{x\colon f(x)\in R\} = f^{-1}(R)$. If $\mu(E_R)>0$, we would have
$A_{E_R}(f) \in R$ by Lemma~\ref{LmAv}(b), which contradicts our
assumption. Therefore $\mu(E_R)=0$. Now every open set in the plane is
a countable union of some closed rectangles. In particular, $\IC
\setminus S = \cup_{i=1}^{\infty} R_i$, hence
$$
   f^{-1}(S) = \cup_{i=1}^{\infty} f^{-1}(R_i)
   \quad\Longrightarrow\quad
   \mu(f^{-1}(S)) \leq \sum_{i=1}^{\infty} \mu(f^{-1}(R_i)) =0
$$
thus $f(x)\in S$ a.e. }

\mycorollary{ In particular, if $\int_E f\, d\mu$ is real-valued for
every $E$, then $f$ is real-valued a.e.\ on $X$. }

\newpage

%******************************************************************************

\section{Regularity of the Lebesgue measure}

\mytheorem{\label{TmEopcl}For any measurable set $E\subset\IR$ and any
$\varepsilon
>0$ there is an open covering set $V\supset E$ and a closed subset $D\subset E$
such that $\bm(V\setminus D)<\varepsilon$. In particular,
$$
  \bm(V\setminus E)<\varepsilon
  \qquad\text{and}\qquad
  \bm(E\setminus D)<\varepsilon
$$
}

In other words, any measurable set can be arbitrarily well approximated
by open sets `from outside' and by closed sets `from inside'.

\myproof{(i) Suppose first that $E$ is bounded, i.e., $E\subset
I=[a,b]$ for some $a<b$. Then $\bm(E)<\infty$ and using the outer
measure (Definition~\ref{Defouter}) we get
$$
   \bm(E) = \muo(E) = \inf \sum_{i=1}^{\infty} |I_i|
$$
where the infimum is taken over all countable covers of $E$ by
intervals, i.e., such that $E \subset \cup_{i=1}^{\infty} I_i$. Thus
for any $\varepsilon >0$ there exist covering intervals
$\cup_{i=1}^{\infty} I_i \supset E$ such that
$$
   \sum_{i=1}^{\infty} |I_i| - \bm(E) < \varepsilon/2
$$
Extending $I_i$'s slightly we can make them open and increase their
total length by no more than $\varepsilon/2$. More precisely, for each
$i\geq 1$ we find an open interval $I_i' \supset I_i$ such that
$|I_i'|-|I_i|<\varepsilon/2^{i+1}$. Then we have $E \subset
\cup_{i=1}^{\infty} I_i'$ and
$$
   \sum_{i=1}^{\infty} |I_i'| - \bm(E) <
   \sum_{i=1}^{\infty} |I_i| + \varepsilon/2 - \bm(E)<\varepsilon
$$
The open set $V=\cup_{i=1}^{\infty} I_i'$ covers $E$ and has the
desired property:
$$
   \bm(V\setminus E) = \bm(V)-\bm(E) \leq
   \sum_{i=1}^{\infty} |I_i'| - \bm(E) < \varepsilon
$$
(ii) Let $E$ be unbounded. Then we can represent $\IR$ as a disjoint
union of some intervals, i.e., $\IR=\uplus_{k=1}^{\infty} I_k$. Each
set $E_k=E\cap I_k$ is bounded and we can find an open set $V_k\supset
E_k$ such that $\bm(V_k\setminus E_k)<\varepsilon/2^k$. Now the set
$V=\cup_{k=1}^{\infty} V_k$ is open and
$$
  \bm(V\setminus E)\leq \sum_{k=1}^{\infty}\bm(V_k\setminus E_k)<\varepsilon.
$$
(iii) The set $E^c=\IR\setminus E$ is measurable, so due to (i)--(ii)
there exists an open set $U\supset E^c$ such that $\bm(U\setminus E^c)
<\varepsilon$. Its complement $D=U^c$ is a closed set, $D\subset E$,
and $E\setminus D = U\setminus E^c$, hence $\bm(E\setminus D) =
\bm(U\setminus E^c) <\varepsilon$.
 }

\newpage

The following exercise demonstrates that approximation by open sets
`from inside' or by closed sets `from outside' is a bad idea:

\myexercise{Find examples of Lebesgue measurable sets $E_1,E_2 \subset
\IR$ such that
$$
   \bm(E_1) < \inf\{\bm(A)\colon E_1\subset A,\ \ A\text{ closed}\}
$$
$$
   \bm(E_2) > \sup\{\bm(V)\colon V\subset E_2,\ \ V\text{ open}\}.
$$
}

The next theorem uses compact sets instead of closed sets:

\mytheorem{\label{TmVKEfin} {\rm (i)} For any measurable set
$E\subset\IR$ we have
\beq \label{VE}
   \bm(E) = \inf\{\bm(V)\colon E\subset V,\ \ V\text{ open}\}
\eeq
and
\beq \label{KE}
   \bm(E) = \sup\{\bm(K)\colon K\subset E,\ \ K\text{ compact}\}
\eeq
{\rm (ii)} If\ \ $\bm(E)<\infty$, then for any $\varepsilon>0$ there
exist an open covering set $V\supset E$ and a compact subset $K\subset
E$ such that $\bm(V\setminus K)<\varepsilon$. In particular,
$$
  \bm(V\setminus E)<\varepsilon
  \qquad\text{and}\qquad
  \bm(E\setminus K)<\varepsilon
$$}

\myproof{Put $\IR = \cup_{n=1}^{\infty} I_n$, where
$I_n=[-n,n]$.\medskip

\noindent (a) First suppose that $\bm(E)=\infty$. Then \eqref{VE} is
trivial: for any open cover $V\supset E$ we have $\bm(V)\geq
\bm(E)=\infty$. To prove \eqref{KE}, we use Theorem~\ref{TmEopcl} by
which there exists a closed set $D\subset E$ such that $\bm(E\setminus
D)<1$. In that case $\bm(D)\geq \bm(E)-1=\infty$, hence
$\bm(D)=\infty$. By standard Definition~\ref{DefLMinf}, $\bm(D) =
\lim_{n\to\infty} \bm(D\cap I_n)$, hence $\sup_n \bm(D\cap I_n)
=\infty$. Each set $D\cap I_n \subset E$ is compact, which proves
\eqref{KE}.\medskip

\noindent (b) Now suppose that $\bm(E)<\infty$. Now claim (i) follows
from the stronger claim (ii), so it is enough to prove (ii). Due to
Theorem~\ref{TmEopcl}, there exist an open covering set $V\supset E$
and a closed subset $D\subset E$ such that $\bm(V\setminus
D)<\varepsilon/2$. Since $\bm(D) \leq \bm(E) <\infty$ and $\bm(D) =
\lim_{n\to\infty} \bm(D\cap I_n)$, we can find $n\geq 1$ such that
$\bm(D\cap I_n) > \bm(D)-\varepsilon/2$. Now the set $K=D\cap I_n$ is
compact, $K\subset E$, and $\bm(V\setminus K) = \bm(V\setminus D) +
\bm(D\setminus K)<\varepsilon$. }

Lebesgue measurable sets may be very complicated and ``ugly'', but the
above theorems say that they are ``approximately open'' and
``approximately closed''. Sets with finite measure are ``approximately
compact''.

\newpage

The following approximation is also useful:

\mycorollary{\label{CrFinUnionInt} If $\bm(E)<\infty$, then for every
$\varepsilon>0$ there exist a finite union of disjoint bounded
intervals $J = \uplus_{n=1}^N I_n$ such that $\bm(E\Delta J)
<\varepsilon$. \label{CrEJ}}

\myproof{Due to Theorem~\ref{TmVKEfin}, for any $\varepsilon>0$ there
exists an open set $V\supset E$ such that $\bm(V\setminus E)<
\varepsilon/2$. Any open set is a finite or countable union of disjoint
open intervals, thus $V = \uplus_{n=1}^{\infty} I_n$. Note that $\bm(V)
= \sum_{n=1}^{\infty} |I_n| <\infty$, i.e., this series converges. Thus
there is $N\geq 1$ such that $\sum_{n>N} |I_n| < \varepsilon/2$. Set $J
= \uplus_{n=1}^N I_n$. Now
$$
  E\Delta J = (E\setminus J) \cup (J\setminus
  E) \subset (V\setminus J) \cup (V\setminus E),
$$
hence
$$
  \bm(E\Delta J) \leq \bm(V\setminus J) + \bm(V\setminus E) <\varepsilon.
$$
}

\mytheorem{Let $\mu$ be a regular Borel measure. Then for every $E \in
\fM$
\begin{itemize} \item[\rm (a)] there exists a $G_{\delta}$-set $G$ such
that $E \subset G$ and $\bm(G\setminus E)=0$; \item[\rm (b)] there
exists an $F_{\sigma}$-set $F$ such that $F \subset E$ and
$\bm(E\setminus F)=0$.
\end{itemize}
}

Thus every measurable set is `almost' $G_\delta$ (and `almost'
$F_\sigma$), up to a null set.

\myproof{Due to Theorem~\ref{TmEopcl}, there are open covering sets
$V_n \supset E$ and closed subsets $D_n\subset E$ such that $\bm(V_n
\setminus D_n) <1/n$. Put $G = \cap_{n=1}^{\infty} V_n$ and $F =
\cup_{n=1}^{\infty} D_n$. Clearly, $G$ is $G_{\delta}$ and $F$ is
$F_{\sigma}$, and $G \supset E \supset F$. Also note that $G\setminus F
\subset V_n \setminus D_n$ for every $n\geq 1$, hence $\bm(G\setminus
F) \leq \ \bm(V_n \setminus D_n) <1/n$, thus $\bm(G\setminus F) =0$.}

\newpage

\topic{Regularity in $\IR^k$}{All the above theorems and proofs extend,
almost verbatim, to the Lebesgue measure $\bm$ in $\IR^k$, $k\geq 2$.
Instead of intervals, one needs to use rectangles in $\IR^2$,
rectangular boxes in $\IR^3$, etc.}

More generally, we can consider other measures in $\IR^k$:

\mydefinition{ A measure $\mu$ defined on a $\sigma$-algebra $\fM$ in
$\IR^k$ is called a Borel measure if it is defined on all Borel sets
(i.e.\ $\fM$ contains all the Borel sets). }

\mydefinition{A Borel measure $\mu$ is said to be \textbf{outer
regular} if
$$
   \mu(E) = \inf\{\mu(V)\colon E\subset V,\ \ V\text{ open}\}
   \quad \forall E\in\fM.
$$
A Borel measure $\mu$ is said to be \textbf{inner regular} if
$$
   \mu(E) = \sup\{\mu(K)\colon K\subset E,\ \ K\text{ compact}\}
   \quad \forall E\in\fM.
$$
A Borel measure $\mu$ is said to be \textbf{regular} if it is both
outer regular and inner regular. }

For regular measures, the above approximation results hold true.

\myexercise{Let $f \colon \IR \to [0,\infty]$ be a Borel function, $f
\in L^1_{\bm}(\IR)$, and consider the measure $\rho(E) = \int_E f\,
d\bm$, where $\bm$ is the Lebesgue measure. Prove that $\rho$ is
regular. Hint: use the result of Exercise~\ref{Einteps}. }

\mytheorem{ If $\mu(E)<\infty$ for any bounded set $E \subset \IR^k$,
then the outer regularity and inner regularity are equivalent. }

\myproof{It is basically a repetition of our arguments in the proofs of
Theorems~\ref{TmEopcl} and \ref{TmVKEfin}, so we omit it.}

\myexercise{ Show that the counting measure in $\IR^k$ is inner
regular, but not outer regular. }

\newpage

%*****************************************************************************

\section{Approximation of Lebesgue measurable functions}

In the previous section we have seen that Lebesgue measurable sets can
be arbitrarily well approximated by open sets (`from outside') and by
compact sets (`from inside'). Here we will approximate Lebesgue
measurable functions arbitrarily well by step functions and by
continuous functions.

\mydefinition{A function $f\colon \IR\to \IC$ is \textbf{Lebesgue
measurable} if for any open set $V\subset \IC$ its preimage $f^{-1}(V)$
is a Lebesgue measurable set, i.e., belongs to the Lebesgue
$\sigma$-algebra.}

Previously, the term \emph{measurable functions} was always understood
in the sense of Borel functions (see Definition~\ref{DefBMF}). Now we
have two types of measurable functions -- Borel measurable and Lebesgue
measurable. Note that Borel measurable functions are Lebesgue
measurable, but not vice versa.

\mydefinition{ A function $\varphi \colon \IR \to \IC$ is called a
\textbf{step function} if $\varphi = \sum_{i=1}^n \alpha_i \chi_{I_i}$
for some $\alpha_i \in \IC$ and disjoint finite intervals $I_i \in
\IR$. }

Do not confuse step functions with simple functions. Every step
function is simple, but not vice versa. For example, Dirichlet function
(\ref{ExDir}) is a simple function but not a step function.

Roughly speaking, simple functions have simple range (a finite set)
but may have arbitrarily complicated domains (the preimage of each
value is just a measurable set). Step functions have simple range (a
finite set) and simple domain (every value is taken on an interval).

\myexercise{Let $s \colon [a,b] \to \IR$ be a simple Lebesgue
measurable function. Show that for every $\varepsilon>0$ there is a
step function $\varphi \colon [a,b] \to \IR$ and a Lebesgue measurable
set $E \subset [a,b]$ such that $s(x) = \varphi(x)$ on $E$ and $\bm
\bigl( [a,b]\setminus E \bigr) <\varepsilon$. Hint: use the regularity
of $\bm$. }

\myexercise{ Let $f \colon [a,b] \to \IR$ be a Lebesgue measurable
function. Show that for every $\varepsilon>0$ there is a step function
$g \colon [a,b] \to \IR$ such that
$$
   \bm \bigl\{ x\in [a,b]\colon |f(x)-g(x)|\geq\varepsilon \bigr\}
    <\varepsilon.
$$
Hint: use approximation by simple functions and then the previous
exercise. }

\myexercise{ Let $f \in L^1_{\bm}(\IR)$. Prove that there is a sequence
$\{g_n\}$ of step functions such that
$$
   \lim_{n\to\infty} \int_{\IR}|f-g_n|\,d\bm = 0.
$$
Hint: use the previous exercise. }

\mydefinition{Let $X$ be a topological space and $f \colon X \to \IC$.
The \textbf{support} of $f$ is defined by
$$
  {\rm supp}\, f = \overline{\{x\in X\colon f(x)\neq 0\}}.
$$
Also, $C_c(X)$ denotes the set of all continuous functions with compact
support.}

\mytheorem{\label{TmLusin} {\rm (Lusin)} Let $f \colon \IR \to \IC$ be
a Lebesgue measurable function, $A \subset \IR$ a Lebesgue measurable
set with $\bm(A)<\infty$ such that $f(x)=0$ for all $x\notin A$. Then
\begin{itemize} \item[\rm (a)] For every $\varepsilon>0$ there exists a compact set $K\subset
A$ such that $\bm(A\setminus K)<\varepsilon$ and the restriction of
$f$ to $K$ is a continuous function. \item[\rm (b)] There exists $g
\in C_c(\IR)$ such that $\bm\bigl\{x\colon f(x)\neq
g(x)\bigr\}<\varepsilon.$ Furthermore, we may arrange it so that
$\sup|g(x)|\leq \sup|f(x)|$.
\end{itemize}}

\myproof{We can assume that $f\colon \IR\to \IR$, as otherwise we can
deal with the real part and imaginary part of $f$ separately.\\

(a) Let $V_1,V_2,\ldots \subset \IR$ denote all open intervals with
rational endpoints. By Theorem~\ref{TmVKEfin}, there exist compact sets
$K_n \subset f^{-1}(V_n)\cap A$ and $K_n' \subset f^{-1}(V_n^c)\cap A$
such that
$$
   \bm\bigl( (f^{-1}(V_n)\cap A)\setminus K_n\bigr)<\tfrac{\varepsilon}{2^{n+1}}
   \quad\text{and}\quad
   \bm\bigl( (f^{-1}(V_n^c)\cap A)\setminus K_n'\bigr)<\tfrac{\varepsilon}{2^{n+1}}
$$
hence
$$
   \bm\bigl( A\setminus(K_n\cup K_n')\bigr)<\varepsilon/2^{n}
$$
Now define $K=\cap_{n=1}^{\infty}(K_n\cup K_n')$. It is a compact set,
$K\subset A$, and $\bm(A\setminus K) < \varepsilon$. Let $f_K = f|_K$
denote the restriction of $f$ to $K$. Note that $f_K^{-1}(V_n) =
K\cap(\IR\setminus K_n')$, which is an open subset of $K$, hence $f_K$
is continuous.
\\

(b) By Corollary~\ref{CrEJ}, there exists a finite union of disjoint
bounded open intervals $J = \uplus_{n=1}^N I_n$ such that
$\bm(A\Delta J) <\varepsilon$. By the part (a), for each
$n=1,\ldots,N$ there exists a compact subset $K_n \subset
A_n\colon=A\cap I_n$ such that $\bm(A_n\setminus K_n)<\varepsilon/N$
and the restriction of $f$ to $K_n$ is continuous. Now we define $g$
on each interval $I_n=(a_n,b_n)$ as follows: \begin{itemize}
\item[\rm (i)] $g(x)=f(x)$ for all $x\in K_n$, \item[\rm (ii)] $g(a_n)= g(b_n) =0$,
\item[\rm (iii)] $g(x)$ is extended linearly and continuously to the rest
of $I_n$. \end{itemize} We clarify the meaning of (iii). The set
$V=I_n\setminus K_n$ is open so it is a finite or countable union of
disjoint open intervals $I_{n,i}=(a_{n,i},b_{n,i})$, $i\geq 1$, such
that the endpoints $a_{n,i},b_{n,i}$ belong to
$K_n\cup\{a_{n}\}\cup\{b_{n}\}$, and on this union $g$ is already
defined. Now we set
$$
   g(x) = g(a_{n,i}) + \frac{g(b_{n,i})-g(a_{n,i})}{b_{n,i}-a_{n,i}}\,(x-a_{n,i}).
   \qquad \forall x\in I_{n,i}
$$
Lastly, we set $g(x)=0$ for all $x\in \IR\setminus J$. One can
verify by direct inspection that $g$ is now continuous on $\IR$ and
has compact support, i.e., $g\in C_c(\IR)$. We also have
\begin{align*}
   \bm\bigl\{x\colon f(x)\neq g(x)\bigr\}&\leq \bm(A\setminus J)
   +\sum_{n=1}^N\bm(I_n\setminus K_n)\\
   &\leq \bm(A\Delta J)
   +\sum_{n=1}^N\bm(A_n\setminus K_n)<2\varepsilon,
\end{align*}
which proves the theorem.}

\mycorollary{Assume that the hypotheses of Lusin's theorem are
satisfied and that $|f|\leq M$. Then there is a sequence $\{g_n\}$
such that $g_n\in C_c(\IR)$ and $|g_n|\leq M$ for each $n\geq 1$,
and $g_n(x) \to f(x)$ a.e.}

\myproof{By Lusin Theorem~\ref{TmLusin}, for each $n\geq 1$ there
exists $g_n\in C_c(\IR)$ such that
$$
  \bm(E_n)<2^{-n},\qquad
  E_n=\bigl\{x\colon f(x)\neq g_n(x)\bigr\}.
$$
Since $\sum_{n=1}^{\infty} \bm(E_n) <\infty$, the analogue of the
Borel-Cantelli Lemma (Corollary~\ref{CrBC}) implies that a.e.\ point
$x\in\IR$ belongs to finitely many $E_n$'s. That is, for a.e.\
$x\in\IR$ there exists $N(x)$ such that $x\notin E_n$ for all
$n>N(x)$. This implies $g_n(x)=f(x)$ for all $n>N(x)$, in particular
$g_n(x)\to f(x)$.}

\newpage

\mydefinition{Let $X$ be a topological space and $f\colon X \to \IR$
(or $[-\infty,\infty]$). We say that $f$ is \textbf{lower
semicontinuous} if $\{x\colon f(x)>a\}$ is open for every $a\in\IR$. We
say that $f$ is \textbf{upper semicontinuous} if $\{x\colon f(x)<a\}$
is open for every $a\in\IR$.}

\myproposition{\label{Prsc} Simple properties of semicontinuous
functions:
\begin{itemize}
\item[\rm (a)] $f$ is continuous $\Leftrightarrow$ $f$ is both upper and lower
semicontinuous; \item[\rm (b)] if $f$ is semicontinuous, then it is
Borel; \item[\rm (c)] $f$ is upper semicontinuous $\Leftrightarrow$
$-f$ is lower semicontinuous; \item[\rm (d)] if $f$ is upper (lower)
semicontinuous and $c>0$, then $cf$ is upper (lower) semicontinuous;
\item[\rm (e)] if $f,g$ are upper (lower) semicontinuous, then $f+g$
is upper (lower) semicontinuous; \item[\rm (f)] if $\{f_\gamma\}$ is
a family of upper (lower) semicontinuous functions, then $\inf
f_\gamma$ (resp., $\sup f_\gamma$)is upper (lower) semicontinuous;
\item[\rm (g)] $V \subset X$ is open $\Leftrightarrow$ $\chi_V$ is
lower semicontinuous; \item[\rm (h)] $A \subset X$ is closed
$\Leftrightarrow$ $\chi_A$ is upper semicontinuous; \item[\rm (i)]
if $f_n\geq 0$ are lower semicontinuous, then $\sum_{n=1}^{\infty}
f_n$ is lower semicontinuous.
\end{itemize}
}

\pt Proof is straightforward, we leave it as an exercise.

\myexercise{Prove that if $f\colon X \to \IR$ is upper (lower)
semicontinuous and $X$ is compact, then $f$ is bounded above (below)
and attains its maximum (minimum).}

\newpage

\mytheorem{\label{TmVC} {\rm (Vitali-Caratheodory)} Let $f \colon \IR
\to \IR$ be Lebesgue integrable function (i.e.\ $f \in L^1$). Then for
every $\varepsilon>0$ there exist functions $u,v \colon \IR \to \IR$,
$u \leq f \leq v$, where $u$ is upper semicontinuous and bounded above,
$v$ is lower semicontinuous and bounded below, and
$$
  \int_{\IR} (v-u)\, d\bm < \varepsilon.
$$}

\myproof{Assume first that $f\geq 0$. By Theorem~\ref{Tmflims},
there are exist simple functions $0\leq s_1\leq s_2\leq \cdots$
converging to $f$ pointwise. Then $f=\sum_{n=1}^{\infty} t_n$, where
$t_n=s_n-s_{n-1}$ (taking $t_0=0$) are nonnegative simple functions.
Thus
\beq  \label{fsumttt}
   f=\sum_{i=1}^{\infty}\alpha_i\chi_{A_i}
\eeq
where $\alpha_i>0$ and $A_i\subset\IR$ are measurable sets (not
necessarily disjoint). We cam assume that $\bm(A_i)<\infty$ for each
$i$, as otherwise we can partition $A_i$ into countably many pieces
$A_{ij} = A_i\cap [j,j+1)$, each of finite measure, and replace
$\alpha_i\chi_{A_i}$ with $\sum_{j=1}^{\infty}\alpha_i\chi_{A_{ij}}$
in \eqref{fsumttt}. Note that $\int_{\IR} f\, d\bm =
\sum_{i=1}^{\infty}\alpha_i\bm(A_i) < \infty$.

By Theorem~\ref{TmVKEfin} there exist compact sets $K_i$ and open
sets $V_i$ such that $K_i\subset A_i \subset V_i$ and
$\bm(V_i\setminus K_i)<\frac{\varepsilon}{\alpha_i2^i}$. Now we
define
$$
  v=\sum_{i=1}^{\infty}\alpha_i\chi_{V_i}
  \quad\text{and}\quad
  u=\sum_{i=1}^{N}\alpha_i\chi_{K_i}
$$
where $N$ is chosen so that $\sum_{i>N}\alpha_i\bm(A_i) <
\varepsilon$. Then $u$ is upper semicontinuous (by
Proposition~\ref{Prsc}eh) and bounded above, $v$ is lower
semicontinuous (by Proposition~\ref{Prsc}gi) and bounded below (by
zero), and
\begin{align*}
  v-u &= \sum_{i=1}^N\alpha_i\chi_{V_i\setminus K_i}
  +\sum_{i=N+1}^{\infty}\alpha_i\chi_{V_i}\\
  &\leq\sum_{i=1}^{\infty}\alpha_i\chi_{V_i\setminus K_i}
  +\sum_{i=N+1}^{\infty}\alpha_i\chi_{A_i}
\end{align*}
so that $\int_{\IR} (v-u)\, d\bm < 2\varepsilon$.

In the general case, $f = f^+ - f^-$, and we attach $u_1$ and $v_1$
to $f^+$ and $u_2$ and $v_2$ to $f^-$, as above, and put $u=u_1-v_2$
and $v=v_1-u_2$. Note that $-v_2$ is upper semicontinuous and $-u_2$
is lower semicontinuous by Proposition~\ref{Prsc}c.}

\newpage

\mycorollary{Let $f \colon \IR \to \IR$ be a Lebesgue measurable
function. Then there exist Borel functions $g,h \colon \IR \to \IR$
such that $g(x) = h(x)$ a.e.\ and $g(x) \leq f(x) \leq h(x)$ for
every $x\in X$.}

\myproof{Let $N>0$ and let us restrict our function $f$ onto the
interval $[-N,N]$. We first prove the theorem for that restricted $f$.
For any $M\geq 1$ Let
$$
   f_M(x) =\left\{\begin{array}{rl} f(x) & \text{if}\ \ |f(x)|\leq M\\
   M & \text{if}\ \ f(x)>M\\ -M & \text{if}\ \ f(x)<-M \end{array}\right.
$$
be the function $f$ truncated at levels $M$ and $-M$. Since $f_M$ is
bounded on the finite interval $[-N,N]$, it is integrable. Now by
Vitali-Caratheodory Theorem~\ref{TmVC} for each $n\geq 1$ there exist
the respective functions $u_{M,n} \leq f_M \leq v_{M,n}$ such that
$$
  \int_{[-N,N]}(v_{M,n}-u_{M,n})\, d\bm< 1/n.
$$
Let $u_M= \sup_n u_{M,n}$ and $v_M= \inf_n v_{M,n}$. Then $u_{M} \leq
f_M \leq v_{M}$ and
$$
  \int_{[-N,N]}(v_{M}-u_{M})\, d\bm = 0.
$$
This implies $u_M=v_M$ a.e.\ on $[-N,N]$, i.e., $\bm(E_M)=0$, where
$$
  E_M=\{x\in [-N,N]\colon u_M(x)\neq v_M(x)\}.
$$
Taking the limit as $M\to\infty$ we obtain $f=\lim f_M$; in fact $f(x)
= f_M(x)$ for all $M> M_0(x)$ (the sequence $f_M(x)$ ``stabilizes'' as
$M\to\infty$). Now define two Borel functions
$$
  g_N=\limsup_{M\to\infty} u_M
  \qquad\text{and}\qquad
  h_N=\liminf_{M\to\infty} v_M.
$$
By direct inspection, $g_N\leq f\leq h_N$ on $[-N,N]$. Also,
$g_N(x)=h_N(x)$ for all $x\in [-N,N]\setminus \cup_M E_M$, hence
$g_N(x)=h_N(x)$ a.e.\ on $[-N,N]$. Lastly, we define $g(x) = \limsup
g_N(x)$ and $h(x) = \liminf h_N(x)$ on the entire $\IR$.}

\newpage

\mytheorem{{\rm (Egorov)} Let $\mu(X)<\infty$ and $\{f_n\}$ a sequence
of complex measurable functions on $X$ such that $\lim_{n\to \infty}
f_n(x) = f(x)$ for a.e.\ $x \in X$. Then for every $\varepsilon>0$
there is $E \subset X$ such that $\mu(X\setminus E) <\varepsilon$ and
$f_n\to f$ uniformly on $E$.}

\myproof{For all $i\geq 1$ and $k\geq 1$ consider the ``bad'' set
$$
   B_{i,k} = \{x\in X\colon |f_i(x)-f(x)|\geq 1/k\}.
$$
Due to a.e.\ convergence, for each $k\geq 1$ a.e.\ point can only
belong to finitely many of $B_{i,k}$, thus $\mu\bigl(\cap_{n\geq
1}\cup_{i\geq n} B_{i,k}\bigr)=0$. By Continuity Theorem
(\ref{tmCIa}) we have $\mu\bigl(\cup_{i\geq n} B_{i,k}\bigr)\to 0$
as $n\to\infty$. Given $\varepsilon>0$, for each $k\geq 1$ there
exists $n_{k,\varepsilon}\geq 1$ such that $\mu\bigl(\cup_{i\geq
n_{k,\varepsilon}} B_{i,k}\bigr)<\varepsilon/2^k$. Let
$$
  B_{\varepsilon} =\cup_{k\geq 1}\cup_{i\geq n_{k,\varepsilon}} B_{i,k}.
$$
Note that $\mu(B_{\varepsilon}) \leq \sum_{k\geq 1}
\mu\bigl(\cup_{i\geq n_{k,\varepsilon}} B_{i,k}\bigr) <\varepsilon$
and
$$
  X\setminus B_{\varepsilon} =
  B_{\varepsilon}^c =\cap_{k\geq 1}\cap_{i\geq n_{k,\varepsilon}} B_{i,k}^c,
$$
i.e., for all $x\in B^c$ we have $|f_i(x)-f(x)| < 1/k$ for all
$i\geq n_{k,\varepsilon}$, which means precisely a uniform
convergence on $E=B_{\varepsilon}^c$.}

\topic{Littlewood's three principles of real analysis}{Littlewood
stated three principles in his 1944 Lectures on the Theory of
Functions. They can be roughly expressed as follows:
\begin{itemize}\item Every measurable set is nearly a finite union of
intervals \item Every convergent sequence of functions is nearly
uniformly convergent.\item Every integrable function (of class
$L^p$) is nearly continuous \end{itemize} The first principle is
given by Corollary~\ref{CrFinUnionInt}. The second one -- by the
above Egorov's theorem. The third one will be precisely formulated
in Chapter~\ref{ChLp}.}

\newpage

%*****************************************************************************

\section{Lebesgue integral versus Riemann integral} \label{ChLIRI}

\topic{Riemann integral (review)}{Recall the definition of Riemann
integral in calculus: given a function on a bounded interval $f\colon
[a,b] \to \IR$, we consider all finite partitions $I= \uplus_{i=1}^n
I_i$ of $I=[a,b]$ into subintervals $I_i$ and denote $\Delta=\{I_i\}$
and $|\Delta| = \max_{1\leq i\leq n} |I_i|$. Now the Riemann integral
is defined by
$$
  \int_a^b f(x)\, dx = \lim_{|\Delta|\to 0}
  \sum_{i=1}^n f(x_i)|I_i|,
$$
where $x_i\in I_i$, provided the (finite) limit exists and does not
depend on the details of the partitions $\Delta=\{I_i\}$ and the choice
of points $x_i\in I_i$.}

\begin{figure}[h]
\centering
\includegraphics[width=3in]{RandLintegrals.eps}
\caption{{\footnotesize Riemann integration (top, blue) versus
Lebesgue integration (bottom, red)}.}\label{FigRLI}
\end{figure}

Both integrals, Riemann and Lebesgue, are designed to compute ``the
area under the graph of the function''. In the Riemann integration, we
divide the \emph{domain} of the function into small pieces and count
the total area of the resulting vertical strips. In the Lebesgue
integration, we divide the \emph{range} of the function into small
pieces and count the total area of the resulting horizontal strips.\\

Roughly speaking, these are different ways of counting money when
you've got a pile of paper bills of various denomination. One way is
to add up the values of all the bills, one by one...\medskip

{\footnotesize Like ``one dollar plus ten dollars, plus five dollars,
plus another one, plus another five...''}\medskip

\noindent This is the idea of Riemann integration.\\

Another way is to sort the bills according to their denomination first
-- singles into one pile, fives into another, tens into another, etc.,
and then count the bills in each pile separately and multiply the
number of bills in each pile by their common value. This is the idea of
Lebesgue integration.

\newpage

\topic{Riemann integral (Darboux's definition)}{A useful definition of
Riemann integral is due to Darboux: for each partition $\Delta=\{I_i\}$
denote
$$
   M_i= \sup_{x\in I_i}f(x)\qquad\text{and}\qquad
   m_i=\inf_{x\in I_i}f(x).
$$
Now consider the ``upper'' and ``lower'' sums
$$
  \cJu(\Delta) =\sum_{i=1}^n M_i|I_i|
  \qquad\text{and}\qquad
  \cJl(\Delta) =\sum_{i=1}^n m_i|I_i|.
$$
Note that $\cJl(\Delta) \leq \cJu(\Delta)$. Furthermore, for any two
partitions $\Delta=\{I_i\}$ and $\Delta'=\{I_j'\}$ we have
$$
   \cJl(\Delta) \leq \cJl(\Delta^\ast) \leq \cJu(\Delta^\ast)\leq \cJu(\Delta')
$$
where $\Delta^\ast=\{I_i\cap I_j'\}$ is the refinement of both $\Delta$
and $\Delta'$ ({\footnotesize see the lemma below}). Therefore
$$
   \sup_{\Delta} \cJl(\Delta) \leq \inf_{\Delta} \cJu(\Delta).
$$
Now the Riemann integral is defined by
$$
  \int_a^b f(x)\, dx = \sup_{\Delta} \cJl(\Delta)
  =\inf_{\Delta} \cJu(\Delta),
$$
provided $\sup_{\Delta} \cJl(\Delta)$ and $\inf_{\Delta} \cJu(\Delta)$
are finite and equal to each other, i.e.,
$$
 \text{provided}\qquad\qquad
 \sup_{\Delta} \cJl(\Delta)=\inf_{\Delta} \cJu(\Delta) \in
   \IR.
$$
Intuitively, the Riemann integral exists iff the upper an lower sums
are finite and can be made arbitrarily close to each other by choosing
a fine enough partition.}

\begin{lemma0} Suppose $\Delta=\{I_i\}$ is a partition of the interval $I$
and $\Delta^\ast = \{I_j^\ast\}$ is a refinement of $\Delta$, i.e.,
every interval $I_j^\ast$ is a part of some interval $I_i$ ($I_j^\ast
\subset I_i$). Then
$$
   \cJl(\Delta) \leq \cJl(\Delta^\ast)
   \qquad\text{and}\qquad
   \cJu(\Delta) \geq \cJu(\Delta^\ast).
$$
\end{lemma0}

\myproof{Whenever $I_j^\ast \subset I_i$, we have
\begin{align*}
   m_i=\inf_{x\in I_i}f(x) &\leq \inf_{x\in I_j^\ast}f(x) =m_j^\ast\\
   M_i= \sup_{x\in I_i}f(x) &\geq \sup_{x\in I_j^\ast}f(x) =M_j^\ast
\end{align*}
Multiplying by $|I_j^\ast|$ and summing up over $j$ proves the lemma. }


\newpage

\mytheorem{Let $f\colon [a,b] \to \IR$. If the Riemann integral
$$
   \cJ = \int_a^b f(x)\, dx
$$
exists, then $f$ is Lebesgue integrable on $[a,b]$ and its Lebesgue
integral equals
$$
   \int_{[a,b]} f \, d\bm = \cJ.
$$
The converse is not true (see an example below). \label{TmRLint}}

\myproof{Let $\Delta_n$ denote a sequence of increasingly finer
partitions of $I=[a,b]$, for example let $\Delta_n = \{I_{n,i}\}$,
$1\leq i\leq 2^n$, be the partition of $I$ into $2^n$ equal
subintervals. Note that each subinterval $I_{n,i}$ in a part of one
of the longer subintervals $I_{n-1,j}$, i.e., $\Delta_n$ is a
refinement of $\Delta_{n-1}$. Denote $M_{n,i}= \sup_{x\in
I_{n,i}}f(x)$ and $m_{n,i}= \inf_{x\in I_{n,i}}f(x)$. Now define
``upper'' and ``lower'' functions $\bar{f}_n$ and $\underline{f}_n$
by
$$
  \bar{f}_n(x) = M_{n,i}\quad\text{and}\quad \underline{f}_n(x)=m_{n,i}
  \qquad \forall x\in I_{n,i}.
$$
Note that
$$
 \int_a^b \bar{f}_n(x)\, dx = \cJu(\Delta_n)
  \qquad\text{and}\qquad
 \int_a^b \underline{f}_n(x)\, dx = \cJl(\Delta_n).
$$
Also note that
$$
  \bar{f}_1\geq \bar{f}_2\geq \cdots \geq f
   \qquad\text{and}\qquad
   \underline{f}_1\leq \underline{f}_2\leq \cdots \leq f
$$
hence there exist limits
$$
   \lim_{n\to\infty} \bar{f}_n = \bar{f} \geq f
   \qquad\text{and}\qquad
   \lim_{n\to\infty} \underline{f}_n = \underline{f} \leq f.
$$
Now by Lebesgue's Dominated Convergence Theorem
$$
  \int_{[a,b]} \bar{f}\, d\bm = \lim_{n\to\infty}
  \int_{[a,b]} \bar{f}_n\, d\bm = \lim_{n\to\infty}
  \cJu(\Delta_n) =\int_a^b f(x)\, dx
$$
and
$$
  \int_{[a,b]} \underline{f}\, d\bm = \lim_{n\to\infty}
  \int_{[a,b]} \underline{f}_n\, d\bm = \lim_{n\to\infty}
  \cJl(\Delta_n) =\int_a^b f(x)\, dx.
$$
Therefore
$$
  \quad\Longrightarrow\quad
  \int_{[a,b]} (\bar{f} - \underline{f})\, d\bm = 0
  \quad\Longrightarrow\quad
  \int_{[a,b]} |\bar{f} - \underline{f}|\, d\bm = 0
$$
(recall that $\bar{f} \geq f \geq \underline{f}$, hence $\bar{f} -
\underline{f} \geq 0$). Theorem~\ref{TmInt=0}(a) implies $\bar{f}(x) =
\underline{f}(x)$ a.e., thus $\bar{f}(x) = \underline{f}(x) = f(x)$
a.e. Now Theorem~\ref{TmIfg0} implies
$$
\int_{[a,b]} \bar{f}\, d\bm =
  \int_{[a,b]} \underline{f}\, d\bm =
  \int_{[a,b]} f\, d\bm
$$
so our theorem follows. }

\newpage

\myexample{Let $f\colon [0,1]\to \IR$ be the Dirichlet function
(Example~\ref{ExDir}) restricted to the interval $[0,1]$, i.e.,
$f(x)=1$ for $x$ rational and $f(x)=0$ for $x$ irrational. It is not
Riemann integrable because $\cJl(\Delta)=0$ and $\cJu(\Delta)=1$ for
every partition $\Delta$. On the other hand, $f$ is Lebesgue integrable
and $\int_{[0,1]}f\, d\bm=0$.}

\mytheorem{\label{TmRL1}{\rm (Riemann-Lebesgue)} The Riemann integral
$$
   \int_a^b f(x)\, dx
$$
exists if and only if $f$ is bounded and almost everywhere continuous.}

\pt See the proof on the next page.

\pt The last condition means that the set
$$
  E_f = \{x\in [a,b]\colon f \text{ is discontinuous at } x\}
$$
has Lebesgue measure zero, i.e., $\bm(E_f)=0$. The set $E_f$ may be
complicated.

\myexample{A modified Dirichlet function $f\colon [0,1]\to \IR$ is
defined as follows: at every irrational number $x$ we set $f(x)=0$ and
at every rational number $x=p/q$, where $p/q$ is an irreducible
fraction, we set $f(x)=1/q$. This function is continuous at every
irrational number but discontinuous at every rational number. Thus $E_f
= \IQ \cap [0,1]$ is a countable and dense set. This function meets the
conditions of the above theorem, thus its Riemann integral exists. In
fact, $\int_0^1 f(x)\, dx=0$.}

\begin{figure}[h]
\centering
\includegraphics[width=2in]{DirichletFunction.eps}
\caption{Modified Dirichlet function}\label{FigMDF}
\end{figure}

\newpage

\noindent Theorem~\ref{TmRL1} (reminder). {\it The Riemann integral}
$$
   \int_a^b f(x)\, dx
$$
{\it exists if and only if $f$ is bounded and almost everywhere
continuous.}

\myproof{``$\Rightarrow$'': Suppose the Riemann integral exists. If $f$
was unbounded, then for each partition $\Delta$ there would be a
subinterval $I_i\subset I$ on which either $M_i=\infty$ or
$m_i=-\infty$. Hence either $\cJu(\Delta) = \infty$ or
$\cJl(\Delta)=-\infty$, which is impossible by the Darboux definition
of the Riemann integral.

Next for each subinterval $I'\subset I$ define the \emph{oscillation}
of $f$ on $I'$ by
$$
   \omega_f(I') = \sup_{x\in I'}f(x)-\inf_{x\in I'}f(x).
$$
The oscillation of $f$ at a point $x\in I$ is defined by
$$
   \omega_f(x) = \lim_{\varepsilon\to 0}
   \omega_f([x-\varepsilon,x+\varepsilon]).
$$
Note: $f$ is continuous at $x$ if and only if $\omega_f(x)=0$.

For each $\delta>0$ denote $$E_\delta = \{x\in I\colon \omega_f(x)\geq
\delta\}.$$ The set of points where $f$ is discontinuous is $E =
\cup_{\delta>0} E_{\delta}$. If $\bm(E)>0$, then there exists a
$\delta_0>0$ such that $\bm(E_{\delta_0})>0$. Now consider an arbitrary
partition $\Delta=\{I_i\}$ of $I$. If int$I_i\cap E_{\delta_0}\neq
\emptyset$, then $M_i-m_i \geq \delta_0$. All such subintervals $I_i$'s
cover $E_{\delta_0}$, hence their total length is $\geq
\bm(E_{\delta_0})$. This implies $\cJu(\Delta) - \cJl(\Delta) \geq
\delta_0 \bm(E_{\delta_0})>0$. Thus the upper sum $\cJu(\Delta)$ and
the lower sum $\cJl(\Delta)$ cannot get arbitrarily close to each
other, contradicting the Darboux definition of the Riemann integral.\\

``$\Leftarrow$'': Suppose $f$ is bounded, $|f|\leq M$, and a.e.\
continuous. We use the sequence of partitions $\Delta_n$ from the proof
of Theorem~\ref{TmRLint}. Suppose $x\in [0,1]$ is \underline{not} an
endpoint of the intervals $I_{n,i}\in \Delta_n$, i.e., $x\neq p/2^q$
for any $p,q\in \IN$, and $f$ is continuous at $x$, i.e.,
$\omega_f(x)=0$. Then $\bar{f}(x) = \underline{f}(x)$. Therefore
$\bar{f} = \underline{f}$ a.e., hence
$$
  \lim_{n\to\infty}\cJu(\Delta_n) =
  \int_{[a,b]} \bar{f}\, d\bm =
  \int_{[a,b]} \underline{f}\, d\bm = \lim_{n\to\infty}
  \cJl(\Delta_n),
$$
which implies the existence of the Riemann integral.  }

\newpage

\myexample{The Dirichlet function is bounded, but discontinuous at
every point. Again we see that it is not Riemann integrable.}

\myexample{The function $f\colon [0,1]\to \IR$ defined by
$f(x)=1/\sqrt{x}$ is Lebesgue integrable, but it is unbounded hence
not Riemann integrable. However, an improper Riemann integral
$$
  \int_0^1 f(x)\, dx = \lim_{a\to 0^+} \int_a^1 f(x)\, dx
$$
exists and is equal to the Lebesgue integral $\int_{[0,1]} f(x)\,
d\bm$}

\myexample{The function $f\colon [0,\infty)\to \IR$ defined by
$f(x)=(-1)^{n+1}/n$ for $n-1\leq x<n$, $n=1,2,\ldots$, has a finite
improper Riemann integral
$$
  \int_0^{\infty} f(x)\, dx = \lim_{A\to 0^+} \int_0^A f(x)\, dx
  =\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n} < \infty.
$$
But it is not Lebesgue integrable because
$$
   \int_{[0,\infty]} |f(x)|\,d\bm = \sum_{n=1}^{\infty}\frac 1n =
   \infty.
$$}

\topic{Improper Riemann integral vs Lebesgue integral}{The existence of
an improper Riemann integral does not imply Lebesgue integrability.
More precisely, if $f$ has a finite improper Riemann integral, then it
is Lebesgue integrable if and only if $|f|$ has a finite improper
Riemann integral. In that case the Lebesgue integral is equal to the
improper Riemann integral. (Note: if $f\geq 0$, then the existence of
an improper Riemann integral is equivalent to Lebesgue integrability.)}

\myexercise{Find a function $f(x)$ on $[0,1]$ such that the improper
Riemann integral $\int_0^1 f(x)\, dx$ exists (is finite), but $f$ is
not Lebesgue integrable.}

\newpage

%*****************************************************************************

\section{$L^p$ spaces}  \label{ChLp}

\mydefinition{\label{DefLp} Let $(X,\fM,\mu)$ be a measure space. For
each $p\in (0,\infty)$, $L^p_{\mu}(X)$ denotes the set of functions
$f\colon X\to \IC$ such that $|f|^p$ is integrable, i.e.
$$
   L^p_{\mu}(X) = \{f\colon \int_X|f|^p\,d\mu<\infty\}
$$
}

\pt Note that $|f(x)|\in [0,\infty)$ for each $x\in X$, thus
$|f(x)|^p$ is well defined for every $0<p<\infty$, and $|f|^p$ is a
non-negative function.

\pt For $p=1$, this definition agrees with our earlier
Definition~\ref{DefL1} of $L^1_{\mu}(X)$.

\pt The set $L^p_{\mu}(X)$ is actually a vector space with a norm,
and we need certain tools to introduce this norm.

\mydefinition{A function $\varphi \colon (a,b) \to \IR$, where $-\infty
\leq a < b \leq \infty$ is said to be \textbf{convex} if
\beq \label{convexity}
  \varphi( px+qy)
  \leq p\varphi(x)+q\varphi(y)
\eeq
for all $a<x < y<b$ and $p,q>0$, $p+q=1$.}

\pt If the inequality in \eqref{convexity} is strict, we have a
\textbf{strictly convex} function.

\pt Geometrically, this means that the secant line joining the
points $(x,\varphi(x))$ and $(y,\varphi(y))$ lies above the graph of
$\varphi$ between $x$ and $y$. A parabola $y=x^2$ is a good example.

\begin{figure}[h]
\centering
\includegraphics[width=2in]{convex_1.eps}
\label{FigConvex-_1}
\end{figure}

\newpage

\mylemma{\label{LmConvex1} A function $f \colon (a,b) \to \IR$ is
convex if and only if for any $a<s<t<u<b$
%\beq \label{convexity1}
$$
   \frac{\varphi(t)-\varphi(s)}{t-s} \leq
   \frac{\varphi(u)-\varphi(t)}{u-t}.
$$
}

\myproof{Geometrically, this is obvious. Algebraically, one can use
\eqref{convexity} and set
$$
  x=s,\quad y=u,\quad p=\frac{u-t}{u-s},\quad q=\frac{t-s}{u-s}
$$
Then $t=px+qy$. The rest is straightforward calculation.}

\pt If $\varphi(x)$ is strictly convex, then the inequality in
Lemma~\ref{LmConvex1} is strict.

\mylemma{If $\varphi$ is differentiable, then it is convex if and only
if $\varphi'$ is monotonically increasing, i.e.\ $\varphi'(x) \leq
\varphi'(y)$ for all $x<y$. }

\myproof{This follows from the previous lemma.}

\pt If the second derivative exists, then $\varphi$ is convex if and
only if $\varphi''(x) \geq 0$.

\mytheorem{If $\varphi$ is convex on $(a,b)$, then it is continuous on
$(a,b)$.}

\pt This is not true on closed intervals $[a,b]$.

\myproof{We prove that $f$ is continuous at any point $c\in (a,b)$.
Choose $a_1 \in (a,c)$ and $b_1 \in (c,b)$. Then by
Lemma~\ref{LmConvex1} we have for any $\varepsilon>0$
$$
   \frac{\varphi(c)-\varphi(a_1)}{c-a_1} \leq
   \frac{\varphi(c+\varepsilon)-\varphi(c)}{\varepsilon}
$$
which implies $\liminf_{x\to c^+} \varphi(x) \geq \varphi(c)$.
Similarly,
$$
   \frac{\varphi(c+\varepsilon)-\varphi(c)}{\varepsilon} \leq
   \frac{\varphi(b_1)-\varphi(c+\varepsilon)}{b_1-c-\varepsilon},
$$
which implies $\liminf_{x\to c^+} \varphi(x) \leq \varphi(c)$. Hence
$\lim_{x\to c^+} \varphi(x) = \varphi(c)$. The left hand limit is
treated similarly. }

\newpage

\mytheorem{{\rm (Jensen's inequality)} Let $(X,\fM,\mu)$ be a measure
space and $\mu(X)=1$. Let $f\colon X \to (a,b) \subset \IR$ be a
Lebesgue integrable function, i.e., $f \in L^1_{\mu}$. Then for any
convex function $\varphi\colon (a,b)\to \IR$ we have
$$
   \varphi\Bigl(\int_{X}f\, d\mu\Bigr)
   \leq \int_{X} (\varphi\circ f)\, d\mu.
$$
Note: the cases $a=-\infty$ and $b=\infty$ are not excluded. }

\pt See the proof on the next page.

\pt A measure $\mu$ on $X$ such that $\mu(X)=1$ is often called
\emph{probability measure}.

An important remark: the integral $\int_{X} (\varphi\circ f)\, d\mu$
here is understood in the ``extended sense''
(cf.~Chapter~\ref{ChLIall}). More precisely, the ``negative'' part of
the integrand belongs in $L^1_{\mu}(X)$, i.e.,
$$
   \int_{X} (\varphi\circ f)^-\, d\mu < \infty,
   \qquad\text{\footnotesize (see the proof below)}
$$
but the positive part may not be in $L^1_{\mu}(X)$, i.e., we can only
claim that
$$
   \int_{X} (\varphi\circ f)^+\, d\mu \leq \infty,
$$
which possibly takes value $\infty$ {\footnotesize (see an example
below)}. Therefore the above integral
$$
  \int_{X} (\varphi\circ f)\,d\mu
  \stackrel{\ref{DefLIreal}}=  \int_{X} (\varphi\circ f)^+\, d\mu
  -  \int_{X} (\varphi\circ f)^-\, d\mu
$$
is either finite, or equal to $\infty$ (but not $-\infty$).

\myexample{Let $X=(0,1)$ and $\mu$ be the Lebesgue measure on $X$; note
that $\mu(X)=1$. Suppose $f(x)=x$ and $\varphi(x)=1/x$. Note that $f\in
L^1_{\mu}(X)$ and $\varphi$ is convex on $(0,1)$. Now $(\varphi \circ
f) (x) = 1/x$. The Riemann integral of this function
$$
  \int_0^1\frac 1x\, dx = \ln x\,\vert_0^1 = \infty
$$
is infinite (by elementary Calculus). Thus its Lebesgue integral is
infinite, too (recall the material in the end of
Chapter~\ref{ChLIRI}).}

\newpage

Below is the proof of Jensen's inequality: $\varphi\Bigl(\int_{X}f\,
d\mu\Bigr)\leq \int_{X} (\varphi\circ f)\, d\mu$.

\myproof{First, note that
$$
   a=a\mu(X)<\int_Xf\,d\mu<b\mu(X)=b
$$
(due to the result of Exercise~\ref{Exf==0}(b) and the assumption
$\mu(X)=1$), hence
\beq \label{Jt}
   t\colon =\int_X f\, d\mu \in (a,b).
\eeq
Next, by Lemma~\ref{LmConvex1} for any $u\in (t,b)$
\beq  \label{Jbeta}
  \beta\colon = \sup_{s\in(a,t)}\frac{\varphi(t)-\varphi(s)}{t-s}
  \leq\frac{\varphi(u)-\varphi(t)}{u-t}<\infty.
\eeq
Therefore, for any $s\in (a,b)$ we have
$$
   \varphi(s) \geq \varphi(t)+\beta(s-t)
$$
(for $s<t$ this follows from the definition of $\beta$ in
\eqref{Jbeta}; for $s>t$ this follows from the middle inequality in
\eqref{Jbeta}, where $u$ must be is replaced with $s$). Thus for any
$x\in X$
\beq \label{Jproof}
   \varphi(f(x)) \geq \varphi(t)+\beta(f(x)-t).
\eeq
Note in particular that
$$
  (\varphi\circ f)^- \leq |\varphi(t) +\beta(f-t)|
  \leq |\varphi(t)| + |\beta|(|f|+|t|),
$$
hence
$$
  \int_X (\varphi\circ f)^-\, d\mu \leq
  |\varphi(t)| + |\beta|\Bigl(\int_X|f|\,d\mu+|t|\Bigr)<\infty,
$$
as we promised above.

Now we have two cases. First, if $\int_X (\varphi\circ f)^+\, d\mu =
\infty$, then $\int_X (\varphi\circ f)\, d\mu = \infty$, and Jensen's
inequality is trivial (a finite number $\leq$ infinity).

Second, if $\int_X (\varphi\circ f)^+\, d\mu < \infty$, then
$\varphi\circ f \in L^1_{\mu} (X)$. Now taking the integral of
\eqref{Jproof} over $X$ gives
$$
   \int_X \bigl(\varphi\circ f -\varphi(t) -\beta(f-t)\bigr)\, d\mu \geq 0.
$$
hence by the linearity (Theorem~\ref{TmLIlin}) we get
$$
   \int_X (\varphi\circ f)\, d\mu \geq
    \varphi(t) +\beta\Bigl(\int_X f\,d\mu-t\Bigr) = \varphi(t),
$$
where the expression in the parentheses vanishes due to \eqref{Jt}.
}

\pt If $\varphi(x)$ is strictly convex, then Jensen's inequality turns
into an equality if and only if $f$ is constant a.e.

\myexample{Let $\varphi(x)=e^x$. Then we get
$$
   e^{\int_Xf\, d\mu} \leq \int_X e^f\, d\mu.
$$
}

\myexample{Let $X = \{1,2,\ldots,n\}$ and $\mu(\{i\})=1/n$ for every
$i=1,\ldots,n$. Let $f(i) = \ln a_i$ for some $a_1, \ldots, a_n>0$ and
again $\varphi(x)=e^x$. Then Jensen's inequality implies
$$
  (a_1a_2\cdots a_n)^{1/n} \leq \frac{a_1+a_2+\cdots+a_n}{n}
$$
(geometric mean is $\leq$ arithmetic mean). More general: if
$\mu(\{i\})=p_i$ for $i=1,\ldots,n$ and $p_1+\cdots+p_n=1$, then
$$
  a_1^{p_1}a_2^{p_2}\cdots a_n^{p_n} \leq
  p_1a_1+p_2a_2+\cdots+p_na_n
$$
(geometric weighted mean is $\leq$ arithmetic weighted mean). }

\myexercise{Prove that the supremum of any collection of convex
functions on $(a,b)$ is convex on $(a,b)$ (assume that the supremum is
finite). Prove that a pointwise limit of a sequence of convex functions
is convex.}

\myexercise{Let $\varphi$ be convex on $(a,b)$ and $\psi$ convex and
nondecreasing on the range of $\varphi$. Prove that $\psi \circ
\varphi$ is convex on $(a,b)$. For $\varphi > 0$, show that the
convexity of $\log \varphi$ implies the convexity of $\varphi$, but not
vice versa.}

\myexercise{Assume that $\varphi$ is a continuous real function on
$(a,b)$ such that
$$
 \varphi\Bigl(\frac{x+y}{2}\Bigr) \leq \frac{1}{2}\,\varphi(x)+
 \frac{1}{2}\,\varphi(y)
$$
for all $x,y \in (a,b)$. Prove that $\varphi$ is convex. (The
conclusion does not follow if continuity is omitted from the
hypotheses.)}

\mydefinition{If $p,q>1$ and
$$
  \frac 1p + \frac 1q = 1,
$$
then we say that $p$ and $q$ are \textbf{conjugate exponents}. }

\pt The most important case is $p=q=2$.

\pt If $p\to 1$, then $q\to\infty$; thus $p=1$ and $q=\infty$ are
sometimes considered as conjugate exponents, too.

\mytheorem{Let $(X,\fM,\mu)$ be a measure space and $f,g \colon X \to
[0,\infty]$ measurable functions. Let $p$ and $q$ be conjugate
exponents.\\ Then we have \textbf{H\"older inequality}:
$$
  \int_X fg\, d\mu \leq \biggl[\int_X f^p\,d\mu\biggr]^{1/p}
  \biggl[\int_X g^q\,d\mu\biggr]^{1/q}.
$$
Equality holds here if and only if there exist $\alpha,\beta\geq 0$,
not both equal to 0, such that $\alpha f(x)^p = \beta g(x)^q$ a.e.
(i.e., $f(x)^p$ and $q(x)^q$ are proportional to each other). }

\myproof{Denote
$$
  A=\biggl[\int_X f^p\,d\mu\biggr]^{1/p},\qquad
  B=\biggl[\int_X g^q\,d\mu\biggr]^{1/q}
$$
If $A=0$, then $f=0$ a.e.\ (by Theorem~\ref{TmInt=0}a) and the case is
trivial. Similarly, if $B=0$, then $g=0$ a.e., and the case is trivial.

\medskip\noindent If $A=\infty$ and $B>0$, then the H\"older inequality is
trivial, as its right hand side is $\infty$. The same happens if
$B=\infty$ and $A>0$.

\medskip\noindent Thus we can assume that $A\in (0,\infty)$ and $B\in
(0,\infty)$. Consider two functions:
$$
  F(x) = f(x)/A \qquad\text{and}\qquad G(x) = g(x)/B
$$
(``normalized'' versions of $f$ and $g$). Note that
$$
  \int_X F^p\, d\mu = \int_X G^q\, d\mu = 1.
$$
It is enough to prove
\beq  \label{FG1}
  \int_X FG\, d\mu \leq 1,
\eeq
and then complete the proof of the H\"older inequality as follows:
$$
  \int_X fg\, d\mu =AB\int_X FG\, d\mu \leq
  AB = \biggl[\int_X f^p\,d\mu\biggr]^{1/p}
  \biggl[\int_X g^q\,d\mu\biggr]^{1/q}.
$$
We are now proving \eqref{FG1}. Note that $F<\infty$ and $G<\infty$
a.e., due to Theorem~\ref{TmBasLI}(f).

\medskip\noindent The following calculus lemma is the key step:

{\footnotesize
\begin{lemma0}
If $F,G\in [0,\infty)$ are two nonnegative real numbers, then
$$
  FG \leq \tfrac 1p F^p + \tfrac 1q G^q.
$$
\end{lemma0}

\noindent Proof of Lemma: If $F=0$ or $G=0$, the lemma is trivial. If
$F,G>0$, we can choose $s,t\in \IR$ such that $F=e^{s/p}$ and
$G=e^{t/q}$. Since $\varphi(x)=e^x$ is a convex function and $\frac 1p
+ \frac 1q =1$, we have
$$
  e^{\frac sp + \frac tq} \leq \tfrac 1p e^s + \tfrac 1q e^t.
$$
In terms of $F$ and $G$, the above inequality is exactly what Lemma
claims. \qed
  }

\medskip\noindent Due to this lemma, we have for a.e.\ $x\in X$
$$
  F(x)G(x) \leq \tfrac 1p F(x)^p + \tfrac 1q G(x)^q.
$$
Integrating over $X$ gives
$$
  \int_X FG\, d\mu  \leq \tfrac 1p \int_X F^p\,d\mu + \tfrac 1q \int_X G^q\, d\mu
  =\tfrac 1p + \tfrac 1q =1
$$
proving \eqref{FG1}. This completes the proof of the H\"older
inequality.

\medskip\noindent We now turn to the characterization of equality. First, suppose that
$\alpha f(x)^p = \beta g(x)^q$ and, without loss of generality,
$\beta\neq 0$. Then $g(x) = c^{1/q} f(x)^{p/q}$, where
$c=\alpha/\beta$. Now
$$
  \int_X fg\, d\mu =c^{1/q} \int_X f^{1+\frac pq}\,d\mu
   =c^{1/q} \int_X f^p\,d\mu
$$
because $\frac 1p + \frac 1q =1$. On the other hand,
$$
   \biggl[\int_X f^p\,d\mu\biggr]^{1/p}
  \biggl[\int_X g^q\,d\mu\biggr]^{1/q}=
  \biggl[\int_X f^p\,d\mu\biggr]^{1/p}
  \biggl[c\int_X f^p\,d\mu\biggr]^{1/q}
  =c^{1/q} \int_X f^p\,d\mu
$$
again because $\frac 1p + \frac 1q =1$. Hence the H\"older inequality
turns into an equality.

\medskip\noindent Now suppose that the H\"older inequality turns into
an equality. Then it follows from our proof of the H\"older inequality
that we must have
$$
  F(x)G(x) = \tfrac 1p F(x)^p + \tfrac 1q G(x)^q \qquad \text{a.e.}
$$
Now we look back into the proof of our lemma. Since $\varphi(x)=e^x$ is
a strictly convex function, the equality in the lemma is only possible
when $s=t$, i.e., $e^s = e^t$, i.e., $F^p = G^q$. Thus we have
$$
        F(x)^p = G(x)^q \qquad \text{a.e.},
$$
which implies that $f(x)^p$ and $q(x)^q$ are proportional to each
other.}

\mycorollary{H\"older inequality in the case $p=q=2$ is known as
\textbf{Schwarz inequality}:
$$
  \biggl[\int_X fg\, d\mu\biggl]^2 \leq \biggl[\int_X f^2\,d\mu\biggr]\cdot
  \biggl[\int_X g^2\,d\mu\biggr].
$$
Equality holds here if and only if there exist $\alpha,\beta\geq 0$,
not both equal to 0, such that $\alpha f(x) = \beta g(x)$ a.e. (i.e.,
$f(x)$ and $q(x)$ are proportional to each other). }

\pt {\footnotesize If we replace integration with summation we
obtain the familiar Cauchy-Schwarz inequality from linear algebra:
$$
  (\bf\cdot\bg)^2=\biggl[\sum f_ig_i\biggl]^2 \leq \biggl[\sum f_i^2\biggr]\cdot
  \biggl[\sum g_i^2\biggr]=\|\bf\|^2\|\bg\|^2.
$$
where $\bf=(f_1,f_2,\ldots)$ and $\bg=(g_1,g_2,\ldots)$ are vectors
and $\bf\cdot\bg$ is their standard inner product. }

\mytheorem{Let $(X,\fM,\mu)$ be a measure space and $f,g \colon X \to
[0,\infty]$ measurable functions. Let $p \geq 1$. Then we have
\textbf{Minkowski inequality}:
$$
  \biggl[\int_X (f+g)^p\, d\mu\biggr]^{1/p} \leq
  \biggl[\int_X f^p\,d\mu\biggr]^{1/p}+
  \biggl[\int_X g^p\,d\mu\biggr]^{1/p}.
$$
If $p=1$, this is actually an equality.

If $p>1$, the equality holds if and only if there exist
$\alpha,\beta\geq 0$, not both equal to 0, such that $\alpha f(x) =
\beta g(x)$ a.e. (i.e., $f(x)$ and $q(x)$ are proportional to each
other). }

\myproof{If $p=1$, we just use the linearity of Lebesgue integral
(Theorem~\ref{TmLIadd}).

\medskip\noindent Assume $p>1$. We can also assume that
\beq \label{Minkow0}
   \int_X (f+g)^p\, d\mu>0, \qquad
   \int_X f^p\,d\mu<\infty, \qquad
   \int_X q^p\,d\mu<\infty
\eeq
as otherwise the Minkowski inequality is trivial.

\medskip\noindent Note that
$$
  (f+q)^p = f(f+g)^{p-1} + g(f+g)^{p-1}.
$$
Due to the H\"older inequality
$$
   \int_X f(f+g)^{p-1}\, d\mu \leq
   \biggl[\int_X f^p\,d\mu\biggr]^{1/p}
  \biggl[\int_X (f+g)^{(p-1)q}\,d\mu\biggr]^{1/q}.
$$
and
$$
   \int_X g(f+g)^{p-1}\, d\mu \leq
   \biggl[\int_X g^p\,d\mu\biggr]^{1/p}
  \biggl[\int_X (f+g)^{(p-1)q}\,d\mu\biggr]^{1/q}.
$$
Also note that
$$
  \frac 1p+\frac 1q = 1
  \quad\Longrightarrow\quad
  p+q=pq
  \quad\Longrightarrow\quad
  (p-1)q=p
$$
Adding the above two integral inequalities gives
$$
   \int_X (f+g)^p\, d\mu \leq
   \biggl(\biggl[\int_X f^p\,d\mu\biggr]^{1/p}+
   \biggl[\int_X g^p\,d\mu\biggr]^{1/p}\biggr)
  \biggl[\int_X (f+g)^{p}\,d\mu\biggr]^{1/q}.
$$
Now if the last factor is finite, we can just divide by it and get
$$
   \biggl[\int_X (f+g)^p\, d\mu\biggr]^{1-1/q} \leq
   \biggl[\int_X f^p\,d\mu\biggr]^{1/p}+
   \biggl[\int_X g^p\,d\mu\biggr]^{1/p}
$$
which is exactly the desired Minkowski inequality because $1-\frac 1q =
\frac 1p$.

\medskip\noindent So all we need is to check that
\beq \label{MinkowI}
      \int_X (f+g)^p\, d\mu < \infty.
\eeq
The following simple lemma will do the job:

{\footnotesize
\begin{lemma0}
If $f,g\in [0,\infty)$ are two nonnegative real numbers and $p>1$, then
$$
  \Bigl(\frac{f+g}{2}\Bigr)^p \leq \frac{f^p + g^p}{2}
$$
\end{lemma0}

\noindent Proof of Lemma: If $f=0$ or $g=0$, the lemma is trivial. If
$f,g>0$, the lemma follows from the convexity of the function
$\varphi(x)=x^p$ on the interval $(0,\infty)$. \qed
  }

\medskip\noindent Now note that $f(x)<\infty$ and $g(x)<\infty$ a.e., due to
Theorem~\ref{TmBasLI}(f). Thus due to the above lemma, we have for
a.e.\ $x\in X$
$$
  \Bigl(\frac{f(x)+g(x)}{2}\Bigr)^p \leq \frac{f(x)^p + g(x)^p}{2}
$$
Integrating over $X$ and using our assumptions \eqref{Minkow0} proves
\eqref{MinkowI}.

\medskip\noindent We now turn to the characterization of equality.
First, suppose that $\alpha f(x) = \beta g(x)$ and, without loss of
generality, $\beta\neq 0$. Then $g(x) = c f(x)$, where
$c=\alpha/\beta$, and by direct calculation we can verify that the
Minkowski inequality turns into an equality.

\medskip\noindent Now suppose that the Minkowski inequality turns into an equality.
The main step of the above proof of the Minkowski inequality is
application of the H\"older inequality twice: once to the functions $f$
and $(f+g)^{p-1}$ and then once again to the functions $g$ and
$(f+g)^{p-1}$. Then the equality requires
$$
   f^p\qquad\text{be proportional to}\qquad (f+g)^{(p-1)q}
$$
and
$$
   g^p\qquad\text{be proportional to}\qquad (f+g)^{(p-1)q}
$$
We see clearly that $f$ must be proportional to $g$, as claimed. }
\pt {\scriptsize If we replace integration in the Minkowski
inequality with summation, we obtain the familiar triangle
inequality for the p-norm of vectors in linear algebra:
$$
  \|\bf+\bg\|_p=\biggl[\sum (f_i+g_i)^p\biggl]^{1/p} \leq \biggl[\sum f_i^p\biggr]^{1/p}
  + \biggl[\sum g_i^p\biggr]^{1/p}=\|\bf\|_p + \|\bg\|_p,
$$
where $\bf=(f_1,f_2,\ldots)$ and $\bg=(g_1,g_2,\ldots)$ are
vectors.}

\myexercise{ Suppose $\mu(X)=1$ and suppose $f$ and $g$ are two
positive measurable functions on $X$ such that $fg\geq 1$. Prove
that $\int_X f \, d\mu \cdot \int_X g \, d\mu\geq 1.$ }

\myexercise{ Suppose $\mu(X)=1$ and $h\colon X\to [0, \infty]$ is
measurable. Denote $A = \int_X h \, d\mu$. Prove that
$$
  \sqrt{1+A^2} \leq \int_X \sqrt{1+h^2}\, d\mu \leq 1+A.
$$
}

\myexercise{[Bonus] If $\bm$ is Lebesgue measure on $[0,1]$ and if
$h$ is a continuous function on $[0,1]$ such that $h=f'$, then the
inequalities in the previous exercise have a geometric
interpretation. From this, conjecture (for general $X$) under what
conditions on $h$ equality can hold in either of the above
inequalities, and prove your conjecture. }

\newpage

\mydefinition{ For a measurable function $f \colon X \to \IC$ and $p
>0$ we define the \textbf{``p-norm''} of $f$ by
$$
   \|f\|_p = \Bigl[ \int_X|f|^p \, d\mu\Bigr]^{1/p}.
$$
}

\pt Definition~\ref{DefLp} can be now stated as
$$
  L^p_{\mu}(X) =\bigl\{ f\colon  \|f\|_p <\infty\bigr\}
$$

\pt If $\mu$ is the Lebesgue measure on $\IR^k$, we will simply write
$L^p(\IR^k)$.

\mydefinition{ A special case: $\IN$ and $\mu$ is a counting measure.
Then functions $f\colon \IN \to \IC$ can be regarded as complex-valued
sequences $\xi = \{\xi_n\}$. Then
$$
   \|\xi\|_p = \biggl[\sum_{n=1}^{\infty}|\xi_n|^p\biggr]^{1/p}
$$
and
$$
  \ell^p = \bigl\{ \xi\colon  \|\xi\|_p <\infty\bigr\}
$$
}

\mytheorem{\label{TmLpnorm1} If $1\leq p <\infty$, then $L^p_\mu(X)$ is
a complex vector space.}

\myproof{Given $f,g \in L^p_{\mu}(X)$ and $\alpha,\beta\in \IC$ we
have, by the Minkowski inequality
\begin{align*}
  \|\alpha f+\beta g\|_p &= \Bigl[ \int_X|\alpha f+\beta g|^p \, d\mu\Bigr]^{1/p}\\
  &\leq\Bigl[ \int_X\bigl(|\alpha f|+|\beta g|\bigr)^p \, d\mu\Bigr]^{1/p}
   \qquad\text{\footnotesize (By triangle inequality for complex numbers)}\\
  &\leq\Bigl[ \int_X |\alpha f|^p\,d\mu\Bigr]^{1/p}+
  \Bigl[ \int_X|\beta g|^p \, d\mu\Bigr]^{1/p}
     \qquad\text{\footnotesize (By Minkowski inequality)}\\
  &= |\alpha|\,\|f\|_p + |\beta|\,\|g\|_p < \infty
     \qquad\text{\footnotesize (By linearity of the Lebesgue integral)}
\end{align*}
Thus $L^p_{\mu}(X)$ is closed under additions and multiplications by
scalars. }

\newpage

Next we investigate the case $p=\infty$.

\mydefinition{Let $f \colon X \to [0,\infty]$ be measurable. A number
$s\geq 0$ is an \textbf{essential upper bound} for $f$ if
$$
  \mu\{x\colon f(x)>s\} = \mu(f^{-1}(s,\infty]) = 0
$$
}

\pt The set of all essential upper bounds is either empty or a closed
infinite interval $[S,\infty)$.

\mydefinition{ The smallest essential upper bound for a given function
$f$ is called the \textbf{essential supremum} and denoted by
$\text{ess-sup} \, f$. If $f$ has no essential upper bounds, we set
$\text{ess-sup} \, f = \infty$. }

\mydefinition{The \textbf{infinity-norm} of a function $f\colon X\to
\IC$ is defined by
$$
 \|f\|_\infty = \, \text{ess-sup} \, |f|.
$$
We also denote by
$$
  L^\infty_\mu(X)=\bigl\{ f\colon  \|f\|_\infty <\infty\bigr\}
$$
the space of \textbf{essentially bounded functions}. }

\pt A special case: $\ell^\infty$ denotes the space of bounded
sequences.

\myexample{The Dirichlet function (Example~\ref{ExDir}) takes two
values, 0 and 1. Its essential supremum is zero, because the value 1 is
taken on a null set.}

\myexercise{Let $f,g \colon X \to [0,\infty]$. Show that
$\text{ess-sup} \, |f+g| \leq\, \text{ess-sup} \,|f|+ \, \text{ess-sup}
\,|g|$.  }

\mytheorem{\label{TmLpnorminf} $L^\infty_\mu$ is a complex vector
space. }

\myproof{One can easily check that
\begin{align*}
  \|\alpha f+\beta g\|_{\infty} &= \, \text{ess-sup} \,|\alpha f+\beta g|\\
  &\leq \, \text{ess-sup} \,|\alpha f|+ \, \text{ess-sup} \,|\beta g|\\
  &= \, |\alpha|\,\text{ess-sup} \,|f|+ |\beta|\, \text{ess-sup} \,|g|\\
  &= \, |\alpha|\,\|f\|_{\infty}+ |\beta|\,\|g\|_{\infty}
\end{align*}
}

\newpage

\mytheorem{{\rm (H\"older inequality for norms)} Let $p$ and $q$ be
complex conjugate exponents, including the limiting cases $p=1$,
$q=\infty$ and $p=\infty$, $q=1$. Then for every $f \in L^p_{\mu}(X)$
and $g\in L^q$ we have $fg\in L^1$ and
$$
   \|fg\|_1 \leq \|f\|_p \, \|g\|_q.
$$
}

\myproof{If $1<p<\infty$ and $1<q<\infty$, then we can just apply
H\"older inequality to functions $|f|$ and $|g|$.

Let $p=\infty$ and $q=1$. Now
$$
   |f(x)g(x)| \leq \|f\|_{\infty}|g(x)|
   \qquad\text{for a.e.}\ \ x\in X
$$
hence
$$
  \|fg\|_1 =\int_X |fg|\, d\mu \leq \|f\|_{\infty}\int_X|g|\,d\mu
  =\|f\|_{\infty}\|g\|_1.
$$
The case $p=1$ and $q=\infty$ is handled similarly. }

\myexercise{ When does one get equality in $\|fg\|_1 \leq \|f\|_\infty
\, \|g\|_1$? }

\newpage

\myproposition{\label{PrLpnorm} Let $1\leq p \leq \infty$. Then for
every $f,g \in L^p_{\mu}(X)$ we have
$$
   \|f+q\|_p \leq \|f\|_p + \|g\|_p
$$
and
$$
   \|cf\|_p=|c| \, \|f\|_p.
$$
}

\myproof{See the proofs of Theorems~\ref{TmLpnorm1} and
\ref{TmLpnorminf}.}

\pt Thus, $\|\cdot\|_p$ has two properties of a norm. But it is still
not a norm, as the next example shows.

\myexample{Let $X=\IR$ and $\mu$ be the Lebesgue measure. The Dirichlet
function $\chi_{\IQ}$ (Example~\ref{ExDir}) satisfies $\|\chi_{\IQ}\|_p
=0$ for every $p\in [1,\infty]$.}

\pt We see that $\|\cdot\|_p$ is not a norm, as there may be nonzero
functions $0\neq f\in L^p_{\mu}(X)$ with $\|f\|_p=0$.

\mylemma{Let $f\colon X\to \IC$ be measurable. Then
$$
 \exists p\in[1,\infty]\colon \|f\|_p=0
 \quad \Longleftrightarrow\quad
 f=0\ \ {\rm a.e.}
 \quad \Longleftrightarrow\quad
 \forall p\in[1,\infty]\colon \|f\|_p=0.
$$}

\myproof{Direct inspection. For $p<\infty$ apply
Theorem~\ref{TmInt=0}(a).}

\newpage

\mydefinition{Let $V$ be a complex vector space and $W \subset V$ a
linear subspace. For two vectors $v_1,v_2 \in V$ we say that $v_1 \sim
v_2$ iff $v_1-v_2 \in W$. This is an equivalence relation. Denote by
$$
  [v] = \{v_1\in V\colon v-v_1\in W\}
$$
the equivalence class containing $v$ and
$$
   V/W = \{[v]\colon v\in V\}
$$
the set of equivalence classes. Then $V/W$ is a vector space with
$$
   [v]+[w]=[v+w],\qquad c[v]=[cv].
$$
We call $V/W$ the \textbf{quotient space}. }

\mylemma{Let $(X,\fM,\mu)$ be a measure space and
$$
  \cN_\mu=\{f\colon X\to\IC\ \ \text{measurable},
  \ \ f=0\ \ \text{a.e.}\}
$$
Then $\cN_{\mu}$ is a vector space.}

\myproof{Let $f,g\in\cN_\mu$ and $\alpha\in\IC$. Then
$$
  \{x\colon f+g\neq 0\} \subset \{x\colon f\neq 0\}
  \cup\{x\colon g\neq 0\}
$$
thus $\mu(\{x\colon f+g\neq 0\})=0$, and so $f+g\in\cN_\mu$. We also
have
$$
  \{x\colon \alpha f\neq 0\} \subset \{x\colon f\neq 0\}
$$
hence $\alpha f\in\cN_{\mu}$. }

\mydefinition{Let $(X,\fM,\mu)$ be a measure space and
$$
  \cN_\mu=\{f\colon X\to\IC\ \ \text{measurable},
  \ \ f=0\ \ \text{a.e.}\}
$$
For every $1\leq p\leq\infty$ we define the `reduced' $L^p_{\mu}(X)$
space by
$$
    \cL^p_\mu = L^p_\mu/\cN_\mu.
$$
}

\pt $\cL^p_\mu(X)$ is obtained from $L^p_\mu(X)$ by identifying
functions that coincide a.e.

\mycorollary{Let $1\leq p \leq \infty$. Then $\cL^p_\mu(X)$ is a vector
space with norm $\|\cdot\|_p$.}

\myexercise{ Suppose $f\colon X\to \IC$ is measurable and
$\|f\|_\infty>0$. Define
$$
  \varphi(p)=\int_X |f|^p \, d\mu = \|f\|_p^p \qquad (0< p < \infty)
$$
and consider the set $E=\{p\colon \varphi(p) < \infty\}$. Each of the
following questions is graded as a separate exercise. Question (c) and
(e) are \textbf{bonus} problems.
\begin{itemize} \item[(a)] Let $r < p < s$ and $r,s\in E$. Prove that
$p \in E $. Thus $E$ is a connected set. \item[(b)]Prove that
$\log\varphi$ is convex in the interior of $E$ and that $\varphi$
is continuous on $E$.
\item[(c)] Is $E$ necessarily open? Closed? Can $E$ consist of a
    single point? Can $E$ be any connected subset of $(0, \infty)$?
    \item[(d)] If $r < p < s$, prove that $\|f\|_p \leq
        \max\bigl(\|f\|_r, \|f\|_s\bigr)$. Show that this implies
        the inclusion $L^r_\mu(X) \cap L^s_\mu(X) \subset
        L^p_\mu(X)$.
\item[(e)] Assume that $\|f\|_r < \infty$ for some $r < \infty$ and
    prove that $\|f\|_p \to \|f\|_\infty$ as $p \to \infty$.
\end{itemize}
}

\topic{Distance in a normed vector space}{Recall that if $V$ is a
vector space with a norm $\|\cdot\|$, we can define distance (metric)
on $V$ by
$$
   d(u,v)=\|u-v\|.
$$
}

\mydefinition{The space $\cL^p_\mu(X)$ with norm $\|\cdot\|_p$ becomes
a metric space. We say that a sequence of functions $f_n$ converges to
$f$ in the $L^p$ norm (metric) if $\|f_n-f\|_p \to 0$ as $n\to\infty$.}

\myproposition{Suppose $f,f_1,f_2,\ldots \in L^p_{\mu}(X)$ and
$f_n\to f$ in the $L^p$ norm. Then $f_n\to f$ in measure.}

\topic{Types of convergence}{We have seen uniform convergence,
pointwise convergence, convergence in measure, and now -- the
convergence in the $L^p$ norm (metric). For $p<\infty$, it is
stronger than the convergence in measure, but generally a little
weaker than pointwise convergence. For $p=\infty$, the convergence
in the $L^{\infty}$ norm is equivalent to the uniform convergence
a.e.}

\myexample{\label{ExSRLp} Recall the `Amazing shrinking sliding
rectangles' functions in Example~\ref{ExSR}. This sequence converges
to the zero function $f\equiv 0$ in the $L^p$ norm for every $p\in
(0,\infty)$, but it does not converge at any point $x$. Note also
that this sequence does not converge in the $L^{\infty}$ norm. }

\newpage

\mydefinition{A metric is \textbf{complete} if every Cauchy sequence
converges to a limit. A vector space $V$ with norm $\|\cdot\|$ that
induces a complete metric on it is called \textbf{Banach space}.}

\pt Reminder: a Cauchy sequence $\{a_n\}$ has the following property:\\
\centerline{$\forall \varepsilon>0$ $\exists N\geq 1$ such that
$\forall m,n \geq N$ we have $|a_n-a_m|<\varepsilon$}

\mytheorem{\label{TmBanach} Let $1\leq p \leq \infty$. Then
$\cL^p_\mu(X)$ is a Banach space. }

\myproof{We consider separately two cases:\medskip

\noindent\textbf{Case I: $1\leq p<\infty$.} Let $\{f_n\}$ be a Cauchy
sequence in $L^p_{\mu}(X)$. We need to find $f\in L^p_{\mu}(X)$ such
that $f_n\to f$ in the $L^p$ norm. Example~\ref{ExSRLp} warns us that
the functions $f_n$ need not converge pointwise, hence we cannot
construct $f$ as a pointwise limit of $f_n$'s. Instead, we will find a
subsequence $\{f_{n_k}\}$ that converges pointwise a.e., and then
define $f(x)$ to be the pointwise limit of $f_{n_k}(x)$.

Since $\{f_n(x)\}$ is a Cauchy sequence, for any $k\geq 1$ there
exists $n_k\geq 1$ such that for all $n',n'' \geq n_k$ we have
$\|f_{n'} - f_{n''}\|_p < 2^{-k}$. We can assume that $n_1 \leq n_2
\leq \cdots$. The subsequence $f_{n_k}(x)$ has the following
property: $\|f_{n_{k+1}} - f_{n_k}\|_p < 2^{-k}$.

Define functions $g_k = \sum_{i=1}^k |f_{n_{i+1}} - f_{n_i}|$. Note
that $0\leq g_1\leq g_2\leq\cdots$, hence there is the limit function
$g(x)$ defined by
$$
  g=\lim_{k\to \infty} g_k = \sum_{i=1}^{\infty}  |f_{n_{i+1}} -
  f_{n_i}|.
$$
By Fatou's Lemma
\begin{align*}
   \int_X g^p\, d\mu &= \int_X \liminf g_k^p\, d\mu
   \leq \liminf \int_X g_k^p\, d\mu.
\end{align*}
Now
\begin{align*}
  \int_X g_k^p\, d\mu = \|g_k\|_p^p
   & = \biggl\|\sum_{i=1}^k |f_{n_{i+1}} - f_{n_i}|\biggr\|_p^p\\
   &\leq \biggl[\sum_{i=1}^k \|f_{n_{i+1}} - f_{n_i}\|_p\biggr]^p
   \qquad\text{\footnotesize (By Proposition~\ref{PrLpnorm})}\\
   &\leq \biggl[\sum_{i=1}^k 2^{-i}\biggr]^p \leq 1
   \qquad\text{\footnotesize (By our choice of $n_i$'s)}
\end{align*}
Therefore $\int_X g^p\, d\mu \leq 1$. According to
Theorem~\ref{TmBasLI}(f), $g(x)<\infty$ a.e., thus the series
$\sum_{i=1}^{\infty}  (f_{n_{i+1}} - f_{n_i})$ converges absolutely
a.e. We define the function $f(x)$ by
$$
   f(x) = f_{n_1}(x) + \sum_{i=1}^{\infty}  (f_{n_{i+1}(x)} - f_{n_i}(x))
$$
wherever the series converges (which happens a.e.) and set $f(x)=0$
elsewhere. Thus for a.e.\ $x\in X$
$$
   f(x) = \lim_{k\to\infty}
   \biggl[f_{n_1}(x) + \sum_{i=1}^{k-1}  (f_{n_{i+1}(x)} - f_{n_i}(x))\biggr]
   =\lim_{k\to\infty} f_{n_k}(x).
$$
In particular, $f(x)$ is measurable.

Next we will show that $f_n \to f$ in the $L^p$-metric and, in
particular, $f\in L^p_{\mu}(X)$.

Let $\varepsilon>0$. Since our sequence $\{f_n\}$ is Cauchy, there
exists $N_{\varepsilon}\geq 1$ such that $\forall m,n \geq
N_{\varepsilon}$ we have $\|f_n -f_m\|_p <\varepsilon$. By Fatou's
Lemma for each $m\geq N_{\varepsilon}$
$$
  \int_X |f-f_m|^p\, d\mu = \int_X \liminf_{k\to\infty} |f_{n_k}-f_m|^p\,d\mu
  \leq \liminf_{k\to\infty} \int_X |f_{n_k}-f_m|^p\,d\mu \leq
  \varepsilon^p.
$$
In particular, $f-f_m \in L^p_{\mu}(X)$ and hence $f\in
L^p_{\mu}(X)$, because $L^p_{\mu}(X)$ is a vector space. We also
have $\|f-f_m\|_p \leq \varepsilon$ for all $m\geq N_{\varepsilon}$.
This means $f_n\to f$ in the $L^p$ metric.

\medskip\noindent\textbf{Case II: $p=\infty$.} Let $\{f_n(x)\}$ be a
Cauchy sequence in $L^{\infty}_{\mu}(X)$. Note that
$\|f_n\|_{\infty}$ is a bounded sequence, i.e., $\exists M<\infty$
such that $\|f_n\|_{\infty} \leq M$ for all $n\geq 1$. Define sets
$$
   A_k = \{x\colon |f_k(x)|>\|f_k\|_{\infty}\}
$$
and
$$
  B_{m,n} = \{x\colon |f_n(x)-f_m(x)|>\|f_n-f_m\|_{\infty}\}
$$
All of these are null sets, thus their union is a null set:
$$
  E = \Bigl(\cup_{k=1}^{\infty}A_k\Bigr) \cup
  \Bigl(\cup_{m,n=1}^{\infty}B_{m,n}\Bigr),
  \qquad \mu(E)=0
$$
For each $x\in X\setminus E$ we have $|f_n(x)-f_m(x)|<
\|f_n-f_m\|_{\infty}$, thus $f_n(x)$ is a Cauchy sequence (of complex
numbers), hence it has a limit. Define $f(x) = \lim_{n\to\infty}
f_n(x)$ on $X\setminus E$ and $f(x)=0$ on $E$. Next, we have
$|f_n(x)|\leq M$ for all $x\in X\setminus E$ and all $n\geq 1$, so
$|f(x)| \leq M$ for all $x\in X\setminus E$. Thus $f \in
L^{\infty}_{\mu}(X)$. Lastly, the convergence $f_n\to f$ is uniform,
hence $\|f_n-f\|_{\infty} =\, \text{ess-sup} \, (f_n-f) \to 0$ as $n\to
\infty$.}

\mycorollary{ Let $1\leq p < \infty$. If $f_n\to f$ in the $L^p_\mu(X)$
metric, then there is a subsequence $\{f_{n_k}\}$ such that $f_{n_k}
\to f$ a.e.}

\myproof{Since $f_n\to f$ in the $L^p_\mu(X)$ metric, it is a Cauchy
sequence, hence the proof of Case I above applies.}

\myexercise{ Let $\mu(X) = 1$. Each of the following questions is
graded as a separate exercise.\begin{itemize} \item[(a)] Prove that
$\|f\|_r \leq \|f\|_s$ if $0 < r < s \leq \infty$. \item[(b)] Under
what condition does it happen that $0 < r < s \leq \infty$ and
$\|f\|_r = \|f\|_s < \infty$? \item[(c)] Prove that $L^r_\mu \supset
L^s_\mu$ if $0<r<s$. If $X=[0,1]$ and $\bm$ is the Lebesgue measure,
show that $L^r_\bm \neq L^s_\bm$.
\end{itemize}
}

\myexercise{[Bonus] For some measures, the relation $r < s$ implies
$L^r(\mu) \subset L^s(\mu)$; for others, the inclusion is reversed;
and there are some for which $L^r(\mu)$ does not contain $L^s(\mu)$
if $r \ne s$. Give examples of these situations, and find conditions
on $\mu$ under which these situations will occur. }

\myexercise{ (a) Show that
$\int_0^{\frac{\pi}{2}}\sqrt{x\sin x}\, dx < \frac{\pi}{2\sqrt{2}}$;\\
${\ \ \ \ \ \ \ }$\ \ \ \ \ \ \ \ \ \ \ \ \ (b) Show that
$\bigl[\int_0^1 x^{\frac{1}{2}}(1-x)^{-\frac{1}{3}}\, dx\bigr]^3
\leq \frac{8}{5}$. }

\newpage

Next we approximate $L^p_{\mu}(X)$ functions by simple functions and
continuous functions.

\mydefinition{\textbf{Simple functions with a finite-measure
support} are defined as follows:
$$
  S=\bigl\{s\colon X\to\IC\ \ \text{simple, measurable},\ \
  \mu(s\neq 0)<\infty\bigr\}.
$$}

\mylemma{Let $s=\sum_{i=1}^n \alpha_i\chi_{A_i}$ be a simple function.
We can assume that $\alpha_i\neq 0$ for all $1\leq i\leq n$. Let
$p<\infty$. Then we have
$$
   s\in L^p_{\mu}(X) \quad\Longleftrightarrow\quad s\in S
$$
}

\myproof{Note that $\int_X |f|^p\, d\mu = \sum_{i=1}^n
|\alpha_i|^p\mu(A_i)$. Then $\int_X |f|^p\, d\mu <\infty$ if and only
if $\mu(A_i)<\infty$ for every $i=1,\ldots,n$, which means exactly that
$s\in S$.}

\mytheorem{\label{TmLpSdense} $S$ is dense in $L^p_{\mu}(X)$ for every
$1\leq p< \infty$.}

\pt This is not true for $p=\infty$ (for example, let $X=\IR$ and
$f(x)\equiv 1$).

\myproof{First let $f\colon X\to[0,\infty)$. Then by
Theorem~\ref{Tmflims} there exist simple functions $s_n \colon X \to
\IR$ such that
$$
   0\leq s_1\leq s_2\leq\cdots \leq f
$$
and $s_n(x) \to f(x)$ as $n\to \infty$ for every $x \in X$. Since $f\in
L^p_{\mu}(X)$, we also have $s_n\in L^p_{\mu}(X)$, hence $s_n \in S$ by
the above lemma. We also have $|f-s_n| \to 0$ as $n\to \infty$ and
$|f-s_n|^p \leq |f|^p \in L^1_{\mu}(X)$ for all $n\geq 1$. Thus by
Lebesgue's Dominated Convergence theorem $\int_X |f-s_n|^p\, d\mu \to
0$, hence $\|f-s_n\|_p \to 0$.

Second, let $f\colon X \to \IR$. Then we approximate $f^+$ and $f^-$,
separately, by simple functions $s_n \in S$, as above.

Third, let $f\colon X \to \IC$. Then we approximate $\re f$ and $\im
f$, separately, by simple functions $s_n \in S$, as above. }

\newpage

\pt Recall that $C_c(\IR)$ denotes the space of continuous functions
$f\colon \IR\to \IC$ with compact support.

\mytheorem{\label{TmLpCcdense} $C_c(\IR)$ is dense in $L^p_{\bm}(\IR)$
for every $1\leq p< \infty$. }

\pt This is not true for $p=\infty$ (for example, let $f(x)\equiv 1$).

\myproof{Due to Theorem~\ref{TmLpSdense} it is enough to show that for
any simple function $s\in S$ and any $\varepsilon>0$ there exists a
continuous function $g\in C_c(\IR)$ such that $\|s-g\|_p <
\varepsilon$. By Lusin's theorem~\ref{TmLusin}(b) there exists $g \in
C_c(\IR)$ such that
$$\bm\bigl\{x\colon s(x)\neq g(x)\bigr\}<\varepsilon$$ and
$$\sup|g(x)|\leq \sup|s(x)|=\colon s_{\max}.$$Therefore
$$
  \|s-g\|_p^p =\int_X |s-g|^p\, d\mu =\int_{\{x\colon s(x)\neq
   g(x)\}}|s-g|^p\, d\mu< [2s_{\max}]^p\varepsilon.
$$
Since $\varepsilon>0$ is arbitrary, the theorem is proved.}

\pt We can say that the $L^p_{\bm}(\IR)$ space, for $1<p<\infty$, is
the completion (in the $p$-metric) of the space $C_c(\IR)$ of
continuous functions with compact support.

\pt The previous statement is not true for $p=\infty$.

\pt If we restrict our domain to a finite interval $[a,b]$, then much
simpler functions -- polynomials -- can be used to approximate
integrable functions. The set of polynomials on $[a,b]$ is dense in
$L^p_{\bm}([a,b])$ for any $1\leq p< \infty$. Indeed, the above theorem
implies that the space of continuous functions $C([a,b])$ is dense in
$L^p_{\bm}([a,b])$, and then \textbf{Weierstrass approximation theorem}
implies that polynomials are dense in $C([a,b])$. More precisely, the
Weierstrass theorem states that every continuous function on $[a,b]$
can be uniformly approximated as closely as desired by a polynomial
function. This last theorem is not a part of our course, though.

\newpage

\pt Recall that a step function $\varphi \colon \IR \to \IC$ is
defined by $\varphi = \sum_{i=1}^n \alpha_i \chi_{I_i}$ for some
$\alpha_i \in \IC$ and disjoint finite intervals $I_i \subset \IR$.

\mytheorem{ Step functions $f\colon \IR \to \IC$ are dense in
$L^p_{\bm}(\IR)$.}

\myproof{Due to Theorem~\ref{TmLpCcdense} it is enough to show that for
any continuous function $f\in C_c(\IR)$ with compact support and any
$\varepsilon>0$ there exists a step function $\varphi$ such that
$\|f-\varphi\|_p < \varepsilon$. Let $[-A,A] \subset \IR$ be a large
finite interval containing the support of $f$, i.e., $f(x)=0$ for
$|x|>A$. Since $f$ is continuous on the compact interval $[-A,A]$, it
is uniformly continuous, hence for any $\varepsilon>0$ there exists
$\delta>0$ such that
$$
  |x'-x''| < \delta \qquad\Longleftrightarrow\qquad |f(x')-f(x'')|<\varepsilon.
$$
Let $\Delta = \{I_i\}_{i=1}^n$ be a finite partition of $[-A,A]$ into
small intervals of length $\leq \delta$ and let $x_i \in I_i$ be
arbitrary points. We define the step function by $\varphi(x) =
\sum_{i=1}^n f(x_i) \chi_{I_i}(x)$. Then $|f(x) - \varphi(x)| \leq
\varepsilon$ for all $x\in [-A,A]$, hence
$$
  \|f-\varphi\|_p^p =\int_X |f-\varphi|^p\, d\mu
  \leq 2A\varepsilon^p.
$$
Since $\varepsilon>0$ is arbitrary, the theorem is proved.}

\pt We can say that the $L^p_{\bm}(\IR)$ space, for $1<p<\infty$, is
the completion (in the $p$-metric) of the space of step functions.

\pt The previous statement is not true for $p=\infty$.

\pt The above proof shows that $\|f-\varphi\|_{\infty} \leq
\varepsilon$, i.e., continuous functions $f\in C_c(\IR)$ with compact
support can be approximated arbitrarily well by step functions in the
$L^{\infty}$ metric.

\newpage

Next we describe the completion of the space $C_c(\IR)$ of continuous
functions with compact support in the $L^{\infty}$ metric.

\mydefinition{ A function $f\colon \IR\to\IC$ is said to \textbf{vanish
at infinity} if $f(x) \to 0$ as $|x|\to \infty$. The space of
continuous functions vanishing at infinity is denoted by $C_0(\IR)$. }

\pt We have $C_c(\IR) \subset C_0(\IR)$, but not vice versa.

\mytheorem{The completion of $C_c(\IR)$ in the $L^{\infty}$-metric is
$C_0(\IR)$ (modulo the identification of equivalent functions). }

\myproof{Let $f_1,f_2\ldots \in C_c(\IR)$ be a Cauchy sequence
(in the $L^\infty$ norm). Due to Theorem~\ref{TmBanach} it converges
to a limit function, $f_n\to f\in L^{\infty}$. We need to show that\\
(i) $f \in C_0(\IR)$;\\ (ii) every function $f \in C_0(\IR)$ is a limit
of a sequence of functions $f_n\in C_c(\IR)$.

\medskip\noindent \textbf{Proof of (i):} For any continuous function
$g \colon \IR \to \IC$ we have $$\sup |g| =\, \text{ess-sup}\, |g|.$$
Therefore $$\sup|f_n-f_m| =\, \text{ess-sup}\, |f_n-f_m| =
\|f_n-f_m\|_{\infty}.$$ Thus $\{f_n\}$ is a Cauchy sequence with
respect to the usual $\sup$ norm on $\IR$. Therefore $f_n\to f$
uniformly everywhere on $\IR$ (not just a.e.). A uniform limit of
continuous functions is a continuous function, hence $f \in C(\IR)$.
Now for any $\varepsilon >0$ there exist $n\geq 1$ such that $\sup |f_n
- f| < \varepsilon$ and $A>0$ such that $f_n(x)=0$ for all $|x|>A$.
This implies $|f(x)|<\varepsilon$ for all $|x|>A$. Thus $f\in
C_0(\IR)$.

\medskip\noindent \textbf{Proof of (ii):} For any function $f\in
C_0(\IR)$ and $n\geq 1$ define $f_n$ as follows:
$$
    f_n(x)=\left\{\begin{array}{ll} f(x) & {\rm if}\ \ x\in [-n,n]\\
     0 & {\rm if}\ \ |x|\geq n+1\\
     f(n)(n+1-x) & {\rm if}\ \ x\in (n,n+1)\\
     f(-n)(n+1+x) & {\rm if}\ \ x\in (-n-1,-n)
     \end{array}\right .
$$
In other words, $f_n(x)$ agrees with $f(x)$ on the interval $[-n,n]$,
is zero beyond the slightly larger interval $[-n-1,n+1]$, and is
extended linearly and continuously to the two small intervals $[n,n+1]$
and $[-n-1,-n]$. See Figure~\ref{Fig2}. Also note that
$$
  \sup_{[n,n+1]} |f_n(x)| \leq |f(n)|
  \qquad\text{and}\qquad
  \sup_{[-n-1,-n]} |f_n(x)| \leq |f(-n)|.
$$
Therefore
$$
   \sup |f_n-f|\leq 2\sup_{|x|\geq n} |f(x)|.
$$
Since $f\in C_0(\IR)$, we have $\sup\limits_{|x|\geq n} |f(x)| \to 0$
as $n\to\infty$, thus $f_n \to f$ in the $L^{\infty}$ norm. }

\begin{figure}[h]
\centering
\includegraphics[width=4in]{Fig2.eps}
\caption{The original function $f\in C_0$ (green, top panel) and the
approximating function $f_n \in C_c$ (blue, bottom
panel).}\label{Fig2}
\end{figure}

\mycorollary{ $C_0(\IR)$ with the $L^{\infty}$ norm is a Banach space.}

\myexercise{[Bonus] Suppose $1 < p < \infty$ and $f\in L^p_{\bm}((0,
\infty))$ relative to the Lebesgue measure. Define
$$
     F(x)=\frac{1}{x}\int_0^x
     f(t)\, dt \ \ \ \ \ \ (0 < x < \infty).
$$
Prove Hardy's inequality
$$
    \|F\|_p \leq \frac{p}{p-1}\|f\|_p
$$
which shows that the mapping $f\to F$ carries $L^p_{\bm}((0, \infty))$
into $L^p_{\bm}((0, \infty))$.\medskip

[Hint: assume first that $f\geq 0$ and $f\in C_c((0,\infty))$, i.e.\
the support of $f$ is a finite closed interval $[a,b] \subset
(0,\infty)$. Then use integration by parts:
$$
   \int_{\varepsilon}^A F^p(x)\, dx = -p\int_{\varepsilon}^A
   F^{p-1}xF'(x)\, dx
$$
where $\varepsilon<a$ and $A>b$. Note that $xF'=f-F$, and apply
H\"older inequality to $\int F^{p-1} f\, dx$.] }

\newpage

%************************************************************************

\section{Complex measures}

We have remarked, right before Theorem~\ref{Tmcmu}, that for any
measure space $(X,\fM,\mu)$ and a real number $c>0$ we can define a
new measure $\nu$ on $\fM$ by $\nu(A) = c\mu(A)$ for all $A\in \fM$.
Thus a measure can be multiplied by a positive constant.

Another useful remark:

\mylemma{Given two measures $\mu_1$ and $\mu_2$ on $(X,\fM)$, we can
define a new measure $\mu = \mu_1+\mu_2$ by
$$
  \mu(A) \colon = \mu_1(A) + \mu_2(A)\qquad \forall\ A \in \fM.
$$
}

\myproof{Clearly, $\mu(A)\geq 0$ is a non-negative function on $\fM$.
Now let $E = \uplus_{n=1}^{\infty} E_n$. Then
\begin{align*}
   \mu(E) = \mu_1(E) + \mu_2(E) &= \sum_{n=1}^{\infty}\mu_1(E_n)
   + \sum_{n=1}^{\infty}\mu_2(E_n)\\ &=
   \sum_{n=1}^{\infty}[\mu_1(E_n)+\mu_2(E_n)]= \sum_{n=1}^{\infty}\mu(E_n),
\end{align*}
hence $\mu$ is a $\sigma$-additive function, thus it is a measure.}

\pt In the above calculation, the essential step was the rearranging
of an infinite sum of non-negative numbers. We remember from
Calculus that an infinite series of non-negative numbers either
converges or diverges to infinity, and its sum is independent of the
order in which its terms are added.

\topic{Measures make a vector space?}{We see that we can add
measures and multiply them by positive constants (scalars). Thus the
collection of measures on $(X,\fM)$ is `almost' a vector space,
except we cannot subtract measures or multiply them by negative
scalars (at least not yet...). Next we will extend the notion of
measure and define \emph{complex measures} that will make a vector
space.}

\topic{Another motivation for complex measures}{Recall that given a
measure $\mu$ on $(X,\fM)$ and a measurable function $f\geq 0$ on $X$
we can define a measure $\lambda$ by $\lambda(A) = \int_A f\, d\mu$ for
all $A \in \fM$. (We write $d\lambda = f\, d\mu$ and call $f$ the
density of $\lambda$.) But what if $f$ takes negative values? Or what
if $f$ takes complex values? Would such a definition of $\nu$ give
something like `complex measure'?}

\newpage

\mydefinition{\label{DefCM} A function $\mu \colon \fM \to \IC$ is
called a \textbf{complex measure} if it is $\sigma$-additive, i.e.\ if
for any countable collection of pairwise disjoint measurable sets
$\{E_i\}_{i=1}^\infty$ we have
$$
   \mu \bigl( \uplus_{i=1}^{\infty} E_i\bigr) =
   \sum_{i=1}^{\infty} \mu(E_i).
$$
}

\pt As opposed to complex measures, we will call the earlier defined
measures \textbf{positive measures}.

\pt Observe that not every positive measure is a complex measure
(because positive measures can take infinite values).

\pt Observe that the convergence of the series in
Definition~\ref{DefCM} is now part of the requirement (unlike
positive measures, where the corresponding series could either
converge or diverge to infinity).

\mylemma{The series $\sum_{i=1}^{\infty} \mu(E_i)$ in
Definition~\ref{DefCM} must converge absolutely.}

\myproof{Indeed, the union of the sets $E_i$ is not changed if the
subscripts are permuted, thus every rearrangement of the above
series must also converge to the same value.}

\pt A reminder from calculus: an infinite series $\sum_{n=1}^{\infty}
a_n$ of complex numbers is absolutely convergent if
$\sum_{n=1}^{\infty} |a_n| < \infty$. A series is absolutely convergent
if and only if its sum is finite and the same for all rearrangements of
its terms.

\mydefinition{A complex measure $\mu$ on $(X,\fM)$ is
\textbf{dominated} by a positive measure $\nu$ if $|\mu(A)| \leq
\nu(A)$ for all $A\in \fM$.}

The dominating measure always exists and we can actually construct
the \textbf{smallest dominating} measure as follows:

\mydefinition{Let $\mu$ be a complex measure on $(X,\fM)$. Define the
function $|\mu|$ on $\fM$ by
$$
   |\mu| (E) =
   \sup \sum_{n=1}^{\infty} |\mu(E_n)|.
$$
where the supremum is taken over all partitions of $E \in \fM$ into
measurable subsets: $E = \uplus_{n=1}^{\infty} E_n$, $E_n\in \fM$. Then
$|\mu|$ is called the \textbf{total variation} of $\mu$.}

\pt The total variation $|\mu|$ actually \emph{is} a positive measure,
see the next theorem.

\pt If $\mu$ is a positive measure, then of course $|\mu| = \mu$.

\newpage

\mytheorem{ Let $\mu$ be a complex measure on $(X,\fM)$.\begin{itemize}
\item[\rm (a)] The total variation $|\mu|$ is a positive measure on
    $(X,\fM)$. It dominates $\mu$, i.e., $|\mu(E)| \leq |\mu|(E)$ for every $E\in
    \fM$;
\item[\rm (b)] If $\lambda$ is another positive measure on $\fM$
    dominating $\mu$, then $|\mu|(E) \leq
    \lambda(E)$ for all $E\in \fM$.
\end{itemize}}

\myproof{\textbf{Proof of part (a):} Let $E = \uplus_{n=1}^{\infty}
E_n$. First we show that
\beq \label{tv1}
   |\mu|(E) \geq \sum_{n=1}^{\infty} |\mu|(E_n).
\eeq
For any $\varepsilon>0$ we can find a partition $E_n =
\uplus_{m=1}^{\infty} E_{nm}$ such that
$$
  |\mu| (E_n) \leq \frac{\varepsilon}{2^n} + \sum_{m=1}^{\infty} |\mu(E_{nm})|
$$
Adding these inequalities up gives
$$
  \sum_{n=1}^{\infty}|\mu| (E_n) \leq \varepsilon +
  \sum_{m,n=1}^{\infty} |\mu(E_{nm})| \leq \varepsilon + |\mu|(E)
$$
(because $E = \uplus_{m,n=1}^{\infty} E_{nm}$ is a countable partition
of $E$). Since $\varepsilon>0$ is arbitrary, we get \eqref{tv1}. Now we
prove that
\beq \label{tv2}
   |\mu|(E) \leq \sum_{n=1}^{\infty} |\mu|(E_n).
\eeq
For any $\varepsilon>0$ we can find a partition $E =
\uplus_{m=1}^{\infty} A_{m}$ such that
$$
  |\mu| (E) \leq \varepsilon+ \sum_{m=1}^{\infty} |\mu(A_{m})|
$$
Denote $E_{nm} = E_n\cap A_m$. Then $\mu(A_{m}) = \sum_{n=1}^{\infty}
\mu(E_{nm})$ and by the triangle inequality
$$
  |\mu| (E) \leq \varepsilon+ \sum_{m=1}^{\infty} \sum_{n=1}^{\infty}
  |\mu(E_{nm})| =\varepsilon+ \sum_{n=1}^{\infty} \sum_{m=1}^{\infty}
  |\mu(E_{nm})|\leq \varepsilon+ \sum_{n=1}^{\infty} |\mu|(E_n)
$$
(because $E_n = \uplus_{m=1}^{\infty} E_{nm}$ is a partition of
$E_n$). Since $\varepsilon>0$ is arbitrary, we get \eqref{tv2}. Now
\eqref{tv1} and \eqref{tv2} together imply that $|\mu|$ is a
$\sigma$-additive. Thus Part (a).
\medskip

\textbf{Proof of part (b):} We have
$$
   |\mu| (E) =
   \sup \sum_{n=1}^{\infty} |\mu(E_n)|
   \leq \sup \sum_{n=1}^{\infty} \lambda(E_n)
   =\lambda(E)
$$
where again the supremum is taken over all partitions of $E \in \fM$
into measurable subsets $E_n$.}

\newpage

\begin{lemma}
If $z_1,\ldots,z_N \in \IC$, then there is a subset $S \subset
\{1,\ldots,N\}$ such that
$$
  \biggl| \sum_{k\in S} z_k \biggr|
  \geq \frac{1}{\pi} \sum_{k=1}^N |z_k|.
$$
\end{lemma}

\begin{theorem}
If $\mu$ be a complex measure on $(X,\fM)$, then $|\mu|$ is a finite
measure, i.e.\ $|\mu|(X) <\infty$.
\end{theorem}

Observe that the range of $\mu$ is bounded, since $|\mu(E)| \leq
|\mu|(E) \leq |\mu|(X)$; i.e.\ all the values of $\mu$ lie in a
closed disk $D$ of radius $R=|\mu|(X)$, i.e.\ $\mu(E)\in D$ for all
$E\in \fM$.

\begin{exercise}
Let $(X, \mathcal{M}, \mu)$  be a measure space. For $f \in L^1_\mu$
define
$$
     \mu_f(E)= \int_{E}f\, d \mu \text{.}
$$
Show:\\
${\ \ \ \ \ \ \ }$(a) $\mu_f$ is a complex measure;\\
${\ \ \ \ \ \ \ }$(b)
$|\mu_f|=\mu_{|f|}$, assuming that $f$ is real-valued;\\
${\ \ \ \ \ \ \ }$(c) $|\mu_f|=\mu_{|f|}$, now for a general $f \in
L^1_{\mu}(X)$.
\end{exercise}

We denote by $\IM(X,\fM)$ the set of all complex measures on
$(X,\fM)$. For any two measures $\mu_1,\mu_2 \in \IM(X,\fM)$ we can
define a new measure $\mu = \mu_1+\mu_2$ by $\mu(A) = \mu_1(A) +
\mu_2(A)$ for all $A \in \fM$ (it is easy to check that $\mu$ is a
measure). Also for any measure $\mu_1 \in \IM(X,\fM)$ on $(X,\fM)$
and a scalar $c\in\IC$ we can define a measure $\mu = c\mu_1$ by
$\mu(A) = c\mu_1(A)$ for all $A \in \fM$.

\begin{theorem}
$\IM(X,\fM)$ is a vector space with a norm $\|\mu\| = |\mu|(X)$.
\end{theorem}

\begin{exercise}[Bonus]
Prove that the space $\IM(X,\fM)$ with the norm $\|\mu\|$ is a
Banach space, i.e.\ it is a complete metric space (every Cauchy
sequence converges to a limit). Hint: given a Cauchy sequence of
complex measures $\{\mu_n\}$ you need to construct the limit measure
$\mu$ and prove that $\|\mu_n - \mu\| \to 0$ as $n \to \infty$.
\end{exercise}


\begin{definition}
Let $\mu$ be a real measure on $(X,\fM)$ (i.e.\ a real-valued
complex measure). Define
$$
   \mu^+ = \tfrac 12 (|\mu|+\mu)
   \qquad\text{and}\qquad
   \mu^- = \tfrac 12 (|\mu|-\mu)
$$
These are called \textbf{positive and negative variations} of $\mu$.
\end{definition}

Note that $\mu^+$ and $\mu^-$ are positive measures that satisfy
$$
   \mu = \mu^+ - \mu^-
   \qquad\text{and}\qquad
   |\mu| = \mu^+ + \mu^-.
$$
The first formula is called \textbf{Jordan decomposition} of $\mu$.
We will prove that $\mu^+$ and $\mu^-$ are \emph{minimal} measures
that satisfy Jordan decomposition.

\begin{definition}
Let $\mu$ be a positive measure and $\lambda$ a complex measure on
$(X,\fM)$.\begin{itemize}
\item[\rm (a)] we say that $\lambda$ is \textbf{absolutely
continuous} with respect to $\mu$ and write $\lambda \ll \mu$ if $$\
\forall E\in \fM \colon\ \mu(E)=0\ \Rightarrow \lambda(E)=0;$$
\item[\rm (b)] we say that $\lambda$ is \textbf{concentrated on}
$A \in \fM$ if $$\ \forall E\in \fM \colon\ \lambda(E)=\lambda(E\cap
A);$$
\item[\rm (c)] we say that two complex measures $\lambda_1$ and
$\lambda_2$ are \textbf{mutually singular} and write $\lambda_1
\perp \lambda_2$ if $\lambda_1$ is concentrated on $A_1$ and
$\lambda_2$ is concentrated on $A_2$ such that $A_1 \cap A_2 =
\emptyset$.
\end{itemize}
\end{definition}

\noindent Note: $\lambda$ is concentrated on $A$ if and only if $$\
\forall E\in \fM \colon\ A\cap E = \emptyset \ \Rightarrow
\lambda(E)=0.$$ Note also that if $\lambda \ll \mu$ and $\mu$ is
concentrated on $A$, then $\lambda$ is concentrated on $A$ as well.
Suppose that $0\neq c\in \IC$; then $\lambda \ll \mu
\Longleftrightarrow c\lambda \ll \mu$; also $\lambda$ is
concentrated on $A$ iff $c\lambda$ is concentrated on $A$.

\begin{proposition}
Let $\mu$ be a positive measure and $\lambda$'s complex measures on
$(X,\fM)$.\begin{itemize}
\item[\rm (a)] if $\lambda$ is concentrated on $A$, then $|\lambda|$
is concentrated on $A$;
\item[\rm (b)] if $\lambda_1 \perp \lambda_2$, then $|\lambda_1| \perp
|\lambda_2|$;
\item[\rm (c)] if $\lambda_1 \perp \mu$ and $\lambda_2 \perp \mu$,
then $\lambda_1+\lambda_2 \perp \mu$;
\item[\rm (d)] if $\lambda_1 \ll \mu$ and $\lambda_2 \ll \mu$,
then $\lambda_1+\lambda_2 \ll \mu$;
\item[\rm (e)] if $\lambda \ll \mu$,
then $|\lambda| \ll \mu$;
\item[\rm (f)] if $\lambda_1 \ll \mu$ and $\lambda_2 \perp \mu$,
then $\lambda_1 \perp \lambda_2$;
\item[\rm (g)] if $\lambda \ll \mu$ and $\lambda \perp \mu$,
then $\lambda = 0$;
\end{itemize}
\end{proposition}

Example: let $\mu$ be a positive measure on $(X,\fM)$ and $f \in
L^1_\mu$. Then the measure $\mu_f$ defined by
$$
   \mu_f (E) = \int_E f\, d\mu
$$
is absolutely continuous with respect to $\mu$, i.e.\ $\mu_f \ll
\mu$.

\begin{exercise}
Let  $\mu$ be a positive measure on $(X,\fM)$ and $f,g \in L^1_\mu$.
Define $\mu_f$ and $\mu_g$ as above. Prove that \begin{itemize}
\item[\rm (a)] $\mu_f$ is concentrated on $A$ if and only if
$\mu\{x \in A^c \colon f(x) \neq 0\} = 0$;
\item[\rm (b)] $\mu_f \perp \mu_g$ if and only if
$\mu\{x\in X \colon f(x)g(x) \neq 0\}=0$;
\item[\rm (c)] if $f \geq 0$, then $$\ \mu\ll\mu_f
\ \Longleftrightarrow\ f(x)>0\ \text{for } \mu-\text{a.e.}\ x\in
X.$$
\end{itemize}
\end{exercise}

\begin{exercise}
Let $\lambda$ be a positive measure on $(X,\fM)$. Prove that
$\lambda$ is concentrated on $A$ if and only if $\lambda(A^c)=0$.
Give a counterexample to this statement in the case of a complex
measure $\lambda$.
\end{exercise}

\begin{definition}
A positive measure $\mu$ on $(X,\fM)$ is said to be
$\sigma$-\textbf{finite} if there exist a countable sequence of sets
$E_n \in \fM$ such that $X = \cup_n E_n$ and $\mu(E_n)<\infty$ for
all $n$.
\end{definition}

\begin{theorem}[Lebesgue-Radon-Nikodym]
Let $\mu$ be a positive $\sigma$-finite measure and $\lambda$ a
complex measure on $(X,\fM)$.\begin{itemize}
\item[\rm (a)] There exist a unique pair of complex measures
$\lambda_{\rm a}$ and $\lambda_{\rm s}$ such that $$\lambda =
\lambda_{\rm a} + \lambda_{\rm s}$$ and $\lambda_{\rm a} \ll \mu$
and $\lambda_{\rm s} \perp \mu$;
\item[\rm (b)] There is a unique $h \in L^1_\mu$ (up to
$\mu$-equivalence) such that $$\lambda_{\rm a} (E) = \int_E h\,
d\mu$$ i.e.\ $\lambda_{\rm a} = \mu_h$.
\end{itemize}
\end{theorem}

Note that $\lambda_{\rm a} \perp \lambda_{\rm s}$. The part (a) is
called the \textbf{Lebesgue decomposition} of $\lambda$. The
function $h$ is called the \textbf{Radon-Nikodym derivative} of
$\lambda_{\rm a}$ with respect to $\mu$, we sometimes write
$d\lambda_{\rm a} = h\, d\mu$.

In particular, if $\lambda \ll \mu$, then $\lambda = h\, d\mu$ for
some $h \in L^1_{\mu}$.

The Lebesgue-Radon-Nikodym theorem can be extended to the case where
both $\mu$ and $\lambda$ are positive $\sigma$-finite measures. But
we cannot go beyond $\sigma$-finiteness, as the following exampke
shows:

Example: let $X=[0,1]$, $\mu$ the Lebesgue measure, and $\lambda$
the counting measure on $X$. Then $\lambda$ cannot be decomposed as
$\lambda_{\rm a} + \lambda_{\rm s}$. Moreover, we have $\mu \ll
\lambda$ but there is no $h\in L^1_{\lambda}$ such that $d\mu = h\,
d\lambda$.

\begin{theorem}
Let $\mu$ be a positive measure and $\lambda$ a complex measure on
$(X,\fM)$. Then the following are equivalent: \begin{itemize}
\item[\rm (a)] $\lambda \ll \mu$; \item[\rm (b)] $\forall
\varepsilon>0$ $\exists \delta>0\colon$ $\mu(E)<\delta
\Longrightarrow |\lambda(E)| < \varepsilon$. \end{itemize}
\end{theorem}

The property (b) justifies the name \emph{absolute continuity}.

If $\lambda$ is a positive but not finite measure, then (a) and (b)
are not equivalent. For example, let $X=(0,1)$, $\mu$ the Lebesgue
measure, and $\lambda(E) = \int_E t^{-1}\, dt$. Then $\lambda \ll
\mu$, but the property (b) does not hold.

\begin{theorem}[Polar representation]
Let $\mu$ be a complex measure on $(X,\fM)$. Then there is a
measurable function $h \colon X \to \IC$ such that $|h|=1$ and $d\mu
= h\, d|\mu|$.
\end{theorem}

\begin{theorem}
Let $\mu$ be a positive measure on $(X,\fM)$. Suppose $g \in
L^1_{\mu}$ and $d\lambda = g\, d\mu$. Then $d|\lambda| = |g|\,
d\mu$.
\end{theorem}

\begin{theorem}[Hahn decomposition]
Let $\mu$ be a real-valued measure on $(X,\fM)$. Then there is a
decomposition $X=A\cup B$, $A\cap B=\emptyset$, and
$$
   \mu^+(E)=\mu(A\cap E), \qquad \mu^-(E)=\mu(B\cap E)
$$
for any $E \in \fM$.
\end{theorem}

\begin{exercise}
Let $f$ be a real-valued and integrable function on $[0,1]$. Prove
that there exists $c \in [0,1]$ such that
$$\int_{[0,c]}f\,d\bm = \int_{[c,1]}f\,d\bm \text{.}$$
\end{exercise}

\begin{exercise}
Let $f, f_k \in L^1_m{[0,1]}$, for $k=1,2,\ldots$. Suppose $f_k(x)
\rightarrow f(x)$ a.e.\ on $[0,1]$, and $\int_{[0,1]} |f_k|\, dm
\rightarrow \int_{[0,1]} |f|\, dm$. Show that $$\int_{[0,1]} |f_k
-f| \, dm \rightarrow 0.$$ Hint: look at $|f| + |f_k| - |f-f_k|$.
\end{exercise}

\begin{exercise}
Do the previous exercise with $L^1$ replaced by $L^2$.
\end{exercise}

Let $X$ and $Y$ be vector spaces with norms and $\Lambda \colon X
\to Y$ a linear mapping.

\begin{definition}
The \textbf{norm} of $\Lambda$ is
\begin{align*}
  \|\Lambda\| &= \sup\{\|\Lambda x\|\colon
  x\in X,\ \ \|x\|=1\} \\
  &= \sup\{\|\Lambda x\|/\|x\|\colon
  x\in X,\ \ x\neq 0\}
\end{align*}
We say that $\Lambda$ is \textbf{bounded} if $\|\Lambda\|<\infty$.
\end{definition}

\begin{lemma}
We have $\|\Lambda\| = \inf\{c>0\colon \|\Lambda x\|\leq c\|x\| \ \
\forall x\in X\}$; furthermore, $\inf$ can be replaced with $\min$.
\end{lemma}

\begin{theorem}
The following conditions are equivalent: \begin{itemize} \item[\rm
(a)] $\Lambda$ is bounded; \item[\rm (b)] $\Lambda$ is continuous on
$X$; \item[\rm (c)] $\Lambda$ is continuous at some point $x\in X$.
\end{itemize}
\end{theorem}

\begin{definition}
In a special case, where $Y=\IC$, we deal with linear
\textbf{functionals} $L\colon X\to \IC$ and call
$$
  X^\ast = \{\text{all bounded linear functionals}\ \ L\colon X\to \IC\}
$$
the \textbf{dual space} (to $X$). It is a vector space with norm
$\|L\|$.
\end{definition}

Consider $L^p_{\mu}(X)$ on a measure space $(X,\fM,\mu)$ with $1\leq
p\leq \infty$. Let $q$ be a conjugate exponent. Given a function
$g\in L^q_{\mu}(X)$, we construct a linear functional $\Phi_g \colon
L^p_{\mu}(X) \to \IC$ by
$$
   \Phi_g(f) = \int_X fg\, d\mu
$$
It is bounded (by H\"older inequality) and $\|\Phi_g\| \leq \|g\|_q$
(here $\|g\|_q$ denotes the norm in the $L^q$ space).

\begin{theorem}
Let $\mu$ be a finite or $\sigma$-finite measure and $1\leq p <
\infty$. Then for every bounded linear functional $\Phi \colon
L^p_{\mu}(X) \to \IC$ there exists a unique $g\in L^q_{\mu}(X)$ (up
to equivalence) such that
$$
   \Phi(f) = \int_X fg\, d\mu \qquad \forall f\in L^p_{\mu}(X),
$$
i.e.\ $\Phi = \Phi_g$; furthermore, $\|\Phi\| = \|g\|_q$.
\end{theorem}

In other words, $L^q_{\mu}$ is isometrically isomorphic to the dual
space $L^p_{\mu}(X)^\ast$.

For $1<p<\infty$, the theorem holds without $\sigma$-finiteness.

This theorem does not hold for $p=\infty$, see the next exercise.

\begin{exercise}
Let $X=[0,1]$ and $\mu$ the Lebesgue measure. Show that
$L^{\infty}(X)^\ast \supset L^1(X)$, but $L^{\infty}(X)^\ast \neq
L^1(X)$ (in the sense $g \rightarrow \Phi_g$). (Hint: Use the
following consequence of the Hahn-Banach theorem: If $X$ is a Banach
space and $A \subset X$ is a closed subspace of $X$, with $A\neq X$,
then there exists $f\in X^\ast$ with $f \neq 0$, and $f(x)=0$ for
all $x \in A$.)
\end{exercise}

\begin{exercise}
Suppose $\mu$ is a positive measure on $X$ and $\mu(X)< \infty$. Let
$f \in L^\infty_{\mu}$ and $\|f\|_{\infty}>0$. Define $$\alpha_n =
\int_X |f|^n\, d\mu \ \ \ \ \ \ \ (n=1,2,3, \dots) \text{.}$$ Prove
that
$$\lim_{n \rightarrow \infty} \frac{\alpha_{n+1}}{\alpha_{n}}
= \|f\|_{\infty} \text{.}$$ (Hint: Start with $\|f\|_{\infty}=1$,
use H\"older inequality and the result of Exercise~51 (e).)
\end{exercise}

\section{Differentiation}

\begin{definition}
Let $\mu$ be a complex measure on $\IR$ (with Borel
$\sigma$-algebra). Then $F(x) = \mu\bigl ((-\infty,x) \bigr)$ is
called the \textbf{distribution function} of the measure $\mu$.
\end{definition}

We denote by $\bm$ the Lebesgue measure on $\IR$ (and on $\IR^k$).

\begin{theorem}
The following two conditions are equivalent: \begin{itemize}
\item[\rm (a)] $F$ is differentiable at $x\in\IR$ and $F'(x)=A$;
\item[\rm (b)] $\forall \varepsilon>0$ $\exists \delta>0 \colon$
$\left|\frac{\mu(I)}{\bm(I)} - A\right| <\varepsilon$ for every open
interval $I \subset \IR$ such that $x \in I$ and $\bm(I)<\delta$.
\end{itemize}
\end{theorem}

Motivated by this we will define derivatives of measures in $\IR^k$.

\begin{definition}
For $x\in \IR^k$ and $r>0$ we denote by
$$
   B(x,r) = \{y\in \IR^k\colon |y-x|<r\}
$$
the \textbf{open ball} of radius $r$ centered on $x$. If $\mu$ is a
complex measure on $\IR^k$ (with Borel $\sigma$-algebra), then we
denote
$$
   (Q_r\mu)(x) = \frac{\mu\bigl(B(x,r)\bigr)}
   {\bm\bigl(B(x,r)\bigr)}
$$
and define the \textbf{symmetric derivative} of $\mu$ at $x$ by
$$
   (D\mu)(x) = \lim_{r\to 0} (Q_r\mu)(x)
$$
(if the limit exists).
\end{definition}


\begin{exercise}
Let $\mu$ be a complex Borel measure on $\IR$ and assume that its
symmetric derivative $(D\mu)(x)$ exists at some $x_0 \in \IR$. Does
it follow that its distribution function $F(x)= \mu((-\infty, x))$
is differentiable at $x_0$?
\end{exercise}


To study derivatives of measures, we introduce more definitions.

\begin{definition}
If $\mu$ is a complex measure on $\IR^k$ (with Borel
$\sigma$-algebra), then the \textbf{maximal function} $M\mu \colon
\IR^k \to [0,\infty]$ defined by
$$
  (M\mu)(x) = \sup_{0<r<\infty} (Q_r|\mu|)(x).
$$
\end{definition}

\begin{lemma}
$M\mu$ is lower semicontinuous, i.e.\ the set $\{x\colon
M\mu(x)>a\}$ is open for every $a\in\IR$.
\end{lemma}

\begin{lemma}[Covering]
Let $W = \cup_{i=1}^N B(x_i,r_i)$ be a finite union of open balls.
Then there is $S \subset \{1,2, \ldots, N\}$ such that
\begin{itemize}
\item[\rm (a)] the balls $(x_i,r_i)$, $i\in S$ are disjoint;
\item[\rm (b)] $W \subset \cup_{i\in S} B(x_i,3r_i)$; \item[\rm (c)]
$\bm(W) \leq 3^k \sum_{i\in S} \bm\bigl(B(x_i,r_i)\bigr)$.
\end{itemize}
\end{lemma}

\begin{theorem} \label{10.7}
Let $\mu$ be a complex measure on $\IR^k$. Then $\forall \lambda>0$
$$
  \bm(M\mu>\lambda) \leq \frac{3^k\|\mu\|}{\lambda}
$$
where $\|\mu\| = |\mu|(\IR^k)$.
\end{theorem}

In other words, the maximal function cannot be large on a large set.

\begin{definition}
\textbf{Weak} $L^1$ is the space of measurable functions
$$
  L^1_W (\IR^k) = \{f\colon \IR^k \to \IC \text{ such that }
  \lambda\, \bm\{|f|>\lambda\} \text{ is bounded on } \lambda
  \in (0,\infty) \}
$$
\end{definition}

\begin{lemma}
We have $L^1_{\bm}(\IR^k) \subset L^1_W(\IR^k)$.
\end{lemma}

Note: there are functions in $L^1_W(\IR^k)$ that are not in
$L^1_{\bm}(\IR^k)$. For example, $f=1/x$ for $k=1$.

\begin{definition}
For every $f\in L^1_W (\IR^k)$ define the \textbf{maximal function}
$Mf \colon \IR^k \to [0,\infty]$ by
$$
  (Mf)(x) = \sup_{0<r<\infty} \frac{1}{\bm(B(x,r))}\,
  \int_{B(x,r)}|f|\, d\bm.
$$
Note that $\bm(B(x,r)) = \bm(B(0,r))$ does not depend on $x$.
\end{definition}

We have $Mf = M\mu$, where $d\mu = f\, d\bm$. Thus
theorem~\ref{10.7} states that the `maximal function' $M$ induces an
operator $L^1_{\bm} (\IR^k) \to L^1_W (\IR^k)$, which is bounded
(its bound is $\leq 3^k$): for every $f \in L^1_{\bm}(\IR^k)$ and
every $\lambda>0$
$$
  \bm\{Mf>\lambda\} \leq 3^k\lambda^{-1}\|f\|_1.
$$

\begin{definition}
If $f\in L^1_{\bm} (\IR^k)$, then any point $x\in \IR^k$ for which
$$
  \lim_{r\to 0} \frac{1}{\bm(B(x,r))}
  \int_{B(x,r)} |f(y)-f(x)|\, d\bm(y) =0
$$
is called a \textbf{Lebesgue point} of $f$.
\end{definition}

Roughly speaking, $x$ is a Lebesgue point if $f$ does not oscillate
too much near $x$, in average sense.

\begin{lemma}
If $f$ is continuous at $x$, then $x$ is a Lebesgue point of $f$.
\end{lemma}

\begin{lemma}
If $x$ is a Lebesgue point of $f$, then
$$
   f(x) =  \lim_{r\to 0} \frac{1}{\bm(B(x,r))}
   \int_{B(x,r)} f\, d\bm
$$
(but the converse is not true).
\end{lemma}

\begin{exercise}
Let $f \in L^1_{\bm} (\IR^k)$. Show that $|f(x)| \leq (Mf)(x)$ at
every Lebesgue point $x$ of $f$.
\end{exercise}

\begin{exercise}
Let
\begin{displaymath}
f(x) = \left\{
\begin{array}{ll}
0 & \textrm{if \ \ $x<0\ $ or $\ x>1$}\\
1 & \textrm{if \ \ $0<x<1$}\\
\end{array} \right. \text{.}
\end{displaymath}
Is it possible to define $f(0)$ and $f(1)$ such that $0$ and $1$
become Lebesgue points of $f$?
\end{exercise}

\begin{exercise}[Bonus]
Construct a function $f \colon \IR \to \IR$ such that $f(0)=0$ and
$0$ is a Lebesgue point of $f$, but for every $\varepsilon>0$
$$
   \bm\bigl\{x\in\IR \colon |x|<\varepsilon\
   \text{ and }\ |f(x)|\geq 1\bigr\}>0,
$$
i.e.\ $f$ is essentially discontinuous at $0$.
\end{exercise}

\begin{theorem}
If $f \in L^1(\IR^k)$, then almost every point $x\in \IR^k$ is a
Lebesgue point of $f$.
\end{theorem}

\begin{theorem}
Let $\mu$ be a complex Borel measure on $\IR^k$ such that $\mu \ll
\bm$. Then the Radon-Nokodym derivative $f = d\lambda/d\bm$ is equal
to the symmetric derivative of $\mu$, i.e.\ $f = D\mu$ $\bm$-a.e.
\end{theorem}

Next we explore some other ways of computing symmetric derivatives.

\begin{definition}
Let $x \in \IR^k$. We say that Borel sets $E_i \subset \IR^k$
\textbf{shrink nicely to} $x$ if there exists $\alpha>0$ such that
for some sequence of balls $B(x,r_i)$ with $r_i \to 0$ we have $E_i
\subset B(x,r_i)$ and $m(E_i) \geq \alpha \bm(B(x,r_i))$ for all
$i$.
\end{definition}

Examples: any sequence of intervals $I_i \supset x$ in $\IR^k$ such
that $\bm(I_i)\to 0$ shrinks to $x$ nicely. More generally: any
sequence of balls or cubes in $\IR^k$ must shrink nicely. But the
sequence of rectangles $[-\tfrac 1i, \tfrac 1i] \times [-\tfrac
1{i^2}, \tfrac 1{i^2}]$ does not shrink nicely to $0$.

\begin{theorem} \label{LP}
If $f \in L^1(\IR^k)$ and $x\in \IR^k$ is a Lebesgue point of $f$,
then for any sequence $\{E_i\}$ that shrinks nicely to $x$ we have
$$
   f(x) = \lim_{i\to\infty} \frac{1}{\bm(E_i)}
   \int_{E_i} f\, d\bm.
$$
\end{theorem}

Recall the Fundamental Theorem of Calculus:\\

\noindent (a) if $f\colon [a,b] \to \IR$ is continuous and $F(x) =
\int_a^x f(t)\, dt$, then $F'(x)=f(x)$ for all $x\in (a,b)$.\\

\noindent (b) if $f\colon [a,b] \to \IR$ is continuously
differentiable, then
$$
   f(x)-f(a) = \int_a^x f'(t)\, dt
$$
for all $x\in [a,b]$.\\

Note that in both parts the Riemannian integral is used. Our goal is
to extend this theorem to Lebesgue integrable functions.

\begin{theorem}[FTC in $L^1$, easy part]
If $f \in L^1(\IR)$ and $F(x) = \int_{(-\infty,x]} f\, d\bm$ for
$x\in \IR$, then $F'(x) = f(x)$ at every Lebesgue point $x$ of $f$.
\end{theorem}

\begin{definition}
Let $E \subset \IR^k$ be a measurable set and $x\in \IR^k$. Then
$$
  \lim_{r\to 0} \frac{\bm(E\cap B(x,r))}{\bm(B(x,r))}
$$
is the \textbf{metric density} of $E$ at $x$ (if the limit exists).
\end{definition}

\begin{corollary}
For every measurable set $E \subset \IR^k$ the metric density is 1
at a.e.\ point $x\in E$ and 0 at a.e.\ point $x\in E^c$.
\end{corollary}

\begin{corollary}
If $\varepsilon>0$, then there is no measurable set $E \subset \IR$
such that $$\epsilon < \frac{\bm(E\cap I)}{\bm(I)}<1-\varepsilon$$
for every finite nontrivial interval $I \subset \IR$.
\end{corollary}

In fact, if $\epsilon < \frac{\bm(E\cap I)}{\bm(I)}$ for every
finite nontrivial interval $I \subset \IR$, then $\bm(E^c)=0$. And
if $\frac{\bm(E\cap I)}{\bm(I)}<1-\varepsilon$ for every finite
nontrivial interval $I \subset \IR$, then $\bm(E)=0$.

Our next goal is to extend to $L^1$ the second part of the FTC. We
want to find a class of functions $f \colon [a,b] \to \IR$ such that
\beq
     f(x)-f(a) = \int_{[a,x]} f'\, d\bm
     \qquad \forall x\in [a,b] \tag{FTC-2}
\eeq
Obviously, $f$ must be differentiable (at least a.e.) and $f'$ must
be integrable (i.e.\ $f' \in L^1 ([a,b])$). But is this enough?

Answer: No! Counterexample: Cantor function (devil's staircase)
constructed via the middle-third Cantor set. This example shows that
(FTC-2) may fail if $f$ experiences `rapid growth on tiny sets'.

\begin{definition}
A function $f\colon [a,b] \to \IC$ is said to be \textbf{absolutely
continuous (a.c.)} on an interval $[a,b]$ if $\forall \varepsilon>0$
$\exists \delta>0$ such that if $n\in \IN$ and $$(\alpha_1,\beta_1),
\ldots, (\alpha_n,\beta_n)$$ are disjoint subintervals of $[a,b]$,
then
$$
   \sum_{i=1}^n (\beta_i-\alpha_i) < \delta\quad
   \Longrightarrow\quad
   \sum_{i=1}^n |f(\beta_i)-f(\alpha_i)| < \varepsilon.
$$
\end{definition}

Note: if $f$ is absolutely continuous, then $f$ is continuous, even
uniformly continuous (but not vice versa).

\begin{lemma}
If $f\colon [a,b] \to \IC$ is differentiable at almost all $x \in
[a,b]$, $f' \in L^1([a,b])$, and (FTC-2) holds, then $f$ is
absolutely continuous.
\end{lemma}

We will show that the converse is also true.

\begin{theorem}
Let $I = [a,b]$ and $f \colon I \to \IR$ be a continuous and
nondecreasing function. Then the following properties are
equivalent:
\begin{itemize}
\item[\rm (a)] $f$ is absolutely continuous; \item[\rm (b)] $f$
maps sets of measure zero to sets of measure zero; \item[\rm (c)]
$f$ is differentiable a.e.\ on $I$, $f' \in L^1(I)$ and (FTC-2)
holds.
\end{itemize}
\end{theorem}

\begin{definition}
The \textbf{total variation function} $V_a^x$ of a function $f
\colon [a,b] \to \IC$ is defined by
$$
  V_a^x = \sup \sum_{i=1}^n |f(t_i) - f(t_{i-1})|
$$
where the supremum is taken over all $n$ and all ordered sequences
$$
   a=t_0<t_1<t_2<\cdots<t_{n-1}<t_n=x.
$$
If $V_a^b<\infty$, then $f$ is said to be of \textbf{bounded
variation} on $[a,b]$, denoted by $f\in BV[a,b]$, and the value of
$V_a^b$ is called the \textbf{total variation} of $f$.
\end{definition}

\begin{lemma}
Suppose $f(x)$ is of bounded variation on $[a,b]$. Then
\begin{itemize}
\item[\rm (a)] $V_a^x$ is non-decreasing in $x$;
\item[\rm (b)] if $f$ is real-valued, then $V+f$ and $V-f$ are
non-decreasing;
\end{itemize}
\end{lemma}

\begin{corollary}
Let $f \colon [a,b] \to \IR$ be of bounded variation on $[a,b]$.
Then there are (strictly) monotonically increasing functions $u,v
\colon [a,b] \to \IR$ such that $f = u-v$.
\end{corollary}

\begin{lemma}
Suppose $f(x)$ is absolutely continuous on $[a,b]$. Then
\begin{itemize}
\item[\rm (a)] $f$ is of bounded variation on $[a,b]$;
\item[\rm (b)] $V$, $V+f$, and $V-f$ are absolutely continuous
on $[a,b]$.
\end{itemize}
\end{lemma}

\begin{theorem}
A function $f \colon [a,b] \to \IC$ is absolutely continuous if and
only if $f$ is differentiable for a.e.\ $x\in [a,b]$, $f'\in
L^1([a,b])$, and (FTC-2) holds.
\end{theorem}

This theorem answers the question posed around (FTC-2).

\medskip Example: Consider a function
$$
   f(x) = \left\{ \begin{array}{cl}
   x^2 \cos\tfrac{\pi}{x^2} & \ \ \text{for}\ \ 0<x\leq 1\\
   0 & \ \ \text{for}\ \ x=0
   \end{array}\right.
$$
It is differentiable at every point $x\in [0,1]$ (including $x=0$),
but $f'$ does not belong to $L^1 ([0,1])$. So this function is not
absolutely continuous.

The following theorem can be stated without proof:

\begin{theorem}
Let $f \colon [a,b] \to \IC$ be differentiable at every point $x\in
[a,b]$ and $f'\in L^1([a,b])$. Then (FTC-2) holds.
\end{theorem}

Note: the differentiability at \emph{every} point $x\in [a,b]$ is
assumed.

\medskip Example: Consider a function
$$
   f(x) = \left\{ \begin{array}{cl}
   x^2 \cos\tfrac{\pi}{x} & \ \ \text{for}\ \ 0<x\leq 1\\
   0 & \ \ \text{for}\ \ x=0
   \end{array}\right.
$$
It is differentiable at every point $x\in [0,1]$ (including $x=0$)
and $f'$ is bounded, hence $f' \in L^1 ([0,1])$. So this function,
unlike the one in the previous example, is absolutely continuous.

\begin{exercise}
Let $\alpha>0$, $\beta>0$ and
$$
   f(x) = \left\{ \begin{array}{cl}
   x^{\alpha} \cos\tfrac{\pi}{x^\beta} & \ \ \text{for}\ \ 0<x\leq 1\\
   0 & \ \ \text{for}\ \ x=0
   \end{array}\right.
$$
Show that if $\alpha > 1$ and $\alpha > \beta$, then $f$ is
absolutely continuous on $[0, 1]$. For an extra credit, show that
the assumption $\alpha >1$ is redundant.
\end{exercise}

\begin{exercise}
Let $f,g$ be absolutely continuous on $[a,b]$. Show that\\
${\ \ \ \ \ \ \ }$(a) $fg$ is absolutely continuous on $[a,b]$.\\
${\ \ \ \ \ \ \ }$(b) if $f(x) \neq 0$  for all $x \in [a,b]$, then
$1/f$ is absolutely continuous on $[a,b]$.\\
${\ \ \ \ \ \ \ }$(c) Does (a) remain true if $[a,b]$ is replaced by
$\IR?$
\end{exercise}

\begin{exercise}
A function $f \colon [a,b] \to \IC$ is said to be Lipschitz
continuous if $\exists L>0$ such that $|f(x) - f(y)| \leq L |x-y|$
for all $x,y\in [a,b]$. Prove that if $f$ is Lipschitz continuous,
then $f$ is absolutely continuous and $|f'| \leq L$ a.e. Conversely,
if $f$ is absolutely continuous and $|f'| \leq L$ a.e., then $f$ is
Lipschitz continuous (with that constant $L$).
\end{exercise}

\begin{proposition}
Let $f \colon [a,b] \to \IR$ be absolutely continuous. Then it maps
sets of measure zero to sets of measure zero.
\end{proposition}

Note: the converse is not true, even if $f$ is continuous or even
differentiable (see the first example above). Also, this proposition
does not extend to functions of bounded variations (a
counterexample: devil's staircase maps the Cantor set onto the
entire unit interval).

\begin{corollary}
Let $f \colon [a,b] \to \IR$ be absolutely continuous. Then it maps
Lebesgue measurable sets to Lebesgue measurable sets.
\end{corollary}

The following theorem can be stated without proof:

\begin{theorem}
Let $f \colon [a,b] \to \IR$ be monotonically increasing. Then it is
differentiable a.e.\ and $f(b) - f(a) \geq \int_{[a,b]} f' \, d\bm$.
\end{theorem}

Note: a strict inequality is possible (example: devil's staircase).

\begin{exercise}
Let $f \colon [a,b] \to \IR$ be absolutely continuous. Prove that
$V_a^x \leq \int_{[a,x]} |f'|\, d\bm$. For an extra credit: is the
equality always true?
\end{exercise}

\begin{exercise}
Let $f \colon [0,1] \to \IR$ be absolutely continuous on $[\delta,
1]$ for each $\delta>0$ and continuous and of bounded variation on
$[0,1]$. Prove that $f$ is absolutely continuous on $[0, 1]$. [Hint:
use the result of the previous exercise to verify that $f' \in
L^1([0,1])$.]
\end{exercise}

\begin{exercise}[Bonus]
Let $f \colon [a,b] \to \IC$ be absolutely continuous. Prove that
$|f|$ is absolutely continuous and
$$
  \Bigl|\frac{d}{dx}|f(x)|\Bigr| \leq |f'(x)|
$$
for a.e.\ $x \in [a,b]$. [Hint: first, use triangle inequality in
the form $\bigl| |p| - |q| \bigr| \leq |p-q|$, for complex numbers
$p,q$, to show that $|f|$ is AC. Then prove the above inequality for
$x \in [a,b]$ that are Lebesgue points for both $f'$ and $|f|'$; use
Theorem~\ref{LP}.]
\end{exercise}

Let $A\colon \IR^k \to \IR^k$ be a linear transformation defined by
a $k \times k$ matrix, which we also call $A$. Then for any
measurable set $E \subset \IR^k$ we have
$$
   \bm (A(E)) = c\, \bm(E)
$$
where the scaling factor is $c = |\det A|$. In particular, every
isometry (translation, rotation, reflection) preserves the Lebesgue
measure.

For a (nonlinear) transformation $T \colon V \to \IR^k$ defined on
an open set $V \subset \IR^k$ we define its derivative $T'(x)=A$ at
a point $x\in V$ by
$$
   \lim_{h\to 0} \frac{\|T(x+h)-T(x)-Ah\|}{\|h\|}=0
$$
(where of course $h \in \IR^k$), if the limit exists. Note that the
derivative $T'(x)$ is a $k\times k$ matrix. (If you define the
transformation $T$ coordinate-wise, by $k$ functions of $k$
variables, then $T'(x)$ will be the matrix of their partial
derivatives.)

\begin{lemma}
Let $T \colon V \to \IR^k$ be differentiable at $x\in V$. Then
$$
  \lim_{r\to 0} \frac{\bm(T(B(x,r)))}{\bm(B(x,r))}=|\det T'(x)|
$$
\end{lemma}

The following is a (global) change of variables rule:

\begin{theorem}
Let $T \colon V \to \IR^k$ be differentiable at every point $x\in V$
and one-to-one. Then for any measurable function $f\colon \IR^k \to
[0,+\infty]$
$$
   \int_{T(V)} f\, d\bm = \int_V (f\circ T) \, |\det T'|\, d\bm
$$
\end{theorem}

The factor $\det T'$ is called the Jacobian (of the transformation
$T$).

Note: a continuous (not differentiable) transformation may map
measurable sets into nonmeasurable sets. Example: devil's staircase.


\section{Integration on product spaces}


\begin{definition}
Let $X$ and $Y$ be two sets. Its \textbf{Cartesian product} $X
\times Y$ is the set of all (ordered) pairs $(x,y)$, with $x\in X$
and $y\in Y$. If $A\subset X$ and $B\subset Y$, then the set
$A\times B \subset X\times Y$ is called a \textbf{rectangle}.
\end{definition}

\begin{definition}
Let $(X,\fM)$ and $(Y,\fN)$ be two measurable spaces. For every $A
\in \fM$ and $B \in \fN$ the set $A \times B$ is called a
\textbf{measurable rectangle} in $X \times Y$. Any finite union $E =
R_1 \cup R_2 \cup \cdots \cup R_n$ of disjoint measurable rectangles
is called an \textbf{elementary set}. The collection of elementary
sets is denoted by $\cE$.
\end{definition}

\begin{lemma}
$\cE$ is an algebra, i.e.\ finite unions, intersections and
differences of elementary sets are elementary sets.
\end{lemma}

We denote by $\fM \times \fN$ the (minimal) $\sigma$-algebra in $X
\times Y$ generated by elementary sets (equivalently, by measurable
rectangles).


\begin{definition}
Let $E \subset X \times Y$ and $x\in X$, $y\in Y$. Then
$$
  E_x = \{y' \colon (x,y')\in E\} \subset Y
$$
is called the $x$-\textbf{section} of $E$ and
$$
  E^y = \{x' \colon (x',y)\in E\} \subset X
$$
is called the $y$-\textbf{section} of $E$.
\end{definition}

\begin{theorem}
If $E \in \fM \times \fN$, then $E_x \in \fN$ and $E^y \in \fM$ for
every $x\in X$ and $y\in Y$.
\end{theorem}

\begin{definition}
A \textbf{monotone class} $\cM$ is a collection of sets with the
following properties: \begin{itemize} \item[(i)] $A_i \in \cM,\ A_i
\subset A_{i+1}\ (i=1,2,\ldots)\ \Longrightarrow\ \cup_{i=1}^\infty
A_i \in \cM$; \item[(ii)] $B_i \in \cM,\ B_i \supset B_{i+1}\
(i=1,2,\ldots)\ \Longrightarrow\ \cup_{i=1}^\infty B_i \in \cM$.
\end{itemize}
\end{definition}

Note: $\sigma$-algebras are monotone classes, but not vice versa.
The intersection of monotone classes is a monotone class.

\begin{lemma}
If $X$ is a set and $\cF$ a collection of subsets of $X$, then there
exists a smallest monotone class $\cM$ that contains $\cF$.
\end{lemma}

\begin{theorem}
The $\sigma$-algebra $\fM \times \fN$ is the smallest monotone class
containing $\cE$.
\end{theorem}

For any function $f \colon X\times Y \to Z$ and $x\in X$ we denote
by $f_x$ a function on $Y$ defined by $f_x(y) = f(x,y)$. Similarly,
for any $y\in Y$ we denote by $f^y$ a function on $X$ defined by
$f^y(x) = f(x,y)$.

\begin{theorem}
Let $Z$ be a topological space and $f \colon X\times Y \to Z$ a
measurable function (with respect to the $\sigma$-algebra $\fM\times
\fN$). Then
\begin{itemize}
\item[\rm (i)] $f_x$ is $\fN$-measurable on $Y$ for each $x\in X$; \item[\rm (ii)]
$f^y$ is $\fM$-measurable on $X$ for each $y\in Y$;
\end{itemize}
\end{theorem}

Next we construct the product of measures.

\begin{theorem}
Let $(X,\fM,\mu)$ and $(Y,\fN,\lambda)$ be two measure spaces and
let $Q \in \fM \times \fN$. Define
\begin{align*}
   \varphi(x)&=\lambda(Q_x)\quad\text{for every  }x\in X\\
   \psi(x)&=\mu(Q^y)\quad\text{for every  }y\in Y
\end{align*}
Then $\varphi$ is $\fM$-measurable, $\psi$ is $\fN$-measurable, and
$$
  \int_X \varphi \, d\mu = \int_Y \psi\, d\lambda.
$$
\end{theorem}

\begin{definition}
Let $(X,\fM,\mu)$ and $(Y,\fN,\lambda)$ be two measure spaces with
$\sigma$-finite measures. Then we can define a measure, $\mu \times
\lambda$, on $\fM \times \fN$ by
$$
   (\mu \times \lambda) (Q) =
   \int_X \lambda(Q_x) \, d\mu(x) = \int_Y \mu(Q^y)\, d\lambda(y).
$$
The measure $\mu \times \lambda$ is called the \textbf{product} of
the measures $\mu$ and $\lambda$.
\end{definition}

Observe that $\mu \times \lambda$ is also a $\sigma$-finite measure.

We can rewrite the above formula as
$$
   (\mu \times \lambda) (Q) =
   \int_X \biggl(\int_Y \chi_Q(x,y)\, d\lambda(y)\biggr) \, d\mu(x)=
   \int_Y \biggl(\int_X \chi_Q(x,y)\, d\mu(x)\biggr) \, d\lambda(y).
$$

\begin{exercise}
Given measure spaces $(X,\fM,\mu)$ and $(Y,\fN,\lambda)$ with
$\sigma$-finite measures, show that $\mu \times \lambda$ is the
unique measure on $\fM \times \fN$ such that
$$
   (\mu \times \lambda)(A \times B)=
   \mu(A)\lambda(B)
$$
for all measurable rectangles $A \times B$ in $X \times Y$.
\end{exercise}

\begin{theorem}[Fubini]
Let $(X,\fM,\mu)$ and $(Y,\fN,\lambda)$ be two measure spaces with
$\sigma$-finite measures and let $f$ be an $(\fM \times
\fN)$-measurable function on $X\times Y$. Then
\begin{itemize}
\item[\rm (a)] If $0\leq f \leq \infty$ and if
$$
   \varphi(x) = \int_Y f_x\, d\lambda,\qquad
   \psi(y) = \int_X f^y\, d\mu,
$$
then $\varphi$ is $\fM$-measurable, $\psi$ is $\fN$-measurable, and
\beq
  \int_X \varphi \, d\mu =
  \int_{X\times Y} f\, d(\mu \times \lambda) =
  \int_Y \psi\, d\lambda.
  \tag{Fubini}
\eeq
\item[\rm (b)] If $f$ is complex-valued and $\int_X \varphi^\ast \,
d\mu < \infty$, where $\varphi^\ast (x) = \int_Y |f|_x\, d\lambda$,
then $f \in L^1_{\mu\times\lambda}$.
\item[\rm (c)] If $f \in L^1_{\mu\times\lambda}$, then
$$
   f_x \in L^1_{\lambda}\quad{\rm for}\ {\rm a.e.}\ \ x\in X,
$$
$$
   f^y \in L^1_{\mu}\quad{\rm for}\ {\rm a.e.}\ \ y\in Y,
$$
$$
    \varphi(x)= \int_Y f_x\, d\lambda \in L^1_{\mu},
$$
$$
    \psi(y)= \int_X f^y\, d\mu \in L^1_{\lambda},
$$
and the above equation {\rm (Fubini)} holds.
\end{itemize}
\end{theorem}

Note that equation (Fubini) can be written as
\begin{align}
  \int_{X\times Y} f\, d(\mu \times \lambda) &=
   \int_X \biggl(\int_Y f(x,y)\, d\lambda(y)\biggr) \, d\mu(x)\nonumber\\
   &=\int_Y \biggl(\int_X f(x,y)\, d\mu(x)\biggr) \,
   d\lambda(y)\tag{DoubleIter}
\end{align}
(a double integral is represented by iterated integrals).

\begin{corollary}
If one iterated integral in {\rm (DoubleIter)} exists, then all the
three exist and are equal.
\end{corollary}

\begin{exercise}
Let $a_n \geq 0$ for $n=1,2,\ldots$, and for $t\geq 0$ let
$$
    N(t)=\#\{n: a_n > t\}
$$
Prove that
$$
   \sum_{n=1}^{\infty} a_n = \int_0^{\infty} N(t)\, dt
$$
For an extra credit, find a formula for $\sum_{n=1}^{\infty}
\phi(a_n)$ in terms of $N(t)$ as defined above, if $\phi:[0,\infty)
\rightarrow [0,\infty)$ is locally absolutely continuous (i.e., AC
on every finite interval), non-decreasing, and $\phi(0)=0$ (Hint:
use the above fact with $\phi(x)=x$).
\end{exercise}

\begin{exercise}
Let $f\in L^1([0,1])$ and $f \geq 0$. Show that
$$
   \int_0^1 \frac{f(y)}{|x-y|^{1/2}}\, dy
$$
is finite for a.e.\ $x \in [0,1]$ and integrable.
\end{exercise}

\begin{exercise}
Use Fubini's theorem and the relation
$$
   \frac{1}{x}=\int_0^{\infty}{e}^{-xt}\, dt\quad\text{for}\ \ x>0
$$
to prove that
$$
   \lim_{A\rightarrow \infty} \int_0^A
   \frac{\sin x}{x} \, dx=\frac{\pi}{2}
$$
\end{exercise}

It is instructive to see a few counterexamples that show that the
assumptions of Fubini's theorem cannot be dispensed with.

First, let $X=Y=\IN$ and $\mu=\lambda$ counting measure. Then
$\mu\times\lambda$ is the counting measure on $X\times Y$. Define a
function $f(x,y)$ on $X\times Y$ as follows: $f(i,j)=a_{ij}$ for
$i,j\geq 1$, where
$$
   a_{ij}=\left\{
   \begin{array}{cl} +1 & \text{if}\ \ i=j\\
   -1 & \text{if}\ \ i=j+1\\
   0 & \text{otherwise} \end{array}\right.
$$
Then
$$
   \int_X \biggl(\int_Y f(x,y)\, d\lambda(y)\biggr) \, d\mu(x)=
   \sum_i \sum_j a_{ij} = 1
$$
but
$$
   \int_Y \biggl(\int_X f(x,y)\, d\mu(x)\biggr) \, d\lambda(y)
   =\sum_j \sum_i a_{ij} =0.
$$
Incidentally, we found a sequence $\{a_{ij}\}$ such that $\sum_i
\sum_j a_{ij} \neq \sum_j \sum_i a_{ij}$. The reason why Fubini's
theorem does not apply is that $f \notin L^1_{\mu\times\lambda}$.

See a Lebesgue-measure version of this example in Rudin (page 166).

The product measure $\mu \times \lambda$ is not necessarily
complete. In fact, if there is a non-empty null set $A \subset X$
and a non-measurable set $B \subset Y$, then $A\times B$ is not
measurable but it is a subset of a null set $A \times Y$. In
particular, if $X = Y = \IR$ and $\mu = \lambda = \bm$ the Lebesgue
measure, then $\bm \times \bm$ is not a complete measure, thus it is
not a Lebesgue measure on $\IR^2$.

\begin{theorem}
Let $\bm_k$ denote the Lebesgue measure on $\IR^k$. Then the
completion of $\bm_s \times \bm_t$ is the Lebesgue measure
$\bm_{s+t}$.
\end{theorem}

There is an alternative version of Fubini's theorem, adapted to
complete measures (in particular, to Lebesgue measures on $\IR^k$):

\begin{theorem}
Let $(X,\fM,\mu)$ and $(Y,\fN,\lambda)$ be two measure spaces with
complete $\sigma$-finite measures. Let $\bigl(X\times Y, (\fM\times
\fN)^\ast, (\mu\times\lambda)^\ast\bigr)$ be the completion of the
measure $\mu \times \lambda$. Let $f$ be an $(\fM \times
\fN)^\ast$-measurable function on $X\times Y$. Then $f_x$ is
$\fN$-measurable for almost every $x\in X$, $f^y$ is
$\fM$-measurable for almost every $y\in Y$, and all the other
conclusions of Fubini's theorem hold.
\end{theorem}

The following interesting lemma is used in the proof:

\begin{lemma}
Let $\nu$ be a positive measure on a $\sigma$-algebra $\fM$ in $X$,
and $(X,\fM^\ast,\mu^\ast)$ be its completion. Then for every
$\fM^\ast$-measurable function $f$ there exists a $\fM$-measurable
function $g$ such that $f=g$ $\nu$-almost everywhere.
\end{lemma}


\begin{definition}
Let $f\colon \IR \to \IC$ and $g\colon \IR \to \IC$ be two Lebesgue
measurable functions. Then their \textbf{convolution} $h = f *g$ is
defined by
$$
   h(x) = \int_{-\infty}^{\infty} f(x-t) \, g(t) \, dt
$$
(whenever the integral exists).
\end{definition}

\begin{theorem}
Let $f,g \in L^1(\IR)$. Then
$$
   \int_{-\infty}^{\infty} |f(x-t) \, g(t)| \, dt < \infty
$$
for almost every $x\in \IR$ and $h=f*g\in L^1(\IR)$ with
\beq
   \|h\|_1 \leq \|f\|_1 \|g\|_1
   \tag{Young's inequality}
\eeq
\end{theorem}

We note that it is not always true that $fg \in L^1(\IR)$. For
example, consider $f = g = x^{-1/2} \chi_{[0,1]}$, then $f,g \in
L^1(\IR)$ but $fg \notin L^1(\IR)$.

If we assume that $f,g \geq 0$, then $\|h\|_1 = \|f\|_1 \|g\|_1$.

\begin{exercise}
Suppose $f \in L^1(\IR)$ and $g \in L^p(\IR)$ for some $1\leq p \leq
\infty$. Show that $f*g$ exists at a.e. $x\in \IR$ and $f*g \in
L^p(\IR)$, and prove that
$$
   \|f*g\|_p \leq \|f\|_1 \|g\|_p.
$$
Hints: the case $p=\infty$ is simple and can be treated separately.
If $p<\infty$, then use H\"older inequality and argue as in the
proof of the previous theorem.
\end{exercise}

\begin{exercise}
Let $f \in L^1(\IR)$ and
$$
   g(x)= \int_{\IR} f(y)\,e^{-(x-y)^2}\, dy.
$$
Show that $g \in L^p(\IR)$, for all $1\leq p \leq \infty$, and
estimate $\|g\|_p$ in terms of $\|f\|_1$. You can use the following
standard fact: $\int_{-\infty}^\infty e^{-x^2}\, dx=\sqrt{\pi}$.
\end{exercise}

\begin{exercise}[Bonus]
Let $E=[1, \infty)$ and $f \in L^2_{\bm} (E)$. Also assume that $f
\geq 0$ a.e.\ and define
$$
          g(x) = \int_E f(y)\, e^{-xy} \, dy.
$$
Show that $g\in L^1(E)$ and
$$
  \|g\|_1 \leq c\,\|f\|_2
$$
for some $c<1$. Estimate the minimal value of $c$ the best you can.
\end{exercise}

\begin{definition}
Let $(X,\fM,\mu)$ be a measure space with a $\sigma$-finite measure
and $f\colon X \to [0,\infty]$ a measurable function. Then
$$
     g(t)=\mu(\{x\in X\colon f(x)>t\}) = \mu\{f>t\}
$$
is called the \textbf{distribution function} of $f$.
\end{definition}

(In probability theory, where $\mu(X)=1$, the distribution function
is defined by $F(t) = \mu\{f\leq t\}=1-g(t)$.)

Note that the distribution function is monotonic non-increasing,
thus it is a Borel measurable function.


\begin{theorem}
Let $f$ and $\mu$ be as above. Suppose $\varphi \colon [0,\infty]
\to [0,\infty]$ is a monotonic non-decreasing function that is
absolutely continuous on every finite interval $[0,T]$ and satisfies
$\varphi(0)=0$ and $\lim_{t\to\infty} \varphi(t) = \varphi(\infty)$.
Then
$$
   \int_X (\varphi \circ f)\, d\mu = \int_0^{\infty}
   \mu\{f>t\}\varphi'(t)\, dt.
$$
\end{theorem}

In particular, if $\varphi(t)=t$ we obtain a useful formula
$$
   \int_X f\, d\mu = \int_0^{\infty} \mu\{f>t\}\, dt,
$$
which is sometimes given as a definition of the Lebesgue integral.

\begin{exercise}
Let $f \colon \IR \to \IR$ be Lebesgue measurable. Prove that\\
${\ \ \ }$(a) $A=\{(x,y) \in \IR^2 \ |\ y < f(x)\}$ is
Lebesgue measurable (in the two-dimensional sense)\\
${\ \ \ }$(b) Let $f\geq 0$. Is it always true that
$\int_{\IR} f\, d\bm$ equals the Lebesgue measure of $A$?\\
${\ \ \ }$(c) $\{(x,y) \in \IR^2 \ |\ y = f(x)\}$
is a null set.
\end{exercise}

\begin{definition}
For every Lebesgue measurable function $f \colon \IR^k \to \IC$
define the \textbf{maximal function} $Mf \colon \IR^k \to
[0,\infty]$ by
$$
  (Mf)(x) = \sup_{0<r<\infty} \frac{1}{\bm(B(x,r))}\,
  \int_{B(x,r)}|f|\, d\bm
$$
whenever the integral exists.
\end{definition}

Note: earlier we defined this function only for $f\in L^1 (\IR^k)$,
and in that case we proved $Mf \in L^1_W (\IR^k)$.

\begin{theorem}
If $f\in L^1 (\IR^k)$ and $Mf \in L^1 (\IR^k)$, then $f =0$ a.e.
\end{theorem}

\begin{exercise}
Let $f \colon \IR^2 \to \IR$ be such that $f_x$ is Borel-measurable
for every $x\in \IR$ and $f^y$ is continuous for every $y \in \IR$.
Prove that $f$ is Borel-measurable. (See hint on p.\ 176 in Rudin.)
\end{exercise}

\begin{theorem}[Hardy--Littlewood]
Let $1<p \leq \infty$. If $f\in L^p (\IR^k)$, then $Mf \in L^p
(\IR^k)$.
\end{theorem}

\end{document}
