Quick question about definition of connectedness and compactness. Definition $1$: Let $X$ be a metric space and $Y \subseteq X$. If every open cover of $Y$ has a finite subcover, we say that $Y$ is compact.
Question 1: Does the open cover consist of sets open relative to $X$, or to $Y$? (my guess would be $X$)
Definition $2$: Let $(X,d)$ be a metric space. We say that $X$ is connected if we can't write $X$ as the disjoint union of $2$ non-empty, open sets. A subset $Y \subseteq X$ is connected if the metric subspace $(Y,d\vert_Y)$ is connected.
Question 2: Does this mean that we cannot write $Y$ as disjoint union of open subsets relative to $Y$?
Thanks in advance.
 A: *

*For the first question it doesn't matter. Given an open cover $U_i$ in terms of open sets of $X$, $Y \cap U_i$ gives an open cover of open sets of $Y$. Given an open cover $V_i$ of open sets of $Y$, each $V_i$ is some $Y \cap U_i$ where the $U_i$s are open sets of $X$ forming an open cover.

*For the second question it needs to be open sets of $Y$. The first example I can think of is just a topological space rather than a metric space, but the concepts should be the same for both. Consider the 'Real line with two zeroes', whose open sets are open sets of $\mathbb{R}$ but may contain one or both zeroes if the open set in $\mathbb{R}$ they come from contains $0$. Then the set $\{0, 0'\}$ is discrete and therefore disconnected, but any two open sets containing one of them intersect on the rest of the real line.
p.s. The answer to this question shows that this can't happen for metric spaces. Nevertheless, I think that it is always better to stick with definitions that are consistent for all topological spaces.
A: 1) relatively to $X$ or $Y$.
2) relatively to $Y$.
