% vim: tw=50
% 07/02/2022 11AM

\subsubsection*{Bounds of a continuous function}

\begin{theorem}
    Let $f : [a, b] \to \RR$ be continuous. Then
    there exists $K$ such that $|f(x)| \le K
    \,\,\forall\,\,x \in [a, b]$.
\end{theorem}

\begin{proof}
    We argue by contradiction. Suppose statement
    is false. Then given any integer $n \ge 1$,
    there exists $x_n \in [a, b]$ such that
    $|f(x_n)| > n$. By Bolzano-Weierstrass, $x_n$
    has a convergent subsequence $x_{n_j} \to x$.
    Since $a \le x_{n_j} \le b$, we must have $x
    \in [a, b]$. By the continuity of $f$,
    $f(x_{n_j}) \to f(x)$ but $|f(x_{n_j}| > n_j
    \to \infty$ (as $j \to \infty$).
    \contradiction
\end{proof}

\begin{theorem}
    $f : [a, b] \in \RR$ continuous. Then $\exists
    x_1, x_2 \in [a, b]$ such that
    \[ f(x_1) \le f(x) \le f(x_2) \]
    for all $x \in [a, b]$. (``A continuous
    function on a closed bounded interval is
    bounded and attains its bounds'').
\end{theorem}

\begin{proof}
    Let $A = \{f(x) : x \in [a, b]\} = f([a, b])$.
    By Theorem 2.4, $A$ is bounded. Since it is
    clearly non-empty, it has supremum, $M$. By
    definition of supremum, given an integer $n \ge
    1$, $\exists x_n \in [a, b]$ such that
    \[ M - \frac{1}{n} < f(x_n) \le M \tag{$*$} \]
    By Bolzano-Weierstrass, $\exists \,\, x_{n_j}
    \to x \in [a, b]$. Since $f(x_{n_j}) \to M$
    (by ($*$)) and $f$ is continuous, we deduce
    that $f(x) = M$. So $x_2 := x$. Similarly for
    the minimum.
\end{proof}

\myskip

\begin{proof}[(alternative proof)]
    $A = f([a, b])$, $M = \sup A$ as before.
    Suppose $\not\exists\,\,x_2$ such that $f(x_2)
    = M$. Let
    \[ g(x) = \frac{1}{M - f(x)} \]
    for $x \in [a, b]$. It is defined and
    continuous on $[a, b]$. By Theorem 2.4 applied
    to $g$, $\exists k > 0$ such that
    \[ g(x) \le K \qquad \forall \,\,x \in [a, b] \]
    This means that $f(x) \le M - \frac{1}{k}$
    for all $x \in [a, b]$. This is absurd since
    it contradicts that $M$ is the supremum.
\end{proof}

\begin{note*}
    Theorems 2.4 and 2.5 are \emph{false} if the
    interval is not \emph{closed} and bounded.
    For example, consider
    \[ (0, 1], \qquad f(x) = \frac{1}{x} \]
\end{note*}

\subsection{Inverse Functions}

\begin{definition*}
    $f$ is \emph{increasing} for $x \in [a, b]$ if
    $f(x_1) \le f(x_2)$ for all $x_1, x_2$ such
    that $a \le x_1 < x_2 \le b$. If $f(x_1) <
    f(x_2)$ we say that $f$ is \emph{strictly
    increasing}. Similarly for decreasing and
    strictly decreasing.
\end{definition*}

\begin{theorem}
    $f : [a, b] \to \RR$ continuous and strictly
    increasing function $x \in [a, b]$. Let $c =
    f(a)$ and $d = f(b)$. Then $f : [a, b] \to [c,
    d]$ is bijective and the inverse $g := f^{-1}
    : [c, d] \to [a, b]$ is continuous and
    strictly increasing.
\end{theorem}

\begin{remark*}
    A similar theorem holds for strictly
    \emph{decreasing} functions.
\end{remark*}

\begin{proof}
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/a815d1d8975311ec.png}
    \end{center}
    Take $c < k < d$. From the Intermediate Value
    Theorem, $\exists h$ such that $f(h) = k$.
    Since $f$ is strictly increasing $h$ is
    unique. Define $g(k) := h$ and this gives an
    inverse
    \[ g : [c, d] \to [a, b] \]
    for $f$.
    \begin{itemize}
        \item $g$ is strictly increasing because
            $y_1 < y_2$, $y_1 = f(x_1)$, $y_2 =
            f(x_2)$. If $x_2 \le x_1$ then since
            $f$ is increasing $f(x_2) \le f(x_1)$
            and so $y_2 \le y_1$, contradiction.
        \item $g$ is continuous because let $\eps
            > 0$ be given, then let $k_1 = f(h -
            \eps)$ and $k_2 = f(h + \eps)$. $f$ is
            strictly increasing so $k_1 < k <
            k_2$. If $k_1 < y < k_2$ then $h -
            \eps < g(y) < h + \eps$ so $g$ is
            continuous at $k$. Here we took $k \in
            (c, d)$ but a very similar argument
            establishes continuity at the
            endpoints (check!)
    \end{itemize}
\end{proof}
