Soundness of a simple tree edge count proof by induction

682 Views Asked by At

I'm trying practice and get better at proofs. Here is my attempt at a proof of the following simple statement:

There are $n-1$ edges in a $n$ vertex tree.

We will prove this by induction on $n$ vertices. Consider the base case, $n=1$, then we clearly have 0 edges.

Let's assume that the claim holds for $n=k$ vertices, and we'll try to show that it must then also hold for a $k+1$ vertices. For $k$ vertices we have then $k-1$ edges according to the claim. Consider adding a vertex. Now, we have a graph with $k + 1$ vertices. Since we are dealing with a tree, it must be connected by definition, so we must add least one edge to connect it to the $k$-vertex tree. Thus, we have a graph with with $k + 1$ vertices and $k$ edges. This new graph $G'$ must also be a tree, because adding a vertex and a single edge cannot produce a new cycle, as moving via the edges we can only enter the newly added vertex, but not leave it.

Finally, we must show that there cannot be any more than $k$ edges in the new graph $G'$. Consider adding an edge $e$ between any pair of nodes $u$ and $v$. Now, we can move from $u$ to $v$ via both the edge $e= (u,v)$ and also via a simple path (using a fact about trees: there is only a single simple path between any two vertices $u$ and $v$), connecting $u$ and $v$. This will form a cycle, which is a contradiction, since trees cannot contain cycles. Thus there cannot be any more than $k$ edges. This completes the proof of the step.

Therefore the total number of edges for a tree of $n$ vertices is exactly $n-1$.

Is this sound?

Edit:

Improved version:

Let's assume that the claim holds for $n=k$ vertices, and we'll try to show that it must then also hold for a $k+1$ vertices. Consider the Tree $T'$ which has $k+1$ vertices. Since every tree has at least one leaf node $v$, we can remove it from $T'$, this obtained tree $T$ now has one node less than $T'$, particularly it has $k$ vertices. According to the induction hypothesis, this $k$-vertex tree must have $k-1$ edges. But then the tree $T'$ must have one edge more, namely $k$ edges. And this is what we wanted to show.

1

There are 1 best solutions below

4
On BEST ANSWER

It is not a priori valid to assume that a tree on $k+1$ vertices is obtained by adding an edge to a $k$-vertex tree. Instead, you should start from an arbitrary* $(k+1)$-vertex tree and then e.g. investigate what happens upon removing an edge.

* I'm not sure if "arbitrary" counts as a pun in this context (arbor is latin for tree)