Exercise A.1.6

Exercise statement

Suppose you know that whenever X is true, then Y is true; that whenever Y is true, then Z is true; and whenever Z is true, then X is true. Is this enough to show that X, Y, Z are all logically equivalent? Explain.

Hints

None.

How to think about the exercise

Once you’ve done this exercise and the previous one, you might be wondering if there’s a general rule for figuring out when a given list of statements consists of logically equivalent statements. Here’s one attempt. Draw all the statements as nodes on a graph, then write a directed edge whenever there is an implication. For this exercise you end up with the following graph:

Now what you have to ask is, starting at any node, can I get to any other node? In this case it’s pretty clear that yes, you can do that. So this means the three statements are equivalent.

Suppose we are given a more complicated implication structure like the following:

How can we tell if all of these statements are logically equivalent? Well, one way is to just check one by one. Starting at A, can I get to every other node? B, C, D, F, E. So yes. Now starting at B, … and so on. At the end you will get a yes or no answer (the answer is “no”).

But there is a better way to go about this, which is to detect subsets of the nodes which are logically equivalent, and then join them together into a single node. For instance, we can see immediately that A and B are logically equivalent, so we can join those two nodes together:

And now, we see that A=B, F, and E form a cycle, so they are logically equivalent (starting from anywhere in a cycle, you can go around to reach each of the other spots). So we can join them together:

We can say we are done here, but notice that there are two ways to get from A=B=E=F to D: we can go directly or we can go via C. We don’t really need the former arrow, since we can still get to D even if we erase it. (On the other hand, we can’t get rid of the arrow pointing to C, since then there would be no way to get to C, so the implication structure will have changed.) So we can erase it to make the graph slightly cleaner:

Now it is pretty clear what is going on. The statements A,B,E,F are all logically equivalent, and they are the strongest statements, because they imply everything else. Then comes C, which implies D but not the other statements. Finally there is D, which does not imply any other the other statements.

Unlike the first method, which just gave a yes or no answer, this second method tells you more, because it gives you a subset of the statements which is logically equivalent, and also tells you the strengths of the statements more generally.

Model solution

Yes, this is enough to show that X, Y, Z are all logically equivalent. If X is true, then Y is true. And since Y is true, we see that Z is true. Thus whenever X is true, the other two statements are also true. Similarly, we can show that whenever Y is true, Z and X are also true, and that whenever Z is true, X and Y are also true. This means that whenever one of the statements is true, the other two are both true.

If X is false, then Z is false (if Z were true, then X would have to be true, which would contradict the fact that X is false). And since Z is false, we see that Y is false. Thus whenever X is false, the other two statements are also false. A similar reasoning shows that whenever one of the statements is false, the other two are also false.

Exercise A.1.5

Exercise statement

Suppose you know that X is true if and only if Y is true, and you know that Y is true if and only if Z is true. Is this enough to show that X, Y, Z are all logically equivalent? Explain.

Hints

None.

How to think about the exercise

This is a straightforward exercise so I don’t have anything to say.

Model solution

Yes, X, Y, Z are all logically equivalent. If X is true, then Y is true since X\iff Y. And since Y is true, Z is true since Y \iff Z. Thus if X is true, then both of the other two statements are true. We can use similar reasoning to show that if Y is true, then both of the other two statements are true, and if Z is true, then both of the other two statements are true. Thus, if one of the statements is true, then the other two are also true.

If X is false, then Y is false since X \iff Y. And since Y is false, Z is false since Y\iff Z. Thus if X is false, then the other two statements are false. We can use similar reasoning to show that if any of the statements is false, then the other two must also be false.

The three statements are logically equivalent, since whenever one of them is true, the other two are also true, and whenever one of them is false, the other two are also false.

Exercise A.1.4

Exercise statement

Suppose that you have shown that whenever X is true, then Y is true, and whenever Y is false, then X is false. Have you now demonstrated that X is true if and only if Y is true? Explain.

Hints

None.

How to think about the exercise

This is a straightforward exercise so I don’t have anything to say.

Model solution

No, we have not demonstrated that X is true if and only if Y is true. We are given X \implies Y and \neg Y \implies \neg X. But \neg Y \implies \neg X is logically equivalent to X\implies Y (since the latter is just the contrapositive). In other words, we are only given that X \implies Y, so there is no way to conclude that X \iff Y.

Here is an example that shows that we can satisfy both of the conditions in the exercise statement, but still have X and Y not be logically equivalent: Let x be a real number, let X be the statement x > 0, and let Y be the statement x \geq 0. So if X is true, then Y is true (since every positive real number is non-negative). Also, whenever Y is false, then X is false (since every negative number is not positive). But it is not the case that X is true if and only if Y is true, since for x=0 we see that X is false and Y is true.

