Proof. Theorems. Theorems. Example. Example. Example. Part 4. The Big Bang Theory

Similar documents
Propositional Logic Not Enough

Logic, Sets, and Proofs

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

1.1 Language and Logic

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

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

Introducing Proof 1. hsn.uk.net. Contents

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013

1.1 Statements and Compound Statements

Proofs. Joe Patten August 10, 2018

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Chapter 1 Elementary Logic

CITS2211 Discrete Structures Proofs

1.1 Language and Logic

First order Logic ( Predicate Logic) and Methods of Proof

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Some Review Problems for Exam 1: Solutions

Logic and Proofs. (A brief summary)

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

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

Chapter 2: The Logic of Quantified Statements

Sec$on Summary. Mathematical Proofs Forms of Theorems Trivial & Vacuous Proofs Direct Proofs Indirect Proofs

Mat 243 Exam 1 Review

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Propositional Logic. Spring Propositional Logic Spring / 32

1 Predicates and Quantifiers

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Propositional Logic: Part II - Syntax & Proofs 0-0

3 The language of proof

Definitions Chapter 1 Proof Technique (Pg.1): Proof (Pg.2): Statement (Pg.2): Conditional Statement/Implication (Pg3.): Hypothesis(Pg.

The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Lecture 5 : Proofs DRAFT

Logic Overview, I. and T T T T F F F T F F F F

Section 1.1 Propositions

CSC Discrete Math I, Spring Propositional Logic

1 Implication and induction

Writing Mathematical Proofs

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

Section 2.1: Introduction to the Logic of Quantified Statements

Mathematical Logic Part Two

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

Lecture 2: Proof Techniques Lecturer: Lale Özkahya

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Practice Test III, Math 314, Spring 2016

Proofs. Chapter 2 P P Q Q

HANDOUT AND SET THEORY. Ariyadi Wijaya

1. Propositions: Contrapositives and Converses

Proof by Contradiction

Proofs. Chapter 2 P P Q Q

Basic Logic and Proof Techniques

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

What can you prove by induction?

The statement calculus and logic

Mathematics 220 Midterm Practice problems from old exams Page 1 of 8

DISCRETE MATHEMATICS BA202

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

A. Propositional Logic

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

Connectives Name Symbol OR Disjunction And Conjunction If then Implication/ conditional If and only if Bi-implication / biconditional

Logic. Propositional Logic: Syntax. Wffs

Propositional Logic: Syntax

MA103 STATEMENTS, PROOF, LOGIC

Logic and Proofs. (A brief summary)

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Reading and Writing. Mathematical Proofs. Slides by Arthur van Goetham

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

Math 10850, fall 2017, University of Notre Dame

The Process of Mathematical Proof

LECTURE 1. Logic and Proofs

Mathematical Reasoning (Part I) 1

Logic. Propositional Logic: Syntax

Exercise Set 1 Solutions Math 2020 Due: January 30, Find the truth tables of each of the following compound statements.

Foundation of proofs. Jim Hefferon.

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

MAT2345 Discrete Math

Topics in Logic and Proofs

Exercises. Exercise Sheet 1: Propositional Logic

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Chapter 3. The Logic of Quantified Statements

Propositional Logic. Fall () Propositional Logic Fall / 30

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Proofs of Mathema-cal Statements. A proof is a valid argument that establishes the truth of a statement.

MAT 243 Test 1 SOLUTIONS, FORM A

Discrete Mathematical Structures: Theory and Applications

A Little Deductive Logic

It rains now. (true) The followings are not propositions.

15414/614 Optional Lecture 1: Propositional Logic

Lecture 7 Feb 4, 14. Sections 1.7 and 1.8 Some problems from Sec 1.8

1 The Foundation: Logic and Proofs

Proof techniques (section 2.1)

Section Summary. Proof by Cases Existence Proofs

Transcription:

Proof Theorems Part 4 The Big Bang Theory Theorems A theorem is a statement we intend to prove using existing known facts (called axioms or lemmas) Used extensively in all mathematical proofs which should be obvious Most theorems are of the form: If X, then Y The theorem below is very easy to interpret If x and y are even integers then x * y is an even integer 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 3 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 4 Theorems are arguments They can be structured as such. Sometimes it is hard to see Below, the same theorem is written using different language x is even y is even x * y is even Suppose x and y are even integers. The product is even. The product xy is even when x and y are both even. 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 5 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 6 1

Definition: x is even Some Basic Definitions x is even if and only if x = 2n for some integer n Abstract? Not really. 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 8 Definition: x is odd Definition: x y (x divides y) x is odd if and only if x = 2n + 1 for some integer n x y (x divides y) iff y = x * k for some integer k 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 9 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 10 Definition: x Q (x is a rational) x is a rational number iff x = y / z for some integers y and z, and z 0 Proving A B Modus Ponens 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 11 2

Proving A B Proving A B The boolean operator A B is true except when A is true and B is false So, we prove A B by showing that whenever A is true, so must B This is essentially a Modus Ponens proof You are showing that if A is true, and A B is true, then B must be true Also note that "A" and "B" can be compound statements 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 13 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 14 Modus Ponens The Steps A B A B Prove always true If this is true There are basically just two steps to follow: 1. Assume A is true 2. Argue that B is true This shows that B is true whenever A is true 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 15 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 16 the argument Let's prove the following theorem from before This is actually quite easy If x and y are even integers then x * y is an even integer x is even y is even x * y is even 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 17 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 18 3

internal structure Remember: all proofs are implications So, we will assume the both premises are true and show conclusion must be true. Assume that x and y are even integers. So, by the definition x = 2i and y = 2j (for some i, j) x is even y is even x * y is even Note: use different arbitrary variables or you are assuming they are equal! 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 19 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 20 Proof Tips So, the product is: x * y = 2i * 2j = 4 * i * j = 2 * (2 * i * j) So, by definition, x * y is even Begin your proof with what you assume to be true (the hypothesis) Don't argue the truth of a theorem by example stay abstract e.g. you know x and y are even integers that's all you know 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 21 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 22 Proof Tips Proof Tips Your proof must work forward from your assumptions to your goal You may work backward on scratch paper to help you figure out how to work forward Write your proof in prose Then read out loud, it should sound like well-written paragraph Quite often you'll use definitions to make progress 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 23 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 24 4

The following is a theorem about the product of an odd and even number The proof is straight-forward using the definitions Assume: x is an even integer and y is an odd integer. If x is even and y is odd, then x * y is even Then x = 2i and y = 2j+1 for some integers i and j 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 25 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 26 : Let's Try Multiplying, we get: x * y = (2i) * (2j + 1) = 4ij + 2i = 2 * (2ij + i)...which is even The following is a theorem about the sum of two odd numbers Let's try this one If x is odd and y is odd, then x + y is even 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 27 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 28 : Let's Try How about something more complicated? The following is a theorem about the product of two odd numbers Let's try Proof by Contrapositive If x is odd and y is odd, then x * y is odd Proof with inverse logic 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 29 5

Proof by Contrapositive Proof by Contrapositive There are several techniques that can be employed to prove an theorem The direct approach, like before is quite common, but its not the only path you can take Proof by Contrapositive has you prove the opposite of the original theorem Quite impressively, this will also prove the original theorem 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 31 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 32 Getting the Contrapositive Getting the Contrapositive First negate both the assertion and conclusion of the implication so, basically, put "not" in front of both operands Second reverse the implication you basically swap the left-hand and right-hand operand of the implication So, both operands swap positions and are negated Are they equal? Let's confirm in a Truth Table p q composite is: q p 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 33 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 34 Contrapositive Truth Table Modus Ponens Contrapositive p q q p p q q p T T F F T T T F T F F F F T F T T T F F T T T T B A B A Prove always true If this is true 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 35 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 36 6

How it Works So, if we prove the contrapositive, we also prove the original theorem For the original A B suppose that if B is false show that A must be false It does make sense, if you think about it The following is a theorem should look familiar This theorem states that the square of a odd number is also odd Direct proof is near impossible! If x 2 is odd then x is odd 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 37 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 38 Contrapositive Contrapositive The contrapositive negates each operand in the implication A B The following shows the reverse of each The contrapositive negates each operand in the implication A B The following shows the reverse of each A = x 2 is odd A = x 2 is not odd = x 2 is even B = x is odd B = x is not odd = x is even 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 39 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 40 Contrapositive Contrapositive Finally, we reconstruct our theory with B A rather than A B This expression is equivalent to the original if x is not odd then x 2 is not odd or if x is even then x 2 is even We assume x is not odd x is not odd means x is even x = 2k for some integer k 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 41 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 42 7

Contrapositive Result We assume x is not odd (even) x 2 = (2k) 2 = 4k 2 = 2(2k 2 ) So, x 2 is even which is not odd We proved: if x is even then x 2 is even By contrapositive, we proved: if x 2 is odd then x is odd 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 43 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 44 Proof by Contradiction Proof by Contradiction Welcome down the rabbit hole Proof by Contradiction takes a novel approach It uses the approach of reductio ad absurdum So what is it? Well, it proves the theorem by showing it can't be false 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 46 But, How? Contradicting Implications Assume it is false Show that (if it is false) something impossible results Therefore, it can't be false and, thus, true! So, if you are proving A B Assume A B which is equivalent to (A B) Show that something impossible results therefore, A B 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 47 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 48 8

Contradiction A B B A B (A B) T T F F F T F T T T The following is a classic Proof By Contradiction The theorem covers if the square-root of 2, is an irrational number F T F F F F F T F F The square root of 2 is irrational 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 49 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 50 To prove by contradiction, we need to show that the opposite cannot be true (i.e. false) The sentence bellow is the theorem negated So, how do we go about proving this? Well, what is a rational number? A rational number can be expressed as "a / b" where a and b are integers with no common factors (aka "lowest terms") The square root of 2 is rational The square root of 2 is rational 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 51 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 52 s of Rational Numbers The Proof: Prove Opposite 1 / 3 7 / 1 22 / 7 7734 / 10001 1 / 123456789 5 / 3 2 is rational 2 = a / b where a, b Z and b 0 and a, b have no common factors 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 53 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 54 9

Analyzing a Analyzing a It is even 2 = a / b 2 * b = a 2 * b 2 = a 2 Let's look at the properties of a 2 * b 2 = a 2 So a 2 is an even number therefore we know a is also even (previous proof even even) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 55 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 56 Analyzing b : Oh ohhhhh Since a is even and a / b is in lowest terms, then b must be odd Why? If b is even, then a / b would have common factors namely 2. However look again at 2 * b 2 = a 2 Since a is even, a 2 is a multiple of 2 2 (aka, a multiple of 4) So, 2 * b 2 is also a multiple of 4 Thus, b is even 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 57 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 58 Result Since b has to be both odd and even, we have a contradiction The theorem "square root of 2 is rational" cannot be true Predicate Logic Therefore, "square root of 2 is irrational" is true Just the facts 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 59 10

Predicate Logic Predicate Logic A predicate is a statement about one or more variables It is stated as a fact being true for the data provided Predicates express properties These can apply to a single entity or relations which may hold on more than one individual 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 61 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 62 Predicate Notation Single variable predicate It follows the same basic syntax as function calls in Java (and most programming languages) However, type case is important: constants start with lower case letters predicates start with upper case letters Predicates can have one variable (at a minimum) The following sentence states one that the cat named Pattycakes has the "sleepy" property "Pattycakes The Cat is sleepy" 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 63 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 64 Single variable predicate Two Variable Predicate Alternatively, we can write it in predicate form The "Sleepy" predicate for "Pattycakes" is true Note the uppercase and lowercase! Predicates can have multiple variables (unlimited actually well within reason) The following is a classic example of a twovariable relationship Sleepy(pattycakes) x < y 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 65 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 66 11

Two Variable Predicate Predicates Summary The LessThan predicate is true for x, y LessThan(x, y) 1-place predicates assign properties to individuals: is a cat is sleepy 2-place assign relations to a pair is sleeping on is the capitol of 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 67 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 68 Predicates Summary 3-place predicates assign relations to triples wants to Cat named likes to on Etc Quantified Statements More Symbols 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 69 Quantified Statements Limitations of Propositional Logic Sometimes we want to say that every element in the universe has some property Let's say the universe is the people in this room and we want to say "everyone in the room is awake" While propositional logic can express a great deal of complex logical expressions, it ultimately is insufficient for all arguments Why? The premises (and conclusions) in propositional logic have no internal structure. 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 71 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 72 12

Propositional Approach #1 Propositional Approach #2 We can write out a descriptive sentence Shortcomings: it is monolithic an inflexible not "mathematical" enough We can also write out that sentence using a long list of predicates So, we list them all or make a pattern Shortcomings: Cumbersome & verbose Everyone in this room is awake. P(moe) and P(larry) and P(curly) and 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 73 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 74 Limitations of Propositional Logic Socrates Argument For example, it cannot show the validity of Socrates Argument This arguments states: "All humans are mortal. Socrates is a human. Therefore, he is mortal." The following is the propositional logic form of the Socrates Argument Can we prove the conclusion? All humans are mortal Socrates is a human Therefore, Socrates is mortal 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 75 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 76 The Socrates Argument Solution The following is the argument in normal form A problem arises since the validity of this argument comes from the internal structure which propositional logic cannot "see" H S M It's time to break apart the logic and see the internal structure So, we are splitting the atom! 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 77 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 78 13

Why go nuclear? New Notation: For All 1. Expose the internal structure of those "atomic" sentences 2. Create new terminology to describe the semantics 3. Introduce laws to use and manage them The "For-All" symbol states every element x in the universe makes P(x) true So, it is true if and only if the every P is the universe is true x P(x) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 79 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 80 New Notation: Exists : Pineapple Pizza The "Exists" States at least one element x in the universe makes P(x) true True if just a single P is true x P(x) Let's create the quantified statement for "Someone doesn't like pineapple pizza!" Let's create a predicate P(x) means "x likes pineapple pizza" What does someone mean? At least one person? 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 81 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 82 Pineapple Pizza: Try #1 Pineapple Pizza: Try #2 How about the following expression? It's not true if at least one person likes pineapple This means "nobody likes pineapple pizza" We can also negate the predicate Means, for at least one person, they dislike pineapple pizza Which is: "someone doesn't like pineapple pizza!" ( x P(x) ) x P(x) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 83 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 84 14

Equivalence Quantifier Equivalence Just like propositional logic, quantitative expressions have equivalencies They follow the same basic logic we have seen before Quantifier Conversion 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 86 : Opposite Expression : Opposite Expression : "Everyone in the room is awake" Let's create the opposite of this expression (that still says the same thing) So, let's just negate the predicate "is awake" into "is asleep" Does that work? No. "Everyone in the room is awake." "Everyone in the room is asleep." 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 87 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 88 : Opposite Expression : Opposite Expression Now, let's negate the quantifier "everyone'" (forall) into "someone" (exists) The expression below works: almost Well, what if we negate the quantifier "everyone'" (for-all) into "someone" (exists) The expression below works: yes "Someone in the room is asleep." "There is no one in the room that is asleep." 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 89 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 90 15

Exists and For-All Equivalence Moving Negation The previous two laws allows us to extrapolate two additional laws Note: we simply push the negative and remove the double-negation You can push a negation through a quantifier by toggling the quantifier Read the expressions below carefully x P(x) x P(x) x P(x) x P(x) x P(x) x P(x) x P(x) x P(x) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 91 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 92 Conjunction & Disjunction Conjunction & Disjunction Breaking Apart and Combining Both the Exists and For-All quantifiers can be broken apart (and combined) This can occur if the expression contains an AND or an OR 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 94 Exists Disjunction For-All Conjunction If the Exists quantifier is used on a disjunction, it can be broken into two Exists This only works with If the For-All quantifier is used on a conjunction, it can be broken into two For-All This only works with x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 95 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 96 16

Bound & Free Variables Bound & Free Variables Some variables are not variable Not all variables used in a quantified expression is treated the same Each variable in an expression is either considered "bound" or "free" 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 98 Bound & Free Variables 1 A variable is free if a value must be supplied to it before expression can be evaluated A variable is bound if it not free (usually a dummy variable) and contains values that are not needed to be evaluated Which variables need we supply a value before the expression can be evaluated? Both x and c Without knowing both we cannot evaluate the expression (both are free) (x ^ 2 < 4 * c) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 99 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 100 2 Which variables need to be supplied before the expression can be evaluated? x: no, it is a dummy variable c: yes, once we give a value for c, we can evaluate the expression Multiple Quantifiers x (x ^ 2 < 4 * c) Many E's and A's doing headstands 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 101 17

Multiple Quantifiers A quantified statement may have more than one quantifier In fact, most of the time, statements will contain several x > y is an expression with two variables The expression is true if an x is supplied which is greater than y x y P(x, y) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 103 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 104 y (x > y) is an expression with one free variable Evaluates to true if x is supplied and there is a y greater than the supplied x x y (x > y) contains no free variables Evaluates to true if y (x > y) is true for every x in the universe. x y P(x, y) x y P(x, y) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 105 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 106 2 Difficult The following in an implication with two quantifiers as operands It states that whenever " x P(x)" is a true statement, then so is " x Q(x)". Let's create a quantified statement for the following logical statement We will go slowly, since this is not easy x P(x) x Q(x) Everyone who has a friend who has measles will have to be quarantined 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 107 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 108 18

Difficult Difficult "Everyone" is a For-All relationship So, we can factor it out into the expression below Now, let's look at the sub expression The sentence " if x has a friend with measles, x must be quarantined" is an implication! Let's look at the antecedent (hypothesis) x (if x has a friend with measles, then x must be quarantined) if x has a friend with measles, then x must be quarantined 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 109 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 110 Difficult Difficult How do we say "x has a friend with measles"? They just need a single friend So, this is an Exists quantifier Now that we have a basic form of the final version, let's make some predicates We will use single letter names for brevity y (x is friends with y, and y has measles) F(x, y) means "x and y are friends" M(x) means "x has measles" Q(x) means "x must be quarantined" 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 111 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 112 Difficult Difficult This says: "There exists a person y where y is friends with person x, and y has measles" Note: x is not bound in this expression So, what happens if a friend has measles? Then, they must be quarantined Note: implication is outside the exists y ( F(x, y) M(y) ) y (F(x, y) M(y)) Q(x) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 113 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 114 19

Difficult Now we can put it all together The following is the quantified expression for our original statement Bounded Quantifiers x ( y (F(x, y) M(y)) Q(x) ) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 115 Hidden Implication (for those who hate to type) Bound Quantifiers Shorthand Notation Some quantifiers can be more than meets the eye For brevity, many predicate and propositional expresses are merged with the and The following type of expression is quite common So much so that a shortcut notation is often employed x (R(x) P(x)) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 117 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 118 Shorthand Notation Likewise The membership sub-expression is moved to the quantifier's subscript This is equivalent to the last The sub-expression before the implication can be anything In this example, x > 5 is moved to the subscript R(x) P(x) x (x > 5 P(x)) = x > 5 P(x) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 119 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 120 20

Induction Induction Proof by Pattern Many proofs, in fact a great number of them, are based on "all positive integers" Induction is a technique of proving a theorem that is based on this criteria 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 122 Induction Induction The proof by induction is based on the Well-Ordering Property It states that: given a set of non-negative numbers there is a least element Induction basically helps prove x P(x) where the universe is positive numbers Or any range starting at one point and going off to infinity (positive or negative) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 123 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 124 How it Works Metaphor: Line It works in 2 steps 1. proving P(1) and then 2. proving that P(n) P(n + 1) As a result... since P(n) P(n + 1) then P(n + 1) P(n + 2) and so on There is a line of people First person tells a secret to the second person The second person then tells it to the third and so on until everyone knows the secret 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 125 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 126 21

Metaphor: Dominos Foundation of Induction You have a long row of Dominos The first domino falls over and hits the second domino The second hits the third and so on until they are all knocked over The following summarizes the proof technique It is important to understand the approach since it is so commonly used P(1) n (P(n) P(n+1)) n P(n) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 127 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 128 Steps to Proof : Sum of Odds Step 1: Basis show the proposition P(1) is true very easy to do just plug in the values Step 2: Induction assume P(n) is true (which is your theorem) show that P(n + 1) must be true Using induction Show that the sum of n odd numbers equals n 2 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 129 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 130 : Sum of Odds Basis: Sum of Odds So, the sum of odd numbers is a square? Is that true? 1 + 3 = 4 1 + 3 + 5 = 9 1 + 3 + 5 + 7 = 16 Okay, that's just odd! (pun intended) The sum of odds, for just 1 number is simply 1 Of course, this is also 1 squared P(1) = 1 = 1 2 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 131 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 132 22

Induction: Sum of Odds Induction: Sum of Odds P(n) is written as: 1 + 3 + 5 +... + (2n 1) = n 2 We assume P(n) is true. Now we prove P(n) P(n + 1) P(n + 1) is written as: 1 + 3 + + (2n 1) + (2n+1) = (n+1) 2 Let's look at the left hand side of the equation 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 133 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 134 Induction: Sum of Odds Induction: Sum of Odds 1 + 3 + + (2n 1) + (2n + 1) = 1 + 3 + + (2n 1) + (2n + 1) = n 2 + (2n + 1) = (n + 1) 2 P(n) assumed true, so the equality is true. You can replace! So, we have shown that when P(n) is true, then P(n + 1) is true. P(n) P(n + 1) Since P(1) is true, we have proved n P(n) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 135 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 136 : Divisible by 3 Basis: Divisible by 3 Using induction Show that n 3 n is divisible by 3 whenever n is a positive integer For our basis, we plug 1 into our expression and get the result The result, 0, is divisible by 3. P(1) = 1 3 1 = 1 1 = 0 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 137 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 138 23

Induction: Divisible by 3 Induction: Divisible by 3 P(n) is written as: n 3 n P(n + 1) is written as: (n + 1) 3 (n + 1) (n + 1) 3 (n + 1) = n 3 + 3n 2 + 3n + 1 (n + 1) = n 3 + 3n 2 + 3n - n = n 3 n + 3n 2 + 3n Rearranged = (n 3 n) + 3(n 2 + n) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 139 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 140 Induction: Divisible by 3 : Sum of 2 n So, for (n 3 n) + 3(n 2 + n) Since we assumed P(n) is true, then (n 3 n) is divisible by 3. and 3(n 2 + n) is divisible by 3 since 3 is a factor Using induction Show that 2 0 + 2 1 + + 2 n = 2 n+1 1 whenever n is a positive integer Hence, P(n) P(n + 1) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 141 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 142 Basis: Sum of 2 n Induction: Sum of 2 n For our basis, we plug 1 into our expression and get the result The result is 1 which is true P(n) is written as: 2 0 + 2 1 + 2 2 + + 2 n = 2 n+1-1 P(n + 1) is written as: P(0) = 2 0 = 1 = 2 1 1 2 0 + 2 1 + + 2 n + 2 n+1 = 2 n+2-1 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 143 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 144 24

Induction: Sum of 2 n Induction: Sum of 2 n 2 0 + 2 1 + + 2 n + 2 n+1 = (2 0 + 2 1 + + 2 n ) + 2 n+1 = (2 n+1 1) + 2 n+1 = 2 n+1 + 2 n+1 1 = 2 n (2 1 + 2 1 ) 1 = 2 n (2 2 ) 1 = 2 n+2 1 P(n) assumed true, so the equality is true Since we assumed P(n) is true 2 0 + 2 1 + + 2 n + 2 n+1 is equal to 2 n+2-1 Hence, P(n) P(n + 1) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 145 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 146 : Polygons : Polygons The sum of the interior angles of a convex polygon with n >= 3 corners is (n-2) * 180 degrees. Induction is not just useful for mathematical series It can also be used to prove concepts like geometry For this one, let's draw on the board rather than using slides 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 147 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 148 Polygons : Sum of Integers Since we can cut each polygon into triangles, we can show the number of points is related to the number of triangles In particular, the number of triangles is the number of points - 2 Using induction Show that the sum of n integers equals n (n+1) / 2 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 149 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 150 25

Induction: Sum of Integers Induction: Sum of Integers P(n) is written as: 1 + 2 + n = n(n+1) / 2 P(n + 1) is written as: 1 + 2 + n + (n+1) = (n+1)(n+2) / 2 1 + 2 + 3 + n + (n+1) = n(n + 1) / 2 + (n+1) = (n 2 + n) / 2 + 2(n+1) / 2 = (n 2 + 3n + 2) / 2 = (n + 1)(n + 2) / 2 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 151 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 152 Strong Induction Strong Induction Another approach Weak induction assumes that P(n) is true, and then uses that to show P(n +1) is true Strong induction assumes P(1), P(2),, P(n) are all true and then uses that to show that P(n +1) is true 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 154 Using the Domino Metaphor Strong Induction If all the dominos (1 to n) fell over, will it also have knocked over n+1? So, strong induction uses more "dominoes" than weak induction which just uses one Both proof techniques are equally valid ( P(1) P(2) P(k) ) P(k + 1) 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 155 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 156 26

Steps to Proof : Product of Primes Step 1: Basis show the proposition P(1) is true very easy to do just plug in the values Step 2: Induction assume that P(1), P(2),, P(n) are all true show that P(n + 1) is true Using strong induction Show that any number n >= 2 can be written as the product of primes 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 157 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 158 Basis: Product of Primes Induction: Product of Primes For 2, we can show that 2 is a product of two primes Namely, 1 and itself P(2) = 1 * 2 = 2 There are two cases for n + 1: P(n + 1) is prime P(n + 1) is composite it can be written as the product of two composites, a and b where 2 a b < n + 1 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 159 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 160 Induction: Product of Primes Result n + 1 prime: it is a product itself and 1 n + 1 is composite: both P(a) and P(b) are assumed to be true so, there exists primes where a * b = n + 1 We showed that any number can be either prime or composite of two numbers and that number holds the same As a result, we can keep moving backwards to show that everything must be whittled down to primes 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 161 3/15/2018 Sacramento State - Cook - CSc 28 - Spring 2018 162 27