Lecture Notes 3
Lecture Notes 3
2
Uniqueness quantifier ! 1
3
Quantifiers with restricted
domains
x 0, x 2 0 same as x( x 0 x 2 0)
3 3
y 0, y 0 same as y ( y 0 y 0)
2 2
z 0, z 2 same as z ( z 0 z 2)
4
Precedence of quantifiers
• and have higher precedence than all
logical operators from propositional calculus
x p ( x) q ( x) (x p ( x)) q ( x) rather than x ( p ( x) q ( x))
5
Binding variables
• When a quantifier is used on the variable x, this
occurrence of variable is bound
• If a variable is not bound, then it is free
• All variables occur in propositional function of
predicate calculus must be bound or set to a
particular value to turn it into a proposition
• The part of a logical expression to which a quantifier
is applied is the scope of this quantifier
6
Example
What are the scope of these expressions?
Are all the variables bound?
x( x y 1)
x( p ( x) q ( x)) xR( x)
x( p ( x) q ( x)) yR( y )
The same letter is often used to represent variables
bound by different quantifiers with scopes
that do not overlap
7
Negating Quantified Expressions
8
Negating Quantified Expressions
9
Rules of Inference
• Proof: valid arguments that establish the truth
of a mathematical statement
• Argument: a sequence of statements that end
with a conclusion
• Valid: the conclusion or final statement of the
argument must follow the truth of proceeding
statements or premise of the argument
10
Argument and inference
• An argument is valid if and only if it is
impossible for all the premises to be true and
the conclusion to be false
• Rules of inference: we use them to deduce
(construct) new statements from statements
that we already have
• Rules of inference are basic tools for
establishing the truth of statements
11
Valid arguments in propositional
logic
• Consider the following arguments involving
propositions :
“If you have a correct password, then you can
log onto the network”
“You have a correct password” premises
therefore,
“You can log onto the network” conclusion
p q
p
q 12
Valid arguments
• (( p q) p) q is tautology
• When ((p→q)˄p) is true, both p→q and p are
true, and thus q must be also be true
• This form of argument is true because when
the premises are true, the conclusion must be
true
13
Rules of inference for propositional
logic
• We can always use truth table to show an
argument form is valid
• For an argument with 10 propositional
variables, the truth table requires 210 rows
• The tautology (( p q) p) q is the rule of
inference called modus ponens (mode that
affirms), or the law of detachment
p
p q
q
14
Modus Ponens
• "P implies Q. P is true. Therefore Q must also
be true.“
15
Example
• If the statements
"If it rains today, then we will have movie night "
and
"It is indeed raining today "
are both true,
• By modus ponens, we can conclude that
" we will have movie night "
is true.
16
Example
3 3 3
If 2 then ( 2 ) 2 ( ) 2 . We know that 2
2 2 2
3 9
Consequently, ( 2 ) 2 2 ( ) 2
2 4
Is it a valid argument? Is conclusion true?
It is red or it is blue.
It is not blue.
Therefore, it is red.
22
Modus ponendo tollens
• Mode that denies by affirming
Not both A and B
A
Therefore, not B
23
Example
– “It is not sunny this
afternoon and it is colder
than yesterday” p q 1) p q hypothesis
– “We will go swimming only if 2) p simplication using (1)
it is sunny” r p 3)r p hypothesis
– “If we do not go swimming, 4) r modus tollens using (2) and (3)
then we will take a canoe 5) r s hypothesis
trip” r s 6) s modus ponens using (4)
– “If we take a canoe trip, then 7) s t hypothesis
we will be home by sunset”
8)t modus ponens using (6) and (7)
s t
Can we conclude
“We will be home byt sunset”?
24
Example
– “If you send me an email
message, then I will finish
my program” p q
– “If you do not send me an 1) p q hypothesis
email message, then I will 2) q p contrapositive of (1)
go to sleep early” p r 3) p r hypothesis
– “If I go to sleep early, then I 4) q r hypotheical syllogism using (2) and (3)
will wake up feeling 5)r s hypothesis
refreshed” r s 6) q s hypothetical syllogism using (4) and (5)
26
Example
• “Jasmine is running or it
is not snowing” q p
• “It is snowing or Bart is p r
playing soccer” q r
imply
• “Jasmine is running or
Bart is playing soccer”
27
Inference with quantified
statements
Instantiation:
c is one particular member
of the domain
Generalization:
for an arbitrary member c
28
Universal modus ponens
• Use universal instantiation and modus ponens
to derive new rule
x( p ( x) q ( x))
p (a ), where a is a particular element in the domain
q(a)
30
Some terminology
• Theorem: a mathematical statement that can be shown to be
true
• Proposition: less important theorem
• Axiom (postulate): a statement that is assumed to be true
• Lemma: less important theorem that is helpful in the proof of
other results
• Corollary: a theorem that can be established directly from a
theorem that has been proved
• Conjecture: a statement proposed to be true, but not proven
yet
31
Direct proofs of p→q
• First assume p is true
• Then show q must be true (using axioms,
definitions, and previously proven theorems)
• So the combination of p is true and q is false
never occurs
• Thus p→q is true
• A direct proof shows that a conditional statement p → q is
true by showing that if p is true, then q must also be true, so
that the combination p true and q false never occurs.
32
Example
• Definition:
– The integer n is even if there exists an integer k
such that n=2k, and
– n is odd if there exists an integer k such that
n=2k+1
– Note that an integer is either even or odd
• Show “If n is an odd integer, then n2 is odd”
33
Example
• Note the theorem states n( p(n) q(n))
• By definition of odd integer, n=2k+1, where k
is some integer
• n2=(2k+1)2=4k2+4k+1=2(2k2+2k)+1
• By definition of odd integer, we conclude n2 is
an odd integer
• Consequently, we prove that if n is an odd
integer, then n2 is odd
34
Example
• “If m and n are both perfect squares, then nm is
also a perfect square (an integer a is a perfect
square if there is an integer b such that a=b2)
• By definition, there are integers s and t such
that m=s2, and n=t2
• Thus, mn=s2t2=(st)2 (using commutativity and
associativity of multiplication)
• We conclude mn is also a perfect square
35