Exercise A.1.3

Exercise statement

Suppose that you have shown that whenever X is true, then Y is true, and whenever X is false, then Y is false. Have you now demonstrated that X and Y are logically equivalent? Explain.

Hints

None.

How to think about the exercise

This is a straightforward exercise, so I don’t have anything to say.

Model solution

Yes. We will show that X is true if and only if Y is true. If X is true, then Y is true by what was given in the exercise statement. Conversely, suppose Y is true. We need to show that X is true. Suppose for sake of contradiction that X is false. Then by what was given in the exercise statement, we see that Y is false. But now Y is both true and false, a contradiction. Thus the assumption that X is false was wrong, so X must be true.

Another way to see this is that we are given that X \implies Y and \neg X \implies \neg Y. But the contrapositive of \neg X \implies \neg Y is Y \implies X. Since the contrapositive of an implication is logically equivalent to it, this means that we have both X\implies Y and Y\implies X, i.e. X \iff Y.

Exercise A.1.2

Exercise statement

What is the negation of the statement “X is true if and only if Y is true”? (There may be multiple ways to phrase this negation).

Hints

None.

How to think about the exercise

This is very similar to the previous exercise. Again, I like to use a truth table:

X Y X if and only if Y Negation of previous column
T T T F
T F F T
F T F T
F F T F

Model solution

Here are some natural ways to state the negation:

  1. Either X is true, or Y is true, but not both.
  2. X XOR Y.
  3. X and Y have different truth values.

Exercise A.1.1

Exercise statement

What is the negation of the statement “either X is true, or Y is true, but not both”?

Hints

None.

How to think about the exercise

Tao does not discuss truth tables, but I think they are the easiest way to work through these kinds of exercises systematically. For this exercise, we have:

X Y X or Y but not both negation of previous column
T T F T
T F T F
F T T F
F F F T

So as you can see, the negation of the statement in question is true when both X and Y are true, or when both X and Y are false. This is the same thing as saying X \iff Y.

The alternative way to do this exercise is to make use of your verbal abilities. We want to negate “either X is true, or Y is true, but not both”. This is the same as saying (X is true or Y is true) and not (X is true and Y is true). So negating this, we have: (X is false and Y is false) OR (both X and Y are true). In other words, both X and Y are false, or both X and Y are true, i.e. X and Y must have the same truth value.

Model solution

Here are two natural ways to state the negation:

  1. X is true if and only if Y is true.
  2. X and Y have the same truth value.

Exercise 4.2.2

Exercise statement

Prove the remaining components of Lemma 4.2.3.

Lemma 4.2.3. The sum, product, and negation operations on rational numbers are well-defined, in the sense that if one replaces a//b with another rational number a'//b' which is equal to a//b, then the output of the above operations remains unchanged, and similarly for c//d.

Hints

  1. You might want to review the proofs for Lemma 4.1.3 and Exercise 4.1.2.

How to think about the exercise

I don’t think Tao’s book ever gives an example of an operation which is not well-defined. (I didn’t check all parts of the book, so I might be wrong about this.) Assuming there is no such example, I think this is a pedagogical mistake, so I want to correct that here (partly because it’s especially easy to give an example of an ill-defined operation on the rationals). Why would I do this? There are two reasons:

  1. It’s good to see both positive and negative examples.
  2. From doing exercises like this one, you might get the mistaken impression that basically all operations are well-defined, and that checking well-definedness is a trivial bureaucratic activity.

So with that out of the way, here is my example: Let a//b and c//d be rational numbers. Then we define their component-wise sum to be (a//b) \oplus (c//d) := (a+c)//(b+d). In other words, the component-wise sum of two rational numbers is the sum of the numerators “divided by” the sum of the denominators. (Remember, this definition is ill-defined, so no such operation actually exists!)

First, let’s quickly check that this definition is ill-defined. We have 1//2 = 2//4 but (1//2) \oplus (1//3) = 2//5 and (2//4) \oplus (1//3) = 3//7. Are these two rationals equal? Well, 2\times 7 = 14 \ne 15 = 3\times 5. Even a single example where the outputs are different proves that the operation is not well-defined.

Now, we can try a different approach. Let’s try to prove that component-wise addition is well-defined. Since component-wise addition is not well-defined, we must get stuck somewhere in the proof. The upshot is that checking an operation is well-defined (such as for addition and multiplication) is not trivial: there is something real happening there, which can’t happen for bogus operations like component-wise addition.

