Purpose
A tree is a connected graph with no cycles. This note proves the edge count of a tree by induction and records the two-out-of-three characterization that makes trees easy to recognize.
Edge Count
Claim: every tree with vertices has edges.
A tree on vertices has edges, and removing any leaf leaves a tree on vertices with edges. The proof below runs that deletion in reverse:
flowchart TD a((a)) --- b((b)) a --- c((c)) b --- d((d)) b --- e((e)) c --- f((f))
Proof: by induction on .
Base case: . A tree with 1 vertex has 0 edges.
Inductive hypothesis: suppose every tree with vertices has edges.
Inductive step: let be a tree with vertices. Since is acyclic, it has a vertex of degree at most 1 (proved in graph fundamentals), and since is connected with at least 2 vertices, that vertex has degree exactly 1. Remove it and its edge to get a graph with vertices. is still connected (the removed vertex was a leaf) and still acyclic, so it is a tree, and by the inductive hypothesis it has edges. Adding the vertex and its edge back gives edges.
Leaf Bound
Trees need enough leaves to support their branching points.
Claim: if is a tree, then the number of leaves of is at least the number of vertices of degree at least .
Proof: by induction on the number of vertices.
Base case: a one-vertex tree has no leaves and no vertices of degree at least .
Inductive step: let be a tree on vertices, and remove a leaf and its incident edge. The remaining graph is still a tree. By the inductive hypothesis,
Let be the former neighbor of .
- If , then adding removes from the leaf set and adds , so the number of leaves stays the same.
- If , then in the vertex has degree , so both the leaf count and the count of degree-at-least- vertices increase by .
- If , then was already counted among the branching vertices, and adding only increases the leaf count.
In every case the inequality is preserved, so the claim holds for .
Two-Out-of-Three Property
Any graph satisfying two of the following properties must satisfy the third, and is therefore a tree:
- is connected
- is acyclic
- has edges
This gives a cheap tree test: count the edges and check either connectivity or acyclicity with a single BFS or DFS traversal.
One property alone is not enough
A two-component forest is acyclic without being connected. A triangle plus an isolated vertex has edges and still contains a cycle. The test needs two of the three properties.