Decide if the function given by $d: X\times X\to \mathbb{R}$ is a metric on $X$ where, $d(x,x) = 0$ and $d(x,y) = \frac{1}{n}$ Can I please receive feedback on my proofs below? Thank you
$\def\R{{\mathbb R}}
\def\N{{\mathbb N}}$
Let $X= \N^\N$ endowed with the product topology. For $x\in X$ denote $x$ by $(x_1,x_2,x_3,\dots)$. 
(a) Decide if the function given by $d: X\times X\to \R$ is a metric on $X$ where, $d(x,x) = 0$ and $d(x,y) = \frac{1}{n}$ where $n$ is the least value for which $x_n \ne y_n$. Prove it.
$\textbf{Solution:}$ Yes, $d$ forms a metric.
(i) $d(x,y) \ge 0$
(ii) $d(x,y) = 0 \text{ if and only if} y=x$, by definition.
(iii) $d(x,y)=d(y,x)$, by definition.
(iv) Let $x = (x_1, x_2, \dots), y= (y_1, y_2, \dots), z = (z_1, z_2, \dots)$. Now, we will show that $d(x,y) \le d(x,z) + d(z,y)$. If $x=y$ then left side is $0$ and right side is greater than or equal to $0$. So, we are done. If $x=z$ then the inequality becomes $d(x,y) \le d(x,x) + d(x,y) = d(x,y)$. And we are done. If $y=z$, then also $d(x,y) \le d(x,y) + d(y,y) = d(x,y).$ 
So, let us assume $x\ne y \ne z, x\ne z$, i.e. all three are different. 
Let $d(x,z) = \frac{1}{n_1}, x = (x_1, x_2, \dots x_{n_1}, \dots)$ and $d(z,y) = \frac{1}{n_2}, z= (x_1, x_2, \dots z_{n_1}, \dots)$ as $x$ and $z$ have first different term is $n_1$. 
Case (a) if $n_2 \le n_1$ then $z = (x_1, x_2, \dots x_{n_2}, \dots z_{n_1}, \dots )$ and $y= (\underline{x_1, x_2, \dots} y_{n_2}, \dots )$. By, $z\ne y$ we have that the underlined terms are the same for $z$ and $y$. Now, $x_{n_2} \ne y_{n_2}$ and for any $i <n_2, x_i = y_i$ implies $d(x,y) = \frac{1}{n_2} = \max(d(x,z), d(z,y))$. Similarly, if $n_1 \le n_2$ then $d(x,y) =\frac{1}{n_1} = \max(d(x,z), d(z,y))$, i.e. $d(x,y) = \max(d(x,z) , d(z,y)) \le d(x,z) + d(z,y)$. Hence, $d$ forms a metric on $X$.
(b) Show that no compact set in $X$ can contain a non-empty open set. 
$\textbf{Solution:}$ Assume that $C\subseteq X$ be a compact set containing a basic non-empty open set $U$ then $U=U_ 1\times U_2 \times U_3 \dots U_n \times \dots \subseteq C$. By definition of product topology there exists $n_0 \in \N$ such that if $n\le n_0, U_n = \N$. 
Let $x = (x_1, x_2, \dots , x_{n_0}, x_{n_0 + 1}, \dots ) \in U \subseteq C$ then as for $n=n_0, U_n = \N$ implies $x^k = (x_1, x_2, \dots, k, x_{n_0 + 1}, \dots) \in U \subseteq C$ for any $k\in \N$. Now, for $k_1\ne k_2, x^{k_1}, x^{k_2} \in U \subseteq C$ and $d(x^{k_1}, x^{k_2}) = \frac{1}{n_0}$ for all $k_1, k_2 \in \N$ where $k_1\ne k_2$. So, we have a sequence $\{x^k\}\in C, k=1,2,\dots$ such that $d(x^{k_1},x^{k_2})=\frac{1}{n_0}$ for all $k_1\ne k_2$ (1). Now if $\{x^k\}$ has any convergent subsequence, let $\{x^{k_i}\}$ be convergent subsequence then for $\epsilon < \frac{1}{n_0}$ there exists $n' \in \N$ such that if $n_i, k_i \ge n', d(x^{n_i},x^{k_i}) < \epsilon < \frac{1}{n_0}.$ But, $d(x^{n_i},x^{k_i}) = \frac{1}{n_0}$ if $n_i, k_i \in \N$ by (1).
So it has no convergent subsequence. So, $C$ has a sequence which does not have any convergent subsequence implies $C$ cannot be compact, a contradiction. Hence, any compact set cannot have any open set contained in it. 
 A: Apart from a typo in (b), where you must mean that $U_n=\Bbb N$ for all $n\color{red}{\ge}n_0$, it appears to be correct. The proof of the triangle inequality in (a)(iv) could be presented a bit more clearly, perhaps something like this:
Let $x=\langle x_n:n\in\Bbb N\rangle,y=\langle y_n:n\in\Bbb N\rangle,z=\langle z_n:n\in\Bbb N\rangle\in X$; we’ll show that
$$d(x,y)\le\max\{d(x,z),d(z,y)\}\le d(x,z)+d(z,y)\;.$$
(Thus, $d$ actually satisfies the strong triangle inequality.)
If $x=z$, then $d(x,y)=0\le\max\{d(x,z),d(z,y)\}$. If $d(x,z)=0$, then $x=z$, and $d(x,y)=d(z,y)=\max\{d(x,z),d(z,y)\}$. Similarly, if $d(z,y)=0$, then $z=y$, and $d(x,y)=d(x,z)=\max\{d(x,z),d(z,y)\}$. 
Now assume that $x\ne y\ne z\ne x$, let $d(x,z)=\frac1m$, and let $d(z,y)=\frac1n$. Then $x_m\ne z_m$, $z_n\ne y_n$, $x_k=z_k$ for $1\le k<m$, and $z_k=y_k$ for $1\le k<n$. Without loss of generality suppose that $m<n$. Then $x_k=z_k=y_k$ for $1\le k<m$, and $x_m\ne z_m=y_m$, so 
$$d(x,y)=\frac1m=\max\left\{\frac1m,\frac1n\right\}=\max\{d(x,z),d(z,y)\}\;,$$
as desired.
