Download Propositional Logic

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Index of logic articles wikipedia , lookup

Infinitesimal wikipedia , lookup

Addition wikipedia , lookup

Theorem wikipedia , lookup

Real number wikipedia , lookup

Elementary mathematics wikipedia , lookup

Hyperreal number wikipedia , lookup

Laws of Form wikipedia , lookup

Transcript
Predicates and
Quantifiers
Dr. Yasir Ali
1. Predicates
2. Quantifiers
a. Universal Quantifiers
b. Existential Quantifiers
3. Negation of Quantifiers
4. Universal Conditional Statement
1. Negation of Universal Conditional
5. Multiple Quantifiers
1. Precedence of quantifiers
2. Order of quantifiers
6. Translation
It is frequently necessary to reason logically about statements of
the form
Everything has the property p
or
something has the property p.
One of the oldest and most famous pieces of logical reasoning,
which was known to the ancient Greeks, is an example:
All men are mortal.
Socrates is a man.
Therefore Socrates is mortal.
Predicate logic, also called first order logic, is an extension to
propositional logic that adds two quantifiers that allow
statements like the examples above to be expressed.
Everything in propositional logic is also in predicate logic: all
the definitions, inference rules, theorems, algebraic laws, etc.,
still hold.
β€œEvery computer connected to the university network is
functioning properly.”
No rules of propositional logic allow us to conclude the truth of
the statement
β€œMATH3 is functioning properly,”
Where MATH3 is one of the computers connected to the
university network.
Predicate
A predicate is a statement that an object π‘₯ has a certain property.
Such statements may be either true or false.
Or more formally,
A predicate is a sentence that contains a finite number of
variables and becomes a statement when specific values are
substituted for the variables. The domain of a predicate variable
is the set of all values that may be substituted in place of the
variable.
Let P(x) be the statement β€œthe word x contains the letter a.” What
are these truth values?
1. P(orange)
2. P(lemon)
3. P(true)
4. P(false)
Let 𝑃(π‘₯) be the predicate β€œπ‘₯ 2 > π‘₯” with domain the set R of all
1
βˆ’1
real numbers. Write 𝑃(2), 𝑃( ), and 𝑃( ), and indicate which
2
2
of these statements are true and which are false.
Truth Set of a predicate
When an element in the domain of the variable of a onevariable predicate is substituted for the variable, the resulting
statement is either true or false. The set of all such elements
that make the predicate true is called the truth set of the
predicate.
Let 𝑃(π‘₯) be the predicate β€œπ‘₯ > 1/π‘₯.”
1
βˆ’1
1. Write 𝑃 2 , 𝑃
, 𝑃(βˆ’1), 𝑃( ), and P(βˆ’8), and indicate
2
2
which of these statements are true and which are false.
2. Find the truth set of 𝑃(π‘₯) if the domain of π‘₯ is R, the set of
all real numbers.
3. If the domain is the set R+ of all positive real numbers, what
is the truth set of 𝑃(π‘₯)?
Let Q(x, y) denote the statement β€œx = y + 3.” What are the truth
values of the propositions Q(1, 2) and Q(3, 0)?
Quantifiers
β€’ One sure way to change predicates into statements is to assign
specific values to all their variables.
β€’ For example, if x represents the number 35, the sentence β€œx is
divisible by 5” is a true statement since 35 = 5· 7.
β€’ Another way to obtain statements from predicates is to add
quantifiers.
β€’ Quantifiers are words that refer to quantities such as β€œsome”
or β€œall” and tell for how many elements a given predicate is
true.
Quantifiers
The Universal Quantifier:
Let 𝑃(π‘₯) be a predicate and 𝐷 the domain of π‘₯. A universal
statement is a statement of the form β€œβˆ€π‘₯ ∈ 𝐷, 𝑃(π‘₯).” It is
defined to be true if, and only if, 𝑃(π‘₯) is true for every π‘₯ in 𝐷. It
is defined to be false if, and only if, 𝑃(π‘₯) is false for at least one
π‘₯ in 𝐷. A value for x for which 𝑃(π‘₯) is false is called a
counterexample to the universal statement.
Besides β€œfor all” and β€œfor every,” universal quantification can be
expressed in many other ways, including β€œall of,” β€œfor each,”
β€œgiven any,” β€œfor arbitrary,” β€œfor each,” and β€œfor any.”
Example:
1. Let 𝐷 = {1, 2, 3, 4, 5}, and consider the statement
βˆ€π‘₯ ∈ 𝐷, π‘₯ 2 β‰₯ π‘₯.
Show that this statement is true.
2. Consider the statement
βˆ€π‘₯ ∈ 𝑹, π‘₯ 2 β‰₯ π‘₯.
Find a counterexample to show that this statement is false.
Note:
When all elements in the domain can be listedβ€”say, π‘₯1 , π‘₯2 , . . . , π‘₯𝑛
the Universal quantificationβˆ€π‘₯ 𝑃(π‘₯) is the same as the conjunction
𝑃 π‘₯1 βˆ§π‘ƒ π‘₯2 ∧ · · · βˆ§π‘ƒ(π‘₯𝑛 ),
because this disjunction is true if and only if all of
𝑃(π‘₯1 ), 𝑃((π‘₯2 ), . . . , 𝑃 (π‘₯𝑛 ) is true and false if atleast one of them is
false.
Existential Quantifier
Let 𝑃(π‘₯) be a predicate and 𝐷 the domain of π‘₯. An existential
statement is a statement of the form
β€œβˆƒπ‘₯ ∈ 𝐷 π‘ π‘’π‘β„Ž π‘‘β„Žπ‘Žπ‘‘ 𝑃(π‘₯).”
It is defined to be true if, and only if, 𝑃(π‘₯) is true for at least one
π‘₯ in 𝐷. It is false if, and only if, 𝑃(π‘₯) is false for all π‘₯ in 𝐷.
Besides the phrase β€œthere exists”, we can also express existential
quantification in many other ways, such as by using the words
β€œfor some,” β€œfor at least one,” or β€œthere is.”
The existential quantification βˆƒπ‘₯ 𝑃(π‘₯) is read as
β€œThere is an π‘₯ such that 𝑃(π‘₯),”
β€œThere is at least one π‘₯ such that 𝑃(π‘₯),”
or
β€œFor some π‘₯ 𝑃(π‘₯).”
Consider the following statement:
βˆ€ π‘π‘Žπ‘ π‘˜π‘’π‘‘π‘π‘Žπ‘™π‘™ π‘π‘™π‘Žπ‘¦π‘’π‘Ÿπ‘  π‘₯, π‘₯ 𝑖𝑠 π‘‘π‘Žπ‘™π‘™.
Which of the following are equivalent ways of expressing this
statement?
1. Every basketball player is tall.
2. Among all the basketball players, some are tall.
3. Some of all the tall people are basketball players.
4. Anyone who is tall is a basketball player.
5. All people who are basketball players are tall.
6. Anyone who is a basketball player is a tall person.
Consider the following statement:
βˆƒπ‘₯ ∈ 𝑹 π‘ π‘’π‘β„Ž π‘‘β„Žπ‘Žπ‘‘ π‘₯ 2 = 2.
Which of the following are equivalent ways of expressing this
statement?
1. The square of each real number is 2.
2. Some real numbers have square 2.
3. The number π‘₯ has square 2, for some real number π‘₯.
4. If π‘₯ is a real number, then π‘₯ 2 = 2.
5. Some real number has square 2.
6. There is at least one real number whose square is 2.
Rewrite the following formal statements in a variety of equivalent but
more informal ways. Do not use the symbol βˆ€ or βˆƒ.
1. βˆ€π‘₯ ∈ 𝑹, π‘₯ 2 β‰₯ 0.
β€’ All real numbers have nonnegative squares.
β€’ Or: Every real number has a nonnegative square.
β€’ Or: Any real number has a nonnegative square.
β€’ Or: The square of each real number is nonnegative.
2. βˆ€π‘₯ ∈ 𝑹, π‘₯ 2 β‰  βˆ’1.
β€’ All real numbers have squares that are not equal to βˆ’1.
β€’ Or: No real numbers have squares equal to βˆ’1.
(The words none are or no . . . are equivalent to the words all are not.)
3. βˆƒπ‘š ∈ 𝒁+ π‘ π‘’π‘β„Ž π‘‘β„Žπ‘Žπ‘‘ π‘š2 = π‘š.
β€’ There is a positive integer whose square is equal to itself.
β€’ Or: We can find at least one positive integer equal to its own square.
β€’ Or: Some positive integer equals its own square.
Rewrite each of the following statements formally. Use quantifiers
and variables.
1. All dinosaurs are extinct.
2. Every real number is positive, negative, or zero.
3. No irrational numbers are integers.
4. Some exercises have answers.
5. Some real numbers are rational.
Example:
1. Consider the statement βˆƒπ‘š ∈ 𝒁+ such that π‘š2 = π‘š.
Show that this statement is true.
2. Let 𝐸 = {5, 6, 7, 8} and consider the statement βˆƒπ‘š ∈
𝐸 such that π‘š2 = π‘š. Show that this statement is false.
Note:
When all elements in the domain can be listedβ€”say,
π‘₯1 , π‘₯2 , . . . , π‘₯𝑛 the existential quantification βˆƒπ‘₯ 𝑃(π‘₯) is the same
as the disjunction
𝑃(π‘₯1 ) ∨ 𝑃(π‘₯2 ) ∨ · · · ∨ 𝑃(π‘₯𝑛 ),
because this disjunction is true if and only if at least one of
𝑃(π‘₯1 ), 𝑃((π‘₯2 ), . . . , 𝑃 (π‘₯𝑛 ) is true and false if all of them are
false.
Statement
When True?
When False?
βˆ€π‘₯ 𝑃(π‘₯)
𝑃(π‘₯) is true for every π‘₯.
There is an π‘₯ for which
𝑃(π‘₯) is false.
βˆƒπ‘₯ 𝑃(π‘₯)
There is an π‘₯ for which
𝑃(π‘₯) is true.
𝑃(π‘₯) is false for every π‘₯.
Negation of Quantified Statement
Also known as De Morgan’s Law for Quantifiers
Negation
Equivalent Statement
When Is Negation
True?
When False?
οΏ’βˆƒπ‘₯𝑃(π‘₯)
βˆ€π‘₯ᅭ𝑃(π‘₯)
For every
π‘₯, 𝑃(π‘₯) is false.
There is an π‘₯
for which
𝑃(π‘₯) is true.
οΏ’βˆ€π‘₯𝑃(π‘₯)
βˆƒπ‘₯ᅭ𝑃(π‘₯)
There is an π‘₯ for
which 𝑃(π‘₯) is
false.
𝑃(π‘₯) is true
for every π‘₯.
What are the negations of the statements β€œThere is an honest
politician” and β€œAll Americans eat cheeseburgers”?
Let H(x) denote β€œx is honest” and C(x) denote β€œx eats
cheeseburgers.”
Universal Conditional Statements
βˆ€π‘₯, 𝑖𝑓 𝑃(π‘₯) π‘‘β„Žπ‘’π‘› 𝑄(π‘₯).
Rewrite the following statement informally, without quantifiers
or variables.
βˆ€π‘₯ ∈ 𝑹, 𝑖𝑓 π‘₯ > 2 π‘‘β„Žπ‘’π‘› π‘₯ 2 > 4.
If a real number is greater than 2 then its square is greater than
4.
Negation
What is the negation of οΏ’βˆ€π‘₯(𝑃(π‘₯) β†’ 𝑄(π‘₯))?
βˆƒπ‘₯(𝑃(π‘₯) ∧ ᅭ𝑄(π‘₯))
Write the negation of the following statement:
βˆ€π‘₯ ∈ 𝑹, 𝑖𝑓 π‘₯ > 2 π‘‘β„Žπ‘’π‘› π‘₯ 2 > 4.
Some real number greater than two has a square less or equal
to 4.
Translating from English into Logical
Expressions
Consider the following statements.
A ≑ Small animals are good pets.
C ≑ Cats are animals.
S ≑ Cats are small.
All we have are three propositions: A, C, and S are known, but
nothing else, and the only conclusions that can be drawn are
uninteresting ones like 𝐴 ∧ 𝐢, 𝑆 ∨ 𝐴, and the like.
The solution is to use predicates to give a more refined
translation of the sentences:
A(x) ≑ x is an animal.
C(x) ≑ x is a cat.
S(x) ≑ x is small.
GP(x) ≑ x is a good pet.
Now a much richer kind of English sentence can be translated
into predicate logic:
βˆ€π‘₯. 𝐢(π‘₯)
βˆ€π‘₯. 𝐢(π‘₯)
βˆ€π‘₯. 𝐢(π‘₯)
βˆ€π‘₯. 𝑆(π‘₯)
β†’ 𝐴(π‘₯) ≑ Cats are animals.
β†’ 𝑆(π‘₯) ≑ Cats are small.
β†’ 𝑆(π‘₯) ∧ 𝐴(π‘₯) ≑ Cats are small animals.
∧ 𝐴(π‘₯) β†’ 𝐺𝑃(π‘₯) ≑ Small animals are good pets.
It is generally straightforward to translate from formal predicate logic
into English, since you can just turn each logical operator directly into
an English word or phrase.
For example,
βˆ€π‘₯. 𝑆(π‘₯) ∧ 𝐴(π‘₯) β†’ 𝐺𝑃(π‘₯)
could be translated into English literally:
(1) For every thing, if that thing is small and that thing is an animal,
then that thing is a good pet.
This is graceless English, but at least it’s comprehensible and correct.
The style can be improved:
(2) Everything which is small and which is an animal is a good pet.
Even better would be:
(3) Small animals make good pets.