[proofplan]
The proof is a direct verification of the metric axioms. Since every point of $Y$ is a point of $X$, the restricted formula $d_Y(y_1,y_2)=d(y_1,y_2)$ is well-defined and inherits its values from $d$. Nonnegativity, identity of indiscernibles, symmetry, and the triangle inequality then follow by applying the corresponding metric axiom for $d$ to points of $Y$, viewed as points of $X$.
[/proofplan]
custom_env
admin
[step:Verify that the restricted distance is well-defined]Let $y_1,y_2\in Y$. Since $Y\subset X$, we have $y_1,y_2\in X$, so $d(y_1,y_2)$ is defined. Because $d:X\times X\to [0,\infty)$, it follows that $d(y_1,y_2)\in [0,\infty)$. Hence the assignment
\begin{align*}
(y_1,y_2)\mapsto d(y_1,y_2)
\end{align*}
defines a function $d_Y:Y\times Y\to [0,\infty)$.[/step]
custom_env
admin
[guided]We first check that the formula actually defines a function on the claimed domain and codomain. Take arbitrary $y_1,y_2\in Y$. The inclusion $Y\subset X$ means that every element of $Y$ is also an element of $X$, so $y_1,y_2\in X$. Therefore the value $d(y_1,y_2)$ is meaningful, because $d$ is a function on $X\times X$.
Moreover, since $d:X\times X\to [0,\infty)$, every value of $d$ lies in $[0,\infty)$. Thus
\begin{align*}
d(y_1,y_2)\in [0,\infty).
\end{align*}
So the rule
\begin{align*}
(y_1,y_2)\mapsto d(y_1,y_2)
\end{align*}
assigns to every ordered pair in $Y\times Y$ a unique element of $[0,\infty)$. This proves that $d_Y:Y\times Y\to [0,\infty)$ is well-defined.[/guided]
custom_env
admin
[step:Inherit nonnegativity and identity of indiscernibles from $d$]
Let $y_1,y_2\in Y$. Since $d$ is a metric on $X$, we have
\begin{align*}
d_Y(y_1,y_2)=d(y_1,y_2)\ge 0.
\end{align*}
Also,
\begin{align*}
d_Y(y_1,y_2)=0 \iff d(y_1,y_2)=0 \iff y_1=y_2,
\end{align*}
where the second equivalence is the identity of indiscernibles for the metric $d$ on $X$.
[/step]
custom_env
admin
[step:Inherit symmetry from $d$]
Let $y_1,y_2\in Y$. Applying symmetry of the metric $d$ on $X$ gives
\begin{align*}
d_Y(y_1,y_2)=d(y_1,y_2)=d(y_2,y_1)=d_Y(y_2,y_1).
\end{align*}
Thus $d_Y$ is symmetric.
[/step]
custom_env
admin
[step:Inherit the triangle inequality from $d$]
Let $y_1,y_2,y_3\in Y$. Since $Y\subset X$, the points $y_1,y_2,y_3$ are elements of $X$. Applying the triangle inequality for $d$ on $X$ gives
\begin{align*}
d_Y(y_1,y_3)=d(y_1,y_3)\le d(y_1,y_2)+d(y_2,y_3)=d_Y(y_1,y_2)+d_Y(y_2,y_3).
\end{align*}
Therefore $d_Y$ satisfies the triangle inequality on $Y$.
[/step]
custom_env
admin
[step:Conclude that $d_Y$ is a metric on $Y$]
The function $d_Y:Y\times Y\to [0,\infty)$ is well-defined, nonnegative, separates points, is symmetric, and satisfies the triangle inequality. These are precisely the metric axioms on the set $Y$. Hence $d_Y$ is a metric on $Y$.
[/step]