Prove that $d(x,y) = \sum_{i\in\mathbb{N}} a_i\frac{d_i(x_i,y_i)}{1+d_i(x_i,y_i)}$ satisfies the triangle inequality Let $(X_i
, d_i), i ∈ \Bbb N$, be a collection of metric spaces.  
Define the metric \begin{align}d(x,y) = \sum_{i\in\mathbb{N}} a_i\frac{d_i(x_i,y_i)}{1+d_i(x_i,y_i)} \end{align} on the infinite product $\prod_{i \in \Bbb N} X_i.$ 
Note that $(a_i)_{i\in\mathbb{N}}$ is positive and satisfies $\sum_{i\in\mathbb{N}} a_i < +\infty$. For example $a_i = 2^{-i}$.
I am wondering how should I go about to prove that this metric satisfy the triangle inequality? 

Let $\rho_k(x_k,y_k) = \frac{d_k(x_k,y_k)}{1+d_k(x_k,y_k)}$ and note that each $\rho_k$ are a metric, so for all $k$
$$
\rho_k(x_k,y_k)\le \rho_k(x_k,z_k) + \rho_k(z_k,y_k).
$$
Then multiplying by $a_k$ and summing from $k=1$ up to $k=n$ we have
$$
\sum_{k=1}^na_k\rho_k(x_k,y_k)\le \sum_{k=1}^na_k\rho_k(x_k,z_k) + \sum_{k=1}^na_k\rho_k(z_k,y_k)
$$
Once both sums on the right side converge, we can make $n\to\infty$ and the limit on the right side will give $d(x,z)+d(z,y)$ as we wanted.
