next up previous
Next: Exercises for the Reader Up: No Title Previous: Definition of Size

Proving a Theorem by Structural Induction

Based on what we've said about our definitions, there is a pretty obvious connection between the three definitions give above. That is, we would expect the size of a tree to be the sum of the leaves and the nodes. We can make this precise as follows:

theorem396

We will prove this by structural induction. As with natural deduction there are two cases: a base case for leaves, and an induction case for composite trees. Here is how it goes:

Proof: Let t: TREE.
Base Case: Assume t is a leaf.

argue70

Induction Case: Assume that tex2html_wrap_inline132 and that the theorem hold for all trees t':TREE such that size(t') < size(t).

argue73



Norman Papernick
Thu Mar 21 14:56:40 EST 1996