[guided]The goal in this direction is to turn many small open neighbourhoods inside the subspace $Y$ into one open set in the ambient space $X$. We first fix the ball notation. For $x\in X$ and $r>0$, define the ambient ball
\begin{align*}
B_X(x,r)=\{z\in X:d(z,x)<r\}.
\end{align*}
For $y\in Y$ and $r>0$, define the subspace ball
\begin{align*}
B_Y(y,r)=\{z\in Y:d_Y(z,y)<r\}.
\end{align*}
Because the subspace metric is defined by $d_Y(z,y)=d(z,y)$ for $z,y\in Y$, membership in $B_Y(y,r)$ is exactly membership in the ambient ball together with membership in $Y$. Hence
\begin{align*}
B_Y(y,r)=Y\cap B_X(y,r)
\end{align*}
for every $y\in Y$ and every $r>0$.
Now assume that $U$ is open in the [metric space](/page/Metric%20Space) $(Y,d_Y)$. By the definition of openness in a metric space, for each $u\in U$ there exists a radius $r_u>0$ such that
\begin{align*}
B_Y(u,r_u)\subset U.
\end{align*}
These radii are chosen point by point, because relative openness only gives a local ball around each point of $U$.
Define the ambient candidate by taking the corresponding ambient balls:
\begin{align*}
G=\bigcup_{u\in U}B_X(u,r_u)\subset X.
\end{align*}
If $U=\varnothing$, this is the empty union, so $G=\varnothing$; the argument below is still valid because all pointwise assertions are then vacuous.
We verify that $G$ is open in $X$. Take any point $x\in G$. By the definition of union, there is some $u\in U$ such that $x\in B_X(u,r_u)$, meaning $d(x,u)<r_u$. The remaining distance from $x$ to the boundary of this particular ball is
\begin{align*}
\varepsilon=r_u-d(x,u)>0.
\end{align*}
If $z\in B_X(x,\varepsilon)$, then $d(z,x)<\varepsilon$. The triangle inequality in the metric space $(X,d)$ gives
\begin{align*}
d(z,u)\le d(z,x)+d(x,u)<\varepsilon+d(x,u)=r_u.
\end{align*}
Therefore $z\in B_X(u,r_u)$, and since $B_X(u,r_u)\subset G$, we have $z\in G$. This proves $B_X(x,\varepsilon)\subset G$, so every point of $G$ has an ambient ball contained in $G$. Hence $G$ is open in $(X,d)$.
Finally we prove the equality $U=Y\cap G$. First let $u\in U$. Since $d(u,u)=0<r_u$, we have $u\in B_X(u,r_u)$, hence $u\in G$. Also $u\in Y$ because $U\subset Y$. Thus $u\in Y\cap G$, proving
\begin{align*}
U\subset Y\cap G.
\end{align*}
For the reverse inclusion, let $y\in Y\cap G$. Since $y\in G$, by the definition of $G$ there exists $u\in U$ such that $y\in B_X(u,r_u)$. Since $y\in Y$, the subspace-ball identity applies:
\begin{align*}
y\in Y\cap B_X(u,r_u)=B_Y(u,r_u).
\end{align*}
The radius $r_u$ was chosen so that $B_Y(u,r_u)\subset U$, so $y\in U$. Hence
\begin{align*}
Y\cap G\subset U.
\end{align*}
Combining the two inclusions gives $U=Y\cap G$.[/guided]