[proofplan]
We verify the metric axioms directly from the coordinate formula. Nonnegativity and symmetry follow from elementary properties of absolute value, while identity of indiscernibles follows because a finite sum of nonnegative [real numbers](/page/Real%20Numbers) vanishes only when every summand vanishes. The only substantive point is the triangle inequality; we prove the finite-dimensional Cauchy-Schwarz estimate inside the argument and then apply it to the coordinate differences $x-z$ and $z-y$.
[/proofplan]
[step:Verify that $d_2$ is nonnegative]
Fix $n\in\mathbb{N}$. Let $x=(x_1,\dots,x_n)\in\mathbb{R}^n$ and $y=(y_1,\dots,y_n)\in\mathbb{R}^n$. For each index $k\in\{1,\dots,n\}$, the real number $|x_k-y_k|^2$ is nonnegative. Hence the finite sum
\begin{align*}
\sum_{k=1}^n |x_k-y_k|^2
\end{align*}
is nonnegative, so its square root is defined and nonnegative. Therefore
\begin{align*}
d_2(x,y)\geq 0.
\end{align*}
[/step]
[step:Show that zero distance is equivalent to equality of points]
Let $x=(x_1,\dots,x_n)\in\mathbb{R}^n$ and $y=(y_1,\dots,y_n)\in\mathbb{R}^n$.
If $x=y$, then $x_k=y_k$ for every $k\in\{1,\dots,n\}$, and therefore
\begin{align*}
d_2(x,y)=\left(\sum_{k=1}^n 0^2\right)^{1/2}=0.
\end{align*}
Conversely, suppose $d_2(x,y)=0$. Squaring both sides gives
\begin{align*}
\sum_{k=1}^n |x_k-y_k|^2=0.
\end{align*}
Each summand $|x_k-y_k|^2$ is nonnegative. A finite sum of nonnegative real numbers is zero only if every summand is zero, so $|x_k-y_k|^2=0$ for every $k\in\{1,\dots,n\}$. Hence $|x_k-y_k|=0$, so $x_k=y_k$ for every $k\in\{1,\dots,n\}$. Thus $x=y$.
[guided]
We must prove both directions because the identity of indiscernibles for a metric says exactly that $d_2(x,y)=0$ happens precisely when $x=y$.
First assume $x=y$. Equality of vectors in $\mathbb{R}^n$ means equality of every coordinate, so $x_k=y_k$ for each $k\in\{1,\dots,n\}$. Thus every coordinate difference is zero, and the defining formula gives
\begin{align*}
d_2(x,y)=\left(\sum_{k=1}^n |x_k-y_k|^2\right)^{1/2}=\left(\sum_{k=1}^n 0^2\right)^{1/2}=0.
\end{align*}
Now assume $d_2(x,y)=0$. Since $d_2(x,y)$ is the nonnegative square root of the sum of squares, squaring the equality $d_2(x,y)=0$ gives
\begin{align*}
\sum_{k=1}^n |x_k-y_k|^2=0.
\end{align*}
For every index $k$, the number $|x_k-y_k|^2$ is nonnegative. If one of these summands were positive, then the whole finite sum would be positive. Therefore every summand must be zero:
\begin{align*}
|x_k-y_k|^2=0
\end{align*}
for every $k\in\{1,\dots,n\}$. A square of a real number is zero only when the real number itself is zero, so $|x_k-y_k|=0$. Absolute value is zero only at zero, hence $x_k-y_k=0$, and therefore $x_k=y_k$ for every $k$. Equality of all coordinates gives $x=y$.
[/guided]
[/step]
[step:Prove symmetry from symmetry of absolute value]
Let $x=(x_1,\dots,x_n)\in\mathbb{R}^n$ and $y=(y_1,\dots,y_n)\in\mathbb{R}^n$. For every $k\in\{1,\dots,n\}$,
\begin{align*}
|x_k-y_k|=|-(y_k-x_k)|=|y_k-x_k|.
\end{align*}
Squaring and summing over $k$ gives
\begin{align*}
\sum_{k=1}^n |x_k-y_k|^2=\sum_{k=1}^n |y_k-x_k|^2.
\end{align*}
Taking nonnegative square roots yields
\begin{align*}
d_2(x,y)=d_2(y,x).
\end{align*}
[/step]
[step:Establish the finite-dimensional Cauchy-Schwarz estimate]
[claim:Finite-dimensional Cauchy-Schwarz estimate]
For all real numbers $a_1,\dots,a_n,b_1,\dots,b_n$,
\begin{align*}
\left|\sum_{k=1}^n a_k b_k\right|\leq \left(\sum_{k=1}^n a_k^2\right)^{1/2}\left(\sum_{k=1}^n b_k^2\right)^{1/2}.
\end{align*}
[/claim]
[proof]
Define
\begin{align*}
A:=\sum_{k=1}^n a_k^2
\end{align*}
and
\begin{align*}
B:=\sum_{k=1}^n b_k^2.
\end{align*}
If $B=0$, then each $b_k^2=0$, so each $b_k=0$, and both sides of the desired inequality are zero.
Assume $B>0$. Define the real quadratic polynomial $q:\mathbb{R}\to\mathbb{R}$ by
\begin{align*}
q(t):=\sum_{k=1}^n (a_k+t b_k)^2.
\end{align*}
For every $t\in\mathbb{R}$, $q(t)\geq 0$. Expanding the square gives
\begin{align*}
q(t)=A+2t\sum_{k=1}^n a_k b_k+t^2B.
\end{align*}
Since this quadratic polynomial has leading coefficient $B>0$ and is nonnegative for all real $t$, its discriminant is nonpositive:
\begin{align*}
4\left(\sum_{k=1}^n a_k b_k\right)^2-4AB\leq 0.
\end{align*}
Therefore
\begin{align*}
\left(\sum_{k=1}^n a_k b_k\right)^2\leq AB.
\end{align*}
Taking nonnegative square roots gives the desired inequality.
[/proof]
This proves the finite-dimensional Cauchy-Schwarz estimate needed for the triangle inequality.
[guided]
The triangle inequality will require us to control a cross term of the form $\sum_{k=1}^n a_k b_k$. The needed estimate is the finite-dimensional [Cauchy-Schwarz inequality](/theorems/432), and we prove it here from the nonnegativity of squares.
Let $a_1,\dots,a_n,b_1,\dots,b_n$ be real numbers. Define
\begin{align*}
A:=\sum_{k=1}^n a_k^2
\end{align*}
and
\begin{align*}
B:=\sum_{k=1}^n b_k^2.
\end{align*}
If $B=0$, then the finite sum of nonnegative terms $\sum_{k=1}^n b_k^2$ is zero, so $b_k=0$ for every $k$. Hence $\sum_{k=1}^n a_kb_k=0$, and the estimate becomes $0\leq 0$.
Now assume $B>0$. Define a function
\begin{align*}
q:\mathbb{R}\to\mathbb{R}
\end{align*}
by
\begin{align*}
q(t):=\sum_{k=1}^n (a_k+t b_k)^2.
\end{align*}
For every real number $t$, each term $(a_k+t b_k)^2$ is nonnegative, so $q(t)\geq 0$. Expanding the square inside the finite sum gives
\begin{align*}
q(t)=\sum_{k=1}^n a_k^2+2t\sum_{k=1}^n a_kb_k+t^2\sum_{k=1}^n b_k^2.
\end{align*}
With the definitions of $A$ and $B$, this is
\begin{align*}
q(t)=A+2t\sum_{k=1}^n a_kb_k+t^2B.
\end{align*}
Why does this imply an inequality? A real quadratic polynomial with positive leading coefficient that is nonnegative for all real $t$ cannot have two distinct real roots. Equivalently, its discriminant must be nonpositive. Applying this to $q$ gives
\begin{align*}
4\left(\sum_{k=1}^n a_kb_k\right)^2-4AB\leq 0.
\end{align*}
After dividing by $4$, we obtain
\begin{align*}
\left(\sum_{k=1}^n a_kb_k\right)^2\leq AB.
\end{align*}
Both sides are nonnegative, so taking square roots gives
\begin{align*}
\left|\sum_{k=1}^n a_kb_k\right|\leq A^{1/2}B^{1/2}.
\end{align*}
Substituting the definitions of $A$ and $B$ yields
\begin{align*}
\left|\sum_{k=1}^n a_k b_k\right|\leq \left(\sum_{k=1}^n a_k^2\right)^{1/2}\left(\sum_{k=1}^n b_k^2\right)^{1/2}.
\end{align*}
[/guided]
[/step]
[step:Prove the triangle inequality by expanding the squared distance]
Let $x=(x_1,\dots,x_n)\in\mathbb{R}^n$, $y=(y_1,\dots,y_n)\in\mathbb{R}^n$, and $z=(z_1,\dots,z_n)\in\mathbb{R}^n$. Define real numbers
\begin{align*}
a_k:=x_k-z_k
\end{align*}
and
\begin{align*}
b_k:=z_k-y_k
\end{align*}
for each $k\in\{1,\dots,n\}$. Then $x_k-y_k=a_k+b_k$ for every $k$. Hence
\begin{align*}
d_2(x,y)^2=\sum_{k=1}^n |a_k+b_k|^2.
\end{align*}
Since $a_k+b_k$ is real, $|a_k+b_k|^2=(a_k+b_k)^2$, so
\begin{align*}
d_2(x,y)^2=\sum_{k=1}^n a_k^2+2\sum_{k=1}^n a_kb_k+\sum_{k=1}^n b_k^2.
\end{align*}
By the finite-dimensional Cauchy-Schwarz estimate,
\begin{align*}
\sum_{k=1}^n a_kb_k\leq \left(\sum_{k=1}^n a_k^2\right)^{1/2}\left(\sum_{k=1}^n b_k^2\right)^{1/2}.
\end{align*}
Therefore
\begin{align*}
d_2(x,y)^2\leq \left(\sum_{k=1}^n a_k^2\right)+2\left(\sum_{k=1}^n a_k^2\right)^{1/2}\left(\sum_{k=1}^n b_k^2\right)^{1/2}+\left(\sum_{k=1}^n b_k^2\right).
\end{align*}
The right-hand side is the square
\begin{align*}
\left(\left(\sum_{k=1}^n a_k^2\right)^{1/2}+\left(\sum_{k=1}^n b_k^2\right)^{1/2}\right)^2.
\end{align*}
Using the definitions of $a_k$ and $b_k$, this becomes
\begin{align*}
d_2(x,y)^2\leq \left(d_2(x,z)+d_2(z,y)\right)^2.
\end{align*}
Both sides are squares of nonnegative real numbers, so taking nonnegative square roots gives
\begin{align*}
d_2(x,y)\leq d_2(x,z)+d_2(z,y).
\end{align*}
[/step]
[step:Conclude that all metric axioms hold]
For arbitrary $x,y,z\in\mathbb{R}^n$, we have proved nonnegativity, identity of indiscernibles, symmetry, and the triangle inequality:
\begin{align*}
d_2(x,y)\geq 0.
\end{align*}
\begin{align*}
d_2(x,y)=0 \iff x=y.
\end{align*}
\begin{align*}
d_2(x,y)=d_2(y,x).
\end{align*}
\begin{align*}
d_2(x,y)\leq d_2(x,z)+d_2(z,y).
\end{align*}
These are exactly the metric axioms on $\mathbb{R}^n$. Since $n\in\mathbb{N}$ was arbitrary, $d_2$ is a metric on $\mathbb{R}^n$ for every $n\in\mathbb{N}$.
[/step]