A proposition is a statement that is either true or false, but not both. Given two propositions P,Q, we have the following logical operations:
P∨Q (read "P or Q") is the statement which is true if at least one of P or Q is true and false if both are false.
P∧Q (read "P and Q) is the statement which is true if both P and Q are true and false if either is false.
¬P (read "not P") is the statement which is true if P is false and false if P is true.
P⟹Q (read "if P then Q") is the statement ¬P∨Q.
If two statements P and Q always evaluate to the same truth value, then we say that they are equivalent and write P≡Q.
Propositional logic looks a lot like set theory: if A,B are sets, then compare the following:
P∨QP∧Q¬P⟷A∪B⟷A∩B⟷Ac
If you're comfortable with set theory, then it might help you remember the symbols. The way I tell the difference between "∨" and "∧" is that "∨" looks like a union, "∪", and "∧" looks like an intersection, "∩".
It's also not surprising that De Morgan's laws apply to propositional logic as well:
Theorem (De Morgan's laws)
Let P,Q be statements. Then
¬(P∨Q)≡¬P∧¬Q
¬(P∧Q)≡¬P∨¬Q
Proof.
To prove equivalences of statements, we'll want to use a truth table.
Something that's surprising is that if P is false, then "P⟹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⟹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" and Q=‘‘I won’t finish my homework". To disprove this, you would need to procrastinate (P is true) and still finish your homework (Q is false). In other words,
¬(P⟹Q)≡P∧¬Q
So by De Morgan's laws,
P⟹Q≡¬(P∧¬Q)≡¬P∨Q.
To finish this section, we'll look at another truth table example.
Example 2.
Evaluate the truth table for Q∨(P⟹(¬Q∨¬P)).
Solution.
First, it might be a good idea to rewrite the implication in terms of ∨, ∧, and ¬. To make things easier to see, let R≡(¬Q∨¬P). Then
P⟹(¬Q∨¬P)≡P⟹R≡¬P∨R≡¬P∨(¬Q∨¬P),
so
Q∨(P⟹(¬Q∨¬P))≡Q∨(¬P∨(¬Q∨¬P))≡Q∨¬P∨¬Q∨¬P,
since parentheses don't matter with ∨'s. This gives the following truth table:
Thus, the original statement always evaluates to true.
Proof Strategies
Let's say we want to prove something in the form P⟹Q. We have three main strategies:
Directly
With this strategy, we assume P is true and try to logically conclude that Q is also true.
Example 3.
Let x∈R be non-zero. Show that x2>0.
Solution.
Since x is not zero, there are two cases: x>0 and x<0. If x is positive, then multiplying by x on both sides of x>0 doesn't flip the inequality:
x⋅x>x⋅0⟹x2>0.
If x<0, then −x>0, so we can do the same thing with this:
(−x⋅−x)>0⋅(−x)⟹x2>0.
By Contrapositive
Definition
The contrapositive of P⟹Q is ¬Q⟹¬P.
Proposition
(P⟹Q)≡(¬Q⟹¬P).
Proof.
Just by expanding out the definition of implication,
(¬Q⟹¬P)≡¬(¬Q)∨¬P≡Q∨¬P≡¬P∨Q≡(P⟹Q)
□
What we've shown is that proving P⟹Q is exactly the same as proving its contrapositive ¬Q⟹¬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,m∈N be such that n is odd. Show that if mn is even, then m is even.
Solution.
Here, P=‘‘mn is even" and Q=‘‘m is even". To prove this by contrapositive, we need to assume ¬Q (i.e., m is odd) and prove ¬P (i.e., mn is odd).
If m is odd, then we can write it in the form m=2k+1, where k∈Z (being odd means that you're 1 away from an even number). Then
mn=(2k+1)n=odd2kn+evenn.
An odd number plus an even number is odd, so mn is odd, which proves ¬P, and we're done.
By Contradiction
The third main way we can prove things is by contradiction. This means assuming P⟹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,b∈Z, then 18a+6b=1.
Solution.
To prove this by contradiction, we need to assume that the statement is false. In this case, P=‘‘a,b∈Z" and Q=‘‘18a+6b=1". The negation of P⟹Q is P∧¬Q, i.e., a,b∈Z, but 18a+6b=1.
If we divide both sides by 6, we get 3a+b=61. But a and b are integers, which means that 3a+b must be an integer. However, this implies that 3a+b=61 is an integer, which is impossible. Thus, ¬(P⟹Q) is false, i.e., P⟹Q is true, which completes the proof.
The Natural Numbers N
Definition (Peano axioms)
The set of natural numbers, denoted N, is defined via the following axioms:
(N1) 1∈N.
(N2) If n∈N, then it has a successorn+1∈N.
(N3) 1 is not the successor of any element.
(N4) If n and m have the same successor, i.e., n+1=m+1, then n=m.
(N5) Suppose S⊆N is a subset satisfying the following properties:
1∈S
If n∈S, then n+1∈S
Then S=N.
Let's try to understand these one-by-one:
(N1) just says that N=∅.
(N2) basically says that you can add natural numbers.
(N3) says that 1 is the first natural number.
(N4) basically tells you that there are no "loops" in N. To illustrate, I'm going to represent N with numbers and arrows to represent successors, e.g., since 3 is the successor of 2, I'm going to draw 2→3.
With (N4), we get what we expect:
Without (N4), then for example, 5 and 2 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 1∈S. Then (ii) lets you conclude 1∈S⟹2∈S. If we use (ii) again, you see 3∈S, 4∈S, etc., so S has to be all of N.
In summary, (N1) through (N4) just means 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 n∈N, we have a statement Pn. In light of (N5), to prove that Pn is true for any n, we just need to prove two things:
P1 is true (base case)
If Pn is true, then Pn+1 is true (inductive step)
When proving Pn⟹Pn+1, Pn is called the inductive hypothesis.
Example 6.
Let r∈R. Show that
1+r+r2+⋯+rn=1−r1−rn+1
for all n∈N.
Solution.
In this problem, Pn is ‘‘1+r+r2+⋯+rn=1−r1−rn+1".
Base case: We need to prove P1, which is the statement 1+r=1−r1−r2. By factoring,
1−r1−r2=1−r(1−r)(1+r)=1+r,
so P1 is true.
Inductive step: Let's assume that Pn is true, i.e., we will assume that