0% found this document useful (0 votes)
137 views

Lesson 1-The Foundations-Logic and Proofs

This document provides an overview of predicate logic and proofs. It introduces predicate logic as a more powerful logic than propositional logic for representing mathematical and computer science statements. Predicates are defined as properties that can be true or false of variables. Logical connectives and quantifiers are used to combine predicates into compound expressions. The document explains how to use universal and existential quantifiers to quantify predicates as applying to all or some variables. It provides examples of writing quantified expressions and determining their truth values. The goal is for students to use predicate logic to represent statements and construct direct proofs.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views

Lesson 1-The Foundations-Logic and Proofs

This document provides an overview of predicate logic and proofs. It introduces predicate logic as a more powerful logic than propositional logic for representing mathematical and computer science statements. Predicates are defined as properties that can be true or false of variables. Logical connectives and quantifiers are used to combine predicates into compound expressions. The document explains how to use universal and existential quantifiers to quantify predicates as applying to all or some variables. It provides examples of writing quantified expressions and determining their truth values. The goal is for students to use predicate logic to represent statements and construct direct proofs.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Lesson 1-The Foundations-Logic and Proofs

By the end of this lesson, students should be able to;


 use predicate logic to express a wide range of statements in mathematics and
computer science.
 construct and use compound propositions with logical connectives
 translate English sentences into expressions involving propositional variables and
logical connectives.
 construct direct proofs to prove statements

1.1 Predicate Logic and Predicates


Since you have already learned the concept of propositional logic, let us revisit the definition
of a propositional statement. A proposition is a declarative statement which is true or false,
but not both. However, propositional logic is not powerful enough to represent all types of
assertions that are used in computer science and mathematics. For example, the assertion "
is greater than 5", where is a variable, is not a proposition because you can not tell whether
it is true or false unless you know the value of . Thus the propositional logic cannot deal
with such sentences. However, such assertions appear quite often in mathematics and to deal
with them, we introduce predicate logic. To understand predicate logic, we first need to
introduce the concept of a predicate. Afterward, we will introduce the notion of quantifiers,
which enable us to reason with statements that assert the existence of an object with a
particular property.

The statement is greater than 5 has two parts.


 The variable X-subject of the statement
 is greater than 5- predicate (property that the subject of the statement can have)
is greater than 5
Subject Predicate
Remark 1
A predicate is a property that states something about the subject. In logic, sometimes we call
this subject a variable or argument.

1
Predicate logic uses the following features:

 Variables:
 Predicates:
 Quantifiers

Example 1.0.1
is greater than is a predicate. If we choose then we get the propositional
statement “ is greater than , which is true. But if we choose , then we get the
propositional statement is greater than which is false. So it is clear that the truth value
of a predicate depends on the value of the variable(s).

1.2 Propositional Functions and Examples

Predicates are often found in mathematical assertions, in computer programs, and in system
specifications. These statements are neither true nor false when the values of the variables are
not specified. In this section, we will discuss the ways that propositions can be produced from
such statements. The statement is greater than has two parts. The first part, the
variable , is the subject of the statement. The second part-the predicate, "is greater than "-
refers to a property that the subject of the statement can have. We can denote the statement
" is greater than 1" by , where denotes the predicate "is greater than " and is the
variable. The statement is also said to be the value of the propositional function at .
Once a value has been assigned to the variable , the statement becomes a proposition
and has a truth value.

Note 1
 Propositional functions become propositions (and have truth values) when their
variables are each replaced by a value from the domain (or bound by a quantifier).
 The statement is said to be the value of the propositional function at .
 Often the domain is denoted by . So in this example is the integers.

2
Example 1.2.3
Let “ ” be denoted by and (for all three variables) be the set of all
integers. Find the truth values of the following.
1.
2.
3.

Solution:
1. F 2. T 3. Not a proposition

Remark 2:
The domain of a propositional function is the set of possible values of the arguments. The
domain is also known as the universe of discourse. This will be discussed in length under
Section 1.4(Quantifiers).

Self-Assessment Exercises

1. Consider the predicate given by Find the truth value when,


and
2. Let “ ” be denoted by , with is the set of all integers. Find the
truth values of the following.
i)
ii)
iii)

3
1.3 Compound Expressions

Recall that, compound propositions are formed by combining two or more existing
propositions using logical operators. We can extend this notion to expressions involving
predicates and quantifiers.

