I'm trying to prove the following theorem: Let $X\subseteq\mathbb{R}^{k}$, $Y\subseteq X$. Then $Y$ is open relative to $X$ $ \iff$ $\forall y\in Y\exists\epsilon>0\ N_{\epsilon}^{X}(y)\subseteq Y$, with $N_{\epsilon}^{X}(y)=\left\{ x|x\in X\ ||x-y||<\epsilon\right\}$.
This is what I did so far:
Proof. Y is open relative to X if there exists Z open such that $Y=X\cap Z$.
Direction 1: Suppose Y is open relative to X . Then a fitting Z exists. Suppose $Y\neq\emptyset$ . If X is open, then $X\cap Z$ is open, and Y is open. Since $Y\subseteq X$ and $\forall y\in Y\exists\epsilon>0\ N_{\epsilon}(y)\subseteq Y$ . Here, $N_{\epsilon}(y)=N_{\epsilon}^{X}(y)$ , hence the statement is true.
If X is closed and $Z\subseteq X$ , then $Y=X\cap Z=Z$ , hence the statement is true.
If X is closed and $X\subseteq Z$ , then Y=X . Hence the statement is true.
If X is closed and neither $X\subseteq Z$ nor $Z\subseteq X$ , then $Y=X\cap Z$ is neither open nor closed. Also, $\left\{ X\cap Z\right\} \subset X$ , hence $\forall y\in Y\exists\epsilon>0\ N_{\epsilon}^{X}(y)\subseteq Y$ . The statement is true.
These are all the possibilities.
Direction 2: $Let Y\subseteq X\subseteq\mathbb{R}^{k}$ . Suppose $\forall y\in Y\exists\epsilon>0\ N_{\epsilon}^{X}(y)\subseteq Y$. . Suppose by contradiction Y is not open relative to X . Two cases, if Y=X , then Y is open relative to X , and the proof is over. If $Y\subset X$...?
I'm stuck here. I think I understand the intuition behind the concept of openness relative to another set, so the second direction seems trivial. Yet, I am unable to write the proof formally.
Also I'd like to get feedback on the first direction, as it is quite unelegant.
Direction 1: Assume Y is open relative to X Then $\exists$Z$\subseteq$$\mathbb{R}$$^{k}$ Y=X$\cap$Z, Z open. Let y$\in$Y. Then y$\in$Z. Therefore $\exists\epsilon>0\ N_{\epsilon}(y)\subseteq$Z , hence, N$_{\epsilon}^{X}(y)\subseteq$ Z$\cap$X=Y.
Direction 2: Assume $\forall y\in Y\ \exists\epsilon>0\ N_{\epsilon}^{X}(y)\subseteq Y$. If $X\subsetneq Z$, then there is nothing to prove. Else: Let $Y=X\cap Z$ but suppose by contradiction Z is not open. Then $X\cap Z$ is not open. Then $\exists y\in Y\ \forall\epsilon>0\ N_{\epsilon}(y)$$\not{\subseteq}Y$ . Notice $N_{\epsilon}^{X}(y)\subseteq N_{\epsilon}(y)\not{\subseteq}Y$, which is a contradiction. $\blacksquare$