# Completeness

> *Definition 1*: a sequence $(x_n)_{n \in \mathbb{N}}$ in a metric space $(X,d)$ is a **Cauchy sequence** if 
>
> $$
>   \forall \varepsilon > 0 \exists N \in \mathbb{N} \forall n,m > N: \quad d(x_n, x_m) < \varepsilon.
> $$

A convergent sequence $(x_n)_{n \in \mathbb{N}}$ in a metric space $(X,d)$ is always a Cauchy sequence since 

$$
    \forall \varepsilon > 0 \exists N \in \mathbb{N}: \quad d(x_n, x) < \frac{\varepsilon}{2}, 
$$

for all $n > N$. By axiom 4 of the definition of a metric space we have for $m, n > N$

$$
    d(x_m, x_n) \leq d(x_m, x) + d(x, x_n) < \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon,
$$

showing that $(x_n)$ is Cauchy.

> *Definition 2*: a metric space $(X,d)$ is **complete** if every Cauchy sequence in $X$ is convergent.

Therefore, in a complete metric space every Cauchy sequence is a convergent sequence.

> *Proposition 1*: let $M \subset X$ be a nonempty subset of a metric space $(X,d)$ and let $\overline M$ be the closure of $M$, then
>
> 1. $x \in \overline M \iff \exists (x_n)_{n \in \mathbb{N}} \text{ in } M: x_n \to x$,
> 2. $M \text{ is closed } \iff M = \overline M$. 

??? note "*Proof*:"

    To prove statement 1, let $x \in \overline M$. If $x \notin M$ then $x$ is an accumulation point of $M$. Hence, for each $n \in \mathbb{N}$ the ball $B(x,\frac{1}{n})$ contains an $x_n \in M$ and $x_n \to x$ since $\frac{1}{n} \to 0$ as $n \to \infty$. Conversely, if $(x_n)_{n \in \mathbb{N}}$ is in $M$ and $x_n \to x$, then $x \in M$ or every neighbourhood of $x$ contains points $x_n \neq x$, so that $x$ is an accumulation point of $M$. Hence $x \in \overline M$. 

    Statement 2 follows from statement 1.

We have that the following statement is equivalent to statement 2: $x_n \in M: x_n \to x \implies x \in M$. 

> *Proposition 2*: let $M \subset X$ be a subset of a complete metric space $(X,d)$, then
>
> $$
>   M \text{ is complete} \iff M \text{ is a closed subset of } X
> $$

??? note "*Proof*:"

    Let $M$ be complete, by proposition 1 statement 1 we have that 

    $$
        \forall x \in \overline M \exists (x_n)_{n \in \mathbb{N}} \text{ in } M: x_n \to x.
    $$

    Since $(x_n)$ is Cauchy and $M$ is complete, $x_n$ converges in $M$ with the limit being unique by statement 1 in [lemma 1](). Hence, $x \in M$ which proves that $M$ is closed because $x \in \overline M$ has been chosen arbitrary.

    Conversely, let $M$ be closed and $(x_n)$ Cauchy in $M$. Then $x_n \to x \in X$ which implies that $x \in \overline M$ by statement 1 in proposition 1, and $x \in M$ since $M = \overline M$ by assumption. Hence, the arbitrary Cauchy sequence $(x_n)$ converges in $M$.

> *Proposition 3*: let $T: X \to Y$ be a map from a metric space $(X,d)$ to a metric space $(Y,\tilde d)$, then
> 
> $$
>   T \text{ is continuous in } x_0 \in X \iff x_n \to x_0 \implies T(x_n) \to T(x_0),
> $$
>
> for any sequence $(x_n)_{n \in \mathbb{N}}$ in $X$ as $n \to \infty$. 

