The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Sentences 1 and 2 are not propositions because they Solution: The negation is
are not declarative sentences. Sentences 3 and 4 are
“It is not the case that Vandana’s smartphone has at
not propositions because they are neither true nor
least 32 GB of memory.”
false. Note that each of sentences 3 and 4 can be
turned into a proposition if we assign values to the This negation can also be expressed as
variables.
“Vandana’s smartphone does not have at least 32 GB
We use letters to denote propositional variables (or of memory”
sentential variables), that is, variables that represent
propositions, just as letters are used to denote or even more simply as
numerical variables. The conventional letters used “Vandana’s smartphone has less than 32 GB of
for propositional variables are p, q, r, s, … . The truth memory.”
value of a proposition is true, denoted by T, if it is a
true proposition, and the truth value of a proposition Table 1 displays the truth table
is false, denoted by F, if it is a false proposition. for the negation of a proposition
Propositions that cannot be expressed in terms of p. This table has a row for each
simpler propositions are called atomic propositions. of the two possible truth values
of p. Each row shows the truth
The area of logic that deals with propositions is called
value of ¬p corresponding to the
the propositional calculus or propositional logic. It
was first developed systematically by the Greek truth value of p for this row.
philosopher Aristotle more than 2300 years ago.
1
q, denoted by p ∨ q, is the proposition “p or q.” The
disjunction p ∨ q is false when both p and q are false
The negation of a proposition can also be considered
and is true otherwise.
the result of the operation of the negation operator
on a proposition. The negation operator constructs a Table 3 displays the truth table for p ∨ q.
new proposition from a single existing proposition.
We will now introduce the logical operators that are
used to form new propositions from two or more
existing propositions. These logical operators are
also called connectives.
Conjunction
Let p and q be propositions. The conjunction of p and
q, denoted by p ∧ q, is the proposition “p and q.” The
conjunction p ∧ q is true when both p and q are true
and is false otherwise.
“if p, q” “p only if q”
proposition that is true when exactly one of p and q is
true and is false otherwise. “p is sufficient for q” “a sufficient condition for q is
p”
Example 8: Let p and q be the propositions that state “q if p” “q whenever p”
“A student can have a salad with dinner” and “A
student can have soup with dinner,” respectively. “q when p” “q is necessary for p”
What is p ⊕ q, the exclusive or of p and q?
“a necessary condition for p “q follows from p”
is q”
Solution: The exclusive or of p and q is the statement q unless ¬p” “q provided that p"
that is true when exactly one of p and q is true. That
is, p ⊕ q is the statement “A student can have soup or
salad, but not both, with dinner.” Note that this is A useful way to understand the truth value of a
often stated as “A student can have soup or a salad conditional statement is to think of an obligation or a
with dinner,” without explicitly stating that taking contract. For example, the pledge many politicians
both is not permitted. make when running for office is
“If I am elected, then I will lower taxes.”
Example 9: Express the statement “I will use all my
savings to travel to Europe or to buy an electric car” If the politician is elected, voters would expect this
in propositional logic using the statement p: “I will politician to lower taxes. Furthermore, if the
use all my savings to travel to Europe” and the politician is not elected, then voters will not have any
statement q: “I will use all my savings to buy an expectation that this person will lower taxes,
electric car.” although the person may have sufficient influence to
cause those in power to lower taxes. It is only when
Solution: To translate this statement, we first note the politician is elected but does not lower taxes that
that the or in this statement must be an exclusive or voters can say that the politician has broken the
because this student can either use all his or her campaign pledge. This last scenario corresponds to
savings to travel to Europe or use all these savings to the case when p is true but q is false in p → q.
buy an electric car, but cannot both go to Europe and Similarly, consider a statement that a professor might
buy an electric car. (This is clear because either make:
option requires all his savings.) Hence, this statement
“If you get 100% on the final, then you will
can be expressed as p ⊕ q.
get an A.”
Conditional Statements If you manage to get 100% on the final, then you
Let p and q be propositions. The conditional would expect to receive an A. If you do not get 100%,
statement p → q is the proposition “if p, then q.” The you may or may not receive an A depending on other
conditional statement p → q is false when p is true factors. However, if you do get 100%, but the
and q is false, and true otherwise. In the conditional professor does not give you an A, you will feel
statement p → q, p is called the hypothesis (or cheated.
antecedent or premise) and q is called the conclusion
(or consequence).
Remark: Because some of the different ways to
Assessment
express the implication p implies q can be confusing,
The statement p → q is called a conditional statement we will provide some extra guidance. To remember
because p → q asserts that q is true on the condition that “p only if q” expresses the same thing as “if p,
3
then q,” note that “p only if q” says that p cannot be and
true when q is not true. That is, the statement is false
“Maria will find a good job unless she does not learn
if p is true, but q is false. When p is false, q may be
discrete mathematics.”
either true or false, because the statement says
nothing about the truth value of q. Note that the way we have defined conditional
statements is more general than the meaning
For example, suppose your professor tells you. attached to such statements in the English language.
“You can receive an A in the course only if your score For instance, the conditional statement in Example
10 and the statement
on the final is at least 90%.”
“If it is sunny, then we will go to the beach”
Then, if you receive an A in the course, then you
know that your score on the final is at least 90%. If are statements used in normal language where there
you do not receive an A, you may or may not have is a relationship between the hypothesis and the
scored at least 90% on the final. Be careful not to use conclusion. Further, the first of these statements is
“q only if p” to express p → q because this is incorrect. true unless Maria learns discrete mathematics, but
The word “only” plays an essential role here. To see she does not get a good job, and the second is true
this, note that the truth values of “q only if p” and p → unless it is indeed sunny, but we do not go to the
beach. On the other hand, the statement
q are different when p and q have different truth
values. To see why “q is necessary for p” is equivalent “If Juan has a smartphone, then 2 + 3 = 5”
to “if p, then q,” observe that “q is necessary for p”
is true from the definition of a conditional
means that p cannot be true unless q is true, or that if
statement, because its conclusion is true.
q is false, then p is false. This is the same as saying
(The truth value of the hypothesis does not
that if p is true, then q is true. To see why “p is matter then.) The conditional statement.
sufficient for q” is equivalent to “if p, then q,” note
that “p is sufficient for q” means if p is true, it must be “If Juan has a smartphone, then 2 + 3 = 6”
the case that q is also true. This is the same as saying is true if Juan does not have a smartphone, even
that if p is true, then q is also true. To remember that though 2 + 3 = 6 is false. We would not use these last
“q unless ¬p” expresses the same conditional two conditional statements in natural language
statement as “if p, then q,” note that “q unless ¬p” (except perhaps in sarcasm), because there is no
means that if ¬p is false, then q must be true. That is, relationship between the hypothesis and the
the statement “q unless ¬p” is false when p is true conclusion in either statement. In mathematical
but q is false, but it is true otherwise. Consequently, reasoning, we consider conditional statements of a
“q unless ¬p” and p → q always has the same truth more general sort than we use in English. The
value. mathematical concept of a conditional statement is
independent of a cause and effect relationship
We illustrate the translation between conditional between hypothesis and conclusion. Our definition of
statements and English statements in Example 10. a conditional statement specifies its truth values; it is
Let p be the statement “Maria learns discrete not based on English usage. Propositional language is
mathematics” and q the statement “Maria will find a an artificial language; we only parallel English usage
good job.” Express the statement p → q as a to make it easy to use and remember.
statement in English. The if-then construction used in many programming
Solution: From the definition of conditional languages is different from that used in logic. Most
statements, we see that when p is the statement programming languages contain statements such as if
Extra Examples “Maria learns discrete mathematics” p then S, where p is a proposition and S is a program
and q is the statement “Maria will find a good job,” p segment (one or more statements to be executed).
→ q represents the statement. (Although this looks as if it might be a conditional
statement, S is not a proposition, but rather is a set of
“If Maria learns discrete mathematics, then executable instructions.) When execution of a
she will find a good job.” program encounters such a statement, S is executed if
p is true, but S is not executed if p is false, as
There are many other ways to express this
illustrated in Example 11.
conditional statement in English. Among the most
natural of these are
“Maria will find a good job when she learns discrete Example 11 What is the value of the variable x after
mathematics.” the statement.
“For Maria to get a good job, it is sufficient for her to if 2 + 2 = 4 then x := x + 1
learn discrete mathematics.”
4
x is defined to be equal to (:=), if x = 0 “If the home team does not win, then it is not
before this statement is encountered? (The raining.”
symbol := stands for assignment. The The converse is
statement x := x + 1 means the assignment “If the home team wins, then it is raining.”
of the value of x + 1 to x.) The inverse is
“If it is not raining, then the home team does not
Solution: Because 2 + 2 = 4 is true, the assignment win.”
statement x := x + 1 is executed. Hence, x has the Only the contrapositive is equivalent to the original
value 0 + 1 = 1 after this statement is encountered. statement.