Example 1.3.1
Let be the statement Find the truth values of the following statements.
1.
2.
3.
4.
Solution:
1. is true (since ) and is false (since So the compound
statement is true.
2. False
3. False
4. True

Self-Assessment Exercises
1. Let be the statement Find the truth values of the following
statements.
i.
ii.
iii.
iv.

1.4 Quantifiers
Consider Example 1.3.1. Does it make sense to assign to the value “blue”? Intuitively, the
universe of discourse (or domain) is the set of all things we wish to talk about; that is, the set
of all objects that we can sensibly assign to a variable in a propositional function.

4
Example 1.4.1

What would be the universe of discourse for the propositional function The test will
be on the be?
Solution:
The universe of discourse ={Sunday, Monday, Tuesday, Wednesday, Thursday, Friday,
Saturday}

As we mentioned earlier, predicate becomes a proposition when we assign it fixed values.


However, another way to make a predicate into a proposition is to quantify it. That is, the
predicate is true (or false) for all possible values in the universe of discourse or for some
value(s) in the universe of discourse. Such quantification can be done with two quantifiers:
the universal quantifier and the existential quantifier.

1.4.1 Universal Quantifier


The universal quantification of a predicate is the proposition is true for all values
of in the universe of discourse . We use the notation which can be read for
all .

Example 1.4.2
1. If denotes and is the integers, then is false.
2. If denotes and is the positive integers, then is true.
3. If denotes and is the integers, then is false.

Example 1.4.3
Let be the propositional function given by where the universe of
discourse for is the set of all integers.
Express the statement for every x and for every using quantifiers.
Solution:

Or, we can also use the shorthand

5
1.4.2 Existential Quantifier

The existential quantification of a predicate is the proposition “There exists an in the


universe of discourse such that is true.” We use the notation which can be read
“there exists an ”

Example 1.4.4
1. If denotes “x > 0” and is the set of all integers, then x P(x) is true. It is also
true if is the positive integers.
2. If denotes “x < 0” and is the set of all positive integers, then is false.
3. If denotes “x is even” and is the set of all integers, then is true.

Example 1.4.5
Let be the propositional function given by where the universe of
discourse for is the set of integers.
Express the statement there exists x and there exists such that using
quantifiers.
Solution:

Or, we can also use the shorthand

1.4.3 Uniqueness Quantifier

The uniqueness quantification of a predicate is the proposition “There exists a unique


(in other words, there exists one and only one ) in the universe of discourse such that
is true.” We use the notation which can be read “there exists a unique ”, OR
equivalently “there exists one and only one x.”

Example 1.4.6
If denotes and is the integers, then is true.
But if denotes then is false.

6
1.4.4 Properties of Quantifiers

The truth value of and depend on both the propositional function and
on the domain

Example 1.4.7
1. If is the set of all positive integers and P(x) is the statement , then
is true, but is false.
2. If U is the set of all negative integers and is the statement , then both
and are true.
3. If consists of and and is the statement , then both and
are true. But if P(x) is the statement , then both and
are false.

1.4.5 Negating Quantified Expressions

We will often want to consider the negation of a quantified expression. For instance, consider
the negation of the statement "Every student in your class has a computer."

This statement is a universal quantification, namely, where the statement is


has a computer and the domain consists of the students in your class. The negation of this
statement is "It is not the case that every student in your class has a laptop." This is
equivalent to "There is a student in your class who does not have a laptop." And this is
simply the existential quantification of the negation of the original propositional function,
namely, .

This example illustrates the following logical equivalence:

Note 2
Let be any predicate and be its domain (universe of discourse). Then the following
hold:

7
Example 1.4.8
Write the negation of the following statements,
1.
2.

Solution:
1.
2.

Note 3
Precedence of Quantifiers
 The quantifiers and have higher precedence than all the logical operators.
 For example, means
 means something different.
 Unfortunately, often people write x P(x) Q(x) when they mean

Self-Assessment Exercises

1. Let be the statement If the domain consists of all integers, what


is the truth value of the statement ?

2. Let be the statement “for every , for every and for every z,
, where the universe of discourse for and is the set of integers.
i. Express the above statement using quantifiers.
ii. Find the truth value of the above statement.

3. Let be the statement . If the domain consists of all “positive


integers”, what is the truth value of the statement ? What will be the truth
value of the statement if the domain is changed to the set of all “integers”?

4. Let be the statement “for each there exists such that where the
universe of discourse for and is the set of integers.

8
i. Express the above statement using quantifiers.
ii. Find the truth value of the above statement.

5. Let be the statement . If the domain consists of all “integers”,


what is the truth value of the statement ? What will be the truth value of the
statement if the domain is changed to the set of all “positive integers”?

6. Using your previous knowledge and Note 2, write the negation of each of the
following statements.
i.
ii.
iii.
iv. )

1.5 Translating from English to Logic

There are many reasons to translate English sentences into expressions involving
propositional variables and logical connectives. In particular, English (and every other human
language) is often ambiguous. Translating sentences into compound statements removes the
ambiguity, which is a basic disadvantage in every human language. Moreover, once we have
translated sentences from English into logical expressions we can analyze these logical
expressions to determine their truth values.

Example 1.5.1
Translate the following sentence into logic:
“The election is decided and the votes have been counted”
Solution:
Clearly, this statement consists of two sentence parts. We will use propositional variables to
represent each sentence part and determine the appropriate logical connectives between them.
Let and represent “the election is decided”, and “the votes have been counted”,
respectively. Then we can simply connect these two components and this sentence can be
represented as .

9
Example 1.5.2
Let p and q be the following propositions.
: You drive over miles per hour.
: You get a speeding ticket.

Write these propositions using and and logical connectives.


