I'm trying to show that the set of continuous functions $f: X \to Y$ is complete under the uniform convergence metric if $Y$ is complete.
Just to be clear, the metric is:
$$d(f,g) = \text{sup}\, \{d(f(x), g(x))\, ; \,x\in X \} $$
So far what I got is:
$C^0(X,Y)$ being complete under the above metric means that every Cauchy sequence of functions is uniformly convergent and that is converges to a continuous function, right?
Lemma: Let $f_n \in C^0(X,Y)$, $f:X \to Y$, $\underset{n \to \infty} \lim d(f_n, f) = 0$, then $f$ is continuous.
Proof: Take $x_0 \in X$ and $\epsilon > 0$. There exists $n_0 \in \mathbb{N}\,; \, n > n_0 \implies d(f_n, f) < \frac{\epsilon}{5}$. We know $f_{n_0}$ is continuous. Then there exists $\delta > 0$ such that the euclidian distance between $f_{n_0}(x_0)$ and $f_{n_0}(x)$ is smaller than $\frac{\epsilon}{5}$. If the euclidian distance between $x$ and $x_0$ is smaller than $\delta$, then we have:
$$d(f(x), f(x_0)) \leq d(f(x), f_{n_0}(x)) + d(f_{n_0}(x), f_{n_0}(x_0)) + d(f_{n_0}(x_0), f(x_0)) \leq \frac{3}{5}\epsilon < \epsilon$$
$\blacksquare$
We have then that any Cauchy sequence in $C^0(X,Y)$ converges – because the limit of a sequence of continuous functions with domain $X$ and range $Y$ is itself a continuous function, which makes $C^0(X,Y)$ complete.
And I think this solves it, but I feel like I'm missing something. I haven't used the fact that $Y$ is complete, for instance. $Y$ being complete guarantees that any function $f \in C^0(X,Y)$ maps a Cauchy sequence to a convergent one and this feels like an useful observation, but I can't see where it fits in a proof.
Best Answer
The problem is not well posed. Are $X,Y$ general metric spaces? If so, what does the euclidean metric $e$ on $Y$ mean? If not, please give the precise assumptions on $X,Y.$
We have another problem: Suppose $X=Y=\mathbb R$ with the euclidean metric. Then both $f(x)=0,g(x)=x$ belong to $C(X,Y).$ But what is $d(f,g)$ supposed to be? You have it as
$$d(f,g)= \sup_{x\in\mathbb R}|f(x)- g(x)| = \sup_{x\in\mathbb R}|0-x| = \infty.$$
There is also a problem with the lemma. You have $f_n \in C(X,Y)$ but there is no condition on $f.$ So why is $d(f_n,f)$ even defined? (Note $d_n$ should be $d$ there.)
Finally, any proof that doesn't use the completeness of $Y$ is doomed. For if $Y$ is not complete, there is a Cauchy sequence $y_n$ in $Y$ that fails to converge to a point of $Y.$ Define $f_n(x)\equiv y_n$ for all $n.$ Then $f_n$ is Cauchy in $C(X,Y)$ but fails to converge to any $f\in C(X,Y).$
Right now my answer is in the form of comments/questions, I know. I need your answers to these questions to give an answer.
Added later: Here's a way to fix things: Since you repeatedly mention the euclidean metric, let's stay in that setting and suppose $X,Y$ are both subsets of some $\mathbb R^m.$ We assume that $Y$ is complete in the usual $\mathbb R^m$ metric. Define $B =B(X,Y)$ to be the set of all bounded functions from $X$ to $Y.$ For $f,g\in B,$ define
$$d(f,g)= \sup_{x\in X} |f(x)-g(x)|.$$
Now we have something that is well defined. Verify that $d$ is a metric on $B.$ Note that $f_n\to f$ in $B$ iff $f_n\to f$ uniformly on $X.$
Now define $C_B= C_B(X,Y)$ to be the set of functions in $B$ that are continuous on $X.$ The result we want to prove is
Thm: $C_B$ is a complete metric space in the $d$ metric.
Your lemma can be stated as
Lemma: If $f_n\in C_B,$ $f\in B$ and $d(f_n,f)\to 0,$ then $f\in C_B.$
Your proof then goes through.
To prove the theorem, suppose $(f_n)$ is a Cauchy sequence in $C_B.$ Then from the definition of the $d$-metric, for each $x\in X,$ $f_n(x)$ is a Cauchy sequence of points in $Y.$ And $Y$ is complete!! Thus for each $x\in X$ the limit $\lim_{n\to \infty}f_n(x)$ exists as a point in $Y.$ We can therefore define $f:X\to Y$ to be this limit at each $x\in X.$
If we can show $f\in B$ and $f_n\to f$ uniformly on $X,$ we'll be done by the lemma. This should be familiar territory. I'll leave the proof here for now, but ask if you have any questions.