Methods of Proof.

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Introduction to Proofs
Chapter 3 Elementary Number Theory and Methods of Proof.
Copyright © Cengage Learning. All rights reserved.
(CSC 102) Discrete Structures Lecture 14.
Fall 2007CS 2251 Proof by Induction. Fall 2007CS 2252 Proof by Induction There are two forms of induction Standard Induction –Prove the theorem is true.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
Introduction to Proofs Goals 1.Introduce notion of proof & basic proof methods. 2.Distinguish between correct & incorrect arguments 3.Understand & construct.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
1 CSCI 2400 section 3 Models of Computation Instructor: Costas Busch.
Introduction to Proofs
Reading and Writing Mathematical Proofs
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
1 Quiz Friday 8-29 Lectures: introduction and methods of proof Text: pp 1-26.
Regular Expressions. Notation to specify a language –Declarative –Sort of like a programming language. Fundamental in some languages like perl and applications.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Introduction to Finite Automata
Fall 2005Costas Busch - RPI1 Mathematical Preliminaries.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
Mathematical Preliminaries
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
Lecture 1 Overview Topics 1. Proof techniques: induction, contradiction Proof techniques June 1, 2015 CSCE 355 Foundations of Computation.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
1 Formal Proofs. 2 Deductive Proofs From the given statement(s) to a conclusion statement (what we want to prove) Logical progression by direct implications.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Mathematical Induction What it is? Why is it a legitimate proof method? How to use it?
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
Lecture 2: Proofs and Recursion. Lecture 2-1: Proof Techniques Proof methods : –Inductive reasoning Lecture 2-2 –Deductive reasoning Using counterexample.
CS151: Mathematical Foundations of Computing Mathematical Induction.
Introduction to Proofs Goals 1.Introduce notion of proof & basic proof methods. 2.Distinguish between correct & incorrect arguments 3.Understand & construct.
Chapter 1 Logic and Proof.
Chapter 1 Logic and Proof.
Indirect Argument: Contradiction and Contraposition
Chapter 2 Sets and Functions.
CSCE 355 Foundations of Computation
Inductive Proof (the process of deriving generalities from particulars) Mathematical Induction (reasoning over the natural numbers)
Copyright © Cengage Learning. All rights reserved.
Regular Expressions.
Chapter 3 The Real Numbers.
Computer Science Department
CSCE 355 Foundations of Computation
Hierarchy of languages
Brief Review of Proof Techniques
CS201: Data Structures and Discrete Mathematics I
Alternating tree Automata and Parity games
Introduction to Finite Automata
Regular Expressions.
CSCI-2400 Models of Computation.
CS21 Decidability and Tractability
Mathematical Preliminaries
Algorithms: the big picture
Copyright © Cengage Learning. All rights reserved.
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

Methods of Proof

Deductive proof: Inductive proof: Used extensively in geometry & trigonometry Not very important in this class Inductive proof: Basis of most automata theory Proficiency in induction is a learning objective of this class

Deductive proof Step-by-step argument from given information to a conclusion “from the information that you gave me, I deduce that ….” No internal assumptions are allowed Example: proving that sets are equivalent

Proving equivalences about sets In automata theory frequently ask “Are sets constructed in different ways actually the same set?” Elements of sets are usually strings; hence sets are called “languages” Statement “set E = set F” means every element in E is in F and every element in F is in E

Equivalent sets set E = set F is example of “if and only if” Element x is in E if and only if x is in F To prove E = F must prove two if…then statements If x is in E then x is in F If x is in F then x is in E

Background on sets If x  A implies x  B, then A is a subset of B (written A  B) If, in addition, A  B then A is a proper subset of B (written A  B)  A  B = intersection of sets A and B defined by {x: x  A and x  B } A  B = union of sets A and B defined by {x: x  A or x  B }  

More background on sets A - B = difference of sets A and B defined by {x: x  A and x  B } Let T be complement of S with respect to U then SU, TU, ST = U, and ST = null Sets obey laws similar to numbers (commutative, associative, distributive, etc)

Proof of distributive law of sets R(ST) = (RS)(RT) Let E = R(ST) Let F = (RS)(RT) Must prove if x is in E then x is in F if x is in F then x is in E

Proof of distributive law of sets: part 1 if x  R(ST) then x  R or x  (ST) (def. of union) x  R or x  S and x  T (def. of intersection) x  RS (def. of union) x  RT (def. of union) x  (RS)(RT) (def. of intersection) Therefore if x is in E then x is in F

Proof of distributive law of sets: part 2 if x  (RS)(RT) then x  RS (def. of intersection) x  RT (def. of intersection) x  R or x  S and x  T (logic?) x  R or x  (ST) (def. of intersection) x  R(ST) (def. of union) Therefore if x is in F then x is in E

Logic of “If H then C” Given 2 statements, hypothesis H and conclusion C, exactly one of following is the case: 1. H and C are both true 2. H is true and C is false 3. H is false and C is true 4. H and C are both false Only (2) makes “if H then C” false (3) does not apply to “if H then C” In both (1) and (4) “if H then C” is true

Contrapositives The contrapositive of “if H then C” is “if not C then not H” New hypothesis is “not C” New conclusion is “not H” 4 cases of previous slide still apply

Logic of “If not C then not H” Given statements not C and not H, exactly one of following is the case: 1. not C and not H are both true 2. not C is true and not H is false 3. not C is false and not H is true 4. not C and not H are both false Only (2) makes “if not C then not H” false (3) does not apply to “if not C then not H ” In both (1) and (4) “if not C then not H” is true hence “if not C then not H” is equivalent to “if H then C” and may be easier to prove

