How to complete this proof process of Arzelà-Ascoli theorem? 
Theorem. Let $X$ be a compact space and $Y$ be a metric space. A set $\mathscr F \subseteq C(X,Y)$ is precompact if and only if it is
pointwise precompact and equi-continuous.

Definitions. A subset $\mathscr F \subseteq C(X,Y)$  is called:

*

*equi-continuous if for every $x ∈ X$ and every $ε > 0$, there exists an
open neighborhood $U \subseteq X$ of $x$ such that $d_Y(f(x), f(x')) < ε$ for all $ x'∈ U$ and all $f ∈ \mathscr F$.

*precompact  if the closure of $\mathscr F$ is compact.

*pointwise precompact if for each $x∈X$, $\mathscr F(x) = \{f(x): f∈\mathscr F \}$ is precompact.

Lemma. Let $(X,d)$ be a metric space and let $K \subseteq X$. Then every sequence in $K$ has a Cauchy subsequence if and only if $K $is totally bounded.
I know how to prove it from left, the way is similar with $X$ is compact metric space. But from right: auth give me some hint.
The key is is to prove every sequence has Cauchy subsequence. By the lemma, we only need to prove $\mathscr F$ is totally bounded. He gives me two hint:

*

*The set $F = \{f(x) :  x ∈ X, f ∈ \mathscr F\} \subseteq Y$ is precompact so  is totally bounded.


*Let $ε > 0$. Cover $F$ by finitely many open balls $V_1,\dots,V_n$ of radius $ε/3$ and cover $X$ by finitely many open sets $U_1,\dots,U_m$ such that
$$\sup_{x,x' ∈ U_i} \sup_{f ∈ \mathscr F} d_Y(f(x),f(x'))＜\frac ε3.$$
Let $\alpha $ be a any map from $\{1,\dots,m\}$ to $\{1,\dots,n\}$.
Define $$\mathscr{F}_α = \{f ∈ \mathscr F : f(U_i) ∩ V_{\alpha(i)} ≠ \varnothing \} .$$  Let $A$ be
the set of all $α$ such that $\mathscr F_α ≠ \varnothing$. Prove that $\mathscr F = \bigcup_{α∈A} \mathscr F_α$.
I can following the hint 2 to achieve it, but I don't how to prove hint 1.
My try: Originally, I choose  $f_n(x_n)$ be sequence of $F$, I use diagonal method to find a subsequence $g_n$ of $f_n$ such that $f_{n_k}$ converges at each $x_i$, and I want to prove that $f_{n_k}(x_{n_k})$ converges to subsequence of $f_n(x_n)$. However I think this way is not ture now.
 A: Let's prove that $F$ is totally bounded
Take $\epsilon \gt 0$. As $\mathcal F$ is supposed to be equicontinuous, for all $x \in X$, it exists an open neighborhood $\mathcal O_x$ such that $d(f(x),f(y)) \lt \epsilon/4$ for all $ f \in \mathcal F$ and all $y \in \mathcal O_x$.
As $X$ is compact, we can extract from $\{\mathcal O_x \mid x \in X\}$ a finite cover $\mathcal O_{x_1}, \dots \mathcal O_{x_m}$.
For all $i \in \{1, \dots, m\}$ $\mathcal F(x_i)$ is precompact  and therefore so is their union $\mathcal U$ (a finite union of precompact subsets is precompact). Let $\{u_1, \dots, u_n\}$ be a finite subset of $\mathcal U$ such that $\mathcal U \subseteq \bigcup_{j=1}^n B(u_j, \epsilon/4)$ where $B(x, r)$ stands for the open ball centered on $x$ of radius equal to $r$.
Now take $f(x) \in  F$. It exists $x_i$ such that $x \in \mathcal O_{x_i}$ and $u_j$ such that $f(x_i) \in B(u_j, \epsilon/4)$. Therefore
$$d(f(x),u_j) \le \underbrace{d(f(x),f(x_i))}_{x \in \mathcal O_{x_i}} + \underbrace{d(f(x_i),u_j)}_{f(x_i) \in B(u_j, \epsilon/4)} \le \epsilon/4 + \epsilon/4 \le \epsilon/2$$ which proves that $$F \subseteq \bigcup_{j=1}^n B(u_j, \epsilon/2)$$
As the diameter of each of the $B(u_j, \epsilon/2)$ is less or equal to $\epsilon$, we can conclude that $\mathcal F$ is totally bounded and to the desired result.
A: It's not said that $Y$ is a complete metric space, but we can work in the completion $\overline{Y}$.
If I'm reading this right, we want to prove

If $\mathscr F \subseteq C(X,Y)$ is equicontinuous and pointwise precompact, then $\mathscr F$ is precompact.

Regarding Hint $\# 1$. Fix $f_n(x_n)\in F, n\in\mathbb N$. Without loss of generality, we may assume $x_n$ to be convergent due to compactness of $X$.
By assumption $\{f_n(x_i) \mid n\in\mathbb N\}$ is precompact for every $i\in\mathbb N$. Apply diagonal argument. Put $\lim\limits_{n\in N_1} f_{n}(x_1)  := f(x_1)\in\overline{Y}$ for some subsequence $N_1\subseteq \mathbb N$. Then, again by precompactness, there exists $N_2\subseteq N_1$ s.t $\lim\limits _{n\in N_2} f_n(x_2) := f(x_2)$ etc. Now define $N\subseteq \mathbb N$ such that the $k$-th component is the $k$-th
component of $N_k$. Then $\lim \limits _{n\in N} f_n(x_i) = f(x_i)$ for every $i\in\mathbb N$.

Now we have $f_{\ell_n}(x_i)\to f(x_i)$ for every $i\in\mathbb N$. Since $x_n\to x$, we also have $x_{\ell_n} \to x$. It suffices to show $f_{\ell_n}(x_{\ell _n})$ is Cauchy.

To ease notation, identify $f_{\ell_n}(x_{\ell _n})$ with $f_n(x_n), n\in\mathbb N$. By triangle inequality
$$d(f_n(x_n), f_m(x_m)) \leqslant d(f_n(x_n), f(x_n)) + d(f_m(x_m), f(x_m)) + d(f(x_m),f(x_n)). $$
The first two terms can be made small due to $f_n(x_i)\to f(x_i)$.
To make the third term small eventually, it suffices to show that $f(x_i)$ is Cauchy. We have $f(x_i) = \lim f_n(x_i)$. Due to continuity, the metric respects limits, so
$$d(f(x_i),f(x_j)) = \lim d(f_n(x_i),f_n(x_j)) \leqslant \lim d(f_n(x_i), f_n(x)) + d(f_n(x_j),f_n(x)). $$
The term $d(f_n(x_i), f_n(x))$ is small eventually due to equicontinuity of $\mathscr F$:
Firstly,  $d(f_n(x_i),f_n(x))$ can be made small around $x$ by definition. But $x_i\to x$ as well, so $x_i\in U_x$ eventually.
