---
# System prepended metadata

title: Advanced Calculus (I)

---

# Advanced Calculus (I) 
`2021 fall`

史習偉大大ㄉ高等微積分一...只有後半段... \
前面的我有時間再慢慢補...

## Overview
[TOC]

## Point-Set Topology of Metric Spaces

### Compact Sets

---

### Connected Sets

Let $(M,d)$ be a metric space and $A\subseteq M$. \
Let $u,v\subseteq M$ be two nonempty open sets. \
We say that ==$u$ and $v$ separates $A$== if 
$\begin{cases}
(1)\; A\subseteq u\cup v \\
(2)\; A\cap u \neq \emptyset \\
(3)\; A\cap v \neq \emptyset \\
(4)\; A\cap u\cap v =\emptyset
\end{cases}$.

And $A$ is said to be ==separated==, or ==disconnected==, if there exist such $u$ and $v$. \
Otherwise, $A$ is said to be ==connected==.

---

Let $(M,d)$ be a metric space and $A\subseteq M$. \
Then $A$ is disconnected **iff** $\exists\,A_1,A_2 \subseteq M$ such that
$\begin{cases}
A_1,A_2 \neq \emptyset \\
A_1\cup A_2 =A \\
\bar{A}_1\cup A_2= A_1\cup\bar{A}_2 = \emptyset
\end{cases}$

:::spoiler proof:
> $\implies:$ \
> If $A$ is disconnected, then there exist two nonempty open sets $u$ and $v$ separating $A$. \
> Select $A_1=A\cap u$ and $A_2=A\cap v$. \
> By (2), $A_1\neq\emptyset$. By (3), $A_2\neq\emptyset$. \
> By (1), $A_1\cup A_2= (A\cap u)\cup(A\cap v)= A\cap(u\cup v)= A$. \
> By (4), $A_1\subseteq v^c$. \
> Since $v^c$ is closed, $\overline{A}_1\subseteq \overline{v^c}= v^c$. \
> $\Rightarrow$ $\overline{A}_1\cap v=\emptyset$ \
> $\Rightarrow$ $\overline{A}_1\cap A_2=\emptyset$ \
> Similarly, $A_1\cap \overline{A}_2=\emptyset$.
> 
> $\impliedby:$ \
> $\exists\,A_1,A_2$ such that $\dots$ \
> Let $u=\bar{A}_{2}^{\,c}$ and $v=\bar{A}_{1}^{\,c}$.
> Since $A_2\subseteq \bar{A}_1^{\,c}$ and $A_1\subseteq \bar{A}_2^{\,c}$, $v$ and $u$ are both nonempty. \
> Hence $A=A_1\cup A_2\subseteq u\cup v$. \
> Since $A_1\cap\bar{A}_1^{\,c}=\emptyset$ and $A_2\cap \bar{A}_2^{\,c}$, we have $A_1\cap v=\emptyset$ and $A_2\cap u=\emptyset$. \
> Then
> $$\begin{aligned}
> A\cap u\cap v &= (A_1\cap u\cap v)\cup(A_2\cap u\cap v) \\
> &= \emptyset
> \end{aligned}$$
> Thus $A$ can be separated by $u$ and $v$, hence $A$ is disconnected.
:::

---

$A\subseteq\mathbb{R}$ is connected ***iff*** for $x,y\in A$ with $x<z<y$, $z\in A$. (interval)

:::spoiler proof:
> $\implies:$ \
> Suppose $x<z<y$ and $x,y\in A$. \
> Assume $z\notin A$. \
> Let $A_1=(-\infty,z)\cap A$ and $A_2=(z,\infty)\cap A$. \
> Since $x\in A_1$ and $y\in A_2$, $A_1$, $A_2$ are nonempty. \
> Since $z\notin A$, $A=A_1\cup A_2$. \
> We have $\bar{A_1}\subseteq (-\infty,z]$ and $\bar{A}_2\subseteq [z,\infty)$. \
> $\Rightarrow$ $\bar{A}_1\cap A_2=\emptyset=A_1\cap\bar{A}_2$ \
> Then $A$ is disconnected. $\quad(\rightarrow\leftarrow)$. \
> Thus $z\in A$.
> 
> $\impliedby:$ \
> Assume $A$ disconneted. \
> $\exists\,A_1,A_2\subseteq\mathbb{R}$ such that (i) $A_1,A_2\neq\emptyset$, (ii) $A=A_1\cup A_2$, 
> (iii) $\bar{A}_1\cap A_2= A_1\cap\bar{A}_2=\emptyset$. \
> By (i), $\exists\,x\in A_1, y\in A_2$. \
> By (iii), $x\neq y$. WLOG, assume $x<y$. \
> Let $z=\sup([x,y]\cap A_1)$. \
> Then $z\in \overline{A}_1$ and thus $z\notin A_2$. \
> - If $z\notin A_1$, then since $z\notin A_2$, $z\notin A$. $\quad(\rightarrow\leftarrow)$
> - If $z\in A_1$, then $z\notin \bar{A}_2$. \
> $\Rightarrow$ $\exists\,r>0$ such that $(z,z+r)\cap A_2=\emptyset$ \
> $\Rightarrow$ $x<z+\frac{r}{2}<y$, $\;z+\frac{r}{2}\notin A_1$, and $z+\frac{r}{2}\notin A_2$ \
> $\Rightarrow$ $z+\frac{r}{2}\notin A$ $\quad(\rightarrow\leftarrow)$ \
> Therefore $A$ is connected.
:::

---

### Subspace Topology

Let $(M,d)$ be a metric space and $N\subseteq M$. \
The topology of $(N,d)$ is called the ==subspace topology== of $(M,d)$. \
<br><br>
$A\subseteq N$ could be open in $(N,d)$ but not open in $(M,d)$. \
<br>
For balls, let $x\in N$, $B_N(x,r)=B_M(x,r)\cap N$.

---

Let $(M,d)$ be a metric space and $N\subseteq M$. \
$v\subseteq N$ is open in $(N,d)$ **iff** $\exists\,u\subseteq M$ is open in $(M,d)$ such that $v=u\cap N$.

:::spoiler proof:
> $\implies:$\
> Since $v$ is open in $(N,d)$, $\forall\,x\in v$, $\exists\,r_x>0$ such that $B_N(x,r_x)\subseteq v$. \
> Then $v\subseteq \displaystyle\bigcup_{x\in v}B_N(x,r_x)\subseteq v$. \
> Define $u=\displaystyle\bigcup_{x\in v}B_M(x,r_x)$. \
> $u$ is open in $(M,d)$. \
> Then
> $$\begin{aligned}
> u\cap N &= \bigcup_{x\in v}B_M(x,r_x) \cap N \\
>  &= \bigcup_{x\in v}\left(B_M(x,r_x)\cap N\right) \\
>  &=\bigcup_{x\in v}B_N(x,r_x) = v
> \end{aligned}$$
> 
> $\impliedby:$\
> Suppose $x\in v =u\cap N$. \
> Since $u$ is open in $(M,d)$, $\exists\,\delta_x>0$ such that $B_M(x,\delta_x)\subseteq u$. \
> Then
> $$\begin{aligned}
> B_N(x,\delta_x) &= B_M(x,\delta_x)\cap N \\
>  &\subseteq u\cap N = v
> \end{aligned}$$
> Hence $v$ is open in $(N,d)$.
:::

:::success
There is similar result for closed sets.
:::

---

Let $(M,d)$ be a metric space and $N\subseteq M$. \
$A\subseteq M$ is said to be ==open relative to $N$== if $A\cap N$ is open in $(M,d)$. \
<br>
If $A$ is open $(M,d)$, then A must be open relative to $N$.

:::success
There are similiar definitions for closed and compact.
:::

---

Let $(M,d)$ be a metric space and $K\subseteq N\subseteq M$. \
$K$ is compact in $(M,d)$ ***iff*** $K$ is compact in $(N,d)$.

proof:

---

---

## Mappings and Limits

Let $(M,d)$ and $(N,\rho)$ be metric spaces and $A \subseteq M$.\
For $x_0 \in \overline{A}$, we say $y_0 \in N$ is the ==limit== of some function $f:A\to N$ at $x_0$ if $\forall\,\varepsilon >0,\exists\,\delta>0$ such that $\rho(f(x),y_0)<\varepsilon$ whenever $x\in A$ and $d(x,x_0)<\delta$, denoted by $\displaystyle\lim_{ \substack{x\to x_0}\\ x\in A }=y_0$.

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A \subseteq M$, and $f:A\to N$ be a map.\
For $x_0 \in \overline{A}$, $\displaystyle\lim_{x\to x_0}f(x)=y$ ***iff*** for every sequence $\{x_k\}_{k=1}^\infty\subseteq A$ converging to $x_0$ in $(M,d)$, the sequence $\{f(x_k)\}_{k=1}^\infty$ converges to $y_0$ in $(N,\rho)$.

:::spoiler proof:
> $\implies$ :\
> $\forall\,\epsilon>0,\;\exists\,\delta>0$ such that $\rho(f(x),y_0)<\epsilon$ when $x\in A$ and $d(x,x_0)<\delta$.\
> Let $\{x_k\}_{k=1}^\infty\subseteq A$ converging to $x_0$.\
> $\Rightarrow$ $\exists\, K \in \mathbb{N}$ such that $d(x_k,x_0)<\delta$ whenever $k\geq K$.\
> $\Rightarrow$ $\rho(f(x_k),y_0)<\epsilon$ whenever $k\geq K$.\
> $\Rightarrow$ $\displaystyle\lim_{k\to\infty}=y_0$.\
> $\impliedby$ :\
> Prove by contradiction.\
> Assume $\displaystyle\lim_{x\to x_0}f(x)\neq y$.\
> Then $\exists\,\epsilon>0$ such that $\forall\,\delta>0$, $\exists\, x_\delta \in A$ with $d(x_\delta,x_0)<\delta$ but $\rho\left(f(x_\delta),y_0\right)\geq\epsilon$.\
> Let $\rho=\frac{1}{k}$, then $\exists\,\{x_k\}_{k=1}^\infty\subseteq A$ such that $d(x_k,x_0)<\frac{1}{k}$ but $\rho\left(f(x_0),y_0\right)\geq\epsilon$.\
> In this case, $\displaystyle\lim_{k\to\infty}x_k=x_0$ but $\displaystyle\lim_{k\to\infty}f(x_k)\neq y_0$. $\quad( \to\gets)$
:::

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A \subseteq M$, and $f:A\to N$ be a map.\
$f$ is said to be ==continuous== at $x_0$ if $\displaystyle\lim_{\substack{x\to x_0\\ x\in A}}f(x)=f(x_0)$.\
(note: $x$ may be an isolated point)\
<br><br>
If $f$ is continuous at every point of $A$, then $f$ is said to be continuous at $A$.

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A \subseteq M$, and $f:A\to N$ be a map.\
Then the following statements are equivalent :\
(1) $f$ is continuous on $A$.\
(2) For every open set $v\subseteq N$, $\; f^{-1}(v)\subseteq A$ is open relative to $A$.\
(3) For every closed set $E\subseteq N$, $\; f^{-1}(E)\subseteq A$ is closed relative to $A$.

