# Metric space with weighted Hamming distance is complete?

Given $(X,d)$ a metric space where

$$X := \{x^{(1)},\ldots,x^{k},\ldots \mid x^k \in \{0,1\},k \in \mathbb{N}\}, \text{ and } d(x,y) := \sum_{k=1}^\infty \frac 1 {2^k}\mid x^{(k)} - y^{(k)}|$$

How to prove this metric space is complete?

My attempt is to show that every Cauchy sequence $(x_n)_{n=1}^\infty$ in $X$ is convergent, an intuitive way is to choose $k \in \mathbb{N}$, then we can find a $n_k \in \mathbb{N}$ such that $d(x_m,x_n) < \frac 1 {2^k}, \forall m,n \ge n_k$. And this simply implies that $x_m,x_n$ have the same first $k$ entries, and as we increase our $k$,this sequence will finally converges. But how to write a rigorous proof for this?

Suppose $x_n$ is Cauchy. For each $i$, there is $N = N(i)$ such that $m, n \ge N$ implies $d(x_n, x_m) < 2^{-i}$, and this implies $x_n^i = x_m^i$. In particular, $x_n^i = x_{N(i)}^i$ for $n \ge N(i)$. The sequence $y$ defined by $y^i = x_{N(i)}^i$ is then in $X$, and it is easy to check that $d(x_n, y) \to 0$ as $n \to \infty$: in fact if $n \ge \max(N(1), \ldots, N(m))$ we have $x_n^i = y^i$ for all $i \le m$, and then $d(x,y) \le \sum_{i=m+1}^\infty 2^{-i} = 2^{-m}$.
Let, $(\xi_n)_{n}\subseteq X$ be a Cauchy sequence, where $\xi_n = (x_n^k)_k$.
Simply put, the idea is to check that each $(x_n^k)_{\color{red}{n}}$ is Cauchy in $\Bbb R$, let $x^k = \lim_n x^k_n$, put $\xi \doteq (x^k)_k$, and check that $\xi = \lim_n \xi_n$. Well, fix $k_0$ and let $\epsilon > 0$. There is $n_0$ such that for $m,n \geq n_0$, $d(\xi_n,\xi_m) \leq \epsilon/2^{k_0}$. So, if $n,m \geq n_0$ we have $$\frac{|x^{k_0}_n - x^{k_0}_m|}{2^{k_0}} \leq d(\xi_n,\xi_m) < \frac{\epsilon}{2^{k_0}}\implies |x^{k_0}_n - x^{k_0}_m| < \epsilon.$$So each $(x_n^k)_{n}$ is Cauchy in $\Bbb R$, hence converges, and we can put $x^k = \lim_n x^k_n$ as planned. Now we check that $\xi_n \to \xi$. Let $\epsilon > 0$ again. The idea is that the tail of the series becomes insignificant. Well, there is $k_0$ such that $\sum_{k>k_0}|x_n^k - x^k|/2^k < \epsilon/2$ since the series converges (Cauchy's criterion might ring a bell). Now for each $k\leq k_0$ take $n_k$ such that $n \geq n_k$ implies $|x_n^k - x^k| < \epsilon/2$, and put $n_0 = \max\{n_1,\ldots,n_{k_0}\}$. Now we're set to go. For $n \geq n_0$: $$\sum_k \frac{|x_n^k - x^k|}{2^k} = \sum_{k \leq k_0} \frac{|x_n^k-x^k|}{2^k} + \sum_{k > k_0}\frac{|x_n^k-x^k|}{2^k} < \frac{\epsilon}{2}\sum_{k \leq k_0}\frac{1}{2^k} + \frac{\epsilon}{2} < \frac{\epsilon}{2}+\frac{\epsilon}{2} = \epsilon.$$