Ok, let’s go: Suppose a//b = a'//b', so that ab' = a'b. Now (a//b) \oplus (c//d) = (a+c)//(b+d) and (a'//b') \oplus (c//d) = (a'+c)//(b'+d). To show that these are equal, we must show (a+c)(b'+d) = (a'+c)(b+d). Expanding this, we have (a+c)(b'+d) = ab' + ad + cb' + cd and (a'+c)(b+d) = a'b + a'd + cb + cd. The first term in each is the same, since ab' = a'b. Also, the final term in each is cd. So it suffices to show that ad + cb' = a'd + cb. How can we do this? We can’t! There is nothing in our assumption ab' = a'b or in the properties of the integers that allows us to conclude this. We are stuck, and for a good reason (since the operation is ill-defined).

We can plug in the numbers from above to check this. We have

\begin{aligned}ab' + ad + cb' + cd &= 1\cdot 4 + 1\cdot 3 + 1\cdot 4 + 1\cdot 3 \\ &= 4 + 3 + 4 + 3\end{aligned}

\begin{aligned}a'b + a'd + cb + cd &= 2\cdot 2 + 2\cdot 3 + 1\cdot 2 + 1\cdot 3 \\ &= 4 + 6 + 2 + 3\end{aligned}

So indeed the first and last terms are the same, and the middle two terms are totally different (even when added together).

Model solution

Sum: this was done in the book.

Product: Suppose a//b = a'//b', so that b,b' are non-zero and ab' = a'b. We want to show that (a//b)\times (c//d) = (a'//b') \times (c//d). The left side is (ac)//(bd) and the right side is (a'c)//(b'd). So we want to show that acb'd = a'cbd. But ab' = a'b so multiplying by cd we have ab'cd = a'bcd, which is what we want (after reordering the factors). Similarly if c//d = c'//d' then cd' = c'd. Now (a//b)\times (c//d) = (ac)//(bd) and (a//b)\times (c'//d') = (ac')//(bd') so we want to show that acbd' = ac'bd, which we have since cd'=c'd.

Negation: Suppose a//b = a'//b', so that ab' = a'b. We have -(a//b) = (-a)//b and -(a'//b') = (-a')//b' by definition of negation. We thus have to show that (-a)//b = (-a')//b', i.e. (-a)b' = (-a')b. But this follows from multiplying both sides of the equation ab' = a'b by -1 and using Exercise 4.1.3.

Exercise 4.2.1

Exercise statement

Show that the definition of equality for the rational numbers is reflexive, symmetric, and transitive.

Hints

  1. For transitivity, use Corollary 4.1.9.
  2. Corollary 4.1.9 only works when the number you are cancelling is non-zero!

How to think about the exercise

This is a pretty straightforward exercise. If this exercise feels difficult, you might want to review Exercise 4.1.1.

Model solution

Let x,y,z be rational numbers. Thus there exist integers a,b,c,d,e,f, with b,d,f non-zero, such that x = a//b, y=c//d, and z=e//f.

Reflexive: We must show x=x, i.e. a//b = a//b. But by definition of equality, a//b = a//b means ab=ab, which is the case since equality is reflexive for integers.

Symmetric: We must show that x=y implies y=x. So suppose x=y. This means that a//b = c//d, i.e. ad = cb. To show y=x we must show c//d = a//b, i.e. cb = ad. Since equality for integers is symmetric, we see that ad = cb implies cb=ad, so we are done.

Transitive: Suppose x=y and y=z. We must show that x=z. Since x=y we see that a//b = c//d, i.e. ad = cb, and since y=z we see that c//d = e//f, i.e. cf = ed. By multiplying the first equality by cf we have (ad)(cf) = (cb)(cf), and by multiplying the second equality by cb we have (cb)(cf) = (cb)(ed). Since equality on the integers is transitive, we have adcf = cbed. But d is non-zero, so by Corollary 4.1.9 we have acf = cbe. Now we have two cases. If c\ne 0, we can use Corollary 4.1.9 again to obtain af = eb, i.e. a//b = e//f. On the other hand, if c=0 then ad=cb so ad=0, and since d\ne 0, Proposition 4.1.8 implies that a=0. Similarly, cf=ed so c=0 means that ed=0, so e=0 since d cannot be zero. Thus af = 0 = eb, which means a//b = e//f. In either case, x=z, so we are done.

Exercise 4.1.7

Exercise statement

Prove Lemma 4.1.11.

Lemma 4.1.11 (Properties of order). Let a, b, c be integers.

