Logic, Sets and Proof, Lecture notes of Logic

Some logical statements are guaranteed to always be true. These are tautologies. Here are two tautologies that involve converses and contrapositives: • (A if ...

Typology: Lecture notes

2022/2023

Uploaded on 03/01/2023

shanti_122
shanti_122 🇺🇸

3.9

(17)

231 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Logic, Sets, and Proofs
David A. Cox and Catherine C. McGeoch
Amherst College
1 Logic
Logical Statements. Alogical statement is a mathematical statement that is either
true or false. Here we denote logical statements with capital letters A, B. Logical
statements be combined to form new logical statements as follows:
Name Notation
Conjunction Aand B
Disjunction Aor B
Negation not A
¬A
Implication Aimplies B
if A, then B
AB
Equivalence Aif and only if B
AB
Here are some examples of conjunction, disjunction and negation:
x > 1 and x < 3: This is true when xis in the open interval (1,3).
x > 1 or x < 3: This is true for all real numbers x.
¬(x > 1): This is the same as x1.
Here are two logical statements that are true:
x > 4x > 2.
x2= 1 (x= 1 or x=1).
Note that x= 1 or x=1” is usually written x=±1.
Converses, Contrapositives, and Tautologies. We begin with converses and
contrapositives:
The converse of Aimplies B is Bimplies A”.
The contrapositive of Aimplies B is ¬Bimplies ¬A
Thus the statement x > 4x > 2” has:
Converse: x > 2x > 4.
Contrapositive: x2x4.
1
pf3
pf4
pf5

Partial preview of the text

Download Logic, Sets and Proof and more Lecture notes Logic in PDF only on Docsity!

Logic, Sets, and Proofs

David A. Cox and Catherine C. McGeoch

Amherst College

1 Logic

Logical Statements. A logical statement is a mathematical statement that is either true or false. Here we denote logical statements with capital letters A, B. Logical statements be combined to form new logical statements as follows:

Name Notation Conjunction A and B Disjunction A or B Negation not A ¬A Implication A implies B if A, then B A ⇒ B Equivalence A if and only if B A ⇔ B

Here are some examples of conjunction, disjunction and negation:

x > 1 and x < 3: This is true when x is in the open interval (1, 3). x > 1 or x < 3: This is true for all real numbers x. ¬(x > 1): This is the same as x ≤ 1.

Here are two logical statements that are true:

x > 4 ⇒ x > 2. x^2 = 1 ⇔ (x = 1 or x = −1).

Note that “x = 1 or x = −1” is usually written x = ±1.

Converses, Contrapositives, and Tautologies. We begin with converses and contrapositives:

  • The converse of “A implies B” is “B implies A”.
  • The contrapositive of “A implies B” is “¬B implies ¬A”

Thus the statement “x > 4 ⇒ x > 2” has:

  • Converse: x > 2 ⇒ x > 4.
  • Contrapositive: x ≤ 2 ⇒ x ≤ 4.

Some logical statements are guaranteed to always be true. These are tautologies. Here are two tautologies that involve converses and contrapositives:

  • (A if and only if B) ⇔ ((A implies B) and (B implies A)). In other words, A and B are equivalent exactly when both A ⇒ B and its converse are true.
  • (A implies B) ⇔ (¬B implies ¬A). In other words, an implication is always equivalent to its contrapositive. This is important to know.

There are many other tautologies. Some are pretty obvious, such as

(A or B) ⇔ (B or A)

(similarly for “and”), while others take a bit of thought, such as the following:

Statement Equivalent statement Description A or (B and C) (A or B) and (A or C) “or” distributes over “and” A and (B or C) (A and B) or (A and C) “and” distributes over “or” ¬(A or B) ¬A and ¬B De Morgan’s law for “or” ¬(A and B) ¬A or ¬B De Morgan’s law for “and” A ⇒ (B ⇒ C) (A and B) ⇒ C conditional proof

In a course that discusses mathematical logic, one uses truth tables to prove the above tautologies.

2 Sets

A set is a collection of objects, which are called elements or members of the set. Two sets are equal when they have the same elements.

Common Sets. Here are some important sets:

  • The set of all integers is Z = {... , − 3 , − 2 , − 1 , 0 , 1 , 2 , 3 ,.. .}.
  • The set of all real numbers is R.
  • The set of all complex numbers is C.
  • The set with no elements is ∅, the empty set.

Another important set is the set of natural numbers, denoted N. In our book,

N = { 1 , 2 , 3 ,.. .},

However, you should be aware that in some other books, N = { 0 , 1 , 2 , 3 ,.. .}.

  • The intersection S ∩ T is the set S ∩ T = {x | x ∈ S and x ∈ T }. Thus an element lies in S ∩T precisely when it lies in both of the sets. Examples: { 1 , 2 , 3 , 4 } ∩ { 3 , 4 , 5 , 6 } = { 3 , 4 } {n ∈ Z | n ≥ 0 } ∩ {n ∈ Z | n < 0 } = ∅.
  • The set difference S − T is the set of elements that are in S but not in T. Example: { 1 , 2 , 3 , 4 } − { 3 , 4 , 5 , 6 } = { 1 , 2 }. A common alternative notation for S − T is S \ T.

3 Variables and Quantifiers

Often we are working with elements of a fixed set. In calculus, this fixed set is often the real numbers R or an interval [a, b] ⊆ R. In linear algebra, the fixed set is often Rn, Cn^ or an abstract vector space V (all of these terms will eventually be defined). In the discussion that follows, this fixed set will be denoted U. A variable such as x represents some unspecified element from the fixed set U. Example: If Z is the fixed set, then “x is even” is a statement that involves the variable x, and “x > y” involves x and y. When a logical statement contains one or more variables, then the truth of the statement depends on which particular members of the fixed set are plugged in for the variables. We combine quantifiers with statements involving variables to form statements about members of the fixed set U. If P (x) is a statement depending on the variable x from the fixed set U , then there are two basic types of quantifiers:

  • ∀x ∈ U (P (x)). This universal quantifier means that for all (or for every or for each or for any) value of x in U , P (x) is true. Example: ∀x ∈ R (2x = (x + 1) + (x − 1)).
  • ∃x ∈ U (P (x)). This existential quantifier means that there exists a (or there is at least one) value of x in U for which P (x) is true. Example: ∃x ∈ Z (x > 5). If the fixed set U is understood, it may be omitted from the quantifier. For example, assuming that the fixed set is Z, then the above statement can be written more simply as ∃x (x > 5). A general strategy for proving things about statements with quantifiers is to work one element at a time. Even when we are dealing with universal quantifiers and infinite fixed sets, we proceed by thinking about the properties that a particular but arbitrary element of the fixed set would have.

Statements with Variables and Sets. A statement depending on a variable, such as P (x), is often used to describe a set in terms of the set-builder notation

S = {x ∈ U | P (x)}.

This means that the set S consists of all elements x of the fixed set for which the statement P (x) is true. Example: The definition S = {n ∈ Z | n > 5 } means n ∈ S if and only if n is an integer greater than 5. If the fixed set is assumed to be Z, it can be left out of the definition, so that S = {n | n > 5 }. We can recast set inclusions using quantifiers. Thus S ⊆ T is equivalent to ∀x (x ∈ S ⇒ x ∈ T ) is equivalent to ∀x ∈ S (x ∈ T ) As a general rule, we prove things about sets by working with the statements that define them. We will see later that the equivalences for S ⊆ T lead to a useful proof strategy. As with the case of quantifiers and statements, proving S ⊆ T means working with one element at a time.

Negations of Quantifiers. It is important to understand how negation interacts with quantifiers. Here are the basic rules.

  • ¬∀x P (x) is equivalent to ∃x (¬P (x)).
  • ¬∃x P (x) is equivalent to ∀x (¬P (x)).

Example: For the fixed set is R, we can understand ¬∀x (x > 0) as follows:

¬∀x (x > 0) is equivalent to ∃x (¬(x > 0)) is equivalent to ∃x (x ≤ 0).

The last statement is clearly true (take x = −1, for example), hence our original statement is true.

4 Proof Strategies

A proof starts with a list of hypotheses and ends with a conclusion. The proof shows the step-by-step chain of reasoning from hypotheses to conclusion. Every step needs to be justified. You can use any of the reasons below to justify a step in your proof:

  • A hypothesis.
  • A definition.
  • Something already proved earlier in the proof.
  • A result proved previously.
  • A consequence of earlier steps according to the rules of logic.

it. Then show that x must also be an element of T using the membership strategy described above. Remember that you can assume that x satisfies the defining properties of S.

  • (Equality) Strategy to prove S equals T , i.e., S = T : First prove that S ⊆ T. Then prove that T ⊆ S.

5 Sample Proofs

Here we give two simple proofs to illustrate various proof strategies.

Proof 1. Let A, B, C be sets. Prove the distribution law for ∪ over ∩, which states A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).

