Show relative opennes wrt set implies intersection 

Prove for any metric spaces $Y \subset X$, we have that $E = Y \cap G$ for some open subset $G$ of $X$ if a subset $E$ of $Y$ is open relative to Y

This proof occurs in Rudin, but he's very terse, so I tried to fill in the holes.
We'll prove a special case where $X = \mathbb R^3, Y = \mathbb R^2, E \subset Y$ and $Y \subset X$ by way of $(x, y) \to (x, y, 0).$ We can easily restore generality by removing references to $\mathbb R^2, \mathbb R^3$.
In the the pic above, each $3$d sphere is a $3$d ball of some radius $r_p$ around a point $p \in E$. Formally, these spheres are defined as $V_p = \{q \in X: d(q, p) < r_p\}.$ This definition $V_p$ is justified because such a radius $r_p$ exists. We know that because $E$ is open relative to $Y$ (by assumption) meaning $N_{r_p}(p) \cap Y \subset E$ for some $r_p > 0.$
We want to prove a union of these balls $G$ intersecting a plane $Y$ gives us $E$. In other words, we must show $E = G \cap Y$ where $G = \bigcup V_p$. We also need to show $G$ is open in $X$.
Suppose $x \in E$. Then $x \in Y$ as $E \subset Y.$ Also $x \in E \implies x = p \in V_p$ for some $p$ as $V_p = N_{r_p} \cap X \subset E$ and so $x \in G.$ Hence $E \subset Y \cap G.$
Since $Y \subset X, \ Y \cap G = \bigcup\{q \in Y: d(p, q) < r_p\} = \bigcup(N_{r_p} \cap Y)$. Thus if $x \in Y \cap G$, then $x \in N_{r_p} \cap Y$ for some $p$ and so $x \in E$ as $E$ is open relative to $Y$ by assumption. Hence $Y \cap G \subset E.$
$V_p$ is open by construction and $G$ is open as $G$ is a union of open sets. All elements of $X$ within a radius of $r_p$ from $p$ are in $G$ as $G \subset X$. Thus $G$ is open in $X$.
My questions:

*

*Is the proof above correct?

*$E$ is open relative to $Y$. That's why some $r_p >0$ exists. This $r_p >0 $ allows us to define $V_p$. Is this a correct place to use the assumption?

*Another place where I use the assumption is when showing $Y \cap G \subset E$. Is that a correct use of the assumption?

*I like to workout the elementary set inclusions in detail. Is the set equality above correct?

Thanks.
 A: I think your argument is in essence OK; I'd write it as follows:
So we have $Y \subseteq X$ and $(X,d)$ some metric space, and the open sets of $X$ are the unions of open balls $B_{d}(x,r) = \{x' \in X\mid d(x,x') < r\}$ where $r>0$ and the centre $x$  can be any point of $X$. Then we consider $Y$ as a metric space in its own right, we just use the metric $d_Y = d\restriction_{Y \times Y}$, which is just $d$ but we only measure distances inside $Y$.
The main observation is that for $y \in Y$, $r>0$ we have
$$B_{d_Y}(y,r) = B_d(y,r) \cap Y\tag{1}$$
which is true by definitions: $y' \in B_{d_Y}(y,r) \iff d_Y(y,y') < r \iff y' \in Y \land d(y,y') < r \iff y' \in B_d(y,r) \land y' \in Y \\
\iff y' \in B_d(y,r) \cap Y$.
So if $E \subseteq Y$ is open in $(Y,d_Y)$ we can write
$$E = \bigcup \{B_{d_Y}(y, r_y)\mid y \in E \}$$
for some $r_y>0$ for each $y \in E$, and then $G =  \bigcup \{B_{d}(y, r_y)\mid y \in E \}$ is open in $(E,d)$ as a union of $d$-balls and then $(1)$ plus basic set theory tells us:
$$G \cap Y = \bigcup \{B_{d}(y, r_y)\mid y \in E \} \cap Y = \bigcup \{B_{d}(y, r_y)\cap Y \mid y \in E \} = \\
\bigcup \{B_{d_Y}(y, r_y)\mid y \in E \} = E$$
as required.