:::spoiler proof:
> #### (1)$\implies$(2) :
> If $f^{-1}(v)=\emptyset$, then it is tivially open relative to $A$.\
> Consider $f^{-1}(v)\neq \emptyset$.\
> Suppose $x_0 \in f^{-1}(v)$.\
> $\Rightarrow$ $f(x_0)\in v$
> $\Rightarrow$ $\exists\,\epsilon>0$ such that $B_N(f(x_0),\epsilon)\subseteq v$\
> Since $f$ is continuous at $x_0$, $\exists\,\delta_{x_0}>0$ such that $f\left(B_M(x_0,\delta_{x_0})\cap A\right) \subseteq B_N(f(x_0),\epsilon) \subseteq v$.\
> Then $B_M(x_0,\delta_{x_0})\cap A \subseteq f^{-1}(v)$.\
> Since $f$ is continuous on $A$, for every $x\in f^{-1}(v)$, $\exists\,\delta_x>0$ such that $f\left(B_M(x_0,\delta_{x_0})\cap A\right) \subseteq v$, and hence $B_M(x,\delta_x)\cap A \subseteq f^{-1}(v)$.\
> Define $u=\displaystyle\bigcup_{x\in f^{-1}(v)}B_M(x,\delta_x)$.\
> Then $u$ is open in $M$ and $f^{-1}(v)\subseteq u\cap A$.\
> On the other side, 
> \begin{align}
> f(u\cap A) &= f\left( \displaystyle\bigcup_{x\in f^{-1}(v)} (B_M(x,\delta_x)\cap A) \right)\\
>  &= \displaystyle\bigcup_{x\in f^{-1}(v)}f(B_M(x,\delta_x)\cap A)\\
>  &\subseteq v
> \end{align}
> $\Rightarrow$ $u\cap A\subseteq f^{-1}(v)$.
> 
> #### (2)$\implies$(1) :
> Suppose $x\in A$.\
> For given $\epsilon>0$, $B_N(f(x),\epsilon)$ is open in $N$.\
> By the hypothesis, there is open $u\subseteq M$ satisfying $u\cap A = f^{-1}(B_N(f(x),\epsilon))$.\
> $\Rightarrow$ $x\in u$ and $\exists\,\delta_x>0$ such that $B_M(x,\delta_x)\subseteq u$\
> Then $f(B_M(x,\delta_x)\cap A)\subseteq f(u\cap A)= B_N(f(x),\epsilon)$.\
> For $y\in B_M(x,\delta_x)\cap A$, we have $\rho(f(x),f(y))<\epsilon$.\
> Hence $f$ is continuous at $x$.
> 
> #### (2)$\implies$(3) :
> $E^c$ is open in $N$.\
> By the hypothesis, $f^{-1}(E^c)$ is open relative to $A$ and there exists an open $u\subseteq M$ such that $f^{-1}(E^c)=u\cap A$.\
> Then $u^c$ is closed in $M$ and $A\cap u^c= A\backslash (u\cap A)= A\backslash f^{-1}(E^c)=  f^{-1}(E)$,
> which is closed relative to $A$.
> #### (3)$\implies$(2) :
> (skip)
:::

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A \subseteq M$.\
If $f:M\to N$ is a function, then its restriction $f|_A$ is continuous on $A$.

---

### Operations on Continuous Maps

Let $(M,d)$ be a metric space, $(V,\|\cdot\|)$ be normed vector space, and $A\subseteq M$.\
Let $f,g:A\to V$ and $h:A\to \mathbb{R}$ be maps.\
$\forall\,x\in A$, $\forall\,\alpha\in\mathbb{R}$, define
\begin{split}
&(1)\; (f\pm g)(x)=f(x)\pm g(x)\\
&(2)\; (\alpha f)(x)=\alpha f(x)\\
&(3)\; (hf)(x)=h(x)f(x)\\
&(4)\; (\frac{f}{h})(x)=\frac{1}{h(x)}f(x),\; h(x)\neq 0
\end{split}
Suppose $x_0\in \bar{A}$, $\displaystyle\lim_{x\to x_0}f(x)=v$, $\displaystyle\lim_{x\to x_0}g(x)=w$, $\displaystyle\lim_{x\to x_0}h(x)=c$.\
Then
\begin{split}
&(5) \displaystyle\lim_{x\to x_0}(f\pm g)(x)=v+w\\
&(6) \displaystyle\lim_{x\to x_0}(hf)(x)=cv\\
&(7) \displaystyle\lim_{x\to x_0}(\frac{f}{h})(x)=\frac{v}{c}\; \text{if }c\neq 0
\end{split}

Also there are similar results for continuity.\
<br><br>
Let $(M,d),(N,\rho),(P,\gamma)$ be metric spaces and $f:M\to N$, $g:N\to P$.\
If $f$ is continuous at $x_0$ and $g$ is continuous at $f(x_0)$, then $g\circ f$ is continuous at $x_0$.

---

### Uniformly Continuous

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A\subseteq M$ and $f:A\to N$.\
$f$ is ==uniformly continuous== on $A$ if $\forall\,\epsilon>0$, $\exists\,\delta>0$ such that $\rho(f(x),f(y))<\epsilon$ whenever $x,y\in A$ and $d(x,y)<\delta$.\
<br>
e.g.\
$f(x)=\frac{1}{x}$ is continuous on $(0,\infty)$ and uniformly continuous on $[a,\infty),\,a>0$.

---

Let $A\subseteq \mathbb{R}$ and $f:A\to \mathbb{R}$.\
$f$ is ==Lipschitz function== if $\exists\,K>0$ such that $\left|f(x)-f(y)\right|\leq K\left|x-y\right|\;\forall\,x,y\in A$.\
<br>
Let $(M,d)$ and $(N,\rho)$ be metric spaces and $f:M\to N$.\
$f$ is ==Lipschitz function== if $\exists\,K>0$ such that $\rho(f(x),f(y))\leq K d(x,y)\;\forall\,x,y\in M$.

---

Let $A\subseteq \mathbb{R}$ and $f:A\to \mathbb{R}$.\
$f$ is ==Hölder continuous with exponents $\alpha$== if $\exists\, K>0$ and $0<\alpha\leq 1$ such that $\left|f(x)-f(y)\right|\leq K\left|x-y\right|^\alpha \;\forall\,x,y\in A$.

---

Suppose $f:\mathbb{R}\to\mathbb{R}$.

$f$ is differentiable and $\exists\, K>0$ such that $|f'(x)|<K$ for all $x\in\mathbb{R}$ \
$\implies$ $f$ is Lipschitz \
$\implies$ $f$ is Hölder continuous with some $0<\alpha<1$ \
$\implies$ $f$ is uniformly continuous

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A\subseteq M$ and $f:A\to N$.\
$f$ is uniformly continuous on $A$ **iff** for any two sequences $\left\{x_n\right\}_{n=1}^\infty$, $\left\{y_n\right\}_{n=1}^\infty \,\subseteq A$,
$\displaystyle\lim_{n\to\infty}d(x,y)=0\implies\displaystyle\lim_{n\to\infty}\rho(f(x_n),f(y_n))=0$.

:::spoiler proof:
> $\implies$: \
> Prove by contradiction. \
> Assume $\displaystyle\lim_{n\to\infty}d(x_n,y_n)=0$ and $\displaystyle\lim_{n\to\infty}\rho(f(x_n),f(y_n))\neq 0$ for some $\{x_n\}_{n=1}^\infty, \{y_n\}_{n=1}^\infty \subseteq A$. \
> $\Rightarrow$ $\exists\,\epsilon>0$ such that $\forall\,
> k\in\mathbb{N}$, $\exists\,n_k\geq k$ such that $\rho(f\left(x_{n_k}),f(y_{n_k})\right)\geq\epsilon$. \
> Since $f$ is uniformly continuous, $\exists\,\delta>0$ such that $\forall\, x,y\in A$ with $d(x,y)<\delta$, we have $\rho(f(x),f(y))<\epsilon$. $\quad(\rightarrow\leftarrow)$ \
> $\impliedby$: \
> Prove by contradiction. \
> $\exists\,\epsilon>0$ such that $\forall\, n\in\mathbb{N}$, $\exists\,x_n,y_n\in A$ with $d(x_n,y_n)<\frac{1}{n}$ but $\rho(f(x_n),f(y_n))\geq\epsilon$. \
> Then for the sequences $\{x_n\}_{n=1}^\infty,\{y_n\}_{n=1}^\infty \subseteq A$ with $\displaystyle\lim_{n\to\infty}d(x_n,y_n)=0$, $\displaystyle\lim_{n\to\infty}\rho(f(x_n),f(y_n))\neq 0$. $\quad(\rightarrow\leftarrow)$
:::

---

Suppose that $\forall\,\epsilon>0$, $\exists\,\delta(x,\epsilon)>0$ such that $\rho(f(x),f(y))<\epsilon$ whenever $d(x,y)<\delta(x,\epsilon)$.\
Define $\delta_f(\epsilon)=\displaystyle\inf_{x\in A}\delta(x,\epsilon)$. \
If $\delta_f(\epsilon)>0\;\forall\,\epsilon>0$, then $f$ is uniformly continuous on $A$.

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A\subseteq M$, and $f:A\to N$ be uniformly continuous.\
If $\left\{x_n\right\}_{n=1}^\infty \subseteq A$ is a Cauchy sequence in $(M,d)$, then $\left\{f(x_n)\right\}_{n=1}^\infty$ is also a Cauchy sequence in $(N,\rho)$.

:::spoiler proof:
> $\forall\,\epsilon>0$, $\exists\,\delta>0$ such that $\rho(f(x),f(y))<\epsilon$ whenever $x,y\in A$ and $d(x,y)<\delta$. \
> Since $\{x_n\}_{n=1}^\infty \subseteq A$ is Cauchy in $(M,d)$, there exists $L\in\mathbb{N}$ such that $d(x_m,x_n)<\delta$ whenever $m,n\geq L$. \
> Therefore for $m,n\geq L$, we have $\rho(f(x_m),f(x_n))<\epsilon$. \
> Thus $\{f(x_n)\}_{n=1}^\infty$ is Cauchy in $(N,\rho)$.
:::

---

 ### Continuous Extension

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$, and $f:A\to N$ be uniformly comitnuous.\
If $(N,\rho)$ is complete, then $f$ has a unique extension to a continuous function on $\bar{A}$, that is, $\exists\, g:\bar{A}\to N$ such that
1. $g$ is uniformly continuous on $\bar{A}$
2. $g(x)=f(x)\;\forall\,x\in A$
3. If there is $h:\bar{A}\to N$ satisfying 1. and 2., then $g=h$ on $\bar{A}$.

:::spoiler proof:
> We need to define the value of $g$ on $\bar{A}\backslash A$. \
> Suppose $x\in\bar{A}\backslash A$. \
> Then there exists $\left\{x_n\right\}_{n=1}^\infty \subseteq A$ converging to $x$. \
> Hence $\left\{x_n\right\}_{n=1}^\infty \subseteq A$ is Cauchy in $M$. \
> Since $f$ is uniformly continuous on $A$, $\left\{f(x_n)\right\}_{n=1}^\infty \subseteq A$ is a Cauchy sequence in $(N,\rho)$. \
> Since $(N,\rho)$ is complete, $\left\{f(x_n)\right\}_{n=1}^\infty$ converges in $(N,\rho)$, say $\displaystyle\lim_{n\to\infty}f(x_n)=y_x$. \
> Define $g(x) = \begin{cases}
>     f(x),\quad &x\in A \\
>     y_x,\quad &x\in\bar{A}\backslash A
> \end{cases}$ \
> To check that $g(x)$ is well-defined, consider another sequence $\left\{z_n\right\}_{n=1}^\infty \subseteq A$ converging to $x$. \
> Then $d(x_n,z_n)\to 0$ as $n\to\infty$. \
> Since $f$ is uniformly conitnuous on $A$, $\displaystyle\lim_{n\to\infty}\rho(f(x_n),f(z_n))=0$. \
> Therefore $\displaystyle\lim_{n\to\infty}f(x_n)=y_x=\displaystyle\lim_{n\to\infty}f(z_n)$. \
> Hence $g$ is well-defined on $\bar{A}$. \
> Check condition 1. :\
> Suppose $\epsilon>0$. \
> Since $f$ is uniformly continuous on $A$, $\exists\,\delta>0$ such that if $x, y\in A$ with $d(x,y)<\delta$, then $\rho(f(x),f(y))<\epsilon$. \
> For $u,v\in \bar{A}$ with $d(u,v)<\frac{\delta}{3}$, by the definition of $g$, $\exists\,\{u_n\}_{n=1}^{\infty}, \{v_n\}_{n=1}^{\infty}\subseteq A$ such that $\displaystyle\lim_{n\to\infty}u_n=u$ and $\displaystyle\lim_{n\to\infty}v_n=v$. \
> $\Rightarrow$ $\exists\, u_m, v_k$ with $d(u,u_m)<\frac{\delta}{3}$ and $d(v,v_k)<\frac{\delta}{3}$ such that 
> $\rho(f(u),f(u_m))<\frac{\epsilon}{3}$ and $\rho(f(v),f(v_k))<\frac{\epsilon}{3}$. \
> Then $$\begin{aligned}
>     d(u_m,v_k) &\leq d(u_m,u)+d(u,v)+d(v,v_k) \\
>     &<\frac{\delta}{3}+\frac{\delta}{3}+\frac{\delta}{3} = \delta
> \end{aligned}$$
> This implies $\rho(f(u_m),f(v_k))<\frac{\epsilon}{3}$ and hence 
> $$\begin{aligned}
>     \rho(g(u),g(v)) &\leq \rho(g(u),g(u_m))+\rho(g(u_m),g(v_k))+\rho(g(v_k),g(v)) \\
>     &< \frac{\epsilon}{3}+\frac{\epsilon}{3}+\frac{\epsilon}{3} \\
>     &= \epsilon
> \end{aligned}$$
> Hence $g$ is uniformly continuous on $\bar{A}$. \
> check condition 3. : \
> Suppose $h:\bar{A}\to N$ satisfying 1. and 2. . \
> Let $x\in\bar{A}\backslash A$. \
> Given $\epsilon>0$, $\exists\, \delta_1,\delta_2>0$ such that $d(x,y)<\delta_1 \implies \rho(g(x),g(y))<\frac{\epsilon}{2}$
> and $d(x,y)<\delta_2 \implies \rho(h(x),h(y))<\frac{\epsilon}{2}$. \
> Since $x\in \bar{A}\backslash A$, $\exists\, y\in A$ such that $d(x,y)<\min(\delta_1,\delta_2)$.\
> Then
> $$\begin{aligned}
>     \rho(g(x),h(x)) &\leq \rho(g(x),g(y))+\rho(g(y),h(y))+\rho(h(y),h(x))\\
>     &< \frac{\epsilon}{2}+0+\frac{\epsilon}{2}\\
>     &=\epsilon
> \end{aligned}$$
> Therefore $g(x)=h(x)\;\forall\, x\in\bar{A}$.
:::

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A\subseteq M$ and $f:A\to N$ be a continuous map. \
If $K\subseteq A$ is compact, then $f(K)$ is compact in $(N,\rho)$.