1. You do not drive over miles per hour.
2. You drive over miles per hour, but you do not get a speeding ticket.
3. If you drive over miles per hour, then you will get a speeding ticket
4. If you do not drive over miles per hour, then you will not get a speeding ticket.

Solution:
1. 2. 3. 4.

Now we know how to use propositions to express sentences in logical expressions. So far, we
have purposely avoided sentences whose translations required predicates and quantifiers.
Translating from English to logical expressions becomes even more complex when
quantifiers are needed. We will use some examples to illustrate how to translate sentences
from English into logical expressions, when quantifiers are involved.

Example 1.5.3
Express the statement "Every student in this class has studied calculus" using predicates and
quantifiers.
Solution:
Step 1: Rewrite the statement so that we can clearly identify the appropriate quantifiers to
use.
"For every student in this class, that student has studied calculus."
Step 2: Introduce a variable
"For every student in this class, has studied calculus."

Step 3: Introduce , which is the statement " has studied calculus." Consequently, if the
domain for x consists of the students in the class, we can translate our statement as

10
Example 1.5.4
Express the statements "Some student in this class has studied Java" and "Every student in
this class has studied either Java or Python" using predicates and quantifiers.
Solution:
Step 1: Rewrite the statement so that we can clearly identify the appropriate quantifiers to
use. "There is a student in this class with the property that the student has studied Java."

Step 2: Introduce a variable


"There is a student in this class having the property that has studied Java"

Step 3: Introduce , which is the statement " has studied Java." Consequently, if the
domain for consists of the students in the class, we can translate our statement as

Similarly, the second statement can be expressed as


"For every in this class, has the property that has studied Java or has studied Python."

We let be " has studied Python" Following our earlier reasoning, we see that if the
domain for consists of the students in this class, this second statement can be expressed as

Self-Assessment Exercises

1. Let be the statement " can speak Russian" and let be the statement " knows
the computer language C++." Express each of these sentences in terms of ,
quantifiers, and logical connectives. The domain for quantifiers consists of all students at
your school.
i. There is a student at your school who can speak Russian and who knows C++.
ii. There is a student at your school who can speak Russian but who doesn't know
C++.
iii. Every student at your school either can speak Russian knows C++.
iv. No student at your school can speak Russian or knows C++.

11
2. Let p, q, and r be the following propositions.

: You have the flu.


: You miss the final examination.
: You pass the course.

Translate each of these English sentences into logic.


i. You have the flue or you pass the course.
ii. If you have the flu then you miss the final examination.
iii. You do not have the flu and you do not miss the final examination.
iv. If you do not have the flue then you pass the course.

3. Let be the statement " has a cat," let be the statement " has a dog," and let
be the statement " has a ferret." Express each of these statements in terms of ,
, , quantifiers, and logical connectives. Let the domain consist of all students in
your class.
i. A student in your class has a cat, a dog, and a ferret.
ii. All students in your class have a cat, a dog, or a ferret.
iii. Some student in your class has a cat and a ferret, but not a dog.
iv. No student in your class has a cat, a dog, and a ferret.
v. For each of the three animals, cats, dogs, and ferrets, there is a student in your
class who has one of these animals as a pet.

1.6 Introduction to Proofs

A proof is a logical argument that tries to show that a statement is true. In mathematics, and
computer science, a proof has to be well thought out and tested before being accepted. There
are many different ways to go about proving something: direct proof, proof by contradiction,
and proof by induction. In this course, we will talk about direct proofs.

Before diving in, we’ll need to explain some terminology.

A theorem is a mathematical statement which is proven to be true.

A statement that has been proven true in order to further help in proving another statement is
called a lemma.

12
Direct Proofs

Many theorems state that a specific type or occurrence of an object exists. One method for
proving the existence of such an object is to prove that ( implies ). In other words,
we would demonstrate how we would build that object to show that it can exist. A proof by
construction is just that, we want to prove something by showing how it can come to be. There
are only two steps to a direct proof:

1. Assume that (hypothesis) is true.


2. Use (hypothesis) to show that (conclusion) must be true.

Example 1.6.1
If and are consecutive integers, the sum of must be an odd number.

Proof: Following the steps we laid out before, we first assume that our hypothesis is true. We
then can say that since and are consecutive integers, is equal to . In that case,
can be rewritten as or . Therefore, we can say that
. We know that any number multiplied by an even number must be even. We also know that
if we add 1 to any even number, it becomes odd. Given these, we can say:
shows that is odd.

Example 1.6.2
If is an odd integer, then is odd.

Proof: Once again, we assume that the hypothesis of this conditional statement is true,
namely, we assume that is odd. By the definition of an odd integer, it follows that
, where is some integer. We want to show that is also odd. We can square both
sides of the equation to obtain a new equation that expresses When we do
this, we find that . By the
definition of an odd integer, we can conclude that is an odd integer (it is one more than
twice an integer). Consequently, we have proved that if is an odd integer, then is an odd
integer.

13
Self-Assessment Exercises

1. Prove that, “if is even, then is even.”

2. Prove that the product of two odd numbers is odd.


Hint: Prove that if and are odd, then is odd.

14

You might also like