Paths from Vertex of Minimal Length form Tree

Theorem
Let $G = \struct {V, E}$ be a simple graph.

Let $r \in V$ be a vertex in $G$.

Let $P$ be the set of finite open paths beginning at $r$ that are of minimal length to reach their endpoints.

That is, an open path $p$ beginning at $r$ and ending at some vertex $s$ is in $P$ there is no path $q$ beginning at $r$ and ending at $s$ such that the length of $q$ is less than the length of $p$.

Let $p, q \in P$.

Let $\set {p, q} \in E'$ either:


 * $q$ is formed by extending $p$ with one edge and one vertex of $G$

or:
 * $p$ is formed by extending $q$ with one edge and one vertex of $G$.

Then $T = \struct {P, E'}$ is a tree.

Proof
Let $\left({r}\right)$ be the $0$-length $G$-path whose only vertex is $r$.

Connected
We will show that there is a $T$-path from $\paren r$ to each element $p$ of $P$.

We proceed by induction on the length of $p$.

If $p$ has length $0$, then $p = \paren r$.

Thus the $0$-length $T$-path $\paren {\paren r}$ connects $\paren r$ to $p$.

Suppose that there is a $T$-path from $\paren r$ to each element of $P$ of length $n$.

Let $p \in P$ have length $n + 1$ and final vertex $z$.

Let $p^*$ be the $G$-path obtained from $p$ by removing the last vertex and the last edge.

Then $p^*$ is a $G$-path of length $n$.

We must show that $p^* \in P$.

Let $w$ be the last vertex of $p^*$.

$p^* \notin P$.

Then by definition of $P$, there is a $G$-path $m$ from $r$ to $w$ which is shorter than $p^*$.

But then appending the last edge and vertex of $p$ to $m$, one obtains a $G$-path from $r$ to $z$ which is shorter than $p$.

This contradicts the supposition that $p \in P$.

Thus we conclude that $p^* \in P$.

By the inductive hypothesis, there is a $T$-path $b$ from $\paren r$ to $p^*$.

Then by definition of $E'$, there is an edge from $p^*$ to $p$.

Appending that edge and $p$ to $b$ yields a $T$-path from $\paren r$ to $p$.

As such a $T$-path exists for each $p \in P$, $T$ is connected.