1
The Foundat ions: Logic and Proof , Set s, and Funct ions The Foundat ions: Logic and The Foundat ions: Logic and Proof , Set s, and Funct ions Proof , Set s, and Funct ions
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 2
The Foundat ions: Logic and The Foundat ions: Logic and The Foundat - - PDF document
The Foundat ions: Logic and The Foundat ions: Logic and The Foundat ions: Logic and Proof , Set s, and Funct ions Proof , Set s, and Funct ions Proof , Set s, and Funct ions 1 Out line Logic Proposit ional Equivalences Predicat es
1
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 2
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 3
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 4
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 5
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 6
Topic #1 – Propositional Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 7
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 8
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 9
–f ir st developed syst emat ically by t he Gr eek philosopher Ar ist ot le mor e t han 2300 year s ago.
–p:t he weat her is f ine t oday.
–p and q, p or q
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 10
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 11
– “Pat is a singer or P at is a wr it er .” - ∨ – “Pat is a man or P at is a woman.” - ⊕
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 12
–if p, t hen q –p implies q –q when p –q f ollows f r om p –p only if q –p is suf f icient f or q –p is a suf f icient condit ion f or q –q is necessar y f or p –q is a necessar y condit ion f or p
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 13
–I f t he polit ician is elect ed, vot er s would expect t his polit ician t o lower t axes. –I f t he polit ician is not elect ed, t hen vot er s will not have any expect at ion t hat t his per son will lower t axes. –I t is only when t he polit ician is elect ed but does not lower t axes t hat vot er s can say t hat t he polit ician has br oken t he campaign pledge.
–p can not be t r ue when q is not t r ue –The st at ement is f alse if p is t r ue, but q is f alse.
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 14
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 15
–The cont r aposit ive has t he same t r ut h value as p→q.
–An implicat ion and it s cont r aposit ive ar e equivalent . –The conver se and t he inver se of an implicat ion ar e also equivalent .
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 16
–p if and only if (if f ) q –p is necessar y and suf f icient f or q –I f p t hen q, and conver sely
–“You can t ake t he f light if f you buy a t icket .”
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 17
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 18
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 19
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 20
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 21
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 22
Topic #2 – Bits
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 23
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 24
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 25
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 26
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 27
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 28
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 29
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 30
Topic #1.1 – Propositional Logic: Equivalences
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 31
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 32
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 33
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 34
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 35
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 36
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 37
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 38
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 39
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 40
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 41
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 42
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 43
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 44
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 45
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 46
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 47
Topic #3 – Predicate Logic
Spring 2005 CS 233601 Discret e Mat h by Shun-Ren Yang, CS, NTHU 48
P(x,y) is f alse f or ever y pair x,y. Ther e is a pair x,y f or which P(x,y) is t r ue. ∃x∃y P(x,y) ∃y∃x P(x,y) For ever y x t hr ee is a y f or which P(x,y) is f alse. Ther e is an x f or which P(x,y) is t r ue f or ever y y ∃x∀y P(x,y) Ther e is an x such t hat P(x,y) is f alse f or ever y y. For ever y x, t her e is a y f or which P(x,y) is t r ue ∀x∃y P(x,y) Ther e is a pair x,y f or which P(x,y) is f alse. P(x,y) is t r ue f or ever y pair (x,y) ∀x∀y P(x,y) ∀y∀x P(x,y)