Compact subset in T2 space is closed I can't understand this proof: let $(X,\tau)$ be $T2$ and $Y\subset X$ be compact then $Y$ is closed. Choose $y\in Y,x\in X-Y$ then $\exists A,B\in \tau$ such that $x\in A,y\in B,A\cap B=\emptyset$. Now there is an indexing: $A=A_y,B=B_y\rightarrow A^*=A_{y_1}\cap..\cap A_{y_n},B^*=B_{y_1}\cup..\cup B_{y_n}$ open sets such that $A^*\cap B^*=\emptyset$. Because $x\in A^*$ and $Y\subset B^*$ it follows $A^*\subset X-Y$. I think it uses $Y$ is compact so if $\mathcal B$ is an open cover of $Y$ then $\exists \{B_1,..,B_n\}$ finite open subcover and $y_i\in B_i\equiv B_{y_i}$, $x$ is fixed but it is probably wrong. I understand why $x\in A^*$ and $A^*, B^*$ are open sets.
 A: The idea is to show that $X-Y$ is open, so to find an open neighborhood $U$ of $x$ such that $U\cap Y=\emptyset$.
We can do it by first obtaining an open cover of $Y$, from which we can extract a finite subcover, by compactness.
I'll deliberately use a different notation, so you can compare the two proofs (actually they're the same).
For every $y\in Y$, choose an open neighborhood $U_y$ of $x$ and an open neighborhood $V_y$ of $y$ such that $U_y\cap V_y=\emptyset$ (here we use $\mathrm{T}_2$).
Since $\{V_y:y\in Y\}$ is an open cover of $Y$, there are $y_1,\dots,y_n\in Y$ such that
$$
Y\subseteq V_{y_1}\cup V_{y_2}\cup\dots\cup V_{y_n}
$$
Now take
$$
U=U_{y_1}\cap U_{y_2}\cap\dots\cap U_{y_n}
$$
which is an open neighborhood of $x$. Suppose $z\in U\cap Y$. Then $z\in V_{y_i}$, for some $i$. But, by definition, $z\in U_{y_i}$, which is a contradiction.
Hence $U\cap Y=\emptyset$ and we're done.
A: To show $Y$ is closed you need to show that for every $x \in X-Y$ there is an open set $A$ such that $Y \cap A = \emptyset$.
And this is exactly what your proof does:
We fix $x \in X-Y$ and for each $y \in Y$ we thus have $x \neq y$ so we apply $T_2$ and get open sets $A_y,B_y$ such that $A_y \cap B_y=\emptyset$ and $y \in B_y$ and $x \in A_y$.
Then we note $\{B_y\mid y \in Y\}$ is by definition an open cover of $Y$ and so by compactness we have finitely many $B_{y_1},\ldots, B_{y_n}$ such that $B^*:= B_{y_1} \cup \ldots \cup B_{y_n} \supseteq A$.
Then we also form $A^* = A_{y_1} \cap \ldots \cap A_{y_n}$ for the corresponding $A_y$ sets and as we have a finite intersection, $A^*$ is open and also contains our fixed $x$.
Crucial observation is $A^* \cap B^*=\emptyset$: if a point is in all of the $B_{y_i}$ it cannot be in any of the $A_{y_i}$ any more by the pairwise disjointness.
In particular $Y \cap B^*=\emptyset$ (as $Y \subseteq A^*$) and we're done with out initial goal.