(a) a>b if and only if a-b is a positive natural number.
(b) (Addition preserves order) If a>b, then a+c > b+c.
(c) (Positive multiplication preserves order) If a>b and c is positive, then ac > bc.
(d) (Negation reverses order) If a>b, then -a<-b.
(e) (Order if transitive) If a>b and b>c, then a>c.
(f) (Order trichotomy) Exactly one of the statements a>b, a<b, or a=b is true.

Hints

  1. Use the first part of this lemma to prove all the others.
  2. You might find Exercise 4.1.3 helpful.

How to think about this exercise

This is a straightforward exercise as long as you follow the hints.

Model solution

(a) Suppose a>b. This means that a\geq b and a\ne b. Since a\geq b, we have a = b+n for some natural number n. Add -b to both sides of this equation to obtain a-b = b+n + (-b) = b+ (-b) + n = n, where the last two equalities follow from the laws of algebra (Proposition 4.1.6). Thus a-b is equal to a natural number. If n=0, then a-b=0 so a=b, a contradiction. Thus n\ne 0, which means a-b is a positive natural number.

Now suppose a-b is a positive natural number. Thus a-b = n, where n\ne 0 is a natural number. By adding b to both sides we obtain a-b + b = n+b, i.e. a = b+n. Thus a\geq b. If a=b then we would have 0=a-b = n, which contradicts the fact that n\ne 0. Thus a\ne b, which together with a\geq b implies that a>b.

(b) Suppose a>b. By part (a), this means a-b is a positive natural number. By the laws of algebra, a-b = a-b + c + (-c) = (a+c) + (-b) + (-c). By Exercise 4.1.3, -b = (-1)b and -c = (-1)c. Thus (-b) + (-c) = (-1)b + (-1)c = (-1)(b+c) = -(b+c), where we have used the distributive law. We thus have a-b = (a+c) - (b+c). Since this is a positive natural number, by part (a) again we see that a+c > b+c.

(c) Suppose a>b and c is positive. By part (a), we see that a-b is positive. Thus by Lemma 2.3.3 we see that (a-b)c is positive. We have (a-b)c = (a + (-b))c = ac + (-b)c = ac + (-1)bc = ac-bc, where we have used the distributive law and Exercise 4.1.3. Since ac-bc is positive, by part (a) again we see that ac > bc.

(d) Suppose a>b. Thus by part (a) we see that a-b is positive. To show that -a < -b, we need to show that (-b) - (-a) is positive. But (-b) - (-a) = (-b) + (-1)(-1)a = (-1)(-1)a + (-b). We have (-1)(-1) = (0{{-}\!{-}}1)(0{{-}\!{-}}1) = 1{{-}\!{-}}0 = 1. Thus (-1)(-1)a + (-b) = a-b. Since a-b is positive, and a-b = (-b)-(-a), we see that (-b)-(-a) is positive as required.

(e) Suppose a>b and b>c. Thus by part (a), we see that a-b and b-c are positive. By Proposition 2.2.8, we thus see that (a-b) + (b-c) = a-c is a positive number. By part (a) again, we thus see that a>c as desired.

(f) We first show that at least one of a>b, a<b, or a=b is true. Consider the integer a-b. By trichotomy (Lemma 4.1.5) it is zero, positive, or negative. If a-b=0 then a=b. If a-b is positive then by part (a), we have that a>b. If a-b is negative, then a-b = -n for some positive natural number n, so -(a-b) = n is positive. But -(a-b) = b-a, so by part (a) we have b > a.

Now we show that at most one of a>b, a<b, or a=b is true. If a>b and a<b then a-b and b-a = -(a-b) are both positive. But if -(a-b) is positive then -(a-b) = n for positive natural number n, so a-b = -n, i.e. a-b is negative. Thus a-b is both positive and negative, which contradicts the trichotomy of integers. If a>b and a=b then we have both a\ne b and a=b, a contradiction. Similarly we cannot have both a<b and a=b.

Exercise 4.1.4

Exercise statement

Prove the remaining identities in Proposition 4.1.6.

Proposition 4.1.6 (Laws of algebra for integers). Let x,y,z be integers. Then we have

x+y = y+x
(x+y) + z = x + (y+z)
x+0 = 0+x = x
x + (-x) = (-x) + x = 0
xy = yx
(xy)z = x(yz)
x1 = 1x = x
x(y+z) = xy+xz
(y+z)x = yx + zx

Hints

  1. One can save some work by using some identities to prove others. For instance, once you know that xy=yx, you get for free that x1=1x, and once you also prove x(y+z) = xy+xz, you automatically get (y+z)x = yx + zx for free.

How to think about the exercise