:::spoiler proof:
> Suppose that $\{U_\alpha\}_{\alpha\in I}$ is an open cover of $f(K)$. \
> For every $\alpha\in I$, since $f:A\to N$ is continuous and $U_\alpha$ is open in $(N,\rho)$, $f^{-1}(U_\alpha)$ is open in $A$. \
> Then for each $\alpha\in I$, there exists $V_\alpha$ which is open in $M$ such that $f^{-1}(U_\alpha)=V_\alpha\cap A$. \
> Since $f(K)\subseteq \displaystyle\bigcup_{\alpha\in I}U_\alpha$ and $K\subseteq A$, $\{V_\alpha\}_{\alpha \in I}$ is an open cover of $K$. \
> Since $K$ is compact, there exists a finite subcover $\{V_{\alpha_i}\}_{i=1}^n$ such that
> $K\subseteq \displaystyle\bigcup_{i=1}^{n}V_{\alpha_i} \cap A = \displaystyle\bigcup_{i=1}^{n}f^{-1}(U_{\alpha_i})$. \
> Then $f(K)\subseteq \displaystyle\bigcup_{i=1}^{n} U_{\alpha_i}$ and thus $f(K)$ is compact in $(N,\rho)$.
:::

---

Let $(M,d)$ be a metric space and $K\subseteq M$ be compact. \
If $f:M\to\mathbb{R}$ is continuous, then $f$ attains its maximum and minimum in $K$. \
That is, $\exists\,x_0,x_1\in K$ such that $f(x_0)=\displaystyle\max_{x\in K}f(x)$ and $f(x_1)=\displaystyle\min_{x\in K}f(x)$.

:::spoiler proof:
> Since $f$ is continuous and $K$ is compact, $f(K)$ is compact in $\mathbb{R}$. \
> Hence, $f(K)$ is closed and bounded. \
> Then $f$ attains its extreme values in $K$.
:::

:::info
This provides the metric space version of extreme value theorem.
:::

---

Let $(M,d)$ be a metric space, $K\subseteq M$ be compact and $f:K\to\mathbb{R}$ be a continuous map. \
Then the set $\big\{ x\in K\mid f(x)=\displaystyle\max_{x\in K}f(x)\big\}$ is nonempty and compact.

---

Let $E$ be a noncompact set in $\mathbb{R}$. \
Then
1. there exists a continuous function on $E$ which is unbounded.
2. there exists a bounded and continuous function on $E$ which has no maximum.

---

Let $(M,d)$ and $(N,\rho)$ be metric spaces, $A\subseteq M$, and $f:A\to N$ be a map. \
If $K\subseteq A$ is compact and $f$ is continuous, then $f$ is uniformly continuous on $K$.

:::spoiler proof:
> Since $f$ is continuous on $K$, given $\varepsilon>0$, for every $x\in K$,
> $\exists\,\delta_x>0$ such that $\rho(f(x),f(y))<\frac{\varepsilon}{2}$ whenever $y\in K$ and $d(x,y)<\delta_x$. \
> Since $K$ is compact and $K\subseteq \displaystyle\bigcup_{x\in K}B(x,\frac{\delta_x}{2})$,
> there exist $x_1,\dotsc,x_L\in K$ such that $K\subseteq \displaystyle\bigcup_{i=1}^L B(x_i,\frac{\delta_{x_i}}{2})$. \
> Select $\delta=\displaystyle\min_{1\leq i\leq L} \frac{\delta_{x_i}}{2}$. \
> Suppose $u,v\in K$ and $d(u,v)<\delta$. \
> Since $K\subseteq \displaystyle\bigcup_{i=1}^L B(x_i,\frac{\delta_{x_i}}{2})$,
> there is $1\leq l\leq L$ such that $u\in B(x_l,\frac{\delta_{x_l}}{2})$. \
> Then
> $$\begin{aligned}
>     d(v,x_l) &\leq d(v,u)+d(u,x_l) \\
>     &< \delta+\frac{1}{2}\delta_{x_l} \\
>     &\leq \delta_{x_l}
> \end{aligned}$$
> Therefore $v\in B(x_l,\delta_{x_l})$ and we have
> $$\begin{aligned}
>     \rho(f(u),f(v)) &\leq \rho(f(u),f(x_l))+\rho(f(x_l),f(v)) \\
>     &< \frac{\varepsilon}{2}+\frac{\varepsilon}{2} = \varepsilon
> \end{aligned}$$
> Hence $d(u,v)<\delta\implies \rho(f(u),f(v))<\varepsilon$. \
> Thus $f$ is uniformly continuous on $K$.
:::

---

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $K\subseteq M$ be compact, 
and $f:K\to N$ be one-to-one and continuous function. \
Then the inverse function $f^{-1}:f(K)\to K$ is continuous.

:::spoiler proof:
> To prove that $f^{-1}$ is continuous,
> we can prove that for every closed $E\subseteq M$, the preimage $\left(f^{-1}\right)^{-1}(E)$ is closed relative to $f(K)$. \
> Since $E\subseteq M$ is closed and $K$ is compact in $M$, $E\cap K$ is compact in $M$. \
> Since $f$ is continous, $f(E\cap K)$ is compact on $N$, and hence is closed in $N$. \
> Since $f$ is one-to-one, we have $f(E\cap K)=\left(f^{-1}\right)^{-1}(E\cap K)=\left(f^{-1}\right)^{-1}(E)$ is closed in $f(K)$. \
> Therefore, $f^{-1}$ is continuous on $f(K)$.
:::
<br><br>
counterexample for noncompact $K$:
- $f(t)=(\cos(t),\sin(t))$ on $[\,0,2\pi)$ leads to discontinuous $f^{-1}$.

---

### Continuous Maps on Connected Sets and Path Connected Sets

Let $(M,d)$ be a metric space and $A\subseteq M$. \
$A$ is said to be ==path connected== if for every pair of points $x,y\in A$, they can be joined by a *path* in $M$. 
That is, there exists a continuous map $\phi:[0,1]\to A$ such that $\phi(0)=x$ and $\phi(1)=y$.

---

Let $V$ be a vector space and $A\subseteq V$.\
$A$ is called ==convex== if for all $x,y\in A$, the *line segment* joining $x$ and $y$, denoted by $\overline{xy}$, lies in $A$.

:::danger
Notice the difference between path and line segment.
:::

---

Any open or closed ball in a vector space $V$ is convex.

---

A convex set in a normed space is path connected by taking $\phi(t)=(1-t)x+ty$.

---

Let $A,B\subseteq M$ be path connected. \
If there exists $a\in A$ and $b\in B$ and a path in $A\cup B$ joining $a$ and $b$,
then $A\cup B$ is path connected.

---

Under a metric space, \
path-connected $\implies$ connected

:::spoiler proof:
> Let $(M,d)$ be a metric space and $A\subseteq M$. \
> To prove by contradiction, assume that $A$ is disconnected. \
> Then there exist open sets $u$ and $v$ in $M$ such that (i) $A\subseteq u\cup v$ 
> (ii) $A\cap u\neq\emptyset$ (iii) $A\cap v\neq\emptyset$ (iv) $A\cap u\cap v=\emptyset$. \
> By (ii) and (iii), choose $x\in A\cap u$ and $y\in A\cap v$. \
> Since $A$ is path-connected, there exists a continuous map $\phi:[0,1]\to A$ 
> such that $\phi(0)=x$ and $\phi(1)=y$. \
> Then the sets $w_1= \phi^{-1}(u)$ and $w_2= \phi^{-1}(v)$ are open relative to $[0,1]$. \
> By (i), $[0,1]\subseteq w_1\cup w_2$. \
> Since $0\in w_1$ and $1\in w_2$, we have $[0,1]\cap w_1\neq\emptyset$ and $[0,1]\cap w_2\neq\emptyset$. \
> By (iv), $[0,1]\cap w_1\cap w_2 = \phi^{-1}(u)\cap \phi^{-1}(v)=\emptyset$. \
> Then $w_1$ and $w_2$ separate $[0,1]$. $\quad (\rightarrow\leftarrow)$
:::
:::success
The converse is false. \
For example, $A=\left\{(x,\sin\frac{1}{x})\mid x\in(0,1)\right\}\cup ({0}\times[-1,1])$ is connected but not path-connected.
:::

---

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$, and $f:A\to N$ be a continuous map. 
1. If $A$ is connected, then $f(A)$ is connected.
2. If $A$ is path-connected, then $f(A)$ is path-connected.

:::spoiler proof:
> (1.): \
> To prove by contradiction, assume that $f(A)$ is disconnected. \
> Then there exist open sets $u$ and $v$ in $N$ such that (i) $f(A)\subseteq u\cup v$ (ii) $f(A)\cap u\neq\emptyset$ 
> (iii) $f(A)\cap v\neq \emptyset$ (iv) $f(A)\cap u\cap v=\emptyset$. \
> Since $f$ is continuous and $u,v$ are open in $N$, $f^{-1}(u)$ and $f^{-1}(v)$ are open relative to $A$. \
> Then there are $w_1$, $w_2$ open in $M$ such that $f^{-1}(u)=A\cap w_1$ and $f^{-1}(v)=A\cap w_2$. \
> By (i), $A\subseteq f^{-1}(u)\cup f^{-1}(v) \subseteq w_1\cup w_2$. \
> By (ii) and (iii), $A\cap w_1\neq\emptyset$ and $A\cap w_2\neq\emptyset$. \
> By (iv), $A\cap w_1\cap w_2=\emptyset$. \
> Hence, $A$ is disconnected. $\quad(\rightarrow\leftarrow)$ \
> (2.): \
> Suppose $y_1,y_2\in f(A)$. \
> $\Rightarrow$ $\exists\,x_1,x_2\in A$ such that $y_1=f(x_1)$ and $y_2=f(x_2)$. \
> Since $A$ is path-connected, there exists a continuous map $\phi:[0,1]\to A$ such that 
> $\phi(0)=x_1$ and $\phi(1)=x_2$. \
> Define $\psi(t)=f(\phi(t))$. \
> Clearly, $\psi:[0,1]\to f(A)$. \
> Since $f$ and $\phi$ are continuous, $\psi$ is continuous on $[0,1]$. \
> Then $\psi(0)=f(\phi(0))=f(x_1)=y_1$ and $\psi(1)=f(\phi(1))=f(x_2)=y_2$. \
> Hence, $\psi$ is a path in $f(A)$ joining $y_1$ and $y_2$. \
> Since $y_1$ and $y_2$ are arbitrary two points in $f(A)$, $f(A)$ is path-connected.
:::

