Number of Edges in Forest

Theorem
Let $F = \left({V, E}\right)$ be a forest with $n$ nodes and $m$ components.

Then $F$ contains $n-m$ edges.

Proof
By definition, a forest is a disconnected graph whose components are all trees.

Let the number of nodes in each component of $F$ be $n_1, n_2, \ldots, n_m$ where of course $\displaystyle \sum_{i \mathop = 1}^m n_i = n$.

From Tree has One Less Edge than it has Nodes, the number of edges in tree $i$ is $n_i - 1$.

So the total number of edges in $F$ is:
 * $\displaystyle \sum_{i \mathop = 1}^m \left({n_i - 1}\right) = \sum_{i \mathop = 1}^m n_i - \sum_{i \mathop = 1}^m 1 = n - m$