Lecture 2
Lecture 2
Lecture 2
Logic
Def 1: The equivalence of two statements A and B, often denoted A if and only
if B, A iff B, A ⇐⇒ B, informally as A = B, A and B are equivalent statements if
they have precisely the same truth values.
Prop: A =⇒ B and ¬A∨B are equivalent statements. I.e. (A =⇒ B) ⇐⇒ (¬A∨B).
A B ¬A ¬ A ∨ B
T T F T
T F F F
F T T T
F F T T
By comparing the truth values, we see that the statements are equivalent.
This can come in handy, in many proofs is it easier to work with ¬A ∨ B instead of
A =⇒ B.
Note: The implication P =⇒ Q is often in the following equivalent phrases.
• Q if P
• Q whenever P
• Q provided that P
• P only if Q (this is easier to see through the contrapositive that willl be
described later)
• P is a sufficient condition for Q.
Thus we can see in general that an implication and its converse do not share the same
truth values, i.e. generally an implication and it’s converse are not logically equivalent.
Ex: Consider the statement,
If an animal is a cat, then it has at most four legs.
and it’s converse
If an animal has at most four legs, then it is a cat.
Pretty clear one of these is true, right?
Def 2: The equivalence/biconditional of two statements A and B, often denoted
A if and only if B, A iff B, A ⇐⇒ B, informally as A = B, is given by (A =⇒
B) ∧ (B =⇒ A). It’s truth table is given by
A B A =⇒ B B =⇒ A (A =⇒ B) ∧ (B =⇒ A)
T T T T T
T F F T F
F T T F F
F F T T T
Notice that this lines up with our prior definition of equivalence as the truth table
shows that A ⇐⇒ B precisely when A and B have identical truth values.
Similar to implication, there are many ways to state logical equivalence
• P if and only if Q.
• P is a necessary and sufficient condition for Q.
• If P , then Q and conversely.
Remark The statement (A ∧ ¬B) ⇐⇒ ¬(A =⇒ B). Via truth table, we see
A B ¬ B A ∧ ¬ B A =⇒ B ¬ (A =⇒ B) ⇐⇒
T T F F T F T
T F T T F T T
F T F F T F T
F F T F T F T
A statement that is always true is called a tautology. (Note: In this case, this is a
tautology because these two statements are equivalent)
All right, let’s be honest. Truth tables can be very boring to work out sometimes.
Luckily, once we have shown certain statements are tautologies via truth tables, we
can use the algebra of logcial connectives to prove two statements are equal.
So, we begin by seeing how certain logical connectives interplay.
Distribution of Negation
A B A ∧ B ¬ (A ∧ B) ¬ A ¬ B ¬ A ∨ ¬ B
T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T
Distribution Laws
Prop: A ∧ (B ∨ C) ⇐⇒ (A ∧ B) ∨ (A ∧ C)
A B C B ∨ C A ∧ (B ∨ C) A ∧ B A ∧ C (A ∧ B) ∨ (A ∧ C)
T T T T T T T T
T T F T T T F T
T F T T T F T T
T F F F F F F F
F T T T F F F F
F T F T F F F F
F F T T F F F F
F F F F F F F F
Associativity
Prop: A ∧ (B ∧ C) ⇐⇒ A ∧ B ∧ C.
A B C B ∧ C A ∧ (B ∧ C) A ∧ B ∧ C
T T T T T T
T T F F F F
T F T F F F
T F F F F F
F T T T F F
F T F F F F
F F T F F F
F F F F F F
Proof.
A =⇒ (B ∨ C) ⇐⇒ ¬A ∨ (B ∨ C) As P =⇒ Q ⇐⇒ ¬P ∨ Q.
⇐⇒ ¬A ∨ B ∨ C Associativity
5
⇐⇒ (¬A ∨ B) ∨ C Associativity
⇐⇒ ¬(A ∧ ¬B) ∨ C Rules of negation
⇐⇒ (A ∧ ¬B) =⇒ C As P =⇒ Q = ¬P ∨ Q.
These quantifiers just give a more compact way of writing statements, for example,
1
∃x ∈ N, s.t. ∈ N.
x
is a more compact way to say the statement “There exists an element of the natural
numbers, x, such that its reciprocal, x1 , is also a natural number.” Similarly,
∀x ∈ R, x2 > 0.
says, “For every element x of the real numbers, x2 > 0.”
Ex: Determine the truth values of the above statements. (True and False respec-
tively)