??? note "*Proof*:"

    Suppose $T$ is continuous at $x_0$, then for a given $\varepsilon > 0$ there is a $\delta > 0$ such that

    $$
        \forall \varepsilon > 0 \exists \delta > 0: \quad d(x, x_0) < \delta \implies \tilde d(Tx, Tx_0) < \varepsilon.
    $$

    Let $x_n \to x_0$ then 

    $$
        \exists N \in \mathbb{N} \forall n > N: \quad d(x_n, x_0) < \delta.
    $$

    Hence,

    $$
        \forall n > N: \tilde d(Tx_n, Tx_0) < \varepsilon.
    $$

    Which means that $T(x_n) \to T(x_0)$. 

    Conversely, suppose that $x_n \to x_0 \implies T(x_n) \to T(x_0)$ and $T$ is not continuous. Then

    $$
        \exists \varepsilon > 0: \forall \delta > 0 \exists x \neq x_0: \quad d(x, x_0) < \delta \quad \text{ however } \quad \tilde d(Tx, Tx_0) \geq \varepsilon,
    $$

    in particular, for $\delta = \frac{1}{n}$ there is a $x_n$ satisfying 

    $$
        d(x_n, x_0) < \frac{1}{n} \quad \text{ however } \quad \tilde d(Tx_n, Tx_0) \geq \varepsilon,
    $$

    Clearly $x_n \to x_0$ but $(Tx_n)$ does not converge to $Tx_0$ which contradicts $Tx_n \to Tx_0$. 

## Completeness proofs

To show that a metric space $(X,d)$ is complete, one has to show that every Cauchy sequence in $(X,d)$ has a limit in $X$. This depends explicitly on the metric on $X$.

The steps in a completeness proof are as follows

1. take an arbitrary Cauchy sequence $(x_n)_{n \in \mathbb{N}}$ in $(X,d)$,
2. construct for this sequence a candidate limit $x$,
3. prove that $x \in X$,
4. prove that $x_n \to x$ with respect to metric $d$.

> *Proposition 4*: the Euclidean space $\mathbb{R}^n$ with $n \in \mathbb{N}$ and the metric $d$ defined by
>
> $$
>   d(x,y) = \sqrt{\sum_{j=1}^n \big(x(j) - y(j) \big)^2},
> $$
>
> for all $x,y \in \mathbb{R}^n$ is complete.

??? note "*Proof*:"

    Let $(x_m)_{m \in \mathbb{N}}$ be a Cauchy sequence in $(\mathbb{R}^n, d)$, then we have

    $$
        \forall \varepsilon > 0 \exists N \in \mathbb{N}: \forall m, k > N: d(x_m, x_k) = \sqrt{\sum_{j=1}^n \big(x_m(j) - x_k(j) \big)^2} < \varepsilon,
    $$

    obtains for all $j \in \mathbb{N}$: $|x_m(j) - x_k(j)| < \varepsilon$. 

    Which shows that $(x_m(j))_{m \in \mathbb{N}}$ is a Cauchy sequence in $\mathbb{R}$. Suppose that it converged by $x_m(j) \to x(j)$ as $(m \to \infty)$ then $x \in \mathbb{R}^n$ since $x = \big(x(1), \dots, x(n)\big)$. 

    Thus for $(k \to \infty)$ we have 

    $$
        d(x_m, x) < \varepsilon \implies x_m \to x,
    $$

    which implies that $\mathbb{R}^n$ is complete.

A similar proof exists for the completeness of the Unitary space $\mathbb{C}^n$. 

> *Proposition 5*: the space $C([a,b])$ of all **real-valued continuous functions** on a closed interval $[a,b]$ with $a<b \in \mathbb{R}$ with the metric $d$ defined by
>
> $$
>   d(x,y) = \max_{t \in [a,b]} |x(t) - y(t)|,
> $$
>
> for all $x, y \in C$ is complete.

??? note "*Proof*:"

    Let $(x_n)_{n \in \mathbb{N}}$ be a Cauchy sequence in $(C,d)$, then we have

    $$
        \forall \varepsilon > 0 \exists N \in \mathbb{N}: \forall n, m > N: d(x_n, x_m) = \max_{t \in [a,b]} |x_n(t) - x_m(t)| < \varepsilon,
    $$

    obtains for all $t \in [a,b]$: $|x_n(t) - x_m(t)| < \varepsilon$. 

    Which shows that $(x_m(t))_{m \in \mathbb{N}}$ for fixed $t \in [a,b]$ is a Cauchy sequence in $\mathbb{R}$. Since $\mathbb{R}$ is complete the sequence converges; $x_m(t) \to x(t)$ as $m \to \infty$. 

    Thus, for $m \to \infty$ we have

    $$
        d(x_n, x) = \max_{t \in [a,b]} | x_n(t) - x(t) | < \varepsilon,
    $$

    hence $\forall t \in [a,b]: | x_n(t) - x(t) < \varepsilon$, obtaining convergence to $x_n \to x$ as $n \to \infty$ and $x \in C$ which implies that $C$ is complete.

