
Notes for Math 122 Logic and Foundations Gary MacGillivray University of Victoria 2 Contents 1 Propositional Logic 9 1.1 Statements . .9 1.2 Compound Statements and Logical Connectives . 10 1.3 Negation of Statements . 11 1.4 Truth Tables . 12 1.5 Tautologies and Contradictions . 14 1.6 Logical Equivalence . 15 1.7 Converse and Contrapositive of an Implication . 17 1.8 Necessary and Sufficient Conditions . 18 1.9 The Laws of Logic . 20 1.10 Using Only And, Or, and Not . 23 1.11 Logical Implication . 25 1.12 Valid Arguments and Inference Rules . 26 1.13 Proving Implications . 32 1.14 Exercises . 33 2 Quantifiers and Written Proofs 39 2.1 Open Statements . 39 2.2 Quantifiers . 40 2.3 Negating Statements Involving Quantifiers . 46 3 4 CONTENTS 2.4 Some Examples of Written Proofs . 49 2.5 Exercises . 52 3 Set Theory 57 3.1 What is a Set? . 57 3.2 Describing Sets . 58 3.3 Special Sets . 60 3.4 Set Membership Set Equality and Set Complement . 60 3.5 The Empty Set . 61 3.6 Subsets . 62 3.7 Proper Subsets . 65 3.8 The Power Set . 66 3.9 Venn Diagrams . 67 3.10 Set Operations . 68 3.11 The Laws of Set Theory . 70 3.12 Investigating Set Relationships with Venn Diagrams . 73 3.13 Counting sets and subsets . 77 3.14 Inclusion - Exclusion . 78 3.15 Exercises . 83 4 Induction and Recursion 87 4.1 Recursive definitions . 87 4.2 Induction: An introduction . 90 4.3 PMI { The Principle of Mathematical Induction . 94 4.4 PMI and the Well Ordering Principle . 98 4.5 Examples Involving Multi-term Recursively Defined Sequences 98 4.6 The Weak Form of Induction . 100 4.7 Examples Involving Summations . 102 4.8 Examples Involving Inequalities . 104 CONTENTS 5 4.9 Finding Formulas for Sequences Generated by 1-Term Recur- rences . 106 4.10 A subtraction game . 109 4.11 Induction Analogies and Fallacies . 111 4.12 Exercises . 112 5 Number Theory 115 5.1 Floors and Ceilings . 115 5.2 The Division Algorithm . 116 5.3 Representing Numbers in Base b ................. 118 5.4 The number of digits . 121 5.5 Divisibility . 122 5.6 Prime numbers and unique factorization . 124 5.7 Using the FTA in Proofs of Irrationality . 126 5.8 There are Infinitely Many Primes . 127 5.9 The Seive of Eratosthenes . 128 5.10 The gcd .............................. 129 5.11 The lcm .............................. 130 5.12 The Euclidean Algorithm . 132 5.13 Integer Linear Combinations . 134 5.14 Relatively prime integers . 135 5.15 Modular Arithmetic (Congruences) . 137 5.16 Testing for divisibility by 3 and by 9 . 141 5.17 Exercises . 142 6 Cartesian Products and Relations 147 6.1 Cartesian Products . 147 6.2 The Definition of a Relation . 150 6.3 Properties of Relations: An Introduction . 152 6 CONTENTS 6.4 Reflexive Relations . 154 6.5 Symmetric Relations . 155 6.6 Transitive Relations . 156 6.7 Anti-symmetric Relations . 157 6.8 Relations and Matrices . 159 6.9 Equivalence Relations . 160 6.10 Equivalence Relations and Partitions . 162 6.11 Exercises . 166 7 Functions 171 7.1 The Definition of a Function and Some Related Terminology . 172 7.2 Equality of functions . 174 7.3 1-1 Functions . 175 7.4 Onto Functions . 177 7.5 Bijections . 179 7.6 Function composition . 180 7.7 The identity function . 181 7.8 Inverse functions . 182 7.9 Exercises . 184 8 Cardinality of sets 187 8.1 1-1 Correspondences and Cardinality . 187 8.2 Cardinality of finite sets . 188 8.3 Cardinality of infinite sets . 189 8.4 Countable Sets and Sequences . 190 8.5 Examples of Countably Infinite Sets . 192 8.6 Proving Countability . 194 8.7 Uncountable Sets . 195 8.8 Proving Uncountability . 196 CONTENTS 7 8.9 Other cardinalities . 197 8.10 Exercises . 198 8 CONTENTS Chapter 1 Propositional Logic 1.1 Statements A statement or proposition is an assertion which is either true or false, though you may not know which. That is, a statement is something that has a truth value. Example 1.1.1 Each of the following is a statement. p a 1. There are no integers a and b so that 2 = b . (True.) 2. For all integers n ≥ 0, the number n2 + n + 41 is prime. (False.) 3. Every even positive integer except 2 is the sum of two prime numbers. (Goldbach's Conjecture: unknown.) Question 1.1.2 Why does of the following fail to be a statement? 1. Have a good day. 2. Are the Canucks a good team? 3. x > 100. We usually use (lower case) letters to denote statements. A good way to think of these letters is as variables that can take the values \true" and \false". Variables that can take two possible values are sometimes called Boolean variables, after the British logician George Boole. 9 10 CHAPTER 1. PROPOSITIONAL LOGIC 1.2 Compound Statements and Logical Con- nectives A compound statement is formed by joining other statements together with logical connectives, several of which are defined below. The statements that are joined together can themselves be compound statements. Let p and q be statements. • The conjunction of p and q is the statement denoted by p ^ q, and read as \p and q", which asserts that p and q are both true. Notice that the wedge symbol looks vaguely like the letter \n" in and. • The disjunction of p and q is the statement denoted by p _ q, and read as \p or q", which asserts that either p is true or q is true, or both. Notice that this is the inclusive sense of the word \or". Also, the vee symbol looks vaguely like the letter \r" in or. • An implication is the statement denoted by p ! q, and read as \p implies q" or \if p then q", which asserts that if p is true, then q is also true. We define that statement p ! q to be true when p is false. • A biconditional, or double implication, is the statement denoted by p $ q, and read \ p if and only if q", which asserts that p and q have the same truth value. Notice that the assertion being made can also be phrased as \if p is true then q is true, and if q is true then p is true." Example 1.2.1 The following are compound statements. 1. (e < π) ^ (57 is prime) (False because \(57 is prime)" is false.) p p p 1+ 5 1+ 5 2. ( 2 is rational) _ ( 2 < 2) (True because \( 2 < 2)" is true). 3. (52 < 0) ! (1 < 2) (True because \(52 < 0)" is false.) 4. (1 < 2) ! (52 < 0) (False because the \1 < 2" is true and \52 < 0" is false. 5. (1 = 2) $ (the number of primes is finite (True because both \(1 = 2)" and \( the number of primes is finite)" are false.) 1.3. NEGATION OF STATEMENTS 11 The third and fourth points in the example demonstrate that the statements p ! q and q ! p are different. That is, for given truth values of p and q, the two statements can have different truth values. In the algebra of real numbers, the order of operations is brackets, exponents, multiply and divide, add and subtract. Thus −32(4 × 2 + 52) = −9(8 + 25) = −9(33) = −264. That is, exponents have precedence over multiplication and division, which in turn have precedence over addition and subtraction. Brackets are used for clarity, or to force operations to occur in a particular order. In propositional logic there is no precedence among logical connectives. Ex- pressions are interpreted from left to right. Brackets are used for clarity, or to force certain connectives to be applied in a particular order. The statement p _ q ! r is actually (p _ q) ! r, though it is far better to simply regard the unbracketed statement as ambiguous and insist on proper bracketing. It is good practice to always use brackets for clarity instead of assuming that the reader is able to interpret the meaning you intend. 1.3 Negation of Statements The negation of p is the statement denoted by :p, and read as \not p," which asserts that p is not true. Sometimes it is helpful to think of :p as asserting \it is not the case that p is true". Thus, :p is false when p is true, and true when p is false. The negation of :p is the statement with the opposite truth value as :p. Thus :(:p) is just another name for p. Notice that \:" is not a logical connective. It does not join two statements together. Instead, it applies to a single (possibly compound) statement. Negation has precedence over logical connectives. This means that p _:q is p _ (:q), although it is more common to write p _:q than it is to write p _ (:q). It is common practice only use brackets for negation when it is a compound statement being negated, and not when an individual statement is being negated, as in :(a ! b) ^ :(c _:d). 12 CHAPTER 1. PROPOSITIONAL LOGIC 1.4 Truth Tables A truth table gives the truth values of a statement for all possible combina- tions of truth values of the other statements from which it is made. Here and elsewhere, 0 and 1 will represent the truth values \false" and \true", respectively. The following is a truth table for the compound statements defined in the Section 1.2. p q p ^ q p _ q p ! q p $ q 0 0 0 0 1 1 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 1 1 1 And here is a truth table for negation.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages199 Page
-
File Size-