Paths of Minimal Length from Vertex form Tree

Theorem
Let $G = (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 far endpoints.

That is, an open path $p$ beginning at $r$ and ending at some vertex $s$ is in $P$ iff 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$.

For $p, q \in P$, let $\{p,q\} \in E'$ iff either:


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

Then $T = (P, E')$ is a tree.

Proof
Let $(r)$ be the $0$-length $G$-path whose only vertex is $r$.

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

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

If $p$ has length $0$, then $p = (r)$.

Thus the $0$-length $T$-path $((r))$ connects $(r)$ to $p$.

Suppose that there is a $T$-path from $(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^*$.

Suppose for the sake of contradiction that $p^* \notin P$.

Then by the 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$, contradicting the fact that $p \in P$.

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

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

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

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

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