# Proving a metric space is a complete metric space.

Let $$X$$ be a compact metric space, and let $$B(X)$$ be the set of real-valued bounded functions on $$X$$. For any $$f, g ∈ B(X)$$, define $$d_B(f, g) :=\sup _{x\in X}\left | f(x)-g(x) \right |$$ Suppose, we already know $$(B(X),d_B)$$ is a metric space.

Prove that $$B(X)$$ is a complete metric space.

My idea (Using the compactness of $$X$$.)

Since $$X$$ is a compact metric space, any sequence $$x_n$$ in $$X$$ must converge to some point $$a$$ in $$X$$ because $$X$$ is sequentially compact.

Then, for any function $$f$$ in $$B(X)$$, $$f(x_n)$$ will converge to $$f(a)$$.

Thus, any sequence $$f(x_n)$$ converges to some constant function in $$B(X)$$.

Hence, $$B(X)$$ is a complete metric space.

But, I am not sure if this idea works to prove the statement because I didn't even use a condition of Cauchy sequence.

Compactness of $$X$$ does not play a rôle. If $$(f_n)_n$$ is a Cauchy sequence in $$B(X)$$, note that for each fixed $$x \in X$$, the sequence $$(f_n(x))_n$$ is Cauchy in $$\Bbb R$$. Now use completeness of $$\Bbb R$$ to have a candidate $$f \in B(X)$$ to converge to, and finally show that it does converge to that $$f$$.
Note that you're given a sequence of fucntions, not a sequence of points of $$X$$. The domain is actually not that relevant.
• Do you agree that compactness of $X$ is not necessary ? Commented May 4, 2021 at 11:02
I guess that if $$f\in B(X)$$, then $$f:X\to \mathbb R$$. Moreover, the compactness of $$X$$ looks not important. Let $$(f_n)$$ be a Cauchy sequence. Since $$f_n(x)$$ is a Cauchy sequence for all $$x$$, it will converges to some $$f(x)$$. Let $$\varepsilon >0$$. Since $$(f_n)$$ is a Cauchy sequence, there is $$N\in\mathbb N$$ s.t. for all $$x\in X$$,
$$|f_N(x)-f_{N+r}(x)|<\varepsilon .$$ Taking $$r\to \infty$$ gives $$|f_N(x)-f(x)|<\varepsilon,$$ for all $$x\in X$$. Finally, if $$x\in X$$, $$|f(x)|\leq |f_N(x)-f(x)|+|f_N(x)|\leq \varepsilon +\sup_{x\in X}|f_N|<\infty .$$
Therefore, $$f\in B(X)$$.