Exercise · Volume 1 · 2.3-14
Exercise 2.3-14
not stated yet in Lean solution written
| Rating | M22 |
|---|---|
| Markers | M (mathematical) |
| Kind | K1, prove: show that a stated fact is true from the written solution |
| Section | Section 2.3 of Volume 1 |
The task
Let be a nonempty finite set of strings (, positive integers ) that is closed in this way: if , then when and when . Show that is the set of Dewey numbers of a tree.
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
First show that . Then show that the children of a node are for some .
Hint 2
Group the strings that begin with . Show that each group, with renamed to , satisfies the same condition and has fewer elements. Use induction on .
Solution
Show the solution
Claim. If is nonempty, finite and closed, there is a unique ordered tree whose Dewey numbers are exactly the strings of .
Step 1: . Take any element of . If it is with , the rule gives in . If , the rule gives . Each such step decreases the sum of the length and the last number, so after finitely many steps the string is . Hence .
Step 2: the children. For a string , let be the largest with , or if there is none. It exists because is finite. By the rule, for each : from the rule gives , and so on down to . So the strings of the form in are exactly .
Step 3: induction on . For we have , the tree of one node. Let . By Step 2 with , the strings of other than begin with for some . For each such let be the set of strings of that begin with (or equal ), where the prefix is replaced by . Each contains , since by Step 2. Each is finite and has fewer elements than , because it misses the string of . The closure is inherited: if then , so or is in , and the corresponding string is in . By induction each is the Dewey set of an ordered tree . Then is the Dewey set of the tree with root and with subtrees in this order. The tree is unique, because the Dewey strings determine the parent and the order of siblings.
Check
Python3 listed the 15 strings with and , tried all nonempty subsets and kept the closed ones. It found 183 closed sets. The number of ordered trees with at most 2 children per node and at most 3 levels below the root is , where and . This gives , , . The two counts agree.
Remarks
This closure condition is a third way to define a tree, next to the recursive definition and the nested sets.
This solution is drafted, and a person has not reviewed it yet. The source.
In Lean
not stated yet The exercise is not stated in Lean yet.
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.