---

Let $V$ be a vector space and $\phi:[0,1]\to V$ be a continuous map. \
$\phi$ is said to be ==piecewise linear== if $\exists\,t_0,t_1,t_2,\dotsc,t_n\in[0,1]$ with $0=t_0<t_1<\cdots<t_n=1$ 
such that $\phi$ is a linear map on each $[t_{i-1},t_i]$.

---

Let $V$ be a vector space and $x,y,z\in V$. \
If there are piecewise linear mapping $\phi_1,\phi_2:[0,1]\to V$ such that 
$\phi_1$ joins $x$ and $y$ and $\phi_2$ joins $y$ and $z$, then there exists a 
piecewise linear mapping $\phi:[0,1]\to V$ which joins $x$ and $z$.

---

Let $G$ be a connected and open set in a vector space $V$. \
Then for any $x,y\in G$, there exists a piecewise linear mapping joining $x$ and $y$.

:::spoiler proof:
> Suppose $x\in G$. \
> Define $G_1= \left\{z\in G\mid \text{there exists a piecewise linear mapping joining } x \text{ and } z\right\}$. \
> To prove $G=G_1$, we want to show that $G_1$ is nonempty, open and closed in $G$. \
> Since $x\in G_1$, $G_1$ is nonempty. \
> Claim 1: $G_1$ is open \
> Suppose $z\in G_1$. \
> Since $G$ is open, $\exists\,\delta>0$ such that $B(z,\delta)\subseteq G$. \
> Since $B(z,\delta)$ is convex, for any point $z_1\in B(z,\delta)$, 
> there exists a piecewise linear mapping joining $z$ and $z_1$. \
> Then there is a piecewise linear mapping joining $x$ and $z_1$. \
> Hence $z_1\in G_1$. \
> Therefore, $B(z,\delta)\subseteq G_1$ and $G_1$ is open. \
> Claim 2: $G_1$ is closed \
> Suppose $w\in G\backslash G_1$. \
> Then there exists no piecewise linear mapping joining $x$ and $w$. \
> Since $G$ is open, $\exists\,r>0$ such that $B(w,r)\subseteq G$. \
> For any point $w_1\in B(w,r)$, there exists a piecewise linear mapping joining $w$ and $w_1$. \
> To prove $w_1\notin G_1$ by contradiction, assume $w_1\in G_1$. \
> Then there is a piecewise linear mapping joining $x$ and $w_1$. \
> $\Rightarrow$ $w\in G_1$ $\quad(\rightarrow\leftarrow)$ \
> Hence $B(w,r)\subseteq G\backslash G_1$ and $G\backslash G_1$ is open. \
> $\Rightarrow$ $G_1$ is closed. \
> Finally, since $G$ is connected and $G_1$ is a nonempty, open and closed subset of $G$, we have $G_1=G$.
:::

---

|domain|function|codomain|
|:-:|:-:|:-:|
|compact|conitnuous|**<font color="#0077c0">compact</font>**|
|compact|continuous|**<font color="#0077c0">uniformly continuous</font>**|
|connected|continuous|**<font color="#0077c0">connected</font>**|
|path-connected|continuous|**<font color="#0077c0">path-connected</font>**|

---

## Pointwise and Uniform Convergence

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$, and $f,f_k:A\to N$ be maps $\forall\,k\in\mathbb{N}$. \
The sequence of maps $\{f_k\}_{k=1}^\infty$ is said to ==converge pointwise to $f$ on $A$== 
if $\displaystyle\lim_{k\to\infty}\rho(f_k(a),f(a))=0$ for every $a\in A$. \
That is, $\forall\,\varepsilon>0$ and $\forall\,a\in A$, $\exists\, N_{\varepsilon,a}>0$ such that 
$\rho(f_k(a),f(a))<\varepsilon$ whenever $k\geq N_{\varepsilon,a}$.

:::danger
Notice that these $N$ also depend on $a$.
:::

---

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$, and $f,f_k:A\to N$ be maps $\forall\,N\in\mathbb{N}$. \
The sequence of maps $\{f_k\}_{k=1}^\infty$ is said to ==converge uniformly to $f$ on $A$== 
if $\forall\,\varepsilon>0$, $\exists\,N_\varepsilon>0$ such that $\rho(f_k(a),f(a))<\varepsilon$ whenever $a\in A$ and $k\geq N_\varepsilon$.

:::spoiler Example:
$f,f_k: [0,1]\to\mathbb{R}$ by $f_k(x)=x^k$ and $f(x)=\begin{cases}
    0, &x\in[0,1) \\
    1, &x=1
\end{cases}$. \
Then
1. $f_k\to f$ pointwise
2. $\{f_k\}_{k=1}^\infty$ does not converge uniformly to $f$ on $[0,1]$.
3. For $0<a<1$, $f_k\to f$ uniformly on $[0,a]$
> 2: \
> Let $\varepsilon=\frac{1}{2}$. \
> Choose $x_N=\sqrt[N]{\frac{2}{3}}$ $\;\forall\,N\in\mathbb{N}$. \
> Then $\left|f_N(x_N)-f(x_N)\right|= \left|\frac{2}{3}-0\right|> \varepsilon$.

> 3: \
> Fix $0<a<1$. \
> Given $\epsilon>0$, choose $N\in\mathbb{N}$ such that $N>\dfrac{\ln \epsilon}{\ln a}$. \
> Since $\ln a<0$, $a^N<\epsilon$. \
> For every $x\in[0,a]$ and $k\geq N$, $\left|f_k(x)-f(x)\right|= |x^k-0|\leq a^k\leq a^N< \epsilon$. \
> Hence, $f_k\to f$ uniformly on $[0,a]$.
:::

---

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$, and $f,f_k:A\to N$ be maps $\forall\,k\in\mathbb{N}$. \
If $f_k\to f$ uniformly, then $f_k\to f$ pointwise.

---

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$, and $f_k:A\to N$ be maps $\forall\,k\in\mathbb{N}$. \
Suppose that $(N,\rho)$ is complete. \
Then $\{f_k\}_{k=1}^\infty$ converges uniformly on $A$ ***iff*** 
$\forall\,\varepsilon>0$, $\exists\,L\in\mathbb{N}$ such that $\rho(f_m(x),f_n(x))<\varepsilon$ whenever $x\in A$ and $m,n\geq L$.

:::spoiler proof:
> $\implies:$ \
> Let $f:A\to N$ be a map where $f_k\to f$ uniformly on A. \
> Given $\epsilon>0$, $\exists\,L\in\mathbb{N}$ such that $\rho(f_k(x),f(x))<\frac{\epsilon}{2}$ 
> whenever $x\in A$ and $k\geq L$. \
> For $m,n\geq L$ and $x\in A$,
> $$\begin{aligned}
>     \rho(f_m(x),f_n(x)) &\leq \rho(f_m(x),f(x))+\rho(f(x),f_n(x)) \\
>      &< \frac{\epsilon}{2}+\frac{\epsilon}{2} =\epsilon
> \end{aligned}$$
> $\impliedby:$ \
> Let $\{f_k\}_{k=1}^\infty$ be a sequence of maps on $A$ satisfying the Cauchy criterion. \
> Fix $a\in A$, $\{f_k(a)\}_{k=1}^\infty$ is a Cauchy sequence in $N$. \
> Since $(N,\rho)$ is complete, $\exists\,y_a\in N$ such that $\displaystyle\lim_{k\to\infty}f_k(a)=y_a$ in $N$. \
> By the same argument, $\forall\,x\in A$, there exists such $y_x$. \
> Define $f:A\to N$ by $f(x)=y_x$. \
> Then $f_k\to f$ pointwise on $A$. \
> Given $\epsilon>0$, by the Cauchy criterion, there exists $L\in\mathbb{N}$ such that 
> $\rho(f_m(x),f_n(x))<\frac{\epsilon}{2}$ whenever $x\in A$ and $m,n\geq L$. \
> Since $f_k\to f$ pointwise on $A$, for every $x\in A$, $\exists\,L_x\in\mathbb{N}$ with $L_x\geq L$ such that 
> $\rho(f_m(x),f(x))<\frac{\epsilon}{2}$ whenever $m>L_x$. \
> Hence for every $x\in A$ and $m\geq L$, we choose $m_x\geq L_x$. \
> Then
> $$\begin{aligned}
>     \rho(f_m(x),f(x)) &\leq \rho(f_m(x),f_{m_x}(x))+\rho(f_{m_x}(x),f(x)) \\
>      &< \frac{\epsilon}{2}+\frac{\epsilon}{2} =\epsilon
> \end{aligned}$$
> Therefore $f_k\to f$ uniformly on $A$.
:::

---

Let $(M,d)$ and $(N,\rho)$ be two metric spaces, $A\subseteq M$ and $f_k:A\to N$ be a sequence of continuous map 
converging to $f:A\to N$ uniformly on $A$. \
Then $f$ is continuous on $A$.

:::spoiler proof:
> Since $f_k\to f$ uniformly on $A$, for given $\varepsilon>0$, there exists $L\in\mathbb{N}$ such that for every $x\in A$ and $k\geq L$,
> $$\rho(f_k(x),f(x))<\frac{\varepsilon}{3}$$
> Since $f_L$ is continuous on $A$, $\forall\,a\in A$, $\exists\,\delta_a>0$ such that $\rho(f_L(x),f_L(a))<\frac{\varepsilon}{3}$ 
> whenever $x\in A$ and $d(x,a)<\delta_a$. \
> Hence, for every $x\in A$ and $d(x,a)<\delta_a$,
> $$\begin{aligned}
>     \rho(f(x),f(a)) &\leq \rho(f(x),f_L(x))+\rho(f_L(x),f_L(a))+\rho(f_L(a),f(a)) \\
>     &<\frac{\varepsilon}{3}+\frac{\varepsilon}{3}+\frac{\varepsilon}{3} \\
>     &=\varepsilon
> \end{aligned}$$
> Thus $f$ is continuous at $a$. \
> $f$ is continuous on $A$.
:::

:::success
If $f_k$ continuous but $f$ not continuous, then $f_k \not\to f$ uniformly. 
:::

:::info
If $f_k\to f$ uniformly on $A$ and $a\in\overline{A}$, then
$$\lim_{x\to a}\left(\lim_{k\to\infty}f_k(x)\right) = \lim_{k\to\infty}\left(\lim_{x\to a}f_k(x)\right)$$
:::

---

Let $f:[a,b]\to\mathbb{R}$ and $P=\{a=t_0<t_1<t_2<\cdots<t_n=b\}$ be a partition of $[a,b]$. \
The upper and lower sums of $P$ for $f$ are $U(P,f)=\displaystyle\sum_{i=1}^n M_i(t_i-t_{i-1})$ and 
$L(P,f)=\displaystyle\sum_{i=1}^n m_i(t_i-t_{i-1})$ where $M_i=\displaystyle\sup_{t\in [t_{i-1},t_i]}f(t)$ and 
$m_i=\displaystyle\inf_{t\in[t_{i-1},t_i]}f(t)$. \
Define $\underline{\int_a^b} f(x)\,dx=\displaystyle\sup_P L(P,f)$ and 
$\overline{\int_a^b}f(x)\,dx=\displaystyle\inf_{P} U(P,f)$. \
We have
1. $L(P,f)\leq U(P,f)$
2. If $P_1$ is a refinement of $P$, then $L(P,f)\leq L(P_1,f)\leq U(P_1,f)\leq U(P,f)$.
3. For any two partitions $P_1$ and $P_2$, $L(P_1,f)\leq U(P_2,f)$.
4. $\underline{\int_a^b} f(x)\,dx \leq \overline{\int_a^b} f(x)\,dx$