This is the sort of exercise where, even if you know exactly what you are doing, you might slip up and make a mistake shuffling symbols around. I would say to not worry about making small errors like that, as long as you can get most of them right. I checked my work a couple of times, but it’s possible that I’ve made such errors below.

Model solution

Write x = (a{{-}\!{-}}b), y=(c{{-}\!{-}}d), and z = (e{{-}\!{-}}f).

First we show that x+y = y+x. We have x+y = (a{{-}\!{-}}b)+(c{{-}\!{-}}d) = (a+c){{-}\!{-}}(b+d) and y+x = (c{{-}\!{-}}d)+(a{{-}\!{-}}b) = (c+a){{-}\!{-}}(d+b) = (a+c){{-}\!{-}}(b+d), where the last equality follows from the commutativity of addition on the natural numbers. Thus one sees that x+y=y+x.

Next we show that (x+y) + z = x + (y+z). We have

\begin{aligned}(x+y) + z &= ((a{{-}\!{-}}b) + (c{{-}\!{-}}d)) + (e{{-}\!{-}}f) \\ &= ((a+c){{-}\!{-}}(b+d)) + (e{{-}\!{-}}f) \\ &= (a+c+e){{-}\!{-}}(b+d+f)\end{aligned}

\begin{aligned}x + (y+z) &= (a{{-}\!{-}}b) + ((c{{-}\!{-}}d) + (e{{-}\!{-}}f)) \\ &= (a{{-}\!{-}}b) + ((c+e){{-}\!{-}}(d+f)) \\ &= (a+c+e){{-}\!{-}}(b+d+f)\end{aligned}

Thus we see that (x+y) + z = x + (y+z).

Next we show that x+0 = 0+x = x. We showed the commutativity of addition above, so x+0 = 0+x. So we just need to show 0+x = x. We have 0+x = (0{{-}\!{-}}0)+(a{{-}\!{-}}b) = (0+a){{-}\!{-}}(0+b) = a{{-}\!{-}}b = x.

Next we show x + (-x) = (-x) + x = 0. By commutativity of addition, we have x + (-x) = (-x) + x. So we just need to show that (-x) + x = 0. We have

\begin{aligned}(-x) + x &= (b{{-}\!{-}}a) + (a{{-}\!{-}}b) \\ &= (b+a){{-}\!{-}}(a+b) \\ &= (a+b){{-}\!{-}}(a+b)\end{aligned}

But (a+b){{-}\!{-}}(a+b) = (0{{-}\!{-}}0) since (a+b)+0 = 0+(a+b).

Next we show that xy = yx. We have xy = (a{{-}\!{-}}b)(c{{-}\!{-}}d) = (ac+bd){{-}\!{-}}(ad+bc) and

\begin{aligned}yx &= (c{{-}\!{-}}d)(a{{-}\!{-}}b) \\ &= (ca+db){{-}\!{-}}(cb+da) \\ &= (ac+bd){{-}\!{-}}(ad+bc)\end{aligned}

Thus the two sides are equal, and we have xy=yx.

The associativity of multiplication, (xy)z = x(yz), was already shown in the book.

Next we show that x1 = 1x = x. We have x1 = 1x by the commutativity of multiplication, which was shown above. Thus we can just show 1x=x. We have 1x = (1{{-}\!{-}}0)(a{{-}\!{-}}b) = (a{{-}\!{-}}b) = x.

Next we show x(y+z) = xy+xz. We have

\begin{aligned}x(y+z) &= (a{{-}\!{-}}b)((c{{-}\!{-}}d) + (e{{-}\!{-}}f)) \\ &= (a{{-}\!{-}}b)((c+e){{-}\!{-}}(d+f)) \\ &= (a(c+e) + b(d+f)){{-}\!{-}}(a(d+f) + b(c+e)) \\ &= (ac+ae+bd+bf){{-}\!{-}}(ad+af+bc+be)\end{aligned}

\begin{aligned}xy+xz &= (a{{-}\!{-}}b)(c{{-}\!{-}}d) + (a{{-}\!{-}}b)(e{{-}\!{-}}f) \\ &= ((ac+bd){{-}\!{-}}(ad+bc)) + ((ae+bf){{-}\!{-}}(af+be)) \\ &= (ac+bd + ae+bf){{-}\!{-}}(ad+bc + af+be) \\ &= (ac+ae+bd+bf){{-}\!{-}}(ad+af+bc+be)\end{aligned}

The two sides are equal, so x(y+z) = xy+xz.

Finally, we show that (y+z)x = yx + zx. We have (y+z)x = x(y+z) = xy+xz = yx+zx by the commutativity of multiplication, the distributive law, and commutativity again, all of which were shown earlier in the proof.