TITLE: Confusion in proof that $C(X,Y)$ is separable
QUESTION [3 upvotes]: From Kechris' Classical Descriptive Set Theory:

(4.19) Theorem If $X$ is compact metrizable and $Y$ is Polish, then $C(X,Y)$ is Polish.

In the proof of separability, we consider
$$
C_{m,n} = \{f \in C(X,Y) : \forall x,y[d_X(x,y) < 1/m \implies d_Y(f(x),f(y))<1/n]\},
$$
and let $X_m$ be a $1/m$-dense set in $X$, i.e. no point in $X$ is further than $1/m$ from an element of $X_m$. Next is the part that confuses me. Kechris writes

Then let $D_{m,n} \subseteq C_{m,n}$ be countable such that for every $f \in C_{m,n}$ and every $\epsilon>0$ there is $g \in D_{m,n}$ with $d_Y(f(y),g(y)) < \epsilon$ for $y \in X_m$.

How do we know that such a set $D_{m,n}$ exists? Of course we could define a countable set of functions with the above property by just declaring that for all $i$ we have $g(x_i) = y_j$ for some $j$ where $\{y_i\}$ is dense in $Y$. However, as far as I know, there is no theorem guaranteeing that given $g:\{x_1,\ldots,x_m\} \to Y$ there is a continuous extension to all of $X$. Tietze's theorem only applies to $\mathbb{R}^n$ as far as I know, not an arbitrary Polish space.

REPLY [3 votes]: Write $X_m=\{ a_1,\dots ,a_N\}$, and consider the set 
$$A=\{ (f(a_1),\dots ,f(a_N));\; f\in C_{m,n}\}\subset Y^N\, .$$
Take any countable dense set $D\subset A$. Then one can write 
$$D=\{ (f(a_1),\dots ,f(a_N));\; f\in D_{m,n}\}$$
for some countable set $D_{m,n}\subset C_{m,n}$. This set $C_{m,n}$ works.
{"set_name": "stack_exchange", "score": 3, "question_id": 421458}