If $\underline{\int_a^b}f(x)\,dx = \overline{\int_a^b}f(x)\,dx$, 
we say $f$ is ==integrable== on $[a,b]$ and denoted by $\int_a^b f(x)\,dx$.

---

A function $f$ is integrable on $[a,b]$ ***iff*** $\forall\,\varepsilon>0$, there exists a partition $P$ of $[a,b]$ such that $U(P,f)-L(P,f)<\varepsilon$.

---

If $f:[a,b]\to\mathbb{R}$ is piecewise continuous, then $f$ is integrable.

---

Let $f_k:[a,b]\to\mathbb{R}$ be a sequence of integrable functions which converge uniformly to $f$ on $[a,b]$. \
Then $f$ is integrable on $[a,b]$ and $\displaystyle\lim_{k\to \infty}\int_a^b f_k(x)\,dx = \int_a^b f(x)\,dx = \int_a^b\lim_{k\to\infty}f_k(x)\,dx$. 

:::spoiler proof:
> Since $\{f_k\}_{k=1}^\infty$ converges uniformly to $f$ on $[a,b]$, for given $\varepsilon>0$, 
> $\exists\,N\in\mathbb{N}$ such that $\left|f_k(x)-f(x)\right|<\varepsilon$ whenever $x\in [a,b]$ and $k\geq N$. \
> Since $f_N$ is integrable on $[a,b]$, there exists a partition $P$ of $[a,b]$ such that $U(P,f_N)-L(P,f_N)<\varepsilon$. \
> Let $M_i=\displaystyle\sup_{t\in[t_{i-1},t_i]}f(t)$, $m_i=\displaystyle\inf_{t\in[t_{i-1},t_i]}f(t)$, 
> and $M_i^{(N)}=\displaystyle\sup_{t\in[t_{i-1},t_i]}f_N(t)$, $m_i^{(N)}=\displaystyle\inf_{t\in[t_{i-1},t_i]}f_N(t)$. \
> Then 
> $$\begin{aligned}
>     \left|M_i-M_i^{(N)}\right| &\leq \sup_{t\in[t_{i-1},t_i]} \left|f(t)-f_N(t)\right|\leq\varepsilon \\
>     \left|m_i-m_i^{(N)}\right| &\leq \sup_{t\in[t_{i-1},t_i]} \left|f(t)-f_N(t)\right|\leq\varepsilon
> \end{aligned}$$
> And we have 
> $$\begin{aligned}
>     U(P,f)-L(P,f) &\leq \left|U(P,f)-U(P,f_N)\right|+\left|U(P,f_N)-L(P,f_N)\right|+\left|L(P,f_N)-L(P,f)\right| \\
>      &<\sum_{i=1}^n \left|M_i-M_i^{(N)}\right|(t_i-t_{i-1})+\varepsilon+\sum_{i=1}^n \left|m_i-m_i^{(N)}\right|(t_i-t_{i-1}) \\
>      &\leq2\varepsilon\sum_{i=1}^n(t_i-t_{i-1})+\varepsilon \\
>      &=[2(b-a)+1]\varepsilon 
> \end{aligned}$$
> Hence, $f$ is integrable on $[a,b]$. \
> Moreover, for $k\geq N$,
> $$\begin{aligned}
>     \left|\int_a^b f(x)\,dx-\int_a^b f_k(x)\,dx\right| &=\left|\int_a^b f(x)-f_k(x)\,dx\right| \\
>      &\leq \int_a^b\left|f(x)-f_k(x)\right|\,dx \\
>      &<\int_a^b\varepsilon\,dx =\varepsilon(b-a)
> \end{aligned}$$
> Therefore $\displaystyle\int_a^b f(x)\,dx = \lim_{k\to\infty}\int_a^b f_k(x)\,dx$.
:::

---

Suppose that $f_k\to f$ pointwise and $\int f_k\,dx\to\int f\,dx$. \
It cannot imply that $f_k\to f$ uniformly.

:::spoiler counterexample:
> The set $\mathbb{Q}\cap[0,1]$ is countable. Write $\mathbb{Q}\cap[0,1]=\{q_k\mid k\in \mathbb{N}\}$. \
> Define $f_k(x):[0,1]\to\mathbb{R}$ by $f_k(x)=\begin{cases}
>     1, &x\in\{q_1,q_2,\dotsc q_k\} \\
>     0, &\text{otherwise}
> \end{cases}$ and $f(x)=\begin{cases}
>     1, &x\in\mathbb{Q}\cap[0,1] \\
>     0, &\text{otherwise}
> \end{cases}$. \
> Then $f_k\to f$ pointwise on $[0,1]$. \
> Every $f_k(x)$ is integrable on $[0,1]$, but $f$ is not integrable on $[0,1]$. \
> Hence $\{f_k\}_{k=1}^\infty$ does not converge uniformly to $f$ on $[0,1]$. 
:::

---