While $C$ with a metric $d$ defined by 

$$
    d(x,y) = \int_a^b |x(t) - y(t)| dt,
$$

for all $x,y \in C$ is incomplete.

??? note "*Proof*:"

    Will be added later.

> *Proposition 6*: the space $l^p$ with $p \geq 1$ and the metric $d$ defined by
>
> $$
>   d(x,y) = \Big(\sum_{j \in \mathbb{N}} | x(j) - y(j) |^p\Big)^\frac{1}{p},
> $$
>
> for all $x,y \in l^p$ is complete.

??? note "*Proof*:"

    Let $(x_n)_{n \in \mathbb{N}}$ be a Cauchy sequence in $(l^p,d)$, then we have

    $$
        \forall \varepsilon > 0 \exists N \in \mathbb{N}: n, m > N: d(x_n, x_m) = \Big(\sum_{j \in \mathbb{N}} |x_n(j) - x_m(j)|^p\Big)^\frac{1}{p} < \varepsilon,
    $$

    obtains for all $j \in \mathbb{N}$: $|x_n(j) - x_m(j)| <\varepsilon$.

    Which shows that $(x_m(j))_{m \in \mathbb{N}}$ for fixed $j \in \mathbb{N}$ is a Cauchy sequence in $\mathbb{C}$. Since $\mathbb{C}$ is complete the sequence converges; $x_m(j) \to x(j)$ as $m \to \infty$. 

    Thus, for $m \to \infty$ we have 

    $$
        d(x_n, x) = \Big(\sum_{j \in \mathbb{N}} |x_n(j) - x(j)|^p\Big)^\frac{1}{p} < \varepsilon,
    $$

    implies that $x_n - x \in l^p$ and $x = x_n - (x_n - x) \in l^p \implies x \in l^p$ and $x_n \to x$ as $n \to \infty$ which implies that $l^p$ is complete.

> *Proposition 7*: the space $l^\infty$ with the metric $d$ defined by
>
> $$
>   d(x,y) = \sup_{j \in \mathbb{N}} | x(j) - y(j) |,
> $$
>
> for all $x,y \in l^\infty$ is complete.

??? note "*Proof*:"

    Let $(x_n)_{n \in \mathbb{N}}$ be a Cauchy sequence in $(l^\infty,d)$, then we have

    $$
        \forall \varepsilon > 0 \exists N \in \mathbb{N}: n, m > N: d(x_n, x_m) = \sup_{j \in \mathbb{N}} | x_n(j) - x_m(j) | < \varepsilon,
    $$

    obtains for all $j \in \mathbb{N}$: $|x_n(j) - x_m(j)| <\varepsilon$.

    Which shows that $(x_m(j))_{m \in \mathbb{N}}$ for fixed $j \in \mathbb{N}$ is a Cauchy sequence in $\mathbb{C}$. Since $\mathbb{C}$ is complete the sequence converges; $x_m(j) \to x(j)$ as $m \to \infty$. 

    Thus, for $m \to \infty$ we have 

    $$
        d(x_n, x) = \sup_{j \in \mathbb{N}} | x_n(j) - x(j) | < \varepsilon \implies |x_n(j) = x(j)| < \varepsilon.
    $$

    Since $x_n \in l^\infty$ there exists a $k_n \in \mathbb{R}: |x_n(j)| \leq k_n$ for all $j \in \mathbb{N}$. Hence 

    $$
        |x(j)| \leq |x(j) - x_n(j)| + |x_n(j)| < \varepsilon + k_n,
    $$

    for all $j \in \mathbb{N}$ which implies that $x \in l^\infty$ and $x_n \to x$ as $n \to \infty$ obtaining that $ l^\infty$ is complete.