%! TEX root = TA.tex
% vim: tw=50
% 02/03/2024 12PM

Recall witch's hat:
\[ f_n(x) = \begin{cases}
  nx & 0 \le x \le \frac{1}{n} \\
  2 - nx & \frac{1}{n} \le \frac{2}{n} \\
  0 & \text{otherwise}
\end{cases} \]
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/e06fce43e3a447eb.png}
\end{center}
Standard example such that $f_n(x) \to 0$ for all
$x$ (check $x = 0$ and $x \neq 0$ separately), so
$f_n \to 0$ pointwise, but $\|f_n\|_\infty = 1$,
so $f_n \not\to 0$ uniformly.

Let $g_{m, n}(x) = f_n(m(x - [x]))$. Then $g_{m,
n}(x) \to 0$ as $n \to \infty$ for all $x$ but
\[ \sup_{x \in \left[ \frac{r}{m}, \frac{r + 1}{m}
\right]} |g_{m, n}(x)| = 1 .\]
Now set
\[ F_n(x) = \sum_{m = 1}^\infty 2^{-m} g_{m, n}(x)
.\]
This converges by the Weierstrass $M$-test. Also,
\[ 0 \le F_n(x) \le \sum_{m = 1}^M 2^{-n} g_{m,
n}(x) + \sum_{m = M + 1}^\infty 2^{-m} \]
so
\[ \limsup_{n \to \infty} F_n(x) \le 0 + 2^{-M} \]
so $F_n(x) \to 0$ for all $x \in [0, 1]$. But
$F_n(x) \ge 2^{-m} g_{n, m}(x)$ so
\[ \sup_{x \in \left[ \frac{r}{m}, \frac{r +
1}{m} \right]} \ge 2^{-m} \qquad \forall n \]
so $F_n$ fails to converge uniformly on any
non-trivial interval.

\begin{flashcard}[osgood-before-baire-thm]
\begin{theorem*}[Osgood before Baire]
  \cloze{If $f : [0, 1] \to \RR$ is continuous and
  $f_n(x) \to 0$ for all $x \in [0, 1]$ then given
  $\eps > 0$ we can find a non-trivial interval
  $I$ and a $N$ such that
  \[ |f_n(x)| \le \eps \qquad \forall n \ge N,
  \forall x \in I .\]}
\end{theorem*}

\begin{proof}
  \cloze{Let $F_n = \{x \in [0, 1] : |f_n(x) \le \eps\}$.
  $F_n$ is closed (since $f$ is continuous). So
  $E_n = \bigcap_{n \ge N} F_n$ is closed. But
  $\bigcup E_N = [0, 1]$ (because if $x \in [0,
  1]$, $f_n(x) \to 0$ so there exists $N$ such
  that $|f_n(x)| < \eps$ for all $n \ge N$). So
  since countable union of nowhere dense sets
  cannot be $[0, 1]$ (since it is complete), there
  exists $N$ such that $E_N$ is not nowhere dense,
  i.e. there exists an interval $I \subseteq E_N$
  and this is what the theorem says.}
\end{proof}
\end{flashcard}

\newpage
\section{Continued Fractions}

We are sed to the representation of real numbers
by decimals.

Before decimals there were fractions. What are the
advantages of decimals over fractions?
\begin{enumerate}[(1)]
  \item Easier starting from a good approximation
    to get a cruder approximation: we can just
    remove some digits from the decimal.
  \item The process of generating a decimal allows
    working to be continued to get a better
    approximation.
\end{enumerate}
However there was a process with these advantages
before: continued fractions.

Idea is divisiion into parts.
\[ \frac{1}{3} < \frac{4}{11} < \frac{1}{2} \]
so can set
\[  \frac{4}{11} = \frac{1}{2 + t} \]
for some $0 < t \le 1$. So need $2 + t =
\frac{11}{4}$. So $t = \frac{3}{4}$, which can be
written as $\frac{1}{1 + s}$ for some $0 < s \le
1$. In fact, $s = \frac{1}{3}$. So we can write:
\[ \frac{4}{11} = \frac{1}{2 + \frac{1}{1 +
\frac{1}{3}}} \]

For $0 < x \le 1$, form
\[ N(x) = \left\lfloor \frac{1}{x} \right\rfloor,
\qquad Tx = \frac{1}{x} - \left\lfloor \frac{1}{x}
\right\rfloor .\]
Then:
\begin{align*}
  x
  &= \frac{1}{N(x) + Tx} \\
  &= \frac{1}{N(x) + \frac{t}{N(x) + T^2 x}} \\
  &= \frac{1}{N(x) + \frac{1}{N(x) +
  \frac{N(x)}{T^3 x}}}
\end{align*}
If $x$ is irrational then the process can not
terminate, and it is pretty clear that we are
getting a succession of better approximations.
However we will not yet consider convergence.

What happens if we start with a rational?
\[ \frac{r_0}{s_0} = \frac{1}{a_1 +
\frac{r_1}{s_1}} = \frac{1}{a_1 + \frac{1}{a_2 +
\frac{r_2}{s_2}}} .\]
We insist that $r_j, s_j$ be coprime.
\[ \frac{r_j}{s_j} = \frac{1}{a_{j + 1} +
\frac{r_{j + 1}}{s_{j + 1}}} .\]
\[ \frac{r_j}{s_j} = \frac{s_{j + 1}}{a_{j + 1}
s_{j + 1} + r_{j + 1}} .\]
$s_{j + 1}$ is coprime to $r_{j + 1}$ and hence
$a_j s_{j + 1} + r_{j + 1}$, provided $r_{j + 1}
\neq 0$. So
\begin{align*}
  s_{j + 1}
  &= r_j \\
  r_{j + 1}
  &= a_{j + 1} s_{j + 1} + r_{j + 1}
\end{align*}
So continued fractions of rationals terminate
(since these terms coincide with the definition of
Euclid's algorithm, which we already know will
always terminate).

\begin{remark*}
  $\frac{1}{n} = \frac{1}{(n - 1) + \frac{1}{1}}$
  so there can be multiple possible final forms.
\end{remark*}

If $y \in \RR$ then $y = \left\lfloor y
\right\rfloor + x$, so we often write
\[ y = a_0 + \frac{1}{a_1 + \frac{1}{a_2}} .\]

\begin{theorem*}
  $\sqrt{2}$ is irrational.
\end{theorem*}

\begin{proof}
  \begin{align*}
    \sqrt{2}
    &= 1 + (\sqrt{2} - 1) \\
    &= 1 + \frac{1}{\sqrt{2} + 1} \\
    &= 1 + \frac{1}{2 + (\sqrt{2} - 1)} \\
    &= 1 + \frac{1}{2 + \frac{1}{\sqrt{2} + 1}} \\
    &= \frac{1}{1 + \frac{1}{2 + \frac{1}{2 +
    \frac{1}{2 + \ddots}}}}
  \end{align*}
  Since this does not terminate, we deduce that
  $\sqrt{2}$ is irrational.
\end{proof}
