0% found this document useful (0 votes)
70 views

Lecture 07 - University of Washington Computer Science and Engineering

The document discusses proofs in logic. It introduces inference rules like modus ponens that allow deducing implied properties. Proofs are constructed by starting with hypotheses and facts, and using rules of inference to extend the set of facts. Quantifiers and proofs involving them are also discussed. Examples prove properties of even and odd numbers, and that the product of two rational numbers is rational. Counterexamples can disprove universal statements. Formal proofs follow simple rules while English proofs are easier for humans to read.

Uploaded by

deathgleaner
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Lecture 07 - University of Washington Computer Science and Engineering

The document discusses proofs in logic. It introduces inference rules like modus ponens that allow deducing implied properties. Proofs are constructed by starting with hypotheses and facts, and using rules of inference to extend the set of facts. Quantifiers and proofs involving them are also discussed. Examples prove properties of even and odd numbers, and that the product of two rational numbers is rational. Counterexamples can disprove universal statements. Formal proofs follow simple rules while English proofs are easier for humans to read.

Uploaded by

deathgleaner
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

CSE 311: Foundations of Computing

Fall 2013 Lecture 7: Proofs

announcements
Reading assignment Logical inference
1.6-1.7 7th Edition 1.5-1.7 6th Edition

Home or! "2 due toda#

last time: $uantifiers ,


(uantifiers onl# act on free )aria*les of t+e formula t+e# $uantif# x ( y (P(x,y) x Q(y, x))) %e &organ's La s

re)ie : logical ,nference


So far e')e considered:
Ho to understand and express t+ings using propositional and predicate logic Ho to compute using -oolean .propositional/ logic Ho to s+o t+at different a#s of e0pressing or computing t+em are equivalent to eac+ ot+er

x P(x) x P(x) x P(x) x P(x)


Logic also +as met+ods t+at let us infer implied properties from ones t+at e !no
E$ui)alence is a small part of t+is

proofs
Start it+ +#pot+eses and facts 1se rules of inference to e0tend set of facts Result is pro)ed +en it is included in t+e set
State ent

re)ie : an inference rule222 Modus Ponens


,f p and p $ are *ot+ true t+en $ must *e true 3rite t+is rule as 4i)en:
,f it is 3ednesda# t+en #ou +a)e a 311 class toda#5 ,t is 3ednesda#5
!es"#t

p, p $ $

Fact 2 Hypothesis 1 Fact 1 Hypothesis 2 Hypothesis 3 State ent

6+erefore7 *# modus ponens:


8ou +a)e a 311 class toda#5

proofs
S+o t+at r follo s from p7 p $7 and $ r 15 25 35 95 :5 p p$ $r $ r gi)en gi)en gi)en modus ponens from 1 and 2 modus ponens from 3 and 9

proofs can use e$ui)alences too


S+o t+at p follo s from p $ and $ 15 25 35 95 p$ $ $p p gi)en gi)en contrapositi)e of 1 modus ponens from 2 and 3

inference rules
Eac+ inference rule is ritten as: 555 +ic+ means t+at if *ot+ ; and are true t+en #ou can infer C and #ou can infer %5
For rule to *e correct .; -/ C and .; -/ % must *e a tautologies

simple propositional inference rules %, & ',(


E0cluded middle plus t o inference rules per *inar# connecti)e7 one to eliminate it and one to introduce it

p$ p, $ p $ , p $ p, p $ $

p, $ p$ p p $, $ p p$ p$
(i)ect P)oo* !"#e
+ot #i,e othe) )"#es

Sometimes rules don't need an#t+ing to start it+5 6+ese rules are called a0ioms:
e5g5 Excluded Middle Axiom

p p

important: application of inference rules


8ou can use e$ui)alences to ma!e su*stitutions of an# su*2formula5 ,nference rules onl# can *e applied to +ole formulas .not correct ot+er ise/5 e5g5 15 p $ 25 .p )) $ gi)en intro from 15

direct proof of an implication


p $ denotes a proof of $ gi)en p as an assumption 6+e direct proof rule: ,f #ou +a)e suc+ a proof t+en #ou can conclude t+at p $ is true
p)oo* s"-)o"tine

E0ample: %oes not follo < e5g 5 p=F F7 $=F F7 r=6 6

assumption 15 p 25 p $ intro for from 1 35 p .p $/ direct proof rule

proofs using t+e direct proof rule


S+o t+at p r follo s from $ and .p $/ r 15 $ 25 .p $/ r 35 p 95 p $ :5 r >5 p r gi)en gi)en assumption from 1 and 3 )ia ,ntro rule modus ponens from 2 and 9 direct proof rule

