Prove that $q(x,y)=(\sum\limits_{i=1}^nd_i(x_i,y_i)^2)^{\frac{1}{2}}$ is a metric.

(Couldn't find it here, if it is duplicated I'm sorry)

Given that $(X_1,d_1),\cdots,(X_n,d_n)$ are metric spaces. Define the function $q: \prod\limits_{i=1}^nX_i \times \prod \limits_{i=1}^nX_i \to[0,\infty)$ by $$q(x,y)=(\sum\limits_{i=1}^nd_i(x_i,y_i)^2)^{\frac{1}{2}}$$

Then prove that $q$ is a metric in $\prod \limits_{i=1}^nX_i$.

I'm stuck on prooving that $q$ satisfy tha triangle inequality.

I know that $q_1(x,y)=\sum\limits_{i=1}^nd_i(x_i,y_i)$ is a metric. Using this, I can prove that for all $x,y$ such that $d_i(x_i,y_i)\leq1 \ \forall i$ we have $q(x,y)\leq \sqrt{q_1(x,y)}$ and we're done because square root is subadditive. But I don't think I could do this for all other $x,y$ in a similar way.

Could you helpe me? Thank's in advance!

• Apply triangle inequality for the $d_i$'s and then apply triangle inequality in $\mathbb R^{n}$. – Kavi Rama Murthy Sep 5 '18 at 6:11

With the definition, $$q(x,y)=(\sum\limits_{i=1}^nd_i(x_i,y_i)^2)^{\frac{1}{2}}$$

You need to show $$q(x,y)\le q(x,z)+q(z,y)$$

That is $$(\sum\limits_{i=1}^nd_i(x_i,y_i)^2)^{\frac{1}{2}}\le (\sum\limits_{i=1}^nd_i(x_i,z_i)^2)^{\frac{1}{2}} +(\sum\limits_{i=1}^nd_i(z_i,y_i)^2)^{\frac{1}{2}}$$

Upon squaring both sides we get $$\sum\limits_{i=1}^nd_i(x_i,y_i)^2\le \sum\limits_{i=1}^nd_i(x_i,z_i)^2 +\sum\limits_{i=1}^nd_i(z_i,y_i)^2+2(\sum\limits_{i=1}^nd_i(x_i,z_i)^2)^{\frac{1}{2}} (\sum\limits_{i=1}^nd_i(z_i,y_i)^2)^{\frac{1}{2}}$$

Note that we have $$d_i(x_i, y_i) \le d_i(x_i, z_i)+d_i(z_i, y_i)$$

Squaing both sides gives us $$d_i(x_i, y_i)^2 \le d_i(x_i, z_i)^2+d_i(z_i, y_i)^2+2d_i(x_i, z_i)d_i(z_i, y_i)$$ Upon adding up we get $$\sum _1^n d_i(x_i, y_i)^2 \le \sum _1^nd_i(x_i, z_i)^2+ \sum _1^n d_i(z_i, y_i)^2+2\sum _1^n d_i(x_i, z_i)d_i(z_i, y_i)$$ It remains to show that $$\sum _1^n d_i(x_i, z_i)d_i(z_i, y_i)\le(\sum\limits_{i=1}^nd_i(x_i,z_i)^2)^{\frac{1}{2}} (\sum\limits_{i=1}^nd_i(z_i,y_i)^2)^{\frac{1}{2}}$$

Which is the Cauchy Schwarz inequality.