Title: Chapter 2 Fundamentals of Logic
1Chapter 2 Fundamentals of Logic
2Propositions
A proposition??or statement ?? is a declarative
sentence that may be assigned a true or false
value. This value is the truth value of the
proposition.
Propositions 224, The earth is flat, Not
Propositions Is 224?, Dont lie! Also
Propositions Green is a beautiful
color,Jesus is Gods son.
3Example
- We use the lowercase letters of the alphabet
(such as p, q, and r) to represent these
statements. - p Discrete math is a required course for
freshmen. - q Margaret Mitchell wrote Gone with the Wind.
- r 2 3 5.
4Example
- We do not regard sentences such as the
exclamation(??) - What a beautiful evening!
- or the command
- Get up and do your exercises. as statements.
- The preceding statements represented by p, q, and
r are considered to be primitive statements ????,
for there is really no way to break them down
into anything simpler.
5True or False, Thats All
We are not going to worry how to define if a
proposition is true or not. The only thing
that matters is the fact that a proposition is
True or False. Sometimes we allow ourselves
to use 0 for False and 1 for True. Things become
interesting if we combine propositions
6- New statements can be obtained from primitive
statements in two ways. - Transform a given statement p into the statement
?p, which denotes its negation ??and is read
Not p. ?p (Negation statements) - Combine two or more statements into a compound
statement, using logical connectives. (Compound
statements????)
7Compound Propositions
- If p and q are propositions, then so isthe
conjunction p?q (read p and q) and the
disjunction p?q (read p or q). - The negation of p is denoted by ?p (or also p).
- Given the truth values of p and q, we can
determine the truth values of these other
propositions.
8Implication or Conditional
- Given the propositions p and q, we can make
theimplication or conditional p?q (If p, then
q, or p implies q). Do not use p ? q. - Note 3 out of 4 are Trueif p is false, p?q is
always true - p?q is equivalent with (?p ? q)
- Do not think in terms of cause and effectIf
224 then fish live in water is True.
9Biconditionals
- Given the propositions p and q, we can make
thebiconditional p?q (p if and only if
q)????.Equivalent with (p?q)?(q?p)
Note that it is fine to talk aboutp?p. This
is just False. Do not write p ? q when you
mean p ? q
10Truth Tables
Using the short hand T and F for True and False,
we have the following truth tables
Note the difference between or and exclusive
or (?).
11Truth Tables in Action
Truth tables summarize what should be obviousIf
John is 6 feet is true and 112 is true,
then John is 6 feet and 112 is also true.
Using parenthesis, we can make longer and more
complicated propositions, like p?(q??(p))
whichcould stand for John is 6 feet, or 112
and Johnis not 6 feet. Observe that the last
proposition is equivalent withJohn is 6 feet or
112. But how to prove this?
12Proving with Truth Tables
- To find the Truth Table of a compound statement,
build it up from its more elementary statements
Example 2.4 The truth table of q ?
(?r?p) Write down all8 combinationsfor the
truth values of p,q,r.
13Example 2.5
14Equivalence
- Two propositions are (logically) equivalent if
and only if for each case their truth values are
the same (?).
Examples p ? (p?p) 112 ? 112 or 112
??p ? p He did not not do it ? He did
it ?(p?q) ? ?p??q If p then not p ? not p
Proving that two propositions are equivalent
canbe done by comparing the two truth tables.
15Example of Equivalence
- How to prove q ? (?r?p) ? (r?q)?(p?q)?
- Earlier we saw
while for the other proposition
16Def. 2.1 Tautology / Contradiction
- Tautology A proposition that is equivalent with
True.Also called logically true. Example
p??p.Contradiction A proposition equivalent
with False. Also called logically false.
Example p??p. - Pay attention to the phrase logically2
31 is not a tautology, but 21 or 2?1
is113 is not a contradiction, but 11 and
1?1 is.As with equivalence look at the truth
tables.
17Writing Down Truth Tables
- True, False is preferred (less ambiguous) than
1, 0 - List the elementary truth values in a consistent
way(from FF to TT or from TT to FF). - They get long with n variables, the length is
2n. - In the end we want to be able to reason about
logic without having to write down such tables.
18 Def.2.2 Logical Equivalence
- Two propositions are (logically) equivalent if
and only if for each case their truth values are
the same (?).
Examples p ? (p?p) 112 ? 112 or 112
??p ? p He did not not do it ? He did
it ?(p?q) ? ?p??q If p then not p ? not p
Proving that two propositions are equivalent
canbe done by comparing their two truth tables.
19Biconditional vs. Equivalence
Dont confuse the equivalence ? with the
biconditional ? (only the biconditional has a
truth table). For examplep ? p is a
proposition/tautology, a statement within logic,
p ? p is mathematically correct, about
logic. p ? ?p is a contradiction (False), p ? ?p
is incorrect Hence p?p ? ?(p??p), and so on.
20Proving Things in Logic
- The standard approach is to use truth tables.
- If we deal with n simple propositions p1,,pn,
our truth table will have size at least 2n. - This becomes a substantial disadvantage if n is
big. - Sometimes there is a much more efficient way to
prove equivalences there is more to
propositional logic than truth tables. - First, look at some very simple equivalences
21The Laws of Logic 1
- Double negation law ??p ? p
- De Morgans laws ?(p?q) ? ?p??q and
?(p?q) ? ?p??q - Commutative laws p?q ? q?p and p?q ? q?p
- Associative laws p?(q?r) ? (p?q)?r and
p?(q?r) ? (p?q)?r - Distributive laws p?(q?r) ? (p?q)?(p?r)
and p?(q?r) ? (p?q)?(p?r)
22The Laws of Logic 2
- Idempotent laws p?p ? p and p?p ? p
- Identity laws p?False ? p and p?True ? p
- Inverse laws p??p ? True and p??p ? False
- Domination laws p?True ? True and p?False ?
False - Absorption laws p?(p?q) ? p and p?(p?q) ? p
23Definition 2.3
- Let s be a statement. If s contains no logical
connectives other than ? and ?, then the dual of
s, denoted sd , is the statement obtained from s
by replacing each occurrence of ? and ? by ? and
?, respectively, and each occurrence of T0 and F0
by F0 and T0, respectively.
24- Given the primitive statements p, q, r and the
compound statement - s (p ??q) ? (r ? T0),
- we find that the dual of s is
- sd (p ??q) ? (r ? F0).
- (Note that ?q is unchanged as we go from s to sd
.)
25Theorem 2.1
- The Principle of Duality. Let s and t be
statements that contain no logical connectives
other than ? and ?. - If s ??t, then sd ??td .
26Substitution Rules
- 1) Rule of substitution If q is a (compound)
statement and an equivalence f(p) ? ?(p) holds
with p elementary, then the equivalence f(q) ?
?(q) holds as well. - 2) Rule of substitution If p and q are
(compound) statement and the equivalence p ? q
holds, then if we replace some p by q to get ?
from f,then f ? ? holds as well.
27Example 2.10
- From the first of DeMorgans Laws
- ?(p ? q)?(?p ??q)
- from the first substitution rule
- ?(r ? s) ? q ? ?(r ? s)??q
- replace each occurrence of q by t ?u
- ?(r?s)?(t ?u) ? ?(r?s)??(t ?u)
28Combining Rules
- Additional equivalence rule for implication p?q
? ?p?q. - Using the previous (simple) equivalences in
combination with the rules of substitution allows
us to prove all true equivalences in
propositional logic.
29Proving Equivalences
- Here is how to prove our q ? (?r?p) ?
(r?q)?(p?q) - q ? (?r?p) ? q?(??r?p) p?q ? ?p?q rule
- ? q?(r?p) double negation
- ? (q?r)?(q?p) distributive law
- ? (r?q)?(q?p) commutative law
- ? (r?q)?(p?q) commutative law
30Associativity
- By repeatedly using the Associative laws we see
that the parentheses in ((p1 ? p2) ? ? pn) do
not matter. Same for ((p1 ? p2) ? ? pn). - When deriving equivalences you are allowed to
apply the rule multiple associative laws. - Even more informal we can drop the parentheses
altogether.
31Commutativity
- By repeatedly using the Commutative laws we see
that the order of the pj in ((p3 ? p7) ? ? p2
do not matter. - Same for ((p3 ? p7) ? ? p2.
- When deriving equivalences you are allowed to
apply the rule multiple commutative laws.
32Rules of Inference
- In real life when proving mathematical statements
we do not establish an equivalence but a
consequence. - Typically, an argument uses hypotheses or
premises to reach a conclusion. - How to do this is described by the rules of
inference.
33Rules of Inference
- Theorems are true/correct mathematical
statements. - Axioms are self-evident theorems.
- Using the rules of inference we can make a
(valid) argument to derive other theorems from
the axioms. - An argument is valid if and only if the validity
of the hypotheses implies the validity of the
conclusion.
34Shape of an Argument
premises or hypotheses
thereforesymbol
conclusion
The therefore symbol ? is a bit old fashioned.
35Some Small Arguments
inversefallacy
ValidArguments
InvalidArguments
36About Arguments
- Def. 2.4 For propositions p,q, if p?q is a
tautology, then p logically implies q. This is
denoted by p?q. - Arguments are correct or incorrect / valid or
invalid a conditional is True or False. - Arguments are to conditionals (?), what
Equivalences (?) are to biconditionals (?)
37Checking Arguments
- An argument (H1??Hn) ? C is valid if for all
cases where the hypotheses Hj are True, the
Conclusion C is True as well. - We can check arguments with the help of truth
tables.But just as with equivalences there are
other ways of proving the validity of an argument.
38Rules of Inference I
39Rules of Inference II
40Rules of Inference III
41Proving Validity of Arguments
- Using basic inference steps and equivalence rules
one can prove the validity of arguments. - Example
Yes, according to truth tables.
valid?
And because p??p ? ?p??p ? ?pwe have the
validityproven a second time.
But also,
42Longer Arguments
- Example 2.31 ((?p??q)?(r?s)) ? (r?t) ? (?t) ? p.
- r?t Premise
- ?t Premise
- ?r Steps 1,2 and Modus Tollens
- ?r??s Step 3 and Disjunctive Amplification
- ?(r?s) Step 4 and DeMorgans Law
- (?p??q)?(r?s) Premise
- ?(?p??q) Steps 5,6 and Modus Tollens
- ??p???q Step 7 and DeMorgans Law
- p?q Step 8 and Double Negation
- p Step 9 and Conjunctive Simplification
43General Remarks
- Propositions that only use ?,?,?,(,) are the
objects in Boolean algebra (without the
implication ?). Note the Laws of Logic do not
use ?. - This is what you typically have in IF THEN
construction. - The implication becomes useful when you want to
connect Boolean algebra with the rules of
inference. - False ? p ? True follows from proof by
contradiction.It holds that (p??p) ? p hence
(p??p) ? p ? True.Take the two cases p ? True
and p ? False.
44Terminology 4 Conditionals
- For the propositions p and q and the conditional
p ? q,we have the three other conditionals - converse q ? p
- inverse ?p ? ?q
- contrapositive ?q ? ?p
Only one of these is equivalent with p ? q
the contrapositive, hence (p?q) ? (?q??p). We
also have for the other two (q?p) ? (?p??q) but
not (p?q) ? (q?p) or (p?q) ? (?p??q)
45Proving Techniques
46Arguments in Real Life
- Theorem ?2 is not a rational number that is
there are no integers a,b such that (a/b)22. - Assume that there are a,b with (a/b)22, with
gcd(a,b)1. - It follows that a22b2, and hence that a has to
be even.With a2c we see that 4c22b2, hence
2c2b2. - This shows that b is even as well, contradicting
thereduction assumptions about a and b. - Conclusion There are no such a,b ?2 is not
rational.
47When Writing Real Proofs
- When writing (real) proofs, you should make it
clear to yourself and your reader why your
statements are true - by hypothesis? (a/b)22
- by definition? a is even, hence a2c
- an earlier proposition? a22b2, hence a is
even - following directly? 4c22b2, hence 2c2b2
- logically equivalent?
- Dont confuse A is (logically) equivalent with
B with B follows (logically) from A.Dont
abuse the word logic/logically.
48Predicate Calculus
- Statements like 3x5, anbncn are not
propositions because they have free variables
they are open statements or predicates(??).With
n free variables, it is an n-place predicate. - If we specify the variables, they become
propositions,like 325, 232333 (True and
False respectively)x2 satisfies the predicate
P(x) 3x5. - Central question for predicates Is the predicate
satisfied for all, some, or none of the possible
values?
49Definition 2.5
- A declarative sentence is an open statement if
- it contains one or more variables, and
- it is not a statement, but
- it becomes a statement when the variables in it
are replaced by certain allowable choices.
50Example
- The number x 2 is an even integer is an open
statement and is denoted by P(x). The allowable
choices for x is called the universe (set) for
P(x). - If x 3, P(3) is a false statement.
- Q(x,y) The numbers y 2, x y, and x 2y
are even integers., then Q(4,2) is true. - ?for some x, P(x) (TRUE), for some x, y, Q(x,y)
(TRUE), or for all x, P(x) (FALSE).
51Quantifiers
- Given a predicate P(x)The universal quantifier
? describes for all x, hence ?x P(x) stands
for for all x, P(x) holds - The existential quantifier ? describes there is
an x ?x P(x) stands for there is an x such
that P(x) holds - It is crucial to understand what the universe or
domain (of discourse) is. - Compare ?x x25, x?Z or x?R?
52Rules of Predicate Logic
- Relation between universal and existential
quantifiers ??x P(x) ? ?x ?P(x) hence ??x
P(x) ? ?x ?P(x) - Assuming a non-zero domain for x,?x P(x)
implies ?x P(x) - Dont confuse ??x P(x) with ?x ?P(x) or
??x P(x) with ?x ?P(x)
the power ofcounterexamples
53Table 2.21 summarize and extend some results for
quantifiers.
54Commuting Quantifiers
- Identical quantifiers commute ?x?y P(x,y) ?
?y?x P(x,y) and ?x?y P(x,y) ? ?y?x P(x,y) - But non-identical ones do not, see ?x?y xy
versus ?y?x xy
55Compound Predicates
- Table 2.22 ?x P(x) ? Q(x) ? ?x P(x) ? ?x
Q(x) ?x P(x) ? Q(x) ? ?x P(x) ? ?x Q(x) - ?x P(x) ? Q(x) ? ?x P(x) ? ?x Q(x) ?x P(x) ?
?x Q(x) ? ?x P(x) ? Q(x) - Note Not ?.
56Table 2.23 Rules for negating statements with
one quantifier.
57What is the negation of
58The Rule of Universal Specification
- If an open statement becomes true for all
replacements by the members in a given universe,
then that open statement is true for each
specific individual member in that universe. - (A bit more symbolically if p(x) is an open
statement for a given universe, and if ?x p(x) is
true, then p(a) is true for each a in the
universe.)
59EXAMPLE 2.53 m(x) x is a mathematics professor
c(x) x has studied calculus.
- Now consider the following argument.
- All mathematics professors have studied calculus.
- Leona is a mathematics professor.
- Therefore Leona has studied calculus.
- Steps Reasons
- 1)?x m(x)?c(x) Premise
- 2) m(l) Premise
- 3) m(l)?c(l) Step (1) and the Rule of Universal
Specification - 4) ? c(l) Steps (2) and (3) and the Rule of
Detachment
60The Rule of Universal Generalization
- If an open statement p(x) is proved to be true
when x is replaced by any arbitrarily chosen
element c from our universe, then the universally
quantified statement ?x p(x) is true. - If an open statement q(x,y) that is proved to be
true when x and y are replaced by arbitrarily
chosen elements from the same universe, or their
own respective universes, then the universally
quantified statement ?x ?y q(x, y) or, ?x, y
q(x, y) is true. Similar results hold for the
cases of three or more variables.
61- Example2.54Let p(x), q(x), and r(x) be open
statements that are defined for a given
universe.We show that the argument - ?x p(x)?q(x)
- ?x q(x)?r(x)
- __________________
- ? ?x p(x)?r(x)
- is valid by considering the following.
- Steps Reasons
- x (p(x)?q(x) Premise
- p(c)?q(c) Step (1) and the Rule of Universal
Specification - x q(x)?r(x) Premise
- q(c)?r(c) Step (3) and the Rule of Universal
Specification - p(c)?r(c) Steps (2) and (4) and the Law of the
Syllogism - ? x p(x)?r(x) Step (5) and the Rule of
Universal Generalization
62Theorem 2.2 For all integers k and l, if k, l
are both odd, then k l is even.
- Since k and l are odd, we may write k 2a 1 and
l 2b 1, for some integers a, b. This is due
to Definition 2.8. - Then
- k l (2a 1) (2b 1) 2(a b 1),
- by virtue of the Commutative and Associative
Laws of Addition and the Distributive Law of
Multiplication over Additionall of which hold
for integers. - Since a, b are integers, a b 1 c is an
integer with k l 2c, it follows from
Definition 2.8 that k l is even.
63THEOREM 2.3For all integers k and l, if k and l
are both odd, then their product kl is also odd.
- Proof Since k and l are both odd, we may write k
2a 1 and l 2b 1, for some integers a and
bbecause of Definition 2.8. Then the product - kl (2a 1)(2b 1) 4ab 2a 2b 1
- 2(2ab a b) 1,
- where 2ab a b is an integer.
- Therefore, by Definition 2.8 once again, it
follows that kl is odd.
64THEOREM 2.5 For all positive real numbers x and
y, if the product xy exceeds 25, then x gt5 or y
gt5.
- Proof Consider the negation of the
conclusionthat is, suppose that 0 lt x 5 and 0
lty 5. Under these circumstances we find that 0
0 0 lt x y 5 5 25, so the product xy does
not exceed 25. - (This indirect method of proof now establishes
the given statement, since we know that an
implication is logically equivalent to its
contrapositive.)