How to show that if $P_1,P_2\in\mathbb{R}^3$ then the straight line connecting them is the shortest one?

Let $P_1,P_2\in\mathbb{R}^3$ and consider all the paths from $P_1$ to $P_2$, I wish to prove that the euclidean distance (that is the length of the line connecting them) is the distanse of the shortest of all paths connecting $P_1$ to $P_2$.

My strategy is to prove that the straight line is a path (trivial) and the for path that is not the straight line connecting $P_1$ to $P_2$ the straight line is shorter, but I am having difficulty with proving the last part.

Edit: for samplicity I edited for the case $n=3$

• I think that first you have to know exactly what you mean by the length of a path. How do you define/compute the length of a path? – Gerry Myerson May 14 '12 at 5:54
• @GerryMyerson - if $\gamma$ is the path where $\gamma=(x(t),y(t),z(t))$ : $L(\gamma)=\intop_{a}^{b}\sqrt{(x'(t))^{2}+(y'(t))^{2}+(z'(t))^{2}}$ – Belgi May 14 '12 at 6:00

I think it's easier to work with the basic definition of arc-length ie. $$l(f)= \sup_{P}\sum_{i=0}^k |f(t_{i+1})-f(t_i)|$$ where $f:[0,1]\to \mathbb{R}^3$, $f(0)=a$, $f(0)=b$ and the $\sup$ is taken over all partitions $P$ of $[0,1]$. Now by the triangle inequality we have $|a-b|=|f(t_0)-f(t_k)|\leq |f(t_0)-f(t_{k-1})|+|f(t_{k-1})-f(t_k)|$, now apply the triangle inequality to the first term, and continue to arrive at $|f(t_0)-f(t_k)|\leq \sum_{i=0}^k |f(t_{i+1})-f(t_i)| \leq l(f)$.
• To finish, you need to note that the straight line path $\gamma(t) = a+t(b-1)$ satisfies $l(\gamma) = |a-b|$. – copper.hat May 14 '12 at 6:42
The integral definition of length presumes that the derivatives exist and are nice enough for us to use the Fundamental Theorem of Calculus. In this setting one can do the following. Let $v$ be the unit vector that points from $P_1$ to $P_2$. Given a path $\gamma\colon [a,b]\to\mathbb R^3$ that goes from $P_1$ to $P_2$, define $g(t)=\langle \gamma(t), v\rangle$. Note that $g(b)-g(a)$ is equal to the distance from $P_1$ to $P_2$. Also, $|g'(t)|=|\langle \gamma\,'(t), v\rangle|\le |\gamma\,'(t)|$. It follows that $g(b)-g(a)\le \int_a^b |\gamma\,'(t)|\,dt$ which was to be proved.