Sets and Logic Linear Algebra, Spring 2012

Similar documents
Introducing Proof 1. hsn.uk.net. Contents

Logic, Sets, and Proofs

Basic Logic and Proof Techniques

PSU MATH RELAYS LOGIC & SET THEORY 2017

3 The language of proof

Exclusive Disjunction

LECTURE 1. Logic and Proofs

Math 38: Graph Theory Spring 2004 Dartmouth College. On Writing Proofs. 1 Introduction. 2 Finding A Solution

Introduction to Basic Proof Techniques Mathew A. Johnson

MATH10040: Chapter 0 Mathematics, Logic and Reasoning

Chapter 1 Review of Equations and Inequalities

Topics in Logic and Proofs

Elementary Linear Algebra, Second Edition, by Spence, Insel, and Friedberg. ISBN Pearson Education, Inc., Upper Saddle River, NJ.

We have seen that the symbols,,, and can guide the logical

MA103 STATEMENTS, PROOF, LOGIC

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

Study skills for mathematicians

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Solving Equations by Adding and Subtracting

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary

Logic and Propositional Calculus

Propositional Logic. Spring Propositional Logic Spring / 32

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Math 300: Foundations of Higher Mathematics Northwestern University, Lecture Notes

Finite Mathematics : A Business Approach

Foundations of Advanced Mathematics, version 0.8. Jonathan J. White

CM10196 Topic 2: Sets, Predicates, Boolean algebras

Basics of Proofs. 1 The Basics. 2 Proof Strategies. 2.1 Understand What s Going On

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Section 1.3. Let I be a set. When I is used in the following context,

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

The statement calculus and logic

EECS 1028 M: Discrete Mathematics for Engineers

Logical Reasoning. Chapter Statements and Logical Operators

Writing Mathematical Proofs

MATH 135 Fall 2006 Proofs, Part IV

Discrete Basic Structure: Sets

THE LOGIC OF COMPOUND STATEMENTS

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

A Brief Introduction to Proofs

The Nature of Mathematics 13th Edition, Smith Notes. Korey Nishimoto Math Department, Kapiolani Community College October

STRATEGIES OF PROBLEM SOLVING

Proving logical equivalencies (1.3)

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

In this initial chapter, you will be introduced to, or more than likely be reminded of, a

1.1 Statements and Compound Statements

Section 3.1: Direct Proof and Counterexample 1

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Chapter 1A -- Real Numbers. iff. Math Symbols: Sets of Numbers

A Little Deductive Logic

Quantifiers. P. Danziger

A Little Deductive Logic

Introduction to Metalogic

3.1 Universal quantification and implication again. Claim 1: If an employee is male, then he makes less than 55,000.

Chapter III. Basic Proof Techniques. Proving the obvious has never been easy. Marty Rubin

Foundation of proofs. Jim Hefferon.

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

Fundamentals of Mathematics I

Propositional Logic. Fall () Propositional Logic Fall / 30

Proof Techniques (Review of Math 271)

CS 173: Induction. Madhusudan Parthasarathy University of Illinois at Urbana-Champaign. February 7, 2016

Practical Algebra. A Step-by-step Approach. Brought to you by Softmath, producers of Algebrator Software

1.1 Language and Logic

Equivalence and Implication

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

1.4 Mathematical Equivalence

Section 1.1: Logical Form and Logical Equivalence

1. SET 10/9/2013. Discrete Mathematics Fajrian Nur Adnan, M.CS

Implications, Quantifiers, and Venn Diagrams. Implications Logical Quantifiers Venn Diagrams. Different Ways of Stating Implications

Logic and Proofs 1. 1 Overview. 2 Sentential Connectives. John Nachbar Washington University December 26, 2014

Mathematical Reasoning. The Foundation of Algorithmics

Manual of Logical Style (fresh version 2018)

This chapter covers propositional logic and predicate logic at a basic level. Some deeper issues will be covered later.

Proof strategies, or, a manual of logical style

CHAPTER 1: Functions

22 3. STATEMENTS. P : 2 is an even number

Some Review Problems for Exam 1: Solutions

Mathmatics 239 solutions to Homework for Chapter 2

27. THESE SENTENCES CERTAINLY LOOK DIFFERENT

