maths.freeDiscrete Math & Logic › 2. Logic and Proofs › Chapter Summary

Chapter Summary

We have considered logic both as its own sub-discipline of mathematics and as a means to help us better understand and write proofs.

Chapter Summary

We have considered logic both as its own sub-discipline of mathematics and as a means to help us better understand and write proofs. We noticed that mathematical statements have a particular logical form, and analyzing that form can help make sense of the statement.

At the most basic level, a statement might combine simpler statements using logical connectives. We often make use of variables and quantify over those variables. How to resolve the truth or falsity of a statement based on these connectives and quantifiers is what logic is all about. From this, we can decide whether two statements are logically equivalent or if one or more statements (logically) imply another.

When writing proofs (in any area of mathematics) our goal is to explain why a mathematical statement is true. Thus it is vital that our argument implies the truth of the statement. To be sure of this, we first must know what it means for the statement to be true, as well as ensure that the statements that make up the proof correctly imply the conclusion. A firm understanding of logic is required to check whether a proof is correct.

There is, however, another reason that understanding logic can be helpful. Understanding the logical structure of a statement often gives clues for how to write a proof of the statement.

This is not to say that writing proofs is always straight-forward. Consider again the Goldbach conjecture:

Every even number greater than 2 can be written as the sum of two primes.

We are not going to try to prove the statement here, but we can at least say what a proof might look like, based on the logical form of the statement. Perhaps we should write the statement to highlight the quantifiers and connectives:

For all integers \(n\), if \(n\) is even and greater than 2, then there exist integers \(p\) and \(q\) such that \(p\) and \(q\) are prime, and \(n = p+q\).

What would a direct proof look like? Since the statement starts with a universal quantifier, we would start, ``Let \(n\) be an arbitrary integer." The rest of the statement is an implication. In a direct proof we assume the if part, so the next line would be, Assume \(n\) is greater than 2 and is even. I have no idea what comes next, but eventually, we would need to find two prime numbers \(p\) and \(q\) (depending on \(n\)) and explain how we know that \(n = p+q\).

Or maybe we try a proof by contradiction. To do this, we first assume the negation of the statement we want to prove. What is the negation? From what we have studied we should be able to see that it is,

There is an integer \(n\) such that \(n\) is even and greater than \(2\), but for all integers \(p\) and \(q\), either \(p\) or \(q\) is not prime, or \(n \ne p+q\).

Could this statement be true? A proof by contradiction would start by assuming it was and eventually conclude with a contradiction, proving that our assumption of truth was incorrect. And if you can find such a contradiction, you will have proved one of the most famous open problems in mathematics. Good luck.