Contrapositive question What is the contrapositive of “if x > 4 then 2x > x2”

Proof by contradiction Proving that “if H then not C” is false is equivalent to proving “if H then C” Example using complement of a set

Proof by contradiction Given: T is the complement of S with respect to U Prove: If S is finite and U is infinite, then T is infinite Hypothesis has 3 parts T is complement of S S is finite U is infinite Conclusion is “T is infinite” not C is “T is finite”

Proof by contradiction assume T is finite (i.e. not C) then ||T||=some integer m Given S is finite; therefore ||S||=some integer n T is complement of S with respect to U; therefore; ST = U and ST = null Hence, ||U||=m+n, which -> U is finite Therefore “if H then not C” contradicts the part of H that U is infinite This proves “if H then C”

Inductive proof Many types of induction Induction on integers is probably the most familiar

Induction on integers S(n) is statement about integers we want to prove Base case establishes truth of the statement for n=is typically the smallest integer where statement is true Inductive step proves statement for n>is typically by “if S(n) then S(n+1)” “if S(n)” is called the “inductive hypothesis”

Setup to use inductive hypothesis Statement of inductive hypothesis I require a “structured” proof. The follow elements must be present and identified. Proof of base case Setup to use inductive hypothesis Statement of inductive hypothesis Application of inductive hypothesis Algebra that completes the proof All algebraic operations must be on the right-hand-side of equals sign

Assignment #1 Due 8-25-17 k=1 to n k = n(n+1)/2 Using the approach if S(n) then S(n+1), give a structured proof that k=1 to n k = n(n+1)/2

“if S(n-1) then S(n)” is equivalent to apply “if S(n-1) then S(n)” to assignment 1

Structured Proof of j=1 to n j = n(n+1)/2 by if S(n-1) then S(n) Base case n=1 j=1 to 1 j =? 1(1+1)/2 Setup equation

Induction in recursive definitions Example: definition of tree Base case: a single node is a tree Induction: the structure obtained by adding a node to the root of a tree is a tree Note: this definition is not general What is the structure of tree it defines? Prove: in a tree the #of nodes = #of edges+1 Hint: use if S(n-1) then S(n).

Structural Induction Prove: in every tree #of nodes = #of edges+1 Basis: true for single-node tree (no edges) IH: assume #of nodes = #of edges+1 is true for a tree with n-1 nodes Induction: As defined in the previous slide, a tree with n nodes can be obtained from a tree with n-1 nodes by attaching a node to the root. Adding a node requires adding an edge; hence, the n-node tree has both one more node and one more edge than the n-1 node tree. Therefore #of nodes = #of edges+1 applies to the n-node tree.

Mutual induction on integers An inductive hypothesis may have several facets If all facets depend on a common value of an integer, then we have “mutual induction on integers”

Example of mutual induction on integers Given that the start state of the switch automaton is “off” prove the following: off push on Start S1(n): automaton is in the off state after n pushes iff n is even S2(n): automaton is in the on state after n pushes iff n is odd

Both S1(n) and S2(n) are iff off push on Start Given that switch starts in “off” we must prove that after n pushes … If switch is off, then n is even If n is even, then switch is off If switch is on, then n is odd If n is odd, then switch is on

Prove: if switch is off then n is even push on Start Basis: in start state switch is off and n=0, which is even. IH: if switch is on then k is odd Let k=n-1 One more push tunes switch off If n-1 is odd then n is even Similar proofs for S2(n)

Prove: if n is even then switch is off push on Start Basis: n=0 is true. Zero is even by definition and switch starts in off. IH: if k is odd then switch is on If n is even then n-1 is odd By IH, switch is on after n-1 pushes One more push tunes switch off

Structural Induction Automata theory involves recursive definitions that become the subject of inductive proofs. Example: recursive definition of a tree Basis: single node is a tree IH: assume that T1, … Tk are trees Induction: connect then to the node that is root of a recursively defined tree

Structural induction 2 Prove: in every tree n = e +1, where n is the number of nodes and e is the number of edges Basis: true for single-node tree IH: assume ni=ei+1 true for trees T1, …, Tk Induction: n=1+n1+n2+…+nk = 1+(e1+1)+…+(ek+1) n=1+k+e1+…+ek = 1+e

Switch automaton Nodes are states; Arcs are transitions off push on Start Nodes are states; Arcs are transitions Arcs labeled by strings that induce the indicated transitions Arrow indicates the start state

Data transfer automaton Ready Sending data in done timeout Start Data induces transition to sending Loop keeps automaton in sending state until transmission is done “Ready” and “Sending” are complex states Many conditions must be met for automaton to be in these states

Mutual Induction 3 off push on Start “switch” automata is always in exactly one state. Not generally true one-state character of switch makes this example of mutual induction artificial Proof of S1(n) implies the truth of S2(n) Text treats as mutual induction

Loop invariant and induction Loop invariant is statement about iterative algorithm Prove the statement is true by induction Show true before 1st iteration (base case or initialization) If true on ith iteration (inductive hypothesis) remains true before i+1 iteration (maintenance)

Loop invariant Termination Aspect of loop invariant analysis that goes beyond general inductive proof Having establish that the loop invariant is true, statement of the loop invariant when looping terminates proves the correctness of the iterative algorithm

Example: Sort by insertion

Validation is usual approach in code development Test code for some simple cases were hand calculation is practical If a “validated” code fails, usually learn something important In CS 317 get some practice with formal proofs