Docsity

Proof Patterns - Computational Concepts in Biological Sciences - Lecture Note, Lecture notes of Computer Science

Partial preview of the text

Download Proof Patterns - Computational Concepts in Biological Sciences - Lecture Note and more Lecture notes Computer Science in PDF only on Docsity!

All theorems, lemmas, corrolaries presume something and then prove something else. Deduction: utilize logical rules of inference. Contradiction: prove that something is not true by deriving a contradiction from assuming it. Induction: prove a large result in incremental steps. Several useful patterns: Proof Patterns Saturday, September 18, 2010 10:35 AM Docsity.com

Q.E.D. = Quod Erat Demonstratum = "that which was to be demonstrated." This ends every proof. Reductio Ad Absurdum = "reduction to a contradiction" Two Latin phrases used in proofs: Some Latin Magic Saturday, September 18, 2010 11:11 AM Docsity.com

Universal instantiation: from general to specific. Universal generalization: from specific to general. Existential instantiation: from quantifier to instance. Existential generalization: from instance to quantifier. instantiation: process of setting a variable to a value. Rules for quantifiers Saturday, September 18, 2010 10:38 AM Docsity.com

Universal instantiation Saturday, September 18, 2010 10:41 AM Docsity.com

Existential instantiation Saturday, September 18, 2010 10:42 AM Docsity.com

Existential generalization Saturday, September 18, 2010 10:43 AM Docsity.com

The idea of contradiction: if we can use our suppositions to prove both p and not p, then our suppositions are inconsistent! Proof by contradiction Saturday, September 18, 2010 10:58 AM Docsity.com

Lemma: Any odd integer can be expressed as 2k+1 for some integer k. Proof: Suppose not. Let P(x) represent the statement "x can be expressed as 2k+1 for some integer k". By DeMorgan's laws for quantifiers, Then there is some odd integer n that cannot be expressed as 2k+1, by existential instantiation: Thus n must be in the set of integers that are not expressible as 2k+1, which are the integers expressible as 2k. These are the even integers, by lemma 1, so n is both odd and even, a contradiction. Q.E.D. Example of proof by contradiction Saturday, September 18, 2010 11:00 AM Docsity.com

Theorem: n logical variables have exactly 2 n possible truth values. Basis step : if n=1, then one variable has exactly 2 truth values. Inductive step: assume that this is true for n>1. Then n variables have exactly 2 n truth values. Add one more variable. The new variable can be either T or F, so that there are precisely 2* n = 2 n+ values of all variables. Thus the theorem is true for n+1. Thus by induction, the theorem holds for all n>=1. Q.E.D. Proof by induction: Proof by induction Saturday, September 18, 2010 11:17 AM Docsity.com

Erronious proof: if n is even, then n is even. Using something you didn't assume. Using a law of logic that is invalid. Common proof errors What can go wrong? Monday, September 20, 2010 3:28 PM Docsity.com

Recently, there has been much interest in proving things by computer. Example: enumeration: prove that Proof by computer Monday, September 20, 2010 11:39 AM Docsity.com

proof by enumeration!

foreach $p (&FALSE, &TRUE) { foreach $q (&FALSE, &TRUE) { foreach $r (&FALSE, &TRUE) { if (&f1($p,$q, $r)!= &f2($p,$q,$r)) { print "The equivalence is false!\n"; exit(0); } } } } print "The equivalence is true. Woohoo!\n"; Pasted from Proof by enumeration Monday, September 20, 2010 1:13 PM Docsity.com

a second logical function of three variables

sub f2 { my ($p,$q,$r) = @_; return ((! $p) && (! $q) && (! $r)); } Pasted from Monday, September 20, 2010 3:42 PM Docsity.com

Can also prove things by deduction by computer. Key is the ability to try all alternatives. Let's consider what it takes to represent and apply DeMorgan's laws. ("not","(","p","and","q",")") Represent each expression as an array: is also called a tokenization of the expression "not (p and q)" Each quoted element of the array is called a token. ("not", "(", X, "and", Y, ")") Pattern matching: match the pattern ("not", "(", "p", "and", "q", ")") with the expression by binding X="p", Y="q". ("(", "not", X,")", "or","(", "not", Y, ")") Transform that pattern into by the DeMorgan transformation rule. ("(", "not", "p",")", "or","(", "not", "q", ")") Substituting bindings X="p" and Y="q" yields: which represents "(not p) or (not q)". Done! Just the beginning of the story; there are much more efficient ways to do this! Proof by deduction Monday, September 20, 2010 1:31 PM Docsity.com