e0ample Pro)e: ..p $/ .$ r// .p r/

one general proof strateg#


15 Loo! at t+e rules for introducing connecti)es to see +o #ou ould *uild up t+e formula #ou ant to pro)e from pieces of +at is gi)en 25 1se t+e rules for eliminating connecti)es to *rea! do n t+e gi)en formulas so t+at #ou get t+e pieces #ou need to do 15 35 3rite t+e proof *eginning it+ +at #ou figured out for 2 follo ed *# 15

inference rules for $uantifiers P(c) for some c x P(x) Let a *e an#t+ing*...P(a) x P(x) x P(x) P(a) for an# a x P(x) P(c) for some special c

. in the do ain o* P

proofs using $uantifiers


6+ere e0ists an e)en prime num*er

e)en and odd

E3en(x) y (x42y) 5dd(x) y (x42y61) (o ain/ 7nte0e)s

Pro)e: 6+e s$uare of e)er# e)en num*er is e)en5 Formal proof of: x (E3en(x) E3en(x2))

P)i e(x)/ x is an inte0e) 1 1 and x is not a -et2een 1 and x

"#tip#e o* any inte0e) st)ict#y

e)en and odd

E3en(x) y (x42y) 5dd(x) y (x42y61) (o ain/ 7nte0e)s

proof *# contradiction: one a# to pro)e p


,f e assume p and deri)e False .a contradiction/7 t+en e +a)e pro)ed p5 15 p 555 35 F 95 p F :5 p F >5 p assumption

Pro)e: 6+e s$uare of e)er# odd num*er is odd Englis+ proof of: x (5dd(x)5dd(x2)) 8et x -e an odd n" -e). 9hen x42,61 *o) so e inte0e) , (dependin0 on x) 9he)e*o)e x24(2,61)24 :,26:,6142(2,262,)61. Since 2,262, is an inte0e), x2 is odd.

direct Proof rule e$ui)alence from 9 e$ui)alence from :

e)en and odd

E3en(x) y (x42y) 5dd(x) y (x42y61) (o ain/ 7nte0e)s

rational num*ers
; real num*er 0 is rational iff t+ere e0ist integers p and $ it+ $0 suc+ t+at 0=p@$5
!ationa#(x) p $ ((x4p<$) 7nte0e)(p) 7nte0e)($) $=)

Pro)e: ?o num*er is *ot+ e)en and odd Englis+ proof: x (E3en(x)5dd(x)) x (E3en(x)5dd(x)) 8et x -e any inte0e) and s"ppose that it is -oth e3en and odd. 9hen x42, *o) so e inte0e) , and x42n61 *o) so e inte0e) n. 9he)e*o)e 2,42n61 and hence ,4n6;. &"t t2o inte0e)s cannot di**e) -y ; so this is a cont)adiction.

Pro)e: ,f 0 and # are rational t+en 0# is rational


x y ((!ationa#(x) !ationa#(y)) !ationa#(xy))

(o ain/ !ea# n" -e)s

rational num*ers
; real num*er 0 is rational iff t+ere e0ist integers p and $ it+ $0 suc+ t+at 0=p@$5
!ationa#(x) p $ ((x4p<$) 7nte0e)(p) 7nte0e)($) $=)

rational num*ers
; real num*er 0 is rational iff t+ere e0ist integers p and $ it+ $0 suc+ t+at 0=p@$5
!ationa#(x) p $ ((x4p<$) 7nte0e)(p) 7nte0e)($) $=)

Pro)e: ,f 0 and # are rational t+en 0# is rational ,f 0 and # are rational t+en 0A# is rational

Pro)e: ,f 0 and # are rational t+en 0# is rational ,f 0 and # are rational t+en 0A# is rational ,f 0 and # are rational t+en 0@# is rational

countere0amples
6o disprove x P(x) find a countere0ample:
so e c s"ch that P(c) 2o),s -eca"se this i p#ies x P(x) 2hich is e$"i3a#ent to x P(x)

proofs
Formal proofs follo simple ell2defined rules and s+ould *e eas# to c+ec!
,n t+e same a# t+at code s+ould *e eas# to e0ecute

Englis+ proofs correspond to t+ose rules *ut are designed to *e easier for +umans to read
Easil# c+ec!a*le in principle

Simple proof strategies alread# do a lot


Later e ill co)er a specific strateg# t+at applies to loops and recursion .mat+ematical induction/

You might also like