taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.1-15

Exercise 1.2.1-15

proved in Lean solution written

RatingHM28
MarkersHM (needs higher mathematics), recommended
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.1 of Volume 1. Companion chapter: Mathematical induction

The task

Study well-orderings: (a) the integers with << are not well-ordered, (b) find a well-ordering of the integers, (c) decide for the nonnegative reals, (d) and (e) decide for tuples under lexicographic order, (f) a characterization by descending sequences, (g) induction on a well-ordered set.

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

Write each part in terms of the property (iii): every nonempty subset has a least element.

Hint 2

For (d), use induction on the length nn of the tuples: look at the set of the first components of a nonempty set of tuples.

Hint 3

For (e), test the order on tuples of the form (a,…,a,b)(a, \ldots, a, b) with a≺ba \prec b. For (g), look at the set of the elements where PP fails.

Solution

Show the solution

Call a least element of a set AA an element x∈Ax \in A with x⪯yx \preceq y for all y∈Ay \in A.

(a) The set ℤ\mathbb Z itself has no least element for <<: for each integer xx, the integer x−1x - 1 is smaller. So (iii) fails. (The set of negative integers fails in the same way.)

(b) Define x≺yx \prec y when ∣x∣<∣y∣|x| < |y|, or when ∣x∣=∣y∣|x| = |y| and x<yx < y. The order of the integers is 0,−1,1,−2,2,−3,3,…0, -1, 1, -2, 2, -3, 3, \ldots. It is the lexicographic order of the pairs (∣x∣,x)(|x|, x), and x↦(∣x∣,x)x \mapsto (|x|, x) is one to one. So (i) and (ii) hold, as for any order given by a one to one map into a totally ordered set. For (iii), let AA be nonempty, and let ss be the least value of ∣x∣|x| for x∈Ax \in A; it exists since the nonnegative integers are well-ordered by <<. At most two elements of AA have ∣x∣=s|x| = s, namely −s-s and ss, and the one that is smaller for << is the least element of AA.

(c) No. The set of the positive reals is a nonempty subset of the nonnegative reals. For each positive xx, the number x/2x/2 is positive and smaller, so there is no least element.

(d) Yes. First (i) and (ii). Let x≠yx \ne y be two tuples, and let kk be the first index with xk≠ykx_k \ne y_k. Then x≺yx \prec y if xk≺ykx_k \prec y_k, and y≺xy \prec x if yk≺xky_k \prec x_k, and exactly one of the two holds by (ii) in SS. For transitivity, let x≺yx \prec y at index kk and y≺zy \prec z at index ll, and let p=min⁡(k,l)p = \min(k, l). The tuples agree up to p−1p - 1. At position pp the three entries satisfy xp⪯yp⪯zpx_p \preceq y_p \preceq z_p with at least one strict step. So xp≺zpx_p \prec z_p by (i) in SS, and x≺zx \prec z.

For (iii) use induction on nn. For n=1n = 1 it is the property of SS. Let n>1n > 1 and let A⊆TnA \subseteq T_n be nonempty. The set of the first components of the elements of AA is a nonempty subset of SS, so it has a least element xx. Let AxA_x be the set of the tuples of AA with first component xx, with the first component removed. This is a nonempty subset of Tn−1T_{n-1}, and by induction it has a least element (x2,…,xn)(x_2, \ldots, x_n). Then (x,x2,…,xn)(x, x_2, \ldots, x_n) is the least element of AA: a tuple of AA with a larger first component is larger, and one with first component xx is larger or equal by the choice of (x2,…,xn)(x_2, \ldots, x_n).

(e) Not in general. The relation still satisfies (i) and (ii), but (iii) fails as soon as SS has two elements a≺ba \prec b. The tuples (b),(a,b),(a,a,b),(a,a,a,b),…(b), (a, b), (a, a, b), (a, a, a, b), \ldots have the property that each one is larger than the next: (ak+1,b)≺(ak,b)(a^{k+1}, b) \prec (a^k, b) since at position k+1k + 1 the entry aa is smaller than bb. So the set has no least element. If SS has only one element, the order is the order by length, and it is a well-ordering. (To get a well-ordering of TT for each SS, compare the length first and then the tuples of equal length by the lexicographic order of (d).)

(f) Let (i) and (ii) hold. If ≺\prec is a well-ordering and x1,x2,…x_1, x_2, \ldots is an infinite sequence with xj+1≺xjx_{j+1} \prec x_j, the set {x1,x2,…}\{x_1, x_2, \ldots\} has a least element xjx_j. But xj+1≺xjx_{j+1} \prec x_j and (ii) say that xj⪯xj+1x_j \preceq x_{j+1} is false. This is a contradiction, so no such sequence exists. Conversely, suppose (iii) fails: some nonempty AA has no least element. Choose x1∈Ax_1 \in A. Since x1x_1 is not least, some x2∈Ax_2 \in A is not ⪰x1\succeq x_1, and by (ii) x2≺x1x_2 \prec x_1. In the same way choose x3≺x2x_3 \prec x_2 in AA, and so on. This is an infinite descending sequence. (The choices use the axiom of choice for countably many steps.) So if there is no such sequence, (iii) holds.

(g) Let AA be the set of the x∈Sx \in S for which P(x)P(x) is false. If AA is not empty, it has a least element x0x_0. For each y≺x0y \prec x_0, y∉Ay \notin A, so P(y)P(y) is true. By the hypothesis of (g), P(x0)P(x_0) is true. This contradicts x0∈Ax_0 \in A. So AA is empty, and P(x)P(x) holds for all x∈Sx \in S. □\square

Check

For (b), the first elements in the order are 0,−1,1,−2,2,…0, -1, 1, -2, 2, \ldots, and the first ten satisfy x≺yx \prec y along the list. In (d) with S={0,1}S = \{0, 1\} and n=2n = 2, the order is (0,0)≺(0,1)≺(1,0)≺(1,1)(0,0) \prec (0,1) \prec (1,0) \prec (1,1). In (e) with a=0a = 0, b=1b = 1: (1)≻(0,1)≻(0,0,1)≻(0,0,0,1)(1) \succ (0, 1) \succ (0, 0, 1) \succ (0, 0, 0, 1), a descending chain. For (g) with S={1,2,…}S = \{1, 2, \ldots\} and <<, the hypothesis at x=1x = 1 is empty, so P(1)P(1) holds without a separate base case, and (g) is the strong induction of Exercise 1.2.1-5.

Remarks

Part (g) is the principle behind all proofs of termination: a quantity that gets smaller at each step in a well-ordered set. Part (d) gives induction on several integers at once, which is called double induction for pairs. The C1 chapter of Section 1.2.1 states the principle and its link to the least-element property.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only. Lean states the parts one by one.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.