A confusion in the proof of Stack of records theorem. The theorem and its Proof is given below:




But I do not understand in the last line of the proof, why he said that $Z$ is closed and why he is sure that it does not contain $y$ ?
The hint of the book is given below:




But I am wondering how the above answer proved that $Z$ is compact?
And how he proved that $f$ maps each $V_{t}$ diffeomorphically into $U$ (the third requirement of the question)?
Could anyone help me in answering the previous questions?
 A: It's mostly general topology background knowledge:
$X$ is compact and $Z' = X - \cup_i U''_i$ is a closed subset of $X$, as it's the complement of the open set $\cup_i U''_i$ (a union of open sets is open). So $Z'$ is compact (as a closed subset of a compact space $X$).
$f$ is continuous, so $Z=f[Z']$ is also compact in $Y$ and as $Y$ is Hausdorff, $f[Z']$ is closed, which makes $V$ and $f^{-1}[V]$ open.
Suppose that $y \in Z=f[Z']$. So for some $x \in Z'$ we have $f(x) = y$.
We know that $f^{-1}(y) = \{x_1, \ldots, x_k\}$ so $x = x_i$ for some $i \in \{1,\ldots,k\}$. But then $x \in U''_i$ for that $i$ and so $x \in \cup_i U''_i$ and $x \notin Z'$ by definition of $Z'$. Contradiction so $y \notin f[Z']=Z$. 
In essence: we already know all points that map to $y$ and we cut them all away with room to spare to define $Z$. So $Z$ contains no point mapping to $y$ anymore.
Finally $f$ is a local diffeomorphism between $U'_i$ and $V'_i$ and if we restrict both sides to smaller open sets so that we still have a bijection between domain and codomain (as we do here), the property of being a local diffeomorphism will be preserved. Check your definition of being a local diffeomorphism, it will be immediate! 
A: $Z$ is closed because it is the image of a compact set by a continuous map (actually $Y$ must be Haussdorf for this result). This is a general result of topology.
