Why is this counterexample wrong? (Theorem about Open subsets and Open relative to)

In Principles of Mathematical Analysis by Walter Rudin, Theorem 2.30 states that:

Suppose $$Y \subset X$$. A subset $$E$$ of $$Y$$ is open relative to $$Y$$ if and only if $$E = Y \cap G$$ for some open subset $$G$$ of $$X$$.

I've thought of the following "counterexample":

If $$X = \mathbb{R}^2$$, $$Y = ([0,2],0)$$, $$G = B_1(0)$$ (i.e. the open ball of radius 1 centered at 0), then the theorem implies that $$E = Y \cap G = ([0,1),0)$$ is open relative to $$Y$$, which it is clearly not (due to $$(0,0) \in E$$).

Could someone point out why this "counterexample" is wrong?

Edit:

Here is the definition of "Open Relative to":

$$E$$ is open relative to $$Y$$ if for each $$p \in E$$ there is an associated $$r>0$$ such that $$q \in E$$ whenever $$d(p,q) < r$$ and $$q\in Y$$.

• In many expositions, the statement you've given is actually the definition of relative open (especially in topology). If Rudin makes this a theorem, what is his definition of relative open? Answerers would need this in order to answer your question correctly. – Randall Jan 20 at 5:00
• Why does $(0,0) \in E$ meany $E$ is not open relatively to $Y$????? – fleablood Jan 20 at 6:25
• On notation: You should write $Y=[0,1]\times \{0\}$ and $E=[0,1)\times \{0\}.$ – DanielWainfleet Jan 20 at 9:36
• @fleablood Yes, it should still be open relative (mistake on my part). – Sean Lee Jan 20 at 13:39

That fact that $$(0,0) \in E$$ doesn't make Rudin wrong. The set $$[0,0.5)$$ is an open neighborhood in $$Y$$ about $$(0,0)$$ that is contained in $$E$$, so $$(0,0)$$ is an interior point of $$E$$.
Note that this line of reasoning fails in $$X$$ because there an open set about $$(0,0)$$ will contain a ball that leaves the $$x$$-axis, and for sure, $$E$$ is not open in $$X$$.
Edit: seeing your updated question with the definition, it seems you've ignored the very important clause "and $$q \in Y$$."
• $r$ could be 0.5 as in my example. You need to focus on $q \in Y$. – Randall Jan 20 at 5:30