Definition (Tree)

A tree is a connected Graph with no cycles.

Definition (Forest)

A forest is a Graph with no cycles, where each connected component is a tree.

Lemma (Trees have Unique Paths)

If is a tree with as vertices, then there is a unique path from to .

Proof: is connected, so there is a path from to . Suppose by contradiction there were two different paths . Suppose are isomorphic up to some vertex . From this vertex, the paths may be unique up to some point (in which can be ). But then as we have a path from from and path from , then we have a cycle, a contradiction.

graph LR;
	u((u)) o--o w((w));
	w o--P1--o x((x));
	w o--P2--o x;
	x o--P1--o v((v));
	x o--P2--o v;

Trees with Vertices

We do this based on maximum degree of a vertex.

graph
	a((a)) o--o b((b));
	a o--o c((c));
	a o--o d((d));
	a o--o e((e));

or

graph
	a((a)) o--o b((b));
	a o--o c((c));
	a o--o d((d));
	b o--o e((e));

or

graph LR
	a((a)) o--o b((b));
	b o--o c((c));
	c o--o d((d));
	d o--o e((e));

But we see that no matter what, there are edges.

Lemma (Tree Edge Count)

For any tree ,

Intuitively, we build a tree by adding edge at a time. Let be the number of vertices of this tree. For each edge connecting we add, one of two things happen:

  1. we decrease the number of connected components (CCs) by
  2. it stays the same, but is now part of a cycle.

Case 1: If are not in the same CC, then given , we can now have a path from one CC to another CC. But then these vertices are now connected, thus reducing one.

Case 2: If is in the same CC, then the number of connected components do not change. But as there is already a path from , adding means we can have another unique path from , creating a cycle.

Let denote the number of connected components. We prove a more general lemma and show equality after. I claim

and that

iff has no cycles.

Proof: By induction on . If then . For equality, we have no cycles and that

so we are done.

Assume that for all with , this is true. We want to prove for where . Suppose we remove some edge in to get edges. Label this graph . By the induction hypothesis, we have that

Suppose we add back this edge. We have two cases:

Case 1: If connects different CCs, then they merge into a single CC. Therefore . So,

which is our hypothesis. If was a forest, then each CC would have no cycle such that

which is our equality case.

Case 2: If does not connect CCs, then are in the same CC. In particular, . So,

Indeed, this shows th inequality and the contrapositive of the equality.

Since trees have no cycles and only CC, then .

Definition (Leaf)

In a tree , a leaf is a vertex of degree .

Lemma (Minimum Leaves)

Any (finite) tree on vertices has at least leaves.

Proof: Let be some tree with vertices. By the Handshake Lemma and Lemma (Tree Edge Count),

Then since the leaves have only degree , we can count the degrees of the leaves.

But then

Definition (Spanning Tree)

If is a Graph, a spanning tree of is a subgraph that is a tree and has the same vertex set.

graph LR;
    A((A)) o--o B((B));
    B((B)) o--o C((C));
    C((C)) o--o A((A));
    B((B)) o--o D((D));
    D((D)) o--o E((E));
    C((C)) o--o E((E));

with the spanning tree:

graph LR;
    A((A)) o--o B((B));
    B((B)) o--o C((C));
    B((B)) o--o D((D));
    D((D)) o--o E((E));

Theorem (Connected Graphs Have a Spanning Tree)

Every (finite) connected graph has a spanning tree.

Proof: Start with graph , and a subgraph with no edges. While does not connect all vertices in , find some edge in that connects different components and add it to .

This construction gives us a tree because we never create a cycle.

Suppose for the sake of contradiction that the construction stops before is a fully connected graph. Thus, is some forest with at least two separate connected components. But then that means there is no edge to connect these two in . But then is now disconnected, a contradiction.