Chapter VI. Relations. Assumptions are the termites of relationships. Henry Winkler

2.2 Graphs of Functions

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

CISC 1100: Structures of Computer Science

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

Dr. Relja Vulanovic Professor of Mathematics Kent State University at Stark c 2008

Chapter 2. Reasoning and Proof

Foundations of Discrete Mathematics

Chapter 1. Foundations of GMAT Math. Arithmetic

chapter 12 MORE MATRIX ALGEBRA 12.1 Systems of Linear Equations GOALS

1.5 MATHEMATICAL LANGUAGE

CS 124 Math Review Section January 29, 2018

27. THESE SENTENCES CERTAINLY LOOK DIFFERENT

Math 016 Lessons Wimayra LUY

An Introduction to Mathematical Reasoning

Section 2.1: Introduction to the Logic of Quantified Statements

Logic. Quantifiers. (real numbers understood). x [x is rotten in Denmark]. x<x+x 2 +1

Transcription:

Sets and Logic Linear Algebra, Spring 2012 There is a certain vocabulary and grammar that underlies all of mathematics, and mathematical proof in particular. Mathematics consists of constructing airtight logical arguments, called proofs, to justify certain statements, called theorems, about mathematical objects. Because the mathematical objects we study are all related to sets in one way or another, and because the tools we use to study them are called logic, it is wise for us to begin this class with a cursory review of sets and a brief introduction to logic. When reading this handout or your textbook, go slowly! Make sure you understand every sentence and every formula; if you don t, please come see me in office hours. 1 Sets and set notation 1.1 Basics about sets We begin with a review of some (but not all) basic concepts of sets and set notation. Sets and elements. Intuitively, a set is a collection of objects, which are called its elements or members. Some commonly used sets are C = the set of complex numbers, R = the set of real numbers, Q = the set of rational numbers (quotients), Z = the set of integers (in German, Zahlen), N = the set of positive integers (or natural numbers). Element-list notation. One can name a set by listing, in curly braces, all the objects that the set contains. For example, the statement S = {1, 2, 3} defines S to be the set containing the numbers 1, 2, and 3. The order in which the elements are listed does not matter; thus {1, 2, 3} is the same set as {3, 2, 1} and {2, 1, 3}. Sometimes we use an ellipsis (...) to save ink, especially for sets with infinitely many elements; for example, N = {1, 2, 3,...} If we happen to list an element twice, it still belongs to the set just once ; for example, {1, 2, 3} and {3, 1, 2, 2} are exactly the same set. The symbol. The notation x S means that x is an element of the set S, whereas the notation x / S means that x is not an element of S. For example, 2 N and π R, while 4 5 / Z and 2 / Q.