Let $I\subseteq \mathbb{R}$ be a finite interval, $f_k:I\to\mathbb{R}$ be a sequence of differentiable functions. \
Suppose that $\{f_k(a)\}_{k=1}^\infty$ converges for some $a\in I$ and $\{f_k'\}_{k=1}^\infty$ converges uniformly to a function $\mathrm{g}$ on $I$. \
Then
1. $\{f_k\}_{k=1}^\infty$ converges uniformly to some function $f$ on $I$.
2. The limit function $f$ is differentiable on $I$ and $f'(x)=\mathrm{g}(x)$ for all $x\in I$. \
That is, $\mathrm{g}(x)=\displaystyle\lim_{k\to\infty}\left(\frac{d}{dx}f_k(x)\right)= f'(x)= \frac{d}{dx}\left(\lim_{k\to\infty}f_k(x)\right)$.

:::spoiler proof: 
> For $x\in I$, by the F.T.C., $f_k(x)=f_k(a)+\int_a^x f_k'(t)\,dt$. \
> Since $\{f_k(a)\}_{k=1}^\infty$ converges, by the previous theorem, $\{\int_a^x f_k'(t)\,dt\}_{k=1}^\infty$ converges for every $x\in I$. \
> Then $\forall\,x\in I$, $\{f_k(x)\}_{k=1}^\infty$ converges, and we can define $f(x)=\displaystyle\lim_{k\to\infty}\left(f_k(a)+\int_a^x f_k'(t)\,dt\right)$. \
> Hence $f(a)=\displaystyle\lim_{k\to\infty}f_k(a)$ and $f(x)-f(a)=\displaystyle\lim_{k\to\infty}\int_a^xf_k'(t)\,dt= \int_a^x\displaystyle\lim_{k\to\infty}f_k'(t)\,dt= \int_a^x \mathrm{g}(t)\,dt$. \
> $\Rightarrow$ $f'(x)=\mathrm{g}(x)$ \
> Now we want to check $f_k\to f$ uniformly on $I$. \
> Since $\displaystyle\lim_{k\to\infty}f_k(a)=f(a)$, given $\varepsilon>0$, $\exists\,N_1\in\mathbb{N}$ such that $|f_k(a)-f(a)|<\frac{\varepsilon}{2}$ whenever $k\geq N_1$. \
> Since $f_k'(x)\to \mathrm{g}(x)$ uniformly on $I$, $\exists\,N_2\in\mathbb{N}$ such that $\left|f_k'(x)-\mathrm{g}(x)\right|<\dfrac{\varepsilon}{2|I|}$ whenever $x\in I$ and $k\geq N_2$. \
> Therefore, for $k\geq \max(N_1,N_2)$,
> $$\begin{aligned}
>     \left|f(x)-f_k(x)\right| &= \left|\left[f(a)+\int_a^x \mathrm{g}(t)\,dt\right]-\left[f_k(a)+\int_a^xf_k'(t)\,dt\right]\right| \\
>      &\leq|f(a)-f_k(a)|+\int_a^x\left|\mathrm{g}(t)-f_k'(t)\right|\,dt \\
>      &<\frac{\varepsilon}{2}+\frac{\varepsilon}{2} =\varepsilon
> \end{aligned}$$
> Thus $f_k\to f$ uniformly on $I$.
:::

---

Suppose $f_k$ differentiable and $f_k\to f$ uniformly. \
It cannot imply $f$ differentialble.

:::spoiler counterexample:
$$f_k(x)=\begin{cases}
    \frac{k}{2}x^2, &|x|\leq\frac{1}{k} \\
    |x|-\frac{1}{2k}, &\frac{1}{k}\leq|x|\leq 1
\end{cases} \text{ and } f(x)=|x|$$
:::

---

#### Dini's Theorem

Suppose that $K$ is compact and \
(a) $f_n:K\to\mathbb{R}$ is continuous on $K$ $\;\forall\, n\in\mathbb{N}$. \
(b) $f_n\to f$ pointwise on $K$ where $f$ is continuous \
(c\) $f_n(x)\leq f_{n+1}(x)$ $\;\forall\,n\in\mathbb{N}$ and $x\in K$.

Then $f_n\to f$ uniformly on $K$.

:::spoiler proof:
> Define $\mathrm{g}_n=f-f_n$ $\;\forall\,n\in\mathbb{N}$. \
> Then, \
> (d) $\mathrm{g}_n$ is continuous on $K$ \
> (e) $\mathrm{g}_n\to \mathbf{0}$ pointwise on $K$ \
> (g) $\mathrm{g}_n(x)\geq \mathrm{g}_{n+1}(x)$ $\;\forall\,n\in\mathbb{N}$ and $x\in K$. \
> Our goal is to show $\mathrm{g}_n\to \mathbf{0}$ uniformly on $K$. \
> Given $\varepsilon>0$, define $K_n=\{x\in K\mid \mathrm{g}_n(x)\geq\varepsilon\}$. \
> For each $n\in\mathbb{N}$, since $\mathrm{g}_n$ is continuous on $K$, $K_n=\mathrm{g}_n^{-1}\big([\varepsilon,\infty)\big)$ is closed in $K$. Then $K_n$ is compact. \
> Moreover, by (g), $K_{n}\supseteq K_{n+1}$ $\forall\,n\in\mathbb{N}$. \
> Fix $x\in K$, since $\mathrm{g}_n(x)\to 0$ as $n\to \infty$, $x\notin K_n$ as $n$ is sufficiently large. \
> That implies $\displaystyle\bigcap_{n=1}^\infty K_n =\emptyset$. \
> According to this proposition
> > If $\{K_n\}_{n=1}^\infty$ is a sequence of nonempty compact sets in a metric space and $K_n\supseteq K_{n+1}$ $\;\forall\,n\in\mathbb{N}$, then $\displaystyle\bigcap_{n=1}^\infty K_n\neq \emptyset$.
> 
> there exists some $N\in\mathbb{N}$ such that $K_N=\emptyset$. 
> 
> That is, if $n\geq N$, $\mathrm{g}_n(x)<\varepsilon$ for every $x\in K$. \
> Hence $f_n\to f$ uniformly on $K$.
:::

:::success
- The result is true if condition (c\) is replaced by $f_n(x)\geq f_{n+1}$.
- The compactness is necessary. You may consider $f_n(x)=\dfrac{1}{nx+1}$ on $(0,1)$.
- The monotonicity is necessary.
:::

---

### Series of Functions

Let $(M,d)$ be a metric space and $(V,\|\cdot\|)$ be a normed space, $A\subseteq M$,and $\mathrm{g}_k,\mathrm{g}:A\to V$ be functions. \
(1) We say that the series $\displaystyle\sum_{k=1}^\infty \mathrm{g}_k$ ==converges pointwise to $\mathrm{g}$ on $A$== 
if the sequence of partial sum $\{S_n\}_{n=1}^\infty$ given by $S_n(x)=\displaystyle\sum_{k=1}^n \mathrm{g}_k(x)$ converges pointwise to $\mathrm{g}$ on $A$. \
(2) We say that $\displaystyle\sum_{k=1}^\infty \mathrm{g}_k$ ==converge to $\mathrm{g}$ uniformly on $A$== 
if $\{S_n\}_{n=1}^\infty$ converges to $\mathrm{g}$ uniformly on $A$.

:::spoiler Example:
For the geometric series $\displaystyle\sum_{k=0}^\infty x^k$,
$$S_n(x)=\sum_{k=0}^n x^k= \begin{cases}
    \frac{1-x^{n+1}}{1-x} &\text{if } x\neq 1 \\
    n+1 &\text{if } x=1
\end{cases}$$
1. For $x\in(-1,1)$, $S_n\to\frac{1}{1-x}$. \
$\Rightarrow$ $\sum_{k=0}^\infty x^k \to \frac{1}{1-x}$ pointwise on $(-1,1)$. 
2. For $x\in(-\infty,1]\cup[1,\infty)$, $\{S_n\}_{n=1}^\infty$ diverges. \
$\Rightarrow$ $\sum_{k=0}^\infty x^k$ diverges.
3. Let $a\in(0,1)$ and $\mathrm{g}(x)=\frac{1}{1-x}$, for $x\in[-a,a]$,
$$|S_n(x)-\mathrm{g}(x)|=\left|\frac{1-x^{n+1}}{1-x}-\frac{1}{1-x}\right|= \left|\frac{x^{n+1}}{1-x}\right|\leq \frac{|a|^{n+1}}{1-a}\to 0\text{ as }n\to\infty$$
Given $\varepsilon>0$, choose $N\in\mathbb{N}$ such that $\dfrac{|a|^{n+1}}{1-a}<\varepsilon$ whenever $n\geq N$. \
Then $|S_n(x)-\mathrm{g}(x)|<\varepsilon$ whenever $x\in[-a,a]$ and $n\geq N$. \
Hence $\sum_{k=0}^\infty x^k$ converges uniformly on $[-a,a]$.
4. $\displaystyle\sum_{k=0}^\infty x^k$ does not converge uniformly on $(-1,1)$ since $\displaystyle\sup_{x\in(-1,1)}|S_n(x)-\mathrm{g}(x)|=\infty$. 
:::

---

**Cauchy Criterion** \
Let $(M,d)$ be a metric space and $(V,\|\cdot\|)$ be a normed space, $A\subseteq M$, and $\mathrm{g}_k:A\to V$ be functions. \
If $\sum_{k=1}^\infty \mathrm{g}_k$ converges uniformly on $A$, then $\forall\,\varepsilon>0$, $\exists\,N\in\mathbb{N}$ such that 
$\left\|\sum_{k=m+1}^n \mathrm{g}_k(x)\right\|<\varepsilon$ whenever $x\in A$ and $n>m\geq N$. \
In addition, if $(V,\|\cdot\|)$ is a Banach space, then the converse holds. 

:::spoiler proof:
> $\implies$: \
> Let $\sum_{k=1}^\infty \mathrm{g}_k$ converge uniformly to $\mathrm{g}$ on $A$. \
> Let $S_n=\sum_{k=1}^n \mathrm{g}_k$ be the partial sum. \
> For $\varepsilon>0$, $\exists\,N\in\mathbb{N}$ such that $\|S_n(x)-\mathrm{g}(x)\|<\frac{\varepsilon}{2}$ 
> whenever $x\in A$ and $n\geq N$. \
> Then for $n>m\geq N$,
> $$\begin{aligned}
>     \left\|\sum_{k=m+1}^n \mathrm{g}_k(x)\right\| &= \|S_n(x)-S_m(x)\| \\
>     &\leq \|S_n(x)-\mathrm{g}(x)\|+\|\mathrm{g}(x)-S_m(x)\| \\
>     &<\frac{\varepsilon}{2}+\frac{\varepsilon}{2} =\varepsilon 
> \end{aligned}$$
> for every $x\in A$.
> 
> $\impliedby \text{ (in Banach space)}$: \
> For $x\in A$, given $\varepsilon>0$, $\exists\,N_{\varepsilon,x}\in\mathbb{N}$ such that 
> $\|S_n(x)-S_m(x)\|=\|\sum_{k=m+1}^n \mathrm{g}_k(x)\|< \varepsilon$ whenever $n>m\geq N_{\varepsilon,x}$. \
> Hence $\{S_n(x)\}_{n=1}^\infty$ is a Cauchy sequence in $V$. \
> Since $(V,\|\cdot\|)$ is complete, $\{S_n(x)\}_{n=1}^\infty$ converges in $V$. \
> Since $x\in A$ is arbitrary, $S_n\to \mathrm{g}=\sum_{k=1}^\infty \mathrm{g}_k$ pointwise on $A$. \
> To check that $S_n\to \mathrm{g}$ uniformly on $A$, given $\varepsilon>0$, \
> $\exists\,N\in\mathbb{N}$ such that $\|S_n(x)-S_m(x)\|<\frac{\varepsilon}{2}$ whenever $x\in A$ and $n>m\geq N$. \
> Since $S_n\to \mathrm{g}$ pointwise on $A$, $\forall\,x\in A$, $\exists\,m_x>N$ such that 
> $\|S_{m_x}(x)-\mathrm{g}(x)\|<\frac{\varepsilon}{2}$. \
> Then for $x\in A$ and $n\geq N$,
> $$\begin{aligned}
>     \|S_n(x)-\mathrm{g}(x)\| &\leq \|S_n(x)-S_{m_x}(x)\|+\|S_{m_x}(x)-\mathrm{g}(x)\| \\
>     &< \frac{\varepsilon}{2}+\frac{\varepsilon}{2} =\varepsilon
> \end{aligned}$$
> Therefore, $S_n\to \mathrm{g}$ uniformly on $A$.
:::

---

If $\sum_{k=1}^\infty \mathrm{g}_k$ converges uniformly on $A$, 
then $\mathrm{g}_k$ converges to $\mathbf{0}$ uniformly on $A$.

---

Let $(M,d)$ be a metric space and $(V,\|\cdot\|)$ be a normed space, $A\subseteq M$, and $\mathrm{g}_k,\mathrm{g}:A\to V$ be functions. \
If $\mathrm{g}_k:A\to V$ are continuous and $\sum_{k=1}^\infty \mathrm{g}_k$ converges to $\mathrm{g}$ uniformly on $A$, then $\mathrm{g}$ is continuous.

---

If $\mathrm{g}_k:[a,b]\to\mathbb{R}$ is integrable on $[a,b]$ and $\mathrm{g}=\sum_{k=1}^\infty \mathrm{g}_k$ converges uniformly on $[a,b]$, then 
$$\begin{aligned}
    \int_a^b \mathrm{g}(x)\,dx = \sum_{k=1}^\infty \int_a^b \mathrm{g}_k(x)\,dx
\end{aligned}$$

---

#### Weirestrass M-test

Let $(M,d)$ be a metric space and $(V,\|\cdot\|)$ be a Banach space, $A\subseteq M$, and $\mathrm{g}_k:A\to V$ be functions. \
Suppose that there exists $M_k>0$ such that $\displaystyle\sup_{x\in A}\|\mathrm{g}_k(x)\|\leq M_k$ whenever $k\in\mathbb{N}$ and $\sum_{k=1}^\infty M_k$ converges. \
Then $\displaystyle\sum_{k=1}^\infty \mathrm{g}_k :A\to V$ converges uniformly and absolutely on $A$. \
That is, $\displaystyle\sum_{k=1}^\infty \|\mathrm{g}_k\|: A\to\mathbb{R}$ converges uniformly on $A$.

:::spoiler proof:
> We intend to show that $\{S_n\}_{n=1}^\infty$ given by $S_n=\sum_{k=1}^n \mathrm{g}_k$ satisfies the Cauchy criterion. \
> Since $\sum_{k=1}^\infty M_k$ converges, given $\varepsilon>0$, $\exists\,N\in\mathbb{N}$ such that 
> $\sum_{k=m+1}^n M_k<\varepsilon$ whenever $n>m\geq N$. \
> Thus 
> $$\begin{aligned}
>     \sup_{x\in A}\|S_n(x)-S_m(x)\| &=\sup_{x\in A}\big\|\sum_{k=m+1}^n \mathrm{g}_k(x)\big\| \\
>     &\leq \sup_{x\in A}\sum_{k=m+1}^n \|\mathrm{g}_k(x)\| \\
>     &\leq \sum_{k=m+1}^n \sup_{x\in A} \|\mathrm{g}_k(x)\| \\
>     &\leq \sum_{k=m+1}^n M_k \\
>     &< \varepsilon
> \end{aligned}$$
> Hence $\{S_n\}_{n=1}^\infty$ converges uniformly on $A$.
> 
> Consider the sequence of functions $\|\mathrm{g}_k\|:A\to\mathbb{R}$. \
> Let $T_n(x)=\sum_{k=1}^n \|\mathrm{g}_k(x)\|$. \
> For $n>m\geq N$,
> $$\begin{aligned}
>     \sup_{x\in A}|T_n(x)-T_m(x)| &= \sup_{x\in A}\sum_{k=m+1}^n \big\|\mathrm{g}_k(x)\big\| \\
>     &\leq \sum_{k=m+1}^n \sup_{x\in A}\|\mathrm{g}_k(x)\| \\
>     &\leq \sum_{k=m+1}^n M_k \\
>     &<\varepsilon
> \end{aligned}$$
> Therefore $\{T_n\}_{n=1}^\infty$ converges uniformly on $A$ and hence $\sum_{k=m+1}^\infty \|\mathrm{g}_k(x)\|$ converges uniformly on $A$.
:::

---

:::spoiler Example of a continuous and nowhere differentiable function

In $(\mathbb{R},|\cdot|)$, define $\phi(x)=|x|$ on $[-1,1]$ and extend $\phi$ to a $2$-periodic function (still called $\phi$). \
Then for $s,t\in\mathbb{R}$, $|\phi(s)-\phi(t)|\leq |s-t|$ ... (a). \
Define $f(x)=\displaystyle\sum_{n=0}^\infty \left(\frac{3}{4}\right)^n \phi\left(4^n x\right)$. \
$\left(\frac{3}{4}\right)^n\phi(4^n x)$ is continuous for every $n\in\mathbb{N}$. \
Since $0\leq \phi(x)\leq 1$, by M-test, the series converges uniformly on $\mathbb{R}$. \
Then $f$ is continuous on $\mathbb{R}$.

To prove that $f$ is nowhere differentiable, suppose $x\in \mathbb{R}$. \
We want to show that $\displaystyle\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ does not exist. \
Fix $m\in\mathbb{N}$ and let $\delta_m=\pm\frac{1}{2}\cdot 4^{-m}$ where the sign is chosen such that 
$\mathbb{Z}\cap \big(4^m x, 4^m(x+\delta_m)\big)=\emptyset$ or $\mathbb{Z}\cap\big(4^m(x+\delta_m),4^m x\big)=\emptyset$. \
Then the interval would contain no interger.

Define $\displaystyle r_n=\frac{\phi(4^n(x+\delta_m))-\phi(4^n x)}{\delta_m}$. \
When $n>m$, $4^n \delta_m= \pm\frac{1}{2} 4^{n-m}$ is an even interger. \
Since $\phi$ is periodic by $2$, $\phi(4^n(x+\delta_m))-\phi(4^n x)=0$ and $r_n=0$. \
When $0\leq n\leq m$, by (a), $|r_n|=\displaystyle\frac{\left|4^n(x+\delta_m)-4^n x\right|}{\delta_m} =4^n$ and 
$\phi(4^m(x+\delta_m))-\phi(4^m x)= \pm r^m\delta_m$. \
$\Rightarrow$ $|r_m|=4^m$

Thus
$$\begin{aligned}
    \left|\frac{f(x+\delta_m)-f(x)}{\delta_m}\right| &= \left|\sum_{n=0}^m\left(\frac{3}{4}\right)^n r_n\right| \\
    &\geq \left(\frac{3}{4}\right)^m |r_m| - \left|\sum_{n=0}^{m-1}\left(\frac{3}{4}\right)^n r_n\right| \\
    &\geq 3^m-\sum_{n=0}^{m-1}3^n \\
    &=\frac{1}{2}(3^m+1) \to\infty \text{ as }m\to\infty
\end{aligned}$$
As $m\to\infty$, $\delta_m\to 0$, we have $\displaystyle\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ does not exist and hence $f$ is not differentiable at $x$.
:::

---

||domain|$f_k$|convergence|$f$|range|
|:-:|:-:|:-:|:-:|:-:|:-:|
|||continuous|uniformly|**<font color="#0077c0">continuous</font>**|
||$[a,b]$|integrable <br> **<font color="#0077c0">$\displaystyle\int\lim_{k\to\infty}=\lim_{k\to\infty}\int$</font>**|uniformly|||
|$\text{Dini}$|compact|continuous <br> monotone|pointwise <br> **<font color="#0077c0">uniformly</font>**|continuous|$\mathbb{R}$|
||$[a,b]$|integrable <br> monotone <br> **<font color="#0077c0">$\displaystyle\int\lim_{k\to\infty}=\lim_{k\to\infty}\int$</font>**|pointwise|integrable|$\mathbb{R}$|
||$[a,b]$|integrable <br> bounded <br> **<font color="#0077c0">$\displaystyle\int\lim_{k\to\infty}=\lim_{k\to\infty}\int$</font>**|pointwise|integrable|$\mathbb{R}$|

- where *integrable* means *Riemann integrable*
- where *monotone* means $f_n(x)\leq f_{n+1}(x) \,\vee\, f_n(x)\geq f_{n+1}(x) \quad \forall\,n\in\mathbb{N}, x\in D_{f_n}$

---

### Power Series

We called a series of the form $$\sum_{k=0}^\infty c_k(x-a)^k$$ a ==power series centered at $a$== 
for some $\{c_k\}_{k=0}^\infty \subseteq\mathbb{R}$ and $a\in\mathbb{R}$.

If $a=0$, it is called a ==Maclaurin series==.

---

Let $\sum_{k=0}^\infty c_k(x-a)^k$ be a power series in $\mathbb{R}$. \
Suppose that the series converges at some $b\neq a$. \
Define $h=|b-a|$. \
Then the series converges on $(a-h,a+h)$. \
Moreover, the series converges uniformly on $[\alpha,\beta]$ if $[\alpha,\beta]\subseteq (a-h,a+h)$.

:::spoiler proof:
> WLOG, let $a=0$ and $\sum_{k=0}^\infty c_k x^k$ converge at $b\neq 0$. \
> Then $h=|b|$. \
> Since $\sum_{k=0}^\infty c_k b^k$ converges, $\displaystyle\lim_{k\to\infty}|c_k b^k| =\lim_{k\to\infty}|c_k|h^k =0$. \
> $\Rightarrow$ $\exists\,N\in\mathbb{N}$ such that $|c_k|h^k<1$ whenever $k\geq N$ \
> $\Rightarrow$ $|c_k|<\frac{1}{h^k}$ for every $k\geq N$
> 
> For $x_0\in(-h,h)$,
> $$\begin{aligned}
>     \sum_{k=N}^\infty |c_k x_0^k| &= \sum_{k=N}^\infty |c_k||x_0|^k \\
>     &\leq \sum_{k=N}^\infty \frac{1}{h^k}|x_0|^k \\
>     &=\sum_{k=N}^\infty \left(\frac{|x_0|}{h}\right)^k \\
>     &< \infty \qquad \text{(geometric series)}
> \end{aligned}$$
> Then $\sum_{k=0}^\infty c_k x_0^k$ would converge absolutely and hence converges. \
> Thus $\sum_{k=0}^\infty c_k x^k$ converges pointwise on $(-h,h)$.
> 
> Suppose $[\alpha,\beta]\subseteq(-h,h)$. \
> Since $(-h,h)$ is open, choose $\delta>0$ such that $[\alpha,\beta]\subseteq(-h+\delta,h-\delta)\subseteq(-h,h)$. \
> Then for $x_0\in[\alpha,\beta]$, $\frac{|x_0|}{h}< 1-\frac{\delta}{h}$. \
> Hence, for $\varepsilon>0$ and $n>m\geq N$,
> $$\begin{aligned}
>     \left|\sum_{k=m+1}^n c_k x_0^k\right|&\leq\sum_{k=m+1}^n \left|c_kx_0^k\right| \\
>     &\leq\sum_{k=m+1}^n |c_k|h^k(1-\frac{\delta}{h})^k \\
>     &<\varepsilon \quad\text{ as }m,n \text{ sufficiently large} 
> \end{aligned}$$
> Therefore, $\sum_{k=0}^\infty c_k x^k$ converges uniformly on $[\alpha,\beta]$.
:::

---

$R>0$ is called the ==radius of convergence== of the power series $\sum_{k=0}^\infty c_k(x-a)^k\subseteq\mathbb{R}$ if 
the series converges for every $x\in(a-R,a+R)$ and diverges for all $x\in(-\infty,a-R)\cup(a+R,\infty)$.

$R=\displaystyle\sup\left\{r\geq 0 \;\middle\vert\; \sum_{k=0}^\infty c_k(x-a)^k \text{ converges in } [a-r,a+r]\right\}$

---

By ratio test, consider the series $\sum_{k=0}^\infty x_k$,
$$\begin{aligned}
    \limsup_{k\to\infty}\left|\frac{x_{k+1}}{x_k}\right|<1 &\implies \text{ the series converges} \\
    \liminf_{k\to\infty}\left|\frac{x_{k+1}}{x_k}\right|>1 &\implies \text{ the series diverges}
\end{aligned}$$

---

Let $\sum_{k=0}^\infty c_k(x-a)^k\subseteq\mathbb{R}$ be a power series. \
If $\displaystyle\lim_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|$ converges, then the radius of convergence of the power series is $\displaystyle\lim_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|$.

:::spoiler proof:
> For $x\neq a$, let $c_k(x-a)^k=b_k$. \
> Then $\left|\frac{b_{k+1}}{b_k}\right|= \left|\frac{c_{k+1}}{c_k}\right||x-a|$. \
> Consider
> $$\begin{aligned}
> \limsup_{k\to\infty}\left|\frac{c_{k+1}}{c_k}\right||x-a|<1 &\iff |x-a|<\frac{1}{\displaystyle\limsup_{k\to\infty}\left|\frac{c_{k+1}}{c_k}\right|} = \liminf_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right| \\
> \liminf_{k\to\infty}\left|\frac{c_{k+1}}{c_k}\right||x-a|>1 &\iff |x-a|<\frac{1}{\displaystyle\liminf_{k\to\infty}\left|\frac{c_{k+1}}{c_k}\right|} = \limsup_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|
> \end{aligned}$$
> 
> If $\displaystyle\lim_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|$ converges, then
> $$\lim_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|= \limsup_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|= \liminf_{k\to\infty}\left|\frac{c_k}{c_{k+1}}\right|= R$$
:::

---

Let $\sum_{k=0}^\infty c_k(x-a)^k \subseteq\mathbb{R}$ be a power series with the radius of convergence $R$, and $[\alpha,\beta]\subseteq(a-R,a+R)$. \
Then the series $\sum_{k=0}^\infty (k+1)c_{k+1}(x-a)^k$ converges pointwise on $(a-R,a+R)$ and converges uniformly on $[\alpha,\beta]$.

:::warning
updating...
:::
proof:
Select $h>0$ such that $[\alpha,\beta]\subseteq[a-h,a+h]\subseteq(a-R,a+R)$. \
Then $r=\frac{|x-a|}{h}<1$. \
Since $a+h\in(a-R,a+R)$, $\sum_{k=0}^\infty \big((a+h)-a\big)^k=\sum_{k=0}^\infty c_k h^k$ converges. \
$\Rightarrow$ $\displaystyle\lim_{k\to\infty}|c_k h^k|=0$ \
$\Rightarrow$ $\exists\,N\in\mathbb{N}$ such that $|c_k h^k|<1$ whenever $k\geq N$. \
Then
$$\begin{aligned}
    \sum_{k=N}^\infty \left|(k+1)c_k(x-a)^k\right| &= \sum_{k=N}^\infty (k+1)|c_k h^k|\left(\frac{|x-a|}{h}\right)^k \\
    &< \sum_{k=N}^\infty (k+1)r^k \\
    &<\infty \quad( r>1)
\end{aligned}$$
By Weirestrass M-test, $\sum_{k=0}^\infty (k+1)c_{k+1}(x-a)^k$ converges uniformly on $[\alpha,\beta]$.

Suppose $x\in (a-R,a+R)$. \
Choose $\delta>0$ such that $x\in[a-R+\delta,a+R-\delta]$. \
Since $\sum_{k=0}^\infty (k+1)c_{k+1}(x-a)^k$ converges uniformly on $[\alpha,\beta]$, it converges pointwise at $x$. \
Hence $\sum_{k=0}^\infty (k+1)c_{k+1}(x-a)^k$ converges pointwise on $(a-R,a+R)$.

---

Let $\sum_{k=0}^\infty c_k(x-a)^k \subseteq\mathbb{R}$ be a power series with the radius of convergence $R$, and $[\alpha,\beta]\subseteq(a-R,a+R)$. \
Then the series is differentiable on $(a-R,a+R)$. \
Moreover,
$$\frac{d}{dx}\sum_{k=0}^\infty c_k(x-a)^k = \sum_{k=0}^\infty \frac{d}{dx} c_k(x-a)^k = \sum_{k=1}^\infty kc_k(x-a)^{k-1}$$

:::success
Since the differentiation is still a power series, it is also differentiable. \
By mathematical induction, a power series is infinitely differentiable.
:::

---

Let $\sum_{k=0}^\infty c_k(x-a)^k$ be a power series with radius of convergence $R$ 
and $[\alpha,\beta]\subseteq(a-R,a+R)$. \
Then the power series $\sum_{k=0}^\infty c_k(x-a)^k$ is integrable on $[\alpha,\beta]$. \
Moreover,
$$\int_\alpha^\beta \sum_{k=0}^\infty c_k(x-a)^k\,dx = \sum_{k=0}^\infty \int_\alpha^\beta c_k(x-a)^k\,dx$$

---

:::spoiler Example 1
The function $e^x=\sum_{k=0}^\infty \frac{x^k}{k!}$ converges on $\mathbb{R}$. \
Then 
$$\begin{aligned}
    \int_0^t e^x\,dx &= \int_0^t \sum_{k=0}^\infty \frac{x^k}{k!}\,dx \\
    &=\sum_{k=0}^\infty \int_0^t \frac{x^k}{k!}\,dx \\
    &=\left. \sum_{k=0}^\infty \frac{x^{k+1}}{(k+1)!} \right|_0^t \\
    &=\sum_{k=1}^\infty \frac{t^k}{k!} \\
    &=\left(\sum_{k=0}^\infty \frac{t^k}{k!}\right) -1 = e^t-1
\end{aligned}$$
:::


:::spoiler Example 2
The series $\sum_{k=1}^\infty \frac{x^k}{k}$ converges on $(-1,1)$. \
Hence, for $x\in(-1,1)$,
$$\begin{aligned}
    \frac{d}{dx}\sum_{k=1}^\infty \frac{x^k}{k} &= \sum_{k=1}^\infty x^{k-1} \\
    &= \sum_{k=0}^\infty x^k =\frac{1}{1-x}
\end{aligned}$$

For $x\in (-1,1)$,
$$\begin{aligned}
    \sum_{k=1}^\infty \frac{x^k}{k} &= \int_0^x \frac{d}{dt}\sum_{k=1}^\infty \frac{t^k}{k}\,dt \quad\text{ by F.T.C.} \\
    &=\int_0^x \frac{1}{1-t}\,dt = -\ln(1-x)
\end{aligned}$$

Moreover, we may consider $x=-1$. \
$\sum_{k=1}^\infty \frac{(-1)^k}{k}$ converges by alternating series test. \
We want to show that $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n \frac{(-1)^k}{k} =-\ln 2$. \
First,
$$\frac{d}{dt}\sum_{k=1}^n \frac{t^k}{k} = \sum_{k=0}^{n-1} t^k = \frac{1-t^n}{1-t} = \frac{1}{1-t}-\frac{t^n}{1-t}$$
and
$$\sum_{k=1}^n \frac{(-1)^k}{k} = \int_{-1}^0 \frac{d}{dt}\sum_{k=1}^n \frac{t^k}{k}\,dt = \int_{-1}^0\frac{1}{1-t}\,dt-\int_{-1}^0\frac{t^n}{1-t}\,dt$$
Then
$$\begin{aligned}
    \left|\sum_{k=1}^n \frac{(-1)^k}{k}-(-\ln 2)\right| &= \left|\int_{-1}^0\frac{1}{1-t}\,dt-(-\ln 2)\right| + \left|\int_{-1}^0\frac{t^n}{1-t}\,dt\right| \\
    &< 0+\left|\int_{-1}^0 t^n\,dt\right| \\
    &=\frac{1}{n+1} \quad \to 0 \text{ as } n\to\infty
\end{aligned}$$
Therefore $\sum_{k=1}^\infty \frac{(-1)^k}{k}=-\ln 2$ and the series converges on $[-1,1)$.
:::


:::spoiler Example 3 

Find a function y satisfying $y''(x)+y(x)=0$. 

Solution (without complete verification): \
Suppose that a solution in the form of power series at $0$, say $y(x)=\sum_{k=0}^\infty c_k x^k$. \
Assume that the series converges on some $(-\delta,\delta)$. \
Then $y'(x)=\sum_{k=1}^\infty kc_{k}x^{k-1}$ and $y''(x)= \sum_{k=2}^\infty k(k-1)c_k x^{k-2}$. \
From the formula, we obtain
$$\begin{aligned}
    0 &= \sum_{k=2}^\infty k(k-1)c_k x^{k-2} + \sum_{k=0}^\infty c_k x^k \\
    &=\sum_{k=0}^\infty \left[(k+2)(k+1)c_{k+2}+c_k\right] x^k
\end{aligned}$$
The coefficients satisfy $(k+2)(k+1)c_{k+1}+c_k=0$ for $k=0,1,2,\dotsc$ and thus the recurrence ralation $c_{k+2}=-\frac{c_k}{(k+1)(k+2)}$.

Hence we have $c_k=\begin{cases}
    \frac{(-1)^{k/2}}{k!}c_0 &k\text{ is even} \\
    \frac{(-1)^{\lfloor k/2\rfloor}}{k!}c_1 &k\text{ is odd}
\end{cases}$. \
Therefore, 
$$\begin{aligned}
    y &= c_0\left[1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots+\frac{(-1)^n}{(2n)!}x^{2n}+\cdots\right] 
    + c_1\left[x-\frac{x^3}{3!}+\frac{x^5}{5!}+\cdots+\frac{(-1)^n}{(2n+1)!}+\cdots\right] \\
    &= c_0 \cos x +c_1 \sin x
\end{aligned}$$
:::

---

### Taylor Series

Suppose that $f$ is a function such that $f'(a),f''(a),\dotsc,f^{(n)}(a)$ exist. \
Define $P_{n,a,f}(x)= c_0+c_1(x-a)+c_2(c-a)^2+\cdots+c_n(x-a)^n$ where $c_k=\frac{f^{(k)}(a)}{k!}$. \
$P_{n,a,f}$ is called the ==Taylor polynomial== of degree $n$ for $f$ at $a$.

---

Suppose that $f$ is a function such that $f'(a)$, $f''(a)$,$\dotsc$,$f^{(n)}(a)$ exist. \
Then
$$\lim_{x\to a}\frac{f(x)-P_{n,a}(x)}{(x-a)^n}=0$$

:::spoiler proof:
> For $x\neq a$,
> $$\frac{f(x)-P_{n,a}(x)}{(x-a)^n}= \frac{f(x)-\sum_{k=0}^{n-1}\frac{f^{(k)}(a)}{k!}(x-a)^k}{(x-a)^n} - \frac{f^{(n)}(a)}{n!}$$
> Let $Q(x)=f(x)-\sum_{k=0}^{n-1}\frac{f^{(k)}(a)}{k!}(x-a)^k$ and $\mathrm{g}(x)=(x-a)^n$.\
> Then for $1\leq i\leq n-1$,
> $$Q^{(i)}(x)= f^{(i)}(x)-f^{(i)}(a)-\frac{f^{(i+1)}(a)}{1!}\,(x-a)-\cdots-\frac{f^{(n-1)}(a)\,(x-a)^{n-1-i}}{(n-1-i)!}$$
> Hence $\displaystyle\lim_{x\to a}Q^{(i)}(x)=0$ for $i=0,1,2,\dotsc,n-1$. \
> On the other hand, $g^{(i)}(x)=n(n-1)\cdots(n-i+1)(x-a)^{n-i}$ and hence $\displaystyle\lim_{x\to a}g^{(i)}(x)=0$ for $i=0,1,2,\dotsc,n-1$. \
> Use L'Hôpital's Rule $n-1$ times,
> $$\begin{aligned}
>     \lim_{x\to a}\frac{f(x)-P_{n,a}(x)}{(x-a)^n} &= \lim_{x\to a}\frac{Q(x)}{g(x)}-\frac{f^{(n)}(a)}{n!} \\
>     &= \lim_{x\to a} \frac{Q'(x)}{g'(x)}-\frac{f^{(n)}(a)}{n!} \\
>     &\quad\quad\vdots \\
>     &=\lim_{x\to a}\frac{Q^{(n-1)}(x)}{g^{(n-1)}(x)} - \frac{f^{(n)}(a)}{n!} \\
>     &=\lim_{x\to a} \frac{f^{(n-1)}(x)-f^{(n-1)}(a)}{n!\,(x-a)} - \frac{f^{(n)}(a)}{n!} \\
>     &=0
> \end{aligned}$$
:::

---

Let $P$, $Q$ be two polynomials in $(x-a)$ of degree less than or equal to $n$. \
Suppose that $P$ and $Q$ are equal up to order $n$ at $a$.\
Then $P=Q$.

---

Suppose that $f$ has first derivative at $a$ and $P$ is a polynomial on $(x-a)$ of degree less than or equal to $n$ 
which equals $f$ up to order $n$ at $a$. \
Then $P(x)=P_{n,a,f}(x)$.

---

Let $f$ be a $n+1$ times differentiable function. \
We define the remainder term $R_{n,a}(x)$ by $R_{n,a}(x)=f(x)-P_{n,a}(x)$. \
Then
$$R_{n,a}(x)=\int_a^x \frac{f^{(n+1)}(t)}{n!}\,(x-t)^n\,dt$$

:::spoiler proof:
> $$\begin{aligned}
>     f(x) &=\underbrace{f(a)}_{P_{0,a}(x)} + \underbrace{\int_a^x f'(t)\,dt}_{R_{0,a}(x)} \quad (\text{F.T.C.}) \\
>     &=f(a)+\left.f'(t)\cdot t\right|_a^x-\int_a^x f''(t)\,dt \quad (\text{integration by parts}) \\
>     &=f(a)+f'(x)\cdot x-f'(a)\cdot a-\int_a^xf''(t)\,t\,dt \\
>     &=f(a)+f'(a)(x-a)-f'(a)\cdot x+f'(x)\cdot x-\int_a^x f''(t)\,t\,dt \\
>     &=f(a)+f'(a)(x-a)+x\int_a^x f''(t)\,dt-\int_a^x f''(t)\,t\,dt \\
>     &=\underbrace{f(a)+f'(a)(x-a)}_{P_{1,a}(x)} + \underbrace{\int_a^x f''(t)(x-t)\,dt}_{R_{1,a}(x)} \\
>     &=f(a)+f'(a)(x-a)-\left.f''(t)\frac{(x-t)^2}{2}\right|_a^x+\int_a^x \frac{f'''(t)}{2}(x-t)^2\,dt \quad (\text{integration by parts})\\
>     &=\underbrace{f(a)+f'(a)(x-a)+\frac{f''(a)}{2}(x-a)^2}_{P_{2,a}(x)} + \underbrace{\int_a^x \frac{f'''(t)}{2}(x-t)^2\,dt}_{R_{2,a}(x)}
> \end{aligned}$$
> By induction, if $f^{(n+1)}$ is continuous on $[a,x]$, then
> $$R_{n,a}(x)=\int_a^x \frac{f^{(n+1)}(t)}{n!}(x-t)^n\,dt$$
:::

---

Let $f$ be a $n+1$ times differentiable function on $[a,x]$ and $R_{n,a}(x)$ be defined by 
$f(x)=f(a)+f'(a)\,(x-a)+\cdots+\frac{f^{(n)}(a)}{n!}\,(x-a)^n+R_{n,a}(x)$. \
Then
- Cauchy form
$$R_{n,a}(x)=\frac{f^{(n+1)}(\xi)}{n!}\,(x-\xi)(x-a) \text{ for some } \xi\in (a,x)$$
- Lagrange form
$$R_{n,a}(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\,(x-a)^{n+1} \text{ for some } \xi\in (a,x)$$
- Integral form
$$R_{n,a}(x)= \int_a^x \frac{(n+1)}{n!}\,(x-t)^n\,dt$$

The $\xi$ are usually different in Cauchy form and Lagrange form. \
$\xi$ depends on $a$ and $x$.

In Lagrange form, if $|f^{(n+1)}(t)|<M$ for all $t\in[a,x]$, then $|R_{n,a}(x)|\leq M\frac{|x-a|^{n+1}}{(n+1)!}$.

In intergral form, if $|f^{(n+1)}(t)|<M$ for all $t\in[a,x]$, then 
$|R_{n,a}(x)|\leq\frac{M}{n!}\left|\int_a^x (x-t)^n\,dt\right|\leq \frac{M}{(n+1)!}\left|\left.-(x-t)^{n+1}\right|_a^x\right|=\frac{M}{(n+1)!}\,|x-a|^{n+1}$.

---

Let $f:(\alpha,\beta)\to\mathbb{R}$ be an infinitely differentiable function and $a\in (\alpha,\beta)$.

1. For every $n\in\mathbb{N}$ and $x\in (\alpha,\beta)$,
$$f(x)=\sum_{k=0}^n \frac{f^{(k)}(a)}{k!}\,(x-a)^k+ \int_a^x\frac{f^{(n+1)}(t)}{n!}(x-t)^n\,dt$$

2. Moreover, for some $0<h<\infty$ such that $(a-h,a+h)\subseteq(\alpha,\beta)$, 
suppose that $\exists\,M>0$ such that $|f^{(k)}(x)|\leq M$ for all $x\in (a-h,a+h)$ and $k\in\mathbb{N}$. \
Then 
$$f(x)=\sum_{k=0}^\infty \frac{f^{(k)}(a)}{k!}\,(x-a)^k \text{ for all } x\in (a-h,a+h)$$


:::spoiler proof of 2:
> Let $S_n(x)=\displaystyle\sum_{k=0}^n \frac{f^{(k)}(a)}{k!}\,(x-a)^k$. \
> For $x\in (a-h,a+h)$,
> $$\begin{aligned}
>     |S_n(x)-f(x)|&\leq \left|\int_a^x\frac{f^{(n+1)}(t)}{n!}(x-t)^n\,dt \right| \\
>     &\leq\frac{M}{h!}\, h^n \left|\int_a^x 1\,dt \right| \\
>     &=\frac{M}{h!}\, h^n |x-a| \\
>     &\leq \frac{M}{n!}\, h^{n+1} \quad \to 0 \text{ as } n\to\infty
> \end{aligned}$$
> Hence $\{S_n(x)\}_{n=1}^\infty$ converges to $f(x)$ uniformly on $(a-h,a+h)$. \
> We obtain $f(x)=\displaystyle\sum_{k=0}^\infty \frac{f^{(k)}(a)}{k!}$ uniformly on $(a-h,a+h)$.
:::

---