Practice (11)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Complete a truth table for the statement \(\neg P \imp (Q \wedge R)\).

    Vis svaret
    \(P\)\(Q\)\(R\)\(\neg P \imp (Q \wedge R)\)
    TTTT
    TTFT
    TFTT
    TFFT
    FTTT
    FTFF
    FFTF
    FFFF
  2. Suppose you know that the statement if Peter is not tall, then Quincy is fat and Robert is skinny is false. What, if anything, can you conclude about Peter and Robert if you know that Quincy is indeed fat? Explain (you may reference Question).

    Vis svaret

    Peter is not tall, and Robert is not skinny. You must be in row 6 in the truth table above.

  3. Are the statements \(P \imp (Q \vee R)\) and \((P \imp Q) \vee (P \imp R)\) logically equivalent? Explain your answer.

    Vis svaret

    Yes. To see this, make a truth table for each statement and compare.

  4. Is the following a valid deduction rule? Explain.

    \(P \imp Q\)
    \(P\imp R\)
    \(\therefore\)\(P \imp (Q \wedge R)\).
    Vis svaret

    Make a truth table that includes all three statements in the argument:

    \(P\)\(Q\)\(R\)\(P \imp Q\)\(P \imp R\)\(P \imp (Q \wedge R)\)
    TTTTTT
    TTFTFF
    TFTFTF
    TFFFFF
    FTTTTT
    FTFTTT
    FFTTTT
    FFFTTT

    Notice that in every row for which both \(P \imp Q\) and \(P \imp R\) is true, so is \(P \imp (Q \wedge R)\). Therefore, whenever the premises of the argument are true, so is the conclusion. In other words, the deduction rule is valid.

  5. Write the negation, converse and contrapositive for each of the statements below.

    1. If the power goes off, then the food will spoil.

    2. If the door is closed, then the light is off.

    3. \(\forall x (x \lt 1 \imp x^2 \lt 1)\)
    4. For all natural numbers \(n\), if \(n\) is prime, then \(n\) is solitary.

    5. For all functions \(f\), if \(f\) is differentiable, then \(f\) is continuous.

    6. For all integers \(a\) and \(b\), if \(a\cdot b\) is even, then \(a\) and \(b\) are even.

    7. For every integer \(x\) and every integer \(y\), there is an integer \(n\) such that if \(x > 0\) then \(nx > y\).

    8. For all real numbers \(x\) and \(y\), if \(xy = 0\) then \(x = 0\) or \(y = 0\).

    9. For every student in Math 228, if they do not understand implications, then they will fail the exam.

    Vis svaret

    1. Negation: The power goes off, and the food does not spoil.

      Converse: If the food spoils, then the power went off.

      Contrapositive: If the food does not spoil, then the power did not go off.

    2. Negation: The door is closed, and the light is on.

      Converse: If the light is off, then the door is closed.

      Contrapositive: If the light is on, then the door is open.

    3. Negation: \(\exists x (x \lt 1 \wedge x^2 \ge 1)\)

      Converse: \(\forall x( x^2 \lt 1 \imp x \lt 1)\)

      Contrapositive: \(\forall x (x^2 \ge 1 \imp x \ge 1)\).

    4. Negation: There is a natural number \(n\) which is prime but not solitary.

      Converse: For all natural numbers \(n\), if \(n\) is solitary, then \(n\) is prime.

      Contrapositive: For all natural numbers \(n\), if \(n\) is not solitary, then \(n\) is not prime.

    5. Negation: There is a function which is differentiable and not continuous.

      Converse: For all functions \(f\), if \(f\) is continuous, then \(f\) is differentiable.

      Contrapositive: For all functions \(f\), if \(f\) is not continuous then \(f\) is not differentiable.

    6. Negation: There are integers \(a\) and \(b\) for which \(a\cdot b\) is even but \(a\) or \(b\) is odd.

      Converse: For all integers \(a\) and \(b\), if \(a\) and \(b\) are even, then \(ab\) is even.

      Contrapositive: For all integers \(a\) and \(b\), if \(a\) or \(b\) is odd, then \(ab\) is odd.

    7. Negation: There are integers \(x\) and \(y\) such that for every integer \(n\), \(x \gt 0\) and \(nx \le y\).

      Converse: For every integer \(x\) and every integer \(y\) there is an integer \(n\) such that if \(nx > y\), then \(x > 0\).

      Contrapositive: For every integer \(x\) and every integer \(y\) there is an integer \(n\) such that if \(nx \le y\), then \(x \le 0\).

    8. Negation: There are real numbers \(x\) and \(y\) such that \(xy = 0\), but \(x \ne 0\) and \(y \ne 0\).

      Converse: For all real numbers \(x\) and \(y\), if \(x = 0\) or \(y = 0\), then \(xy = 0\)

      Contrapositive: For all real numbers \(x\) and \(y\), if \(x \ne 0\) and \(y \ne 0\), then \(xy \ne 0\).

    9. Negation: There is at least one student in Math 228 who does not understand implications but will still pass the exam.

      Converse: For every student in Math 228, if they fail the exam, then they did not understand implications.

      Contrapositive: For every student in Math 228, if they pass the exam, then they understood implications.

  6. Consider the statement, For all integers \(n\), if \(n\) is even and \(n \le 7\), then \(n\) is negative or \(n \in \{0,2,4,6\}\).

    1. Is the statement true? Explain why.

    2. Write the negation of the statement. Is it true? Explain.

    3. State the contrapositive of the statement. Is it true? Explain.

    4. State the converse of the statement. Is it true? Explain.

    Vis svaret

    1. The statement is true. If \(n\) is an even integer less than or equal to 7, then the only way it could not be negative is if \(n\) was equal to 0, 2, 4, or 6.

    2. There is an integer \(n\) such that \(n\) is even and \(n \le 7\), but \(n\) is not negative and \(n \not\in \{0,2,4,6\}\). This is false, since the original statement is true.

    3. For all integers \(n\), if \(n\) is not negative and \(n \not\in\{0,2,4,6\}\), then \(n\) is odd or \(n > 7\). This is true, since the contrapositive is equivalent to the original statement (which is true).

    4. For all integers \(n\), if \(n\) is negative or \(n \in \{0,2,4,6\}\), then \(n\) is even and \(n \le 7\). This is false. \(n = -3\) is a counterexample.

  7. Consider the statement: \(\forall x (\forall y (x + y = y) \imp \forall z (x\cdot z = 0))\).

    1. Explain what the statement says in words. Is this statement true? Be sure to state what you are taking the universe of discourse to be.

    2. Write the converse of the statement, both in words and in symbols. Is the converse true?

    3. Write the contrapositive of the statement, both in words and in symbols. Is the contrapositive true?

    4. Write the negation of the statement, both in words and in symbols. Is the negation true?

    Vis svaret

    1. For any number \(x\), if it is the case that adding any number to \(x\) gives that number back, then multiplying any number by \(x\) will give 0. This is true (of the integers or the reals). The if part only holds if \(x = 0\), and in that case, anything times \(x\) will be 0.

    2. The converse in words is this: For any number \(x\), if everything times \(x\) is zero, then everything added to \(x\) gives itself. Or in symbols: \(\forall x (\forall z (x \cdot z = 0) \imp \forall y (x + y = y))\). The converse is true: The only number which when multiplied by any other number gives 0 is \(x = 0\). And if \(x = 0\), then \(x + y = y\).

    3. The contrapositive in words is: For any number \(x\), if there is some number which when multiplied by \(x\) does not give zero, then there is some number which when added to \(x\) does not give that number. In symbols: \(\forall x (\exists z (x\cdot z \ne 0) \imp \exists y (x + y \ne y))\). We know the contrapositive must be true because the original implication is true.

    4. The negation: There is a number \(x\) such that any number added to \(x\) gives the number back again, but there is a number you can multiply \(x\) by and not get 0. In symbols: \(\exists x (\forall y (x + y = y) \wedge \exists z (x \cdot z \ne 0))\). Of course since the original implication is true, the negation is false.

  8. Simplify the following.

    1. \(\neg (\neg (P \wedge \neg Q) \imp \neg(\neg R \vee \neg(P \imp R)))\)
    2. \(\neg \exists x \neg \forall y \neg \exists z (z = x + y \imp \exists w (x - y = w))\)

    Vis svaret

    1. \((\neg P \vee Q) \wedge (\neg R \vee (P \wedge \neg R))\)
    2. \(\forall x \forall y \forall z (z = x+y \wedge \forall w (x-y \ne w))\)

  9. Consider the statement, For all integers \(n\), if \(n\) is odd, then \(7n\) is odd.

    1. Prove the statement. What sort of proof are you using?

    2. Prove the converse. What sort of proof are you using?

    Vis svaret

    1. Direct proof.

      Proof

      Let \(n\) be an integer. Assume \(n\) is odd. So \(n = 2k+1\) for some integer \(k\). Then \[7n = 7(2k+1) = 14k + 7 = 2(7k +3) + 1\].

      Since \(7k + 3\) is an integer, we see that \(7n\) is odd.

    2. The converse is: For all integers \(n\), if \(7n\) is odd, then \(n\) is odd. We will prove this by contrapositive.

      Proof

      Let \(n\) be an integer. Assume \(n\) is not odd. Then \(n = 2k\) for some integer \(k\). So \(7n = 14k = 2(7k)\) which is to say \(7n\) is even. Therefore \(7n\) is not odd.

  10. Suppose you break your piggy bank and scoop up a handful of 22 coins (pennies, nickels, dimes, and quarters).

    1. Prove that you must have at least 6 coins of a single denomination.

    2. Suppose you have an odd number of pennies. Prove that you must have an odd number of at least one of the other types of coins.

    3. How many coins would you need to scoop up to be sure that you either had 4 coins that were all the same or 4 coins that were all different? Prove your answer.

    Vis svaret

    1. Suppose you only had 5 coins of each denomination. This means you have 5 pennies, 5 nickels, 5 dimes, and 5 quarters. This is a total of 20 coins. But you have more than 20 coins, so you must have more than 5 of at least one type.

    2. Suppose you have 22 coins, including \(2k\) nickels, \(2j\) dimes, and \(2l\) quarters (so an even number of each of these three types of coins). The number of pennies you have will then be \[22 - 2k - 2j - 2l = 2(11-k-j-l)\]. But this says that the number of pennies is also even (it is 2 times an integer). Thus we have established the contrapositive of the statement, If you have an odd number of pennies, then you have an odd number of at least one other coin type.

    3. You need 10 coins. You could have 3 pennies, 3 nickels, and 3 dimes. The 10th coin must either be a quarter, giving you 4 coins that are all different, or else a 4th penny, nickel, or dime. To prove this, assume you don't have 4 coins that are all the same or all different. In particular, this says that you only have 3 coin types, and each of those types can only contain 3 coins, for a total of 9 coins, which is less than 10.

  11. You come across four trolls playing bridge. They declare:

    Troll 1: All trolls here see at least one knave.

    Troll 2: I see at least one troll that sees only knaves.

    Troll 3: Some trolls are scared of goats.

    Troll 4: All trolls are scared of goats.

    Are there any trolls that are not scared of goats? Recall, of course, that all trolls are either knights (who always tell the truth) or knaves (who always lie).

Symbols used here

x \in A,\ A \subseteq B
element of, subset
x belongs to A; every element of A is in B.
\forall,\ \exists
for all, there exists
Quantifiers: every x; at least one x.
\neg,\ \wedge,\ \vee,\ \Rightarrow,\ \Leftrightarrow
not, and, or, implies, iff
Logical connectives.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\neq
not equal
The two sides are different.
n!
factorial
n × (n−1) × … × 1; the number of orderings of n things. 0! = 1.
\binom{n}{k}
binomial coefficient, "n choose k"
Number of k-element subsets of n things: n!/(k!(n−k)!).
\sum_{k=1}^{n} a_k
summation
Add a_k for k = 1 up to n.
A \cup B,\ A \cap B,\ A \setminus B
union, intersection, difference
In either; in both; in A but not B.
\emptyset,\ |A|
empty set, cardinality
The set with no elements; the number of elements of A.
\blacksquare\ \text{or}\ \square
end of proof (halmos)
Marks the point where the statement has been established.
a \equiv b \pmod n
congruent modulo n
n divides a − b; a and b have the same remainder.
O(n^2),\ \Theta,\ \Omega
big-O notation
Grows no faster than n² (up to a constant), for large n.
a \bmod n
remainder
What is left after dividing a by n.

Questions people ask

What makes mathematics "discrete"?

It deals with separate, countable objects — integers, graphs, statements — rather than continuous quantities. No limits, no infinitesimals; instead induction, counting and logic.

How does a proof by induction work?

Show the statement for the first case, then show that whenever it holds for n it holds for n + 1. Like dominoes: the first falls, and each knocks over the next.

Prøv din egen

Parts of this page are adapted from Levin, Discrete Mathematics: An Open Introduction (CC BY-SA 4.0). Condensed and re-explained here; errors are ours.

Mer i Discrete Math & Logic