Sets and Logic Linear Algebra, Spring 2012 Page 2 of 15 Sets containing sets. The elements of one set might be other sets; for example, {2, {5}} is the set whose elements are 2 and {5}. So 2 {2, {5}} and {5} {2, {5}}, but 5 / {2, {5}}. (This is because 5 {5}.) The empty set. The empty set, denoted, is a special set which doesn t have any elements; in other words, = {}. One can think of the empty set as a box with nothing inside. (The empty set is a potential source of confusion. Be sure you understand why {0} and 0.) Subsets. Consider two sets A and B. If every element of A is also an element of B, we say that A is a subset of B, and we write A B. For example, Z is a subset of R, but R is not a subset of Z. Every set is a subset of itself. Also, the empty set is a subset of every set. Equality of sets. Two sets are equal if and only if they have the same elements. For example, {1, 2, 3} = {2, 3, 1} = {3, 1, 2, 2, 1, 1, 1, 3, 3} but {2, {5}} {2, 5}. 1.2 Set-builder notation Basic form Another, more powerful way to name a set X is to start with a bigger set U (for universe ) and give a rule that determines whether or not a particular element of U is an element of our set X. For example, we might want to let E be the set of all even integers, which of course is a subset of Z. So we could name that set as which is written symbolically as The set of all x Z such that x is even. E = { x Z : x is even} or { x Z x is even}. The set of all such that The set of all such that The colon and vertical bar are synonyms in these expressions, and are both pronounced such that. The initial { should be pronounced The set of all.... (Do not use : or to mean such that except in this context.) You can think of this as an algorithm: run through all x Z, and for each one decide whether x is even. If so, keep it; if not, throw it out. In the end, you will have the desired set.

Sets and Logic Linear Algebra, Spring 2012 Page 3 of 15 As another example, N = {x Z x > 0}, which reads, the set of all x Z such that x > 0. Additional form What if we want to form the set S of all perfect squares (1, 4, 9, 16, etc.)? We could write it as S = {x Z x = k 2 for some k Z}, but that is a little bulky. set-builder notation: Mathematicians therefore have come up with another form of S = {k 2 k Z}, which (as before) is pronounced the set of all k 2 such that k Z. As an algorithm, this says to run through all k Z, and for each one compute k 2 and keep that. We could even add conditions to this; for example, is the set of all squares of odd integers. T = {k 2 k Z and k is odd} 1.3 Unions, intersections, differences, and Venn diagrams The union of two sets A and B, denoted by A B, is the set of all objects that are in A or B (or both): A B = {x : x A or x B} The intersection of A and B is the set of all objects that are in both A and B: A B = {x : x A and x B} For example, {1, 2, 3} {3, 4, 5} = {1, 2, 3, 4, 5} and {1, 2, 3} {3, 4, 5} = {3}. Venn diagrams are a good way to visualize these and other set-theoretic concepts. In Figure 1(a), the inside of the circle on the left represents the contents of A, while the inside of the circle on the right represents B. The shaded region is A B. In Figure 1(b), the shaded region is A B. How would we demonstrate the meaning of A B with a Venn diagram? The difference between two sets A and B, denoted by A \ B or A B, is defined as follows: A \ B = {x A : x / B} Figure 1(c) gives a Venn diagram illustrating this operation. For example, Z \ N is the set of nonpositive integers, i.e. {..., 3, 2, 1, 0}.

Sets and Logic Linear Algebra, Spring 2012 Page 4 of 15 A B A B A \ B A B A B A B (a) (b) (c) Figure 1: Venn diagrams of the union, intersection, and set difference of A and B 2 Logic The business of mathematics is proving theorems by constructing proofs that is, airtight logical arguments that must convince every rational reader. Usually in mathematical proofs we express our logic in English 1 words, but in this section we will be using logical symbols to look under the hood at how logic works. For one thing, the mathematical meanings of logical words like or and and are very precise, and using symbols is a good way to understand exactly what is happening. Moreover, when it comes to more complicated logic involving quantifiers and negation, it may actually be easier to work with the symbols than with English sentences. Throughout this section, try to think both symbolically and in English. When you see logical symbols, try coming up with an example and running through the logic in English too. When you see logic in English, try translating it into symbols like P, Q,,,,, etc. When you can easily translate both ways, you will be ready to do proofs. In mathematics, a statement is a sentence that is either true or false, but not both. For example, 6 is an even integer and 4 is an odd integer are statements. (The first one is true, and the second is false.) We will use capital letters such as P and Q to denote statements. 2.1 Logical Operations In arithmetic, we can combine or modify numbers with operations such as +,, etc. Likewise, in logic, we have certain operations for combining or modifying statements. In mathematics, these words have precise meanings, which are given below. Watch out! In some cases, the mathematical meanings of these words differ slightly from, or are more precise than, common English usage. 1 or Latin or Russian or German or Chinese...

Sets and Logic Linear Algebra, Spring 2012 Page 5 of 15 Not. The simplest logical operation is negation, denoted by the word not or the symbol. If P is a statement, then not P or P is defined to be true, when P is false; false, when P is true. We can summarize this in the truth table below. To the left of the double line, we see the two possible values for P ; to the right of the double line we read the corresponding values of P. P P T F F T In English, a statement can usually negated by putting the word not before the verb. As an English example, if P = It is snowing, then P = It is not snowing. And. If P and Q are two statements, then the statement P and Q is denoted P Q and is defined to be true, when P and Q are both true; false, when P is false, or Q is false, or both P and Q are false. Since the joins two statements, P and Q, our truth table needs 4 rows to list all the possibilities. P Q P Q T T T T F F F T F F F F If P = It is snowing and Q = My dog is cold, then P Q = It is snowing and my dog is cold. Please note that the word but in English is logically synonymous with and. Saying It is raining but the sun is shining too simply means It is raining and the sun is shining (and I am a little surprised by this!). The extra connotation of surprise attached to the word but is unimportant in logic. Or. If P and Q are two statements, then the statement P or Q is abbreviated P Q and is defined to be true, when P is true or Q is true or both P and Q are true; false, when both P and Q are false.

Sets and Logic Linear Algebra, Spring 2012 Page 6 of 15 Be careful! In English, sometimes P or Q means P is true or Q is true, but not both. (For example, a menu might read The steak dinner comes with soup or salad. ) However, this is never, ever the case in mathematics. In mathematics, saying P or Q, or even either P or Q, always allows for the possibility that both P and Q are true, unless we explicitly say otherwise. P Q P Q T T T T F T F T T F F F For example, let P = It is snowing and Q = My dog is cold. Then the statement P Q = It is snowing or my dog is cold (or both). If... then. A more involved relationship is that of logical implication. If P and Q are two statements, then we can form the statement if P then Q, which is abbreviated P Q and pronounced P implies Q. We refer to P as the assumption or hypothesis and Q as the conclusion. Understanding implication is a little tricky. If we claim that the implication P Q is true, we are not claiming that P or Q is necessarily true. 2 Rather, we are making the conditional statement that if P happens to be true, then Q is also true. So if P is false, the statement P Q is vacuously true. Hence the statement P Q is mathematically defined to be true, when P and Q are both true or when P is false; false, when P is true and Q is false. Thus P Q is logically equivalent to Q P, as we see in the following truth tables. P Q P Q T T T T F F F T T F F T P Q P Q P T T F T T F F F F T T T F F T T Students are often bothered the idea of vacuously true. Sometimes it helps to ask the question How could the statement be proved wrong? For example, suppose I claim If there is a blizzard, then there will be no classes. If there is a blizzard, and classes are canceled, then of course I am right. (This is the first row of the truth table.) If there is a blizzard, but classes are not canceled, then of course I am wrong. (This is the second row of the truth table.) But if there is no blizzard, then you cannot prove 2 For example, if I say If there is a blizzard, there will be no classes, I am not actually claiming there is a blizzard, nor that there will really be no classes.

Sets and Logic Linear Algebra, Spring 2012 Page 7 of 15 me wrong, so (being innocent until proven guilty) my statement is true. (These are the third and fourth rows of the truth table.) Here is yet another way to understand it: The statement If x > 4, then x 2 > 16 should be true, right? And it should be true for all x, not just for some special x s. So how can it be true when x = 3? If x = 3, then x 4; so the statement is true because it doesn t apply. If and only if. If P and Q are statements, then the statement P if and only if Q or P iff Q or P Q is the claim that P and Q are either both true or both false; that is, P and Q are logically equivalent. In other words, P Q is defined to be true, when P and Q are both true or both false; false, when one of P and Q is true and the other is false. P Q P Q T T T T F F F T F F F T The phrase if and only if may seem a little funny at first, but it does make sense. To say P if Q means If Q, then P in other words, Q P. To say P only if Q means that P only happens if Q does too; hence if P happens, you know Q must also have happened, so P Q. So if either P or Q is true, they both are; likewise if either P or Q is false, they both are false. Order of operations If we encounter a statement like P Q R, how should we interpret it? (P Q) R, or P (Q R)? The following rule is used: Should it be 1. First, do anything in parentheses. 2. Second, apply negations. 3. Third, do. 4. Fourth, do. 5. Finally, do and. So for example, P Q means ( P ) Q, and P Q R means P (Q R). A word of caution: the priority of over isn t very obvious to the eye. Although technically P Q R should automatically mean P (Q R), it s best to explicitly write the parentheses out to make your meaning clear.

Sets and Logic Linear Algebra, Spring 2012 Page 8 of 15 2.2 Truth tables Truth tables were introduced in the last section. A truth table needs to have as many rows as there are possibilities for each of its variables to be true or false. Thus a truth table with only one variable P only needs two rows, but a truth table with two statements P and Q requires four rows. A truth table with three statements P, Q, and R would need eight rows, and so on. Sometimes you may need to construct a truth table for a complicated statement like (P Q) P. One good approach is to use multiple columns. Just as you would compute a complicated expression like 4(3 (2 + 5) + 6 8 1 ) by first adding 2 + 5, then taking 3 times that, and so on, so in logic you can do the innermost operations, then the next innermost, and so on. Example: Find the truth table for (P Q) P. Solution: We have a P and a Q, so we ll need 4 rows in our truth table. Now the innermost operation in (P Q) P is finding Q, so let s put that in the first column of the table. P Q Q T T F T F T F T F F F T Next, let s compute P Q and put that in a new column in the table. We go down, row by row, and compare P and Q according to the rule for : if one or the other or both are T, then we put down T; if both are F, then we put down F. Next we need P. P Q Q P Q T T F T T F T T F T F F F F T T P Q Q P Q P T T F T F T F T T F F T F F T F F T T T Finally, we combine the (P Q) and P with an to get our answer: P Q Q P Q P (P Q) P T T F T F F T F T T F F F T F F T F F F T T T T

Sets and Logic Linear Algebra, Spring 2012 Page 9 of 15 2.3 Converse, inverse, and contrapositive There are three ways of changing the implication P Q into related statements: the converse, the inverse, and the contrapositive. Take as an example the statement If the Cobbers are winning, then we are happy. Writing P = The Cobbers are winning and Q = We are happy, the four related statements are: original P Q If the Cobbers are winning, then we are happy. converse Q P If we are happy, then the Cobbers are winning. inverse P Q If the Cobbers are not winning, then we are not happy. contrapositive Q P If we are not happy, then the Cobbers are not winning. If we examine the truth tables for these statements (below), we see that the converse and inverse always have the same truth values. Similarly the original statement and the contrapositive also always have the same truth values. We say that a statement and its contrapositive are logically equivalent. original converse inverse contrapositive P Q P Q P Q Q P P Q Q P T T F F T T T T T F F T F T T F F T T F T F F T F F T T T T T T Thus you can always replace a statement with its contrapositive, but take care! Neither the converse nor the inverse is logically equivalent to the original statement, nor even implied by it. Many logical mistakes, both inside the classroom and out in the world, are made by taking a true statement and assuming its converse or inverse also holds but that s not true! It is possible for a statement (and its contrapositive) to be true, but the converse (and inverse) to be false. (For example, we might be happy even though the Cobbers are losing, just because we re eating ice cream.) It is also possible for all four statements to be true, but only when P and Q are logically equivalent. Remember, a statement is not equivalent to its converse! 2.4 Quantifiers Consider the sentence x is even. This is not what we have been calling a statement; we can t say whether it is true or false until we know what x is. We call a sentence like this, that depends on the value of x, a statement about x. If we denote the sentence x is even by P (x) then we can think of

Sets and Logic Linear Algebra, Spring 2012 Page 10 of 15 the sentence as a function: when you plug in a particular value of x, you get an output of T or F. For example, P (5) = 5 is even = F, but P (72) = 72 is even = T, and so forth. There are three basic ways to turn a statement about x like P (x) into a statement pure and simple. The first, rather boring, way is to say exactly what x is. For example, When x = 6, x is even. The following are two more interesting ways of turning the sentence into a statement: There exists an integer x such that x is even. For every integer x, x is even. The phrases there exists and for every are called quantifiers; they explain which x or x s the statement is referring to. Let us examine the two types of quantifiers in detail. Existential quantifier ( ). An existential quantifier makes a rather modest statement: it says only that there is at least one instance when a claim is satisfied. In other words, it says there exists some x that makes the claim true. Common existential quantifiers in English are some, there exist(s), and at least one. In mathematics, we sometimes abbreviate these with the symbol, which is pronounced there exists. When writing mathematics in English (as opposed to symbols), the words such that usually come between there exists x and the claim. For example, There exists an integer x such that x is even. Moreover, we often want to state in what set we will find this x; we usually do this right after the there exists phrase, as in There exists x Z such that x is even. We can express the whole sentence symbolically, if we like: ( x Z) x is even. Universal quantifier ( ). A universal quantifier, on the other hand, asserts that a claim is always true, no matter what particular x is chosen. Common universal quantifiers in English are every, all, any, whenever, no, and none. The mathematical symbol for a universal quantifier is, which is pronounced for all. In practice, we usually restrict our attention a little bit. If I said For all x, x 2 0, before you decided whether I was right or not, you would naturally ask, What kind of x? Are imaginary numbers allowed? So to make my statement true, I ought to say For all x R, x 2 0. In pure symbols, I would write ( x R) x 2 0.

Sets and Logic Linear Algebra, Spring 2012 Page 11 of 15 As an example of the use of quantifiers, we can give precise definitions of the terms even and odd. Definition 1: An integer x is even if and only if there exists an integer y such that x = 2y. Symbolically, x is even means ( y Z) x = 2y. Definition 2: An integer x is odd if and only if there exists an integer y such that x = 2y+1. Symbolically, x is odd means ( y Z) x = 2y + 1. In order to have a statement, every variable needs a quantifier. For example, ( y Z) x = 2y is not a statement, because there is no quantifier for the variable x; thus it is only a statement about x. We can turn it into a genuine statement by using a quantifier to say what x is. Examples: The statement ( x Z)( y Z) x = 2y says that all integers are even. (This is of course false.) The statement ( x Z)( y Z) x = 2y says that there exists at least one even integer. (This is true.) The sentence ( y Z) x = 2y + 1 means that x is odd, so the statement ( (( y ) ( ) ) ( x Z) Z) x = 2y ( y Z) x = 2y + 1 says that every integer x is even or odd. Order of quantifiers Although we might put the quantifier at the end in English, saying x 2 0 for all x R, nevertheless when writing symbolically we always put the quantifiers first: ( x R) x 2 0. If there are multiple quantifiers, the order in which they are written is very important! Changing the order of the quantifiers alters the meaning of a statement dramatically. For example, the statement ( x Z)( y Z) x < y says for every integer x, there is some integer y that is less than x, so it is true. With the quantifiers swapped, however, the statement ( y Z)( x Z) x < y says that there is some maximum integer y that is greater than every integer x, which is patently false.

Sets and Logic Linear Algebra, Spring 2012 Page 12 of 15 2.5 Negating statements We often need to find the negations of complicated statements (for instance, in finding the contrapositive of a statement). Negating a simple statement is not difficult, but if we add in quantifiers and connectives, it becomes rather tricky. Let us take a look, keeping some English examples in mind. Rules for negating statements with quantifiers: The negation of a statement involving a universal quantifier uses an existential quantifier. In symbols, ( x) P (x) ( x) P (x). For example, the negation of Every piece of candy is sweet would be There exists a piece of candy that is not sweet, say a lemon drop. The negation of a statement involving an existential quantifier uses a universal quantifier. In symbols, ( x) P (x) ( x) P (x). For example, the negation of There exists a cow that is purple would be Every cow is not purple. In short, you can move the across the quantifier, but only if you flip the quantifier from to or vice versa. Remember, you ll still have a when you are done, so the P (x) claim itself will be negated. Rules for negating statements with connectives (DeMorgan s Laws): The negation of P or Q is (not P ) and (not Q). In symbols, (P Q) P Q. For example, the negation of My car is yellow or your truck is green is My car is not yellow and your truck is not green. The negation of P and Q is (not P ) or (not Q). In symbols, (P Q) P Q. For example, the negation of Roses are red and violets are blue is Either roses are not red, or violets are not blue. In short, when you are trying to negate an and- or an or-statement, you can negate each part separately, but you have to flip the connector: and becomes or and or becomes and.

Sets and Logic Linear Algebra, Spring 2012 Page 13 of 15 Rule for negating implications It is also possible to negate implications. This is a crucial skill for proving theorems using the method of proof by contradiction. Suppose I asserted that If the Cobbers are winning, then we are happy. How could you prove me wrong? You would have to show me that the Cobbers are indeed winning, but we are nevertheless not happy (perhaps because our ice cream fell on the sidewalk). Symbolically, (P Q) P Q. Example: Negate the statement ( ) ( x Z)[ ( y Z) x 2 = 3y + 1 ( ( z Z) (x = 3z + 1 x = 3z + 2)) ]. Solution: First, we put a not in front of it: ( ) ( ( x Z)[ ( y Z) x 2 = 3y + 1 ( z Z) (x = 3z + 1 x = 3z + 2)) ]. We can move the across the quantifier ( x Z), but it flips to become a : ( ) ( ( x Z) [ ( y Z) x 2 = 3y + 1 ( z Z) (x = 3z + 1 x = 3z + 2)) ]. Now we negate the implication. Remembering that (P Q) becomes P Q, we get ( ) ( ( x Z)[ ( y Z) x 2 = 3y + 1 ( z Z) (x = 3z + 1 x = 3z + 2)) ]. Moving the across the quantifier and flipping it from to, we get ( ) ( ( x Z)[ ( y Z) x 2 = 3y + 1 ( z Z) (x = 3z + 1 x = 3z + 2)) ]. We can negate the or-statement by negating each part and changing to : ( ) ( ( x Z)[ ( y Z) x 2 = 3y + 1 ( z Z) ( (x = 3z + 1) (x = 3z + 2) ))]. Finally, we recognize that we can write (x = 3z +1) more simply as x 3z +1, and likewise for (x = 3z + 2), so our final answer is ( ) ( ( x Z)[ ( y Z) x 2 = 3y + 1 ( z Z) ( (x 3z + 1) (x 3z + 2) ))]. It is good practice to read through this example out loud, trying to understand each logical move in English.

Sets and Logic Linear Algebra, Spring 2012 Page 14 of 15 Exercises 1. Write out three elements of the set } {y Z : y2 3 Z. 2. Give the more common name of each of the following sets: (a) {a + bi : a, b R}, where i = 1 (b) { a b : a, b Z, b 0} 3. Write the set of all real numbers that are not square roots of integers in set-builder notation. Your answer should be all mathematical symbols, without any English words. 4. How many subsets does the set {1, 2, 3} have? 5. Construct truth tables for the following statements: (a) P P (b) (P Q) (P Q) (c) (P R) Q (d) P (Q R) 6. Use truth tables to show that P Q and (P Q) (Q P ) are logically equivalent. 7. Let P = Doug is a student and Q = Franz is an engineer. Write each of the following symbolic statements as a proper English sentence. (a) P (b) P Q (c) (P Q) (d) P Q (e) P Q 8. Let P = Quintus worships Mars and Q = Quintus worships Apollo. Translate each of the following English sentences into symbols, using P, Q,,,, and. (a) Quintus worships Mars or Apollo. (b) Quintus worships Mars but not Apollo. (c) If Quintus worships Mars, then he worships Apollo too. (d) Quintus worships Mars only if he worships Apollo too. (e) Quintus worships neither Mars nor Apollo.

Sets and Logic Linear Algebra, Spring 2012 Page 15 of 15 9. Each of the following English sentences is really a compound of simpler statements joined by or. Identify the simple statements, label them as P and Q, and express the compound statement symbolically. (a) John lives on campus, but Fred lives off campus. (b) Easter is either in March or in April. (c) Either Gauss or Riemann proved the Fundamental Theorem of Algebra. (d) The display cases in Jones have bugs and lizards. (e) No Amtrak trains go to Brainerd or Dubuque. 10. State the inverse, converse, and contrapositive of each of the following (you do not need to prove them): (a) If m is an odd integer, then m 2 is odd. (b) If x > 4, then x 2 > 16. (c) If the function f is not continuous at a, then f is not differentiable at a. 11. Rewrite each of the following English statements using the appropriate quantifiers. Let S be the set of all college professors, let P (x) = x likes cheese, and let Q(y) = x is from Wisconsin. (a) All college professors like cheese. (b) Some college professors do not like cheese. (c) If someone does not like cheese, he is not from Wisconsin. (d) Every college professor who is from Wisconsin likes cheese. (e) Every integer has a square root in the real numbers. (f) There is a certain real number that is less than the square of every integer. 12. State the negation of the following: (a) m and n are odd integers. (b) Either m is odd or n is odd. (c) x is a real number and y is an integer. (d) x = 0 or xy > 0, for all numbers x and y in R. (e) x 0 and x + y = y, for some numbers x and y in R. (f) For every number x in R, x 2 > 0. (g) For every x R, there is a number y R such that xy = 1. (h) There is a set S such that for every set T, S T. 13. State the inverse, converse, and contrapositive of the following: (a) If x 2 > x, then either x < 0 or x > 1. (b) Let f and g be functions. If f and g are both differentiable at a, then f + g is differentiable at a.