Week 2 Discussion Notes

Table of Contents

Truth Tables

Definition

A proposition is a statement that is either true or false, but not both. Given two propositions P,QP, Q, we have the following logical operations:

  • PQP \vee Q (read "PP or QQ") is the statement which is true if at least one of PP or QQ is true and false if both are false.
  • PQP \wedge Q (read "PP and QQ) is the statement which is true if both PP and QQ are true and false if either is false.
  • ¬P\neg P (read "not PP") is the statement which is true if PP is false and false if PP is true.
  • P    QP \implies Q (read "if PP then QQ") is the statement ¬PQ\neg P \vee Q.

If two statements PP and QQ always evaluate to the same truth value, then we say that they are equivalent and write PQP \equiv Q.

Propositional logic looks a lot like set theory: if A,BA, B are sets, then compare the following:

PQABPQAB¬PAc\begin{aligned} P \vee Q &\longleftrightarrow A \cup B \\ P \wedge Q &\longleftrightarrow A \cap B \\ \neg P &\longleftrightarrow A^\comp \end{aligned}

If you're comfortable with set theory, then it might help you remember the symbols. The way I tell the difference between "\vee" and "\wedge" is that "\vee" looks like a union, "\cup", and "\wedge" looks like an intersection, "\cap".

It's also not surprising that De Morgan's laws apply to propositional logic as well:

Theorem (De Morgan's laws)

Let P,QP, Q be statements. Then

  1. ¬(PQ)¬P¬Q\neg \p{P \vee Q} \equiv \neg P \wedge \neg Q
  2. ¬(PQ)¬P¬Q\neg \p{P \wedge Q} \equiv \neg P \vee \neg Q
Proof.

To prove equivalences of statements, we'll want to use a truth table.

For (i), we have

PQ¬P¬QPQ¬(PQ)¬P¬Q1100100100110001101000011011\begin{array}{ccccccc} P & Q & \neg P & \neg Q & P \vee Q & \neg \p{P \vee Q} & \neg P \wedge \neg Q \\\hline 1 & 1 & 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 1 & 1 \\\hline \end{array}

From the table, we see that ¬(PQ)\neg\p{P \vee Q} and ¬P¬Q\neg P \wedge \neg Q always evaluate to the same true value, so they are equivalent.

Similarly, for (ii),

PQ¬P¬QPQ¬(PQ)¬P¬Q1100100100101101100110011011\begin{array}{ccccccc} P & Q & \neg P & \neg Q & P \wedge Q & \neg \p{P \wedge Q} & \neg P \vee \neg Q \\\hline 1 & 1 & 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 0 & 1 & 1 \\\hline \end{array}

So ¬(PQ)¬P¬Q\neg\p{P \wedge Q} \equiv \neg P \vee \neg Q also. \square

Remark.

Compare these with De Morgan's laws for sets:

  • ¬(PQ)¬P¬Q(AB)c=AcBc\neg \p{P \vee Q} \equiv \neg P \wedge \neg Q \longleftrightarrow \p{A \cup B}^\comp = A^\comp \cap B^\comp
  • ¬(PQ)¬P¬Q(AB)c=AcBc\neg \p{P \wedge Q} \equiv \neg P \vee \neg Q \longleftrightarrow \p{A \cap B}^\comp = A^\comp \cup B^\comp

Something that's surprising is that if PP is false, then "P    QP \implies Q" is true. For example, the statement "if pigs can fly, then I like math" is a true statement, regardless of whether you like math or not. This is another example of a vacuous truth like we saw last week).

The intuition is as follows: how would you prove "P    QP \implies Q" wrong?

Example 1.

Let's consider the following statement:

If I procrastinate, then I won't finish my homework.

In this case, P=I procrastinate"P = ``\text{I procrastinate}" and Q=I won’t finish my homework"Q = ``\text{I won't finish my homework}". To disprove this, you would need to procrastinate (PP is true) and still finish your homework (QQ is false). In other words,

¬(P    Q)P¬Q\neg\p{P \implies Q} \equiv P \wedge \neg Q

So by De Morgan's laws,

P    Q¬(P¬Q)¬PQ.P \implies Q \equiv \neg\p{P \wedge \neg Q} \equiv \neg P \vee Q.

To finish this section, we'll look at another truth table example.

Example 2.

Evaluate the truth table for Q(P    (¬Q¬P))Q \vee \p{P \implies \p{\neg Q \vee \neg P}}.

Solution.

First, it might be a good idea to rewrite the implication in terms of \vee, \wedge, and ¬\neg. To make things easier to see, let R(¬Q¬P)R \equiv \p{\neg Q \vee \neg P}. Then

P    (¬Q¬P)P    R¬PR¬P(¬Q¬P),P \implies \p{\neg Q \vee \neg P} \equiv P \implies R \equiv \neg P \vee R \equiv \neg P \vee \p{\neg Q \vee \neg P},

so

Q(P    (¬Q¬P))Q(¬P(¬Q¬P))Q¬P¬Q¬P,Q \vee \p{P \implies \p{\neg Q \vee \neg P}} \equiv Q \vee \p{\neg P \vee \p{\neg Q \vee \neg P}} \equiv Q \vee \neg P \vee \neg Q \vee \neg P,

since parentheses don't matter with \vee's. This gives the following truth table:

PQ¬P¬Q¬Q¬PQ¬P¬Q¬P110001100111011011001111\begin{array}{ccccc} P & Q & \neg P & \neg Q & \neg Q \vee \neg P & Q \vee \neg P \vee \neg Q \vee \neg P \\\hline 1 & 1 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 1 & 1 \\\hline \end{array}

Thus, the original statement always evaluates to true.

Proof Strategies

Let's say we want to prove something in the form P    QP \implies Q. We have three main strategies:

Directly

With this strategy, we assume PP is true and try to logically conclude that QQ is also true.

Example 3.

Let xRx \in \R be non-zero. Show that x2>0x^2 > 0.

Solution.

Since xx is not zero, there are two cases: x>0x > 0 and x<0x < 0. If xx is positive, then multiplying by xx on both sides of x>0x > 0 doesn't flip the inequality:

xx>x0    x2>0.x \cdot x > x \cdot 0 \implies x^2 > 0.

If x<0x < 0, then x>0-x > 0, so we can do the same thing with this:

(xx)>0(x)    x2>0.\p{-x \cdot -x} > 0 \cdot \p{-x} \implies x^2 > 0.

By Contrapositive

Definition

The contrapositive of P    QP \implies Q is ¬Q    ¬P\neg Q \implies \neg P.

Proposition

(P    Q)(¬Q    ¬P)\p{P \implies Q} \equiv \p{\neg Q \implies \neg P}.

Proof.

Just by expanding out the definition of implication,

(¬Q    ¬P)¬(¬Q)¬PQ¬P¬PQ(P    Q)\begin{aligned} \p{\neg Q \implies \neg P} &\equiv \neg\p{\neg Q} \vee \neg P \\ &\equiv Q \vee \neg P \\ &\equiv \neg P \vee Q \\ &\equiv \p{P \implies Q} \end{aligned}

\square

What we've shown is that proving P    QP \implies Q is exactly the same as proving its contrapositive ¬Q    ¬P\neg Q \implies \neg P. As simple as it is, some proofs are a lot easier when you prove the contrapositive instead of proving it directly.

Example 4.

Let n,mNn, m \in \N be such that nn is odd. Show that if mnmn is even, then mm is even.

Solution.

Here, P=mn is even"P = ``mn \text{ is even}" and Q=m is even"Q = ``m \text{ is even}". To prove this by contrapositive, we need to assume ¬Q\neg Q (i.e., mm is odd) and prove ¬P\neg P (i.e., mnmn is odd).

If mm is odd, then we can write it in the form m=2k+1m = 2k + 1, where kZk \in \Z (being odd means that you're 11 away from an even number). Then

mn=(2k+1)n=2knodd+neven.mn = \p{2k + 1}n = \underbrace{2kn}_\text{odd} + \underbrace{n}_\text{even}.

An odd number plus an even number is odd, so mnmn is odd, which proves ¬P\neg P, and we're done.

By Contradiction

The third main way we can prove things is by contradiction. This means assuming P    QP \implies Q is false and trying to arrive at a contradiction, i.e., something that goes against a fact that we know.

Example 5.

Show that if a,bZa, b \in \Z, then 18a+6b118a + 6b \neq 1.

Solution.

To prove this by contradiction, we need to assume that the statement is false. In this case, P=a,bZ"P = ``a, b \in \Z" and Q=18a+6b1"Q = ``18a + 6b \neq 1". The negation of P    QP \implies Q is P¬QP \wedge \neg Q, i.e., a,bZa, b \in \Z, but 18a+6b=118a + 6b = 1.

If we divide both sides by 66, we get 3a+b=163a + b = \frac{1}{6}. But aa and bb are integers, which means that 3a+b3a + b must be an integer. However, this implies that 3a+b=163a + b = \frac{1}{6} is an integer, which is impossible. Thus, ¬(P    Q)\neg\p{P \implies Q} is false, i.e., P    QP \implies Q is true, which completes the proof.

The Natural Numbers N\N

Definition (Peano axioms)

The set of natural numbers, denoted N\N, is defined via the following axioms:

  • (N1) 1N1 \in \N.

  • (N2) If nNn \in \N, then it has a successor n+1Nn + 1 \in \N.

  • (N3) 11 is not the successor of any element.

  • (N4) If nn and mm have the same successor, i.e., n+1=m+1n + 1 = m + 1, then n=mn = m.

  • (N5) Suppose SNS \subseteq \N is a subset satisfying the following properties:

    1. 1S1 \in S
    2. If nSn \in S, then n+1Sn + 1 \in S

    Then S=NS = \N.

Let's try to understand these one-by-one:

  • (N1) just says that N\N \neq \emptyset.

  • (N2) basically says that you can add natural numbers.

  • (N3) says that 11 is the first natural number.

  • (N4) basically tells you that there are no "loops" in N\N. To illustrate, I'm going to represent N\N with numbers and arrows to represent successors, e.g., since 33 is the successor of 22, I'm going to draw 232 \to 3.

    With (N4), we get what we expect:

    Without (N4), then for example, 55 and 22 could have the same successor:

    As you can see, we just end up with a loop, which is not how the natural numbers behave—they go on forever and never repeat.

  • (N5) is the principle of mathematical induction. Intuitively, this should be true: (i) tells you that 1S1 \in S. Then (ii) lets you conclude 1S    2S1 \in S \implies 2 \in S. If we use (ii) again, you see 3S3 \in S, 4S4 \in S, etc., so SS has to be all of N\N.

In summary, (N1) through (N4) just means N\N is what you expect it to be. (N5) is the one that you'll be using a lot to prove things.

Mathematical Induction

Suppose we have a sequence of statements, i.e., for each nNn \in \N, we have a statement PnP_n. In light of (N5), to prove that PnP_n is true for any nn, we just need to prove two things:

  • P1P_1 is true (base case)
  • If PnP_n is true, then Pn+1P_{n+1} is true (inductive step)

When proving Pn    Pn+1P_n \implies P_{n+1}, PnP_n is called the inductive hypothesis.

Example 6.

Let rRr \in \R. Show that

1+r+r2++rn=1rn+11r1 + r + r^2 + \cdots + r^n = \frac{1 - r^{n+1}}{1 - r}

for all nNn \in \N.

Solution.

In this problem, PnP_n is 1+r+r2++rn=1rn+11r"``1 + r + r^2 + \cdots + r^n = \frac{1 - r^{n+1}}{1 - r}".

Base case: We need to prove P1P_1, which is the statement 1+r=1r21r1 + r = \frac{1 - r^2}{1 - r}. By factoring,

1r21r=(1r)(1+r)1r=1+r,\frac{1 - r^2}{1 - r} = \frac{\p{1 - r}\p{1 + r}}{1 -r} = 1 + r,

so P1P_1 is true.

Inductive step: Let's assume that PnP_n is true, i.e., we will assume that

1+r+r2++rn=1rn+11r.1 + r + r^2 + \cdots + r^n = \frac{1 - r^{n+1}}{1 - r}.

We need to prove that Pn+1P_{n+1} is true:

(1+r+r2++rn)+rn+1=1rn+11r+rn+1(Pn)=1rn+1+(1r)rn+11r=1rn+21r.\begin{aligned} \p{1 + r + r^2 + \cdots + r^n} + r^{n+1} &= \frac{1 - r^{n+1}}{1 - r} + r^{n+1} && (P_n) \\ &= \frac{1 - r^{n+1} + \p{1 - r}r^{n+1}}{1 - r} \\ &= \frac{1 - r^{n+2}}{1 - r}. \end{aligned}

This shows that Pn    Pn+1P_n \implies P_{n+1}, so by mathematical induction, PnP_n is true for all nNn \in \N.