Lecture 3: Quantifiers and Proof Techniques

368 Views

Download Presentation
## Lecture 3: Quantifiers and Proof Techniques

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Lecture 3: Quantifiers and Proof Techniques**Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Predicate or Propositional Function • Let x be a variable and D be a set; P(x) is a sentence • Then P(x) is called a predicate or propositional function with respect to the set D if for each value of x in D, P(x) is a statement; i.e., P(x) is true or false • Moreover, D is called the domain of the discourse and x is called the free variable Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Predicate or Propositional Function • Example: • Q(x,y) : x > y, where the Domain is the set of integers • Q is a 2-place predicate • Q is T for Q(4,3) and Q is F for Q (3,4) Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Universal Quantifier • Let P(x) be a predicate and let D be the domain of the discourse. The universal quantification of P(x) is the statement: • For all x, P(x) or • For every x, P(x) • The symbol is read as “for all and every” • Two-place predicate: Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Existential Quantifier • Let P(x) be a predicate and let D be the domain of the discourse. The existential quantification of P(x) is the statement: • There exists x, P(x) • The symbol is read as “there exists” • Bound Variable • The variable appearing in: or Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Negation of Predicates (DeMorgan’s Laws) • Example: • If P(x) is the statement “x has won a race” where the domain of discourse is all runners, then the universal quantification of P(x) is , i.e., every runner has won a race. The negation of this statement is “it is not the case that every runner has won a race. Therefore there exists at least one runner who has not won a race. Therefore: and so, Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Negation of Predicates (DeMorgan’s Laws) Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Formulas in Predicate Logic • All statement formulas are considered formulas • Each n, n =1,2,...,n-place predicate P( ) containing the variables is a formula. • If A and B are formulas, then the expressions ~A, (A∧B), (A∨B) , A →B and A↔B are statement formulas, where ~, ∧, ∨, → and ↔ are logical connectives • If A is a formula and x is a variable, then ∀x A(x) and ∃x A(x) are formulas • All formulas constructed using only above rules are considered formulas in predicate logic Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Additional Rules of Inference • If the statement ∀x P(x) is assumed to be true, then P(a) is also true,where a is an arbitrary member of the domain of the discourse. This rule is called the universal specification (US) • If P(a) is true, where a is an arbitrary member of the domain of the discourse, then ∀x P(x) is true. This rule is called the universal generalization (UG) • If the statement ∃x P (x) is true, then P(a) is true, for some member of the domain of the discourse. This rule is called the existential specification (ES) • If P(a) is true for some member a of the domain of the discourse, then ∃x P(x) is also true. This rule is called the existential generalization (EG) Discrete Mathematical Structures: Theory and Applications**Quantifiers and First Order Logic**• Counterexample • An argument has the form ∀x (P(x ) → Q(x )), where the domain of discourse is D • To show that this implication is not true in the domain D, it must be shown that there exists some x in D such that (P(x ) → Q(x )) is not true • This means that there exists some x in D such that P(x) is true but Q(x) is not true. Such an x is called a counterexample of the above implication • To show that ∀x (P(x) → Q(x)) is false by finding an x in D such that P(x) → Q(x) is false is called the disproof of the given statement by counterexample Discrete Mathematical Structures: Theory and Applications**Proof Techniques**• Theorem • Statement that can be shown to be true (under certain conditions) • Typically Stated in one of three ways • As Facts • As Implications • As Biimplications Discrete Mathematical Structures: Theory and Applications**Proof Techniques**• Direct Proof or Proof by Direct Method • Proof of those theorems that can be expressed in the form ∀x (P(x) → Q(x)), D is the domain of discourse • Select a particular, but arbitrarily chosen, member a of the domain D • Show that the statement P(a) → Q(a) is true. (Assume that P(a) is true • Show that Q(a) is true • By the rule of Universal Generalization (UG), ∀x (P(x) → Q(x)) is true Discrete Mathematical Structures: Theory and Applications**Proof Techniques**• Indirect Proof • The implication p → q is equivalent to the implication (∼q → ∼p) • Therefore, in order to show that p → q is true, one can also show that the implication (∼q → ∼p) is true • To show that (∼q → ∼p) is true, assume that the negation of q is true and prove that the negation of p is true Discrete Mathematical Structures: Theory and Applications**Proof Techniques**• Proof by Contradiction • Assume that the conclusion is not true and then arrive at a contradiction • Example: Prove that there are infinitely many prime numbers • Proof: • Assume there are not infinitely many prime numbers, therefore they are listable, i.e. p1,p2,…,pn • Consider the number q = p1p2…pn+1. q is not divisible by any of the listed primes • Therefore, q is a prime. However, it was not listed. • Contradiction! Therefore, there are infinitely many primes Discrete Mathematical Structures: Theory and Applications**Proof Techniques**Discrete Mathematical Structures: Theory and Applications**Proof Techniques**• Proof of Biimplications • To prove a theorem of the form ∀x (P(x) ↔ Q(x )), where D is the domain of the discourse, consider an arbitrary but fixed element a from D. For this a, prove that the biimplication P(a) ↔ Q(a) is true • The biimplication p ↔ q is equivalent to (p → q) ∧ (q → p) • Prove that the implications p → q and q → p are true • Assume that p is true and show that q is true • Assume that q is true and show that p is true Discrete Mathematical Structures: Theory and Applications**Proof Techniques**• Proof of Equivalent Statements • Consider the theorem that says that statements p,q and r are equivalent • Show that p → q, q → r and r → p • Assume p and prove q. Then assume q and prove r Finally, assume r and prove p • Or, prove that p if and only if q, and then q if and only if r • Other methods are possible Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Proof of a mathematical statement by the principle of mathematical induction consists of three steps: Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Assume that when a domino is knocked over, the next domino is knocked over by it • Show that if the first domino is knocked over, then all the dominoes will be knocked over Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Let P(n) denote the statement that then nth domino is knocked over • Show that P(1) is true • Assume some P(k) is true, i.e. the kth domino is knocked over for some • Prove that P(k+1) is true, i.e. Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Assume that when a staircase is climbed, the next staircase is also climbed • Show that if the first staircase is climbed then all staircases can be climbed • Let P(n) denote the statement that then nth staircase is climbed • It is given that the first staircase is climbed, so P(1) is true Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Suppose some P(k) is true, i.e. the kth staircase is climbed for some • By the assumption, because the kth staircase was climbed, the k+1st staircase was climbed • Therefore, P(k) is true, so Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Preconditions and Postconditions • User of algorithm need not be concerned with how the algorithm is implemented • He or she must know how to use the algorithm and what the algorithm does • Precondition • Assertion (set of statements) that remains true before algorithm executes • Postcondition • Assertion that is true after algorithm executes Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Loop Invariant • Set of statements that remains true each time the loop body is executed • Example: the syntax of a while loop is: while booleanExpression do loopBody • The booleanExpression is evaluated. If the booleanExpression evaluates to true ,the loopBody executes. After executing the loopBody ,the booleanExpression is evaluated again. Then the loopBody continues to execute as long as the booleanExpression evaluates to False . Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• Loop Invariant Example (continued) • The booleanExpression is either true or false. It is a statement. • Let q denote the booleanExpression Discrete Mathematical Structures: Theory and Applications**Mathematical Deduction**• We can associate a predicate, P(n). The predicate P(n) is such that: N Discrete Mathematical Structures: Theory and Applications