Definition of compactness of metric spaces In my lecturer's notes it says the following:
Let $A \subseteq M$ and let $B = \{U_i : i \in I\}$ be an open cover of $A$. When determining the compactness or not of $A$, we might question whether it matters whether the $U_i$ are open in $A$ or open in $M$. In fact, it does not matter whether the $U_i$ are open in $A$ and
$A=\cup_{i \in I} U_i$
or whether the the $U_i$ are open in $M$ and
$A \subseteq\cup_{i \in I} U_i$.
Why is this?
 A: Assume that $A\subseteq M$ is compact, and assume that $U_i$ is an open cover of $A$, where the $U_i$ are open in $A$. By definition of the subspace topology, there exist sets $V_i$ that are open in $M$, such that $U_i = V_i\cap A$.
Since
$$A = \bigcup_{i} U_i = (\bigcup_{i} V_i)\cap A\subseteq \bigcup_{i} V_i,$$
we see that the $V_i$ is an open cover of $A$ of sets that are open in $M$. Since $A$ is compact in $M$, there exists a finite subcover $V_1,\ldots,V_n$, such that
$$A \subseteq V_1\cup\cdots\cup V_n.$$
Since $U_i = V_i\cap A$, we can take the intersection with $A$ on both sides to get
$$A = U_1\cup\cdots\cup U_n.$$
The cover of sets $U_i$ that were open in $A$ thus has a finite subcover.
This proves that if $A$ is compact, then any cover of $A$ of sets that are open in $A$ have a finite subcover.
For the other direction, assume that any cover of $A$ of sets that are open in $A$ have a finite subcover. We want to prove that $A$ is compact, so let $\{V_i\}$ be an open cover of $A$ of sets that are open in $M$. Then
$$A\subseteq \bigcup_i V_i.$$
Taking the intersection with $A$ on both sides, we get
$$A = \bigcup_i (A\cap V_i),$$
so by definition of being open in $A$, the sets $A\cap V_i$ constitute an open cover of $A$ (of sets that are open relative to $A$). By our hypothesis, this has a finite subcover, so
$$A = (A\cap V_1)\cup\cdots\cup (A\cap V_n)\subseteq V_1\cup\cdots\cup V_n.$$
This proves that the cover $\{V_i\}$ has a finite subcover, whence $A$ is compact.
A: This is because compactness is independent of the ambient space. More formally stated, if $A \subset E \subset M$, then $A$ is compact in $E$ iff $A$ is compact in $M$. In your case, $E = A$ but the result still holds. This is because given an open (in $A$) cover of $A$, one can easily show from it the existence of an open (in $M$) cover of $A$, and vice versa.
A: Assume every $M$-open cover of $A$ has a finite subcover. Take $A$-open cover $B_A$ of $A$. Then $B_A$ is a collection of sets of the form $V_i = U_i \cap A$, where $U_i$ are open in $M$. Now the collection $B_M = \{U_i\}$ is an $M$-open cover of $A$ and thus has a finite subcover $B_M'$. Now we can define a finite $A$-open subcover of $A$ by setting
$$
B_A' = \{U_i \cap A: U_i \in B_M'\}\,.
$$
Conversely, assume every $A$-open cover of $A$ has a finite subcover. Now let $B_M = \{ U_i\}$ be an arbitrary $M$-open cover of $A$. Define
$$
B_A = \{ U_i \cap A: U_i \in B_M\}\,.
$$
Now $B_A$ is an $A$-open cover of $A$ and thus has a finite subcover $B_A'$. This then defines a finite subcover of $B_M$ by
$$
B_M' = \{ U_i : U_i \cap A \in B_A'\}\,.
$$
