Solution (source code)

= Solution

A <metric space> is a set $X$ with a function $d:X\times X\to[0,\infty)$ satisfying $d(x,y)=0\iff x=y$, symmetry and the <triangle inequality>. A subset $U$ is open if every $x\in U$ has some open <open ball> $B(x,r)$ contained in $U$.

For finitely many <open sets> $U_1,\ldots,U_k$ and $x$ in their intersection, choose radii $r_j>0$ with $B(x,r_j)\subseteq U_j$. The positive minimum radius gives a ball contained in the intersection. Thus every <finite intersection> is open; the empty intersection is $X$, also open.

For distinct points put $\delta=d(x_1,x_2)>0$. The balls $B(x_1,\delta/3)$ and $B(x_2,\delta/3)$ are disjoint: a common point would make $d(x_1,x_2)<2\delta/3$ by the <triangle inequality>. This proves the <Hausdorff condition>.

A <singleton> $\{x\}$ is closed because each $y\ne x$ has a ball of radius $d(x,y)/2$ avoiding it, making its complement open. <Finite unions> of <closed sets> are closed, as their complements are <finite intersections> of <open sets>. Hence \b[every finite subset is closed], including the empty subset.