Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (1 vote)
393 views

Propositional Logic: If and Only If (Rather Than Plus, Minus, Negative, Times

Propositional logic is the study of propositions and logical operators used to combine them. It uses variables to stand for propositions and logical operators like and, or, not, implies, and if and only if. Good notation and symbol manipulation skills allow us to derive conclusions quickly while understanding the meaning behind the symbols and steps. Propositional logic has two main elements - propositions which are statements that are true or false, and logical operators like conjunction, disjunction, and negation that combine propositions into new, compound propositions. Truth tables define the logical operators by specifying the truth value of the compound proposition for every combination of the component propositions' truth values.

Uploaded by

rams334
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
393 views

Propositional Logic: If and Only If (Rather Than Plus, Minus, Negative, Times

Propositional logic is the study of propositions and logical operators used to combine them. It uses variables to stand for propositions and logical operators like and, or, not, implies, and if and only if. Good notation and symbol manipulation skills allow us to derive conclusions quickly while understanding the meaning behind the symbols and steps. Propositional logic has two main elements - propositions which are statements that are true or false, and logical operators like conjunction, disjunction, and negation that combine propositions into new, compound propositions. Truth tables define the logical operators by specifying the truth value of the compound proposition for every combination of the component propositions' truth values.

Uploaded by

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

Propositional Logic

• Propositional logic is the study of propositions (true or


false statements) and ways of combining them (logical
operators) to get new propositions. It is effectively an
algebra of propositions. In this algebra, the variables
stand for unknown propositions (instead of unknown real
numbers) and the operators are and, or, not, implies, and
if and only if (rather than plus, minus, negative, times,
and divided by). Just as middle/high school students
learn the notation of algebra and how to manipulate it
properly, we want to learn the notation of propositional
logic and how to manipulate it properly.

11/16/09 1
Propositional Logic
• Symbol manipulation has a bad reputation in some circles, and
rightly so when one learns it without understanding what the
symbols and manipulations mean. On the other hand, as you
know, the development of good notation is a huge part of the
history of mathematics. Good notation greatly facilitates clear
thinking, intuition, and insight. It strips away the irrelevant to help
us see true relationships that would otherwise be invisible. Good
manipulation skills allow us to proceed from one conclusion to the
next quickly, confidently, and verifiably. They save us from
having to justify routine, familiar steps every time we encounter
them, and they suggest new ways of proceeding that we might
never have discovered otherwise.

11/16/09 2
Propositional Logic
• Symbol manipulation has a bad reputation in some circles, and
rightly so when one learns it without understanding what the
symbols and manipulations mean. On the other hand, as you
know, the development of good notation is a huge part of the
history of mathematics. Good notation greatly facilitates clear
thinking, intuition, and insight. It strips away the irrelevant to help
us see true relationships that would otherwise be invisible. Good
manipulation skills allow us to proceed from one conclusion to the
next quickly, confidently, and verifiably. They save us from
having to justify routine, familiar steps every time we encounter
them, and they suggest new ways of proceeding that we might
never have discovered otherwise.

11/16/09 3
Propositional Logic
• The Two Elements of Symbolic Logic: Propositions
– A proposition is a statement with a truth value. That is, it is a
statement that is true or else a statement that is false. Here are
some examples with their truth values.

11/16/09 4
Propositional Logic
• The Two Elements of Symbolic Logic: Propositions
– Ayres Hall houses the mathematics department at the University
of Tennessee. (true)
– The main campus of the University of Kentucky is in Athens,
Ohio. (false)
– Homer was the blind poet who composed the Illiad and the
Odyssey. (The statement is certainly true or false, but we may not
know which. Tradition asserts the truth of this proposition, but
some scholars doubt its truth).
– Jesus of Nazareth was God incarnate. (Again the statement is
certainly true or false, even though many people stand on both
sides of the question.)

11/16/09 5
Propositional Logic
• The Two Elements of Symbolic Logic: Propositions
– It will rain in Knoxville tomorrow. (We cannot know the truth
of this statement today, but it is certainly either true or false.)
– 2+2=4 (true)
– 2+2=19 (false)
– There are only finitely many prime numbers. (false)
– Every positive even integer greater than 2 can be written as the
sum of two prime numbers. (This is certainly true or false, but
no one knows which. The proposition is known as Goldbach’s
Conjecture. It holds for every integer yet tested – e.g, 4=2+2,
6=3+3, 8=3+5 – but no one has found a proof that it holds for
all even integers greater than two.)

11/16/09 6
Propositional Logic
• The Two Elements of Symbolic Logic: Propositions
– On the other hand, here are some examples of expressions that
are not propositions.

11/16/09 7
Propositional Logic
• The Two Elements of Symbolic Logic: Propositions
– Where is Ayres Hall? (This is neither true nor false. It is a
question.)
– Find Ayres Hall! (This is neither true nor false. It is a
command.)
– Blue is the best color to paint a house. (This is a matter of
opinion, not truth. It may be your favorite color, but it is not
objective truth.)

11/16/09 8
Propositional Logic
• The Two Elements of Symbolic Logic: Propositions
– Coffee tastes better than tea. (Again, this is a matter of taste,
not truth.)
– The integer n is even. (Since n has no value, this statement is
neither true nor false. If n is given a value, this statement
becomes a proposition. Later we will call such statements
predicates or propositional functions. They are not
propositions, but they become propositions when their
variables are assigned values.)

11/16/09 9
Propositional Logic
• The Two Elements of Symbolic Logic: Logical Operators
– Arithmetic operators (operations) such as addition, subtraction,
multiplication, division, and negation act on numbers to give new numbers.
Logical operators such conjunction (and), disjunction (or), and negation
(not) act on propositions to give new (compound) propositions. Logical
operators should be truth functional; that is, the truth value of the
compound proposition should depend only on the truth value of the
component propositions. This makes it easy to specify the effect of a
logical operator: we simply list the truth value of the compound proposition
for every combination of truth values of the component compositions. Such
a list is a called a truth table. Note that no such definition of arithmetic
operations is possible because there are infinitely many possible values of
numbers.

11/16/09 10
Propositional Logic
• The Common Logical Operators
– Conjunction (and): The conjunction of propositions p and q is
the compound proposition “p and q”. We denote it p ∧ q .
It is true if p and q are both true and false otherwise. For
instance the compound proposition “2+2=4 and Sunday is the
first dayp ∧of
q the week” is true, but “3+3=7 and the freezing

point of water is 32 degrees” false. The truth table that defines


conjunction is

11/16/09 11
p q
p∧q
T T T

T F F

F T F

F F F

11/16/09 12
Propositional Logic
• The Common Logical Operators
– Disjunction (or): In English the word or has two senses:
inclusive and exclusive. The inclusive sense means “either or
both” as in “to be admitted to the university you must have an
ACT composite score of at least 17 or a high school GPA of at
least 2.5.” The exclusive sense means “one or the other but not
both” as in “for dinner I will have a sirloin steak or the fried
shrimp platter” or “is the capital of Kentucky Louisville or
Lexington?” In mathematics and logic the word or always has
the inclusive sense; exceptions require alarm bells and warning
lights.

11/16/09 13
Propositional Logic
• The Common Logical Operators
– The disjunction of propositions p and q is the compound
proposition “p or q”. We denote it p ∨ q . It is true if p is
true or q is true or both. For instance the compound proposition
“2+2=4 or Sunday is the first day of the week” is true, and
“3+3=7 or the freezing point of water is 32 degrees” is also
true, but “2+2=5 or UT is in Oklahoma” is false. The truth
table that defines disjunction is

11/16/09 14
p q p∨q
T T T

T F F

F T F

F F F

11/16/09 15
Propositional Logic
• The Common Logical Operators
– Negation (not): The negation of a proposition p is “not p”. We
denote it . It is true if p false and vice versa. This differs from
the previous operators in that it is a unary operator, acting on a
single proposition rather than a pair (the others are binary
operators). Sometimes there are several ways of expressing a
negation in English, and you should be careful to choose a
clear one. For instance if p is the proposition “2<5”, then
reasonable statements of ~p are “it is not the case that 2<5”
and “2 is not less than 5” and “”. The truth table that defines
negation is

11/16/09 16
p ~p

T F

F T

11/16/09 17
Propositional Logic
• The Common Logical Operators: Conditional (implies,
if-then)
– An implication is a compound proposition of the form “if p
then q” or “p implies q”. In English this phrase carries many
meanings. Sometimes it means that p causes q as in “if you eat
too much you will get fat.” Sometimes it means that p
guarantees q and vice versa as in “if you write a book report, I
will give you five points extra credit” (tacitly assuring you that
if you do not write it, I certainly will not give you extra credit).
Sometimes it takes a very weak sense, simply asserting that the
truth of p guarantees the truth of q as in “if you resign the
chess game, you will lose” (but of course if you play on in a
bad position, you will probably lose anyway — continued play
does not guarantee winning).

11/16/09 18
Propositional Logic
• The Common Logical Operators: Conditional (implies,
if-then)
– Mathematics and logic always use implication in this weakest
sense. Why? Because this is the very least that implication
means in English. It makes our claims as conservative as
possible. If we take “if-then” in this very weak sense, then we
will never assume the phrase means more than it should. We
denote the compound proposition “p implies q” by p → q .
From our discussion above the truth table for implies is

11/16/09 19
p q p→q
T T T

T F F

F T T

F F T

11/16/09 20
Propositional Logic
• The Common Logical Operators: Conditional (implies,
if-then)
– Thus an implication is true unless its antecedent p is true and
its consequent q is false. For instance, suppose I say “if I win
the lottery, I will give each of you $5.00.” Obviously if I win
the lottery and give you $5.00, I have kept my word. Similarly
if I do not win and I do not give you $5.00, I have kept my
word. What if I do not win but I still give you $5.00 (here p is
false and q is true)? In our technical use of implies, p → qstill
I have
kept my word; my promise is still kept. The point is that I
made a promise only about what I would do if I did win the
lottery. If I did not win the lottery, I am free to do as I will. The
only way I can break my word is to win the lottery but not give
you $5.00.

11/16/09 21
Propositional Logic
• The Common Logical Operators: Conditional (implies,
if-then)
– Similarly conditionals like “if 2+2=5, then all prime numbers
are even” are true, even if their usefulness is not immediately
apparent.

11/16/09 22
Propositional Logic
• The Common Logical Operators: Conditional (implies,
if-then)
– The implication has many phrasings in English. It is helpful to
be well acquainted with the possibilities as some of them are
counterintuitive. Here are a few.
• if p then q
• p implies q
• p is sufficient for q
• q is necessary for p
• q, if p
• p only if q (unexpected but correct)

11/16/09 23
Propositional Logic
• The Common Logical Operators: Biconditional (if and
only if):
– The biconditional of propositions p and q is the compound
proposition “p if and only if q” or “p is necessary and
sufficient for q”. We denote it . It is true if p and q have the
same truth value (both true or both false). It is, in fact, one of
the stronger senses of the phrase “if…then…” in everyday
English as mentioned above. The biconditional “2+2=4 if and
only if Sunday is the first day of the week” is true, and “3+3=7
or the freezing point of water is 32 degrees” is false, but
“2+2=5 or UT is in Oklahoma” is true. The truth table that
defines the biconditional is

11/16/09 24
p q p↔q
T T T

T F F

F T F

F F T

11/16/09 25
Propositional Logic
• The Common Logical Operators:
– Exclusive or (xor, p or q but not both): It is possible to define a
logical operator for exclusive or. The book discusses the idea
briefly on page four, but the concept will not interest us much
in this course.

encounter & for and, | for or, ¬


– Other notations are common for logical operators. You may
for not, and ⊂ for
the conditional.

11/16/09 26
Propositional Logic
• In a more extensive treatment of logic we would define
careful rules about order of logical operation, just as we
teach students in pre-algebra about arithmetic/algebraic
order of operation. For our course, however, we will
introduce just two simple rules: First evaluate
parentheses from the inside out. Second, subject to the
first rule evaluate negation before other operators. These
two rules require us to indicate the order of all binary
operations explicitly using parentheses. For instance
p →. : q ∨ r is ambiguous, possibly meaning ( p →: q ) ∨ r
or p → ( : q ∨ r ) .

11/16/09 27
Propositional Logic
• Truth Tables: A truth table lists the truth values of a
compound proposition for every combination of truth
values of its component simple propositions. Truth tables
are a basic tool of propositional logic. Below I present a
simple way of constructing truth tables. The book also
shows a more efficient way that you may prefer.

11/16/09 28
Propositional Logic
• Truth Tables: First note that if a compound proposition
involves n simple propositions, then its truth table must
have 2 n lines (since there are two choice for the truth
value of each of n propositions). It is tedious to construct
truth tables for compound propositions involving more
than three simple propositions. It is also important to
have a simple pattern for listing all possible
combinations of the truth values of those simple
propositions.

11/16/09 29
Propositional Logic
• For example, suppose we want the truth table for
p → (: q ∨ ( p ∧ r ))
Here is the truth table we get, building up one operator at
a time

11/16/09 30
p q r ~q
p∧r : q ∨ ( p ∧ r) p → (: q ∨ ( p ∧ r ))
T T T F T T T
T T F F F F F
T F T T T T T
T F F T F T T
F T T F F F T
F T F F F F T
F F T T F T T
F F F T F T T

11/16/09 31
Propositional Logic
• Why are truth tables important?
– A truth table gives us complete information about the role that
the form of a compound proposition plays in determining the
truth of the compound proposition. Form is the key word. An
expression like p → ( : q ∨ ( p ∧ r )) is only a form
until actual propositions replace the variables p, q, and r. (just
as in arithmetic/algebra an expression like x 2 − y 2 is
only a form until actual numbers replace the variables x and y).

11/16/09 32
Propositional Logic
• Why are truth tables important?
– Mathematics often studies form rather than content. For
instance we know that the numbers that make the form x − y
2 2

equal some fixed positive constant take the shape of a


hyperbola. An algebraic expression like x − y
2 2

represents an infinite collection of numbers generated by a


common arithmetic form. Simplistically speaking, we often
characterize such forms by the shapes of graphs (line, parabola,
ellipse, etc.); shapes are helpful in describing infinite
collections of points. Tables, on the other hand, are seldom
useful since a table of values for x 2 − y 2 has infinitely
many lines, one for each possible value of x and y.

11/16/09 33
Propositional Logic
• Why are truth tables important?
– Logical variables (p, q, r, etc.) stand for infinitely many propositions,
but these propositions can take on only two truth values. Thus there
are only finitely many ways to assign truth values to a logical
expression like

p → (: q ∨ ( p ∧ r ))
The truth table lists the possible assignments together with
the resulting truth value of the expression. This describes
the form perfectly and completely, giving us far more
information about the logical expression than the graph does
for an algebraic expression. A truth table is the natural way
to try to answer every question about a logical expression.

11/16/09 34
Propositional Logic
• Logical Equivalence
– Two expressions are logically equivalent if they have the same
truth table. In other words, their component simple
propositions take on the same truth values, then the
expressions take on the same truth values.
– For example, the expressions p → q and : p ∨ q
are logically equivalent as the following truth tables show.

11/16/09 35
p q p→q : p∨q
T T T T

T F F F

F T T T

F F T T

11/16/09 36
Propositional Logic
• Logical Equivalence
– We use the symbol ≡ to indicate logical equivalence (the
symbol ⇔ is probably more common, but it is also more
confusing). In the above case we write
( p → q ) ≡ (: p ∨ q)

Note ≡ is not a logical operator. Rather it indicates


( p → q ) ≡ (: p ∨ q )
a kind of equality. The statement
is an actual, concrete proposition (a true
one), not a formal expression with a truth table.

11/16/09 37
Propositional Logic
• Logical Equivalence
– The notion of logical equivalence is similar to that of algebraic identity. For
instance, when we write the identity

( x + y ) = x + 2 xy + y
2 2 2

we are saying that once the values of x and y are fixed the two expressions
evaluate to the same number (i.e., identical inputs always produce identical
outputs). This is useful because it means we can freely substitute one
expression for the other. Similarly we may freely replace a compound
proposition by another one that is logically equivalent. One can, thus,
discover and prove new logical equivalences by taking a compound
proposition and successively replacing parts of it by logically equivalent
expressions. The book gives an example of this process in the second
paragraph on page 16, justifying each step with one of the “famous
equivalences” below.

11/16/09 38
Propositional Logic
• Logical Equivalence: Famous Equivalences
– Just as we use certain algebraic identities again and again, there
are logical equivalences that prove useful frequently. For
instance, associated to a conditional p → q are three other
conditionals: the converse q→ p , the inverse : p →: q
and the contrapositive: q →: p . It turns out that the
contrapositive is logically equivalent to the original conditional
and the converse is logically equivalent to the inverse. That is
( p → q ) ≡ ( : q →: p )
and
( q → p ) ≡ ( : p →: q )
These terms are worth memorizing
11/16/09 39
Propositional Logic
• Logical Equivalence: Famous Equivalences
– This is intuitively clear. For instance to say “if n is odd, then so
is its square” is clearly equivalent to saying “if the square of n
is not odd, then neither is n itself.”
– Theorem 1.4 on pp. 14–15 lists other common logical
equivalences. These are not worth memorizing, but you should
read them over a time or two to become acquainted with them.

11/16/09 40
Propositional Logic
• Tautologies and Contradictions
– Some compound propositions have a truth value of true
regardless of the truth values of their component propositions.
That is, their truth tables show them being true on every line.
Such propositions are called tautologies (the book also uses the
somewhat confusing term logically true — a better term would
be formally true). A simple example is p ∨ : p whose
truth table appears below.

11/16/09 41
p ~p
p∨ : p
T F T

F T T

11/16/09 42
Propositional Logic
• Tautologies and Contradictions
– This tautology guarantees the truth of statements like

2 + 2 = 4 or 2 + 2 ≠ 4
and “UT is in Knoxville or UT is not in Knoxville.”
The form guarantees the truth of the statement
regardless of its content.

11/16/09 43
Propositional Logic
• Tautologies and Contradictions
– In studying propositional logic we sometimes encounter a need
for a tautology, any tautology. Instead of inserting one
haphazardly we simply use the boldface letter T to stand for
such a tautology.
– Similarly an expression has a truth value of false regardless of
the truth values of its component propositions is called a
contradiction (or logically false). We denote contradictions by
F. An example is p ∧ : p , covering such propositions as
“UT is in Knoxville and UT is not in Knoxville.” Its truth table
is

11/16/09 44
p ~p
p∧ : p
T F F

F T F

11/16/09 45
Propositional Logic
• Tautologies and Contradictions
– Continuing the analogy between logical and algebraic
expressions, we recognize tautologies and contradictions as the
“constant functions” of propositional logic; a contradiction is
false by form regardless of its content just as x-x=0 regardless
of the value of x.
– The book shows several more logical equivalences involving
tautologies and contradictions at the top of page 16.

11/16/09 46

You might also like