Proof. The proof has two parts because we want to prove two sets are equal. To prove A ∪ (B ∩ C) ⊆ (A ∪ B) ∩ (A ∪ C), take x ∈ A ∪ (B ∩ C). Then we have a series of implications:

x ∈ A ∪ (B ∩ C) implies x ∈ A or x ∈ B ∩ C Def ∪ implies x ∈ A or (x ∈ B and x ∈ C) Def ∩ implies (x ∈ A or x ∈ B) and (x ∈ A or x ∈ C) Dist implies x ∈ A ∪ B and x ∈ A ∪ C Def ∪ implies x ∈ (A ∪ B) ∩ (A ∪ C) Def ∩.

This shows that A ∪ (B ∩ C) ⊆ (A ∪ B) ∩ (A ∪ C). For the opposite inclusion (A∪B)∩(A∪C) ⊆ A∪(B∩C), take x ∈ (A∪B)∩(A∪C). The implications in the first part of the proof are reversible, so that x ∈ A ∪ (B ∩ C). This proves (A ∪ B) ∩ (A ∪ C) ⊆ A ∪ (B ∩ C), and equality follows. QED

Proof 2. Prove that ∀n ∈ Z (n is even ⇔ n^2 is even).

Proof. Fix an arbitrary n ∈ Z. Then we need to prove that n is even ⇔ n^2 is even. The proof has two parts because we want to prove an equivalence. Proof that n is even ⇒ n^2 is even: Take n ∈ Z and assume n is even. By the definition of even, this means n = 2m for some m ∈ Z. Then

n^2 = (2m)^2 = (2m)(2m) = 2(2m^2 ),

which shows that n^2 is even. Proof that n^2 is even ⇒ n is even: Now take n ∈ Z and assume n^2 is even. We prove that n is even by contradiction. So assume n is not even, i.e., n is odd. This means n = 2m + 1 for some m ∈ Z. Then

n^2 = (2m + 1)^2 = (2m + 1)(2m + 1) = 4m^2 + 4m + 1 = 2(2m^2 + 2m) + 1,

which shows that n^2 is odd. This contradicts our assumption that n^2 is even, and it follows that n must be even. QED