Download Introduction to proposition

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

Fuzzy logic wikipedia , lookup

Inquiry wikipedia , lookup

History of logic wikipedia , lookup

Axiom of reducibility wikipedia , lookup

Modal logic wikipedia , lookup

Intuitionistic logic wikipedia , lookup

Quantum logic wikipedia , lookup

Boolean satisfiability problem wikipedia , lookup

Truth wikipedia , lookup

History of the function concept wikipedia , lookup

Meaning (philosophy of language) wikipedia , lookup

Laws of Form wikipedia , lookup

Tractatus Logico-Philosophicus wikipedia , lookup

Syllogism wikipedia , lookup

Catuṣkoṭi wikipedia , lookup

Interpretation (logic) wikipedia , lookup

Law of thought wikipedia , lookup

Argument wikipedia , lookup

Bernard Bolzano wikipedia , lookup

Natural deduction wikipedia , lookup

Propositional calculus wikipedia , lookup

Propositional formula wikipedia , lookup

Analytic–synthetic distinction wikipedia , lookup

Principia Mathematica wikipedia , lookup

Truth-bearer wikipedia , lookup

Transcript
Introduction
The rules of logic specify the meaning of mathematical statements. For instance, these rules help
us understand and reason with statements such as “There exists an integer that is not the sum of
two squares”. Logic is the basis of all mathematical reasoning. It has practical applications to the
design of computing machines, to the specification of systems, to artificial intelligence, to
computer programming, to programming languages, and to other areas of computer science, as
well as too many other fields of study.
Many algorithms and proofs use logical expressions such as:
“IF p THEN q” or “If p1 AND p2, THEN q1 OR q2”
Therefore it is necessary to know the cases in which these expressions are TRUE or FALSE, that
is, to know the “truth value” of such expressions.
To understand mathematics, we must understand what makes up a correct mathematical
argument, that is, a proof. Once we prove a mathematical statement is true, we call it a theorem.
Proofs are used to verify that computer programs produce the correct output for all possible input
values, to show that algorithms always produce the correct result, to establish the security of a
system, and to create artificial intelligence.
Propositional Logic
The rules of logic give precise meaning to mathematical statements. These rules are used to
distinguish between valid and invalid mathematical arguments. basic building blocks of logic is
proposition. A proposition is a declarative sentence (that is, a sentence that declares a fact) that
is either true or false, but not both.
All the following declarative sentences are propositions.
1. Washington, D.C., is the capital of the United States of America.
2. Toronto is the capital of Canada.
3. 1 + 1 = 2.
4. 2 + 2 = 3.
Propositions 1 and 3 are true, whereas 2 and 4 are false.
Consider the following sentences.
1. What time is it?
2. Read this carefully.
3. x + 1 = 2.
4. 4x + y = z.
Sentences 1 and 2 are not propositions because they are not declarative sentences. Sentences 3
and 4 are not propositions because they are neither true nor false. Note that each of sentences 3
and 4 can be turned into a proposition if we assign values to the variables.
We use letters to denote propositional variables (or statement variables), that is, variables that
represent propositions, just as letters are used to denote numerical variables. Conventional letters
used for propositional variables are p, q, r, s, . . . . The truth value of a proposition is true,
denoted by T, if it is a true proposition, and the truth value of a proposition is false, denoted by F,
if it is a false proposition. The area of logic that deals with propositions is called the
propositional calculus or propositional logic. It was first developed systematically by the
Greek philosopher Aristotle more than 2300 years ago.
Compound Propositions
Many propositions are composite, that is, composed of subpropositions and various connectives
(logic operators) discussed subsequently. Such composite propositions are called compound
propositions. A proposition is said to be primitive if it cannot be broken down into simpler
propositions, that is, if it is not composite. The fundamental property of a compound proposition
is that its truth value is completely determined by the truth values of its subpropositions together
with the way in which they are connected to form the compound propositions.
Basic Logical Operations
There are three basic logical operations of conjunction, disjunction, and negation which
correspond, respectively, to the English words “and,” “or,” and “not.”
Conjunction, p ∧ q
Any two propositions can be combined by the word “and” to form a compound proposition
called the conjunction of the original propositions. Symbolically,
p∧q
read “p and q,” denotes the conjunction of p and q. Since p ∧ q is a proposition it has a truth
value, and this truth value depends only on the truth values of p and q. That is p ∧ q is true only
when both p and q are true.
Question: Find the conjunction of the propositions p and q where p is the proposition “Rebecca’s
PC has more than 16 GB free hard disk space” and q is the proposition “The processor in
Rebecca’s PC runs faster than 1 GHz.”
Solution: The conjunction of these propositions, p ∧ q, is the proposition “Rebecca’s PC has
more than 16 GB free hard disk space, and the processor in Rebecca’s PC runs faster than 1
GHz.” This conjunction can be expressed more simply as “Rebecca’s PC has more than 16 GB
free hard disk space, and its processor runs faster than 1 GHz.” For this conjunction to be true,
both conditions given must be true. It is false, when one or both of these conditions are false.
Disjunction, p ∨ q
Any two propositions can be combined by the word “or” to form a compound proposition called
the disjunction of the original propositions. Symbolically,
p∨q
read “p or q,” denotes the disjunction of p and q. The truth value of p ∨ q depends only on the
truth values of p and q. The disjunction p ∨ q is false when both p and q are false and is true
otherwise.
Question: Find the disjunction of the propositions p and q where p is the proposition “Rebecca’s
PC has more than 16 GB free hard disk space” and q is the proposition “The processor in
Rebecca’s PC runs faster than 1 GHz.”
Solution: “Rebecca’s PC has at least 16 GB free hard disk space, or the processor in Rebecca’s
PC runs faster than 1 GHz.”
Negation, ¬p
Given any proposition p, another proposition, called the negation of p, can be formed by writing
“It is not true that . . .” or “It is false that . . .” before p or, if possible, by inserting in p the word
“not.” Symbolically, the negation of p, read “not p,” is denoted by
¬p
The truth value of ¬p depends on the truth value of p. The truth value of the negation of p, ¬p,
is the opposite of the truth value of p.
Question: Find the negation of the proposition “Michael’s PC runs Linux” and express this in
simple English.
Solution: The negation is
“It is not the case that Michael’s PC runs Linux.”
This negation can be more simply expressed as
“Michael’s PC does not run Linux.”
Question: Find the negation of the proposition
“Vandana’s smartphone has at least 32GB of memory” and express this in simple English.
Solution: The negation is
“It is not the case that Vandana’s smartphone has at least 32GB of memory.”
This negation can also be expressed as
“Vandana’s smartphone does not have at least 32GB of memory”
or even more simply as
“Vandana’s smartphone has less than 32GB of memory.”
Exclusive or (⊕)
The use of the connective or in a disjunction corresponds to one of the two ways the word or is
used in English, namely, as an inclusive or. A disjunction is true when at least one of the two
propositions is true. For instance, the inclusive or is being used in the statement
“Students who have taken calculus or computer science can take this class.”
Here, we mean that students who have taken both calculus and computer science can take the
class, as well as the students who have taken only one of the two subjects. On the other hand, we
are using the exclusive or when we say
“Students who have taken calculus or computer science, but not both, can enroll in this class.”
Here, we mean that students who have taken both calculus and a computer science course cannot
take the class. Only those who have taken exactly one of the two courses can take the class.
Let p and q be propositions. The exclusive or of p and q, denoted by p ⊕ q, is the proposition
that is true when exactly one of p and q is true and is false otherwise.
Propositions and Truth Tables
Let P(p, q, . . .) denote an expression constructed from logical variables p, q, . . ., which take on
the value TRUE (T) or FALSE (F), and the logical connectives ∧, ∨, and ¬ (and others
discussed subsequently). Such an expression P(p, q, . . .) will be called a proposition.
The main property of a proposition P(p, q, . . .) is that its truth value depends exclusively upon
the truth values of its variables, that is, the truth value of a proposition is known once the truth
value of each of its variables is known. A simple concise way to show this relationship is through
a truth table.
for example, the proposition ¬(p∧¬q). Observe that the first columns of the table are for the
variables p, q, . . . and that there are enough rows in the table, to allow for all possible
combinations of T and F for these variables. (For 2 variables, as above, 4 rows are necessary; for
3 variables, 8 rows are necessary; and, in general, for n variables, 2n rows are required.) There is
then a column for each “elementary” stage of the construction of the proposition, the truth value
at each step being determined from the previous stages by the definitions of the connectives ∧, ∨,
¬. Finally, we obtain the truth value of the proposition, which appears in the last column. The
actual truth table of the proposition¬(p∧¬q) is shown.
In order to avoid an excessive number of parentheses, we sometimes adopt an order of
precedence for the logical connectives. Specifically,
¬has precedence over ∧ which has precedence over ∨
Tautologies and Contradictions
A compound proposition that is always true, no matter what the truth values of the propositional
variables that occur in it, is called a tautology. A compound proposition that is always false is
called a contradiction. A compound proposition that is neither a tautology nor a contradiction is
called a contingency.
Some propositions P(p, q, . . .) contain only T in the last column of their truth tables or, in other
words, they are true for any truth values of their variables. Such propositions are called
tautologies. Analogously, a proposition P(p, q, . . .) is called a contradiction if it contains only F
in the last column of its truth table or, in other words, if it is false for any truth values of its
variables. For example, the proposition “p or not p,” that is, p ∨¬p, is a tautology, and the
proposition “p and not p,” that is, p∧¬p, is a contradiction. This is verified by looking at their
truth tables.
Note that the negation of a tautology is a contradiction since it is always false, and the negation
of a contradiction is a tautology since it is always true. Now let P(p, q, . . .) be a tautology, and
let P1(p, q, . . .), P2(p, q, . . .), . . . be any propositions. Since P(p, q, . . .) does not depend upon
the particular truth values of its variables p, q, . . ., we can substitute P1 for p, P2 for q, . . . in the
tautology P(p, q, . . .) and still have a tautology. In other words:
Theorem: (Principle of Substitution): If P(p, q, . . .) is a tautology, then P(P1, P2, . . .) is a
tautology for any propositions P1, P2, . . ..
Logical Equivalence
Two propositions P(p, q, . . .) and Q(p, q, . . .) are said to be logically equivalent, or simply
equivalent or equal, denoted by
P(p, q, . . .) ≡ Q(p, q, . . .)
if they have identical truth tables.
Let p be “Roses are red” and q be “Violets are blue.” Let S be the statement:
“It is not true that roses are red and violets are blue.”
Then S can be written in the form ¬(p ∧ q). However, ¬(p ∧ q) ≡ ¬p ∨ ¬q. Accordingly, S
has the same meaning as the statement:
“Roses are not red, or violets are not blue.”
Algebra of Propositions
Propositions satisfy various laws which are listed in Table (In this table, T and F are restricted to
the truth values “True” and “False,” respectively.)
Conditional and Biconditional statements
Conditional statements
Many statements, particularly in mathematics, are of the form “If p then q.” Such statements are
called conditional statements and are denoted by
p→q
The conditional p → q is frequently read “p implies q” or “p only if q.”
The conditional p → q is false only when the first part p is true and the second part q is false.
Accordingly, when p is false, the conditional p → q is true regardless of the truth value of q.
Biconditional statements
Another common statement is of the form “p if and only if q.” Such statements are called
biconditional statements and are denoted by
p↔q
The biconditional p ↔ q is true whenever p and q have the same truth values and false otherwise.
Note that the truth table of ¬p ∨q and p → q are identical, that is, they are both false only in the
second case. Accordingly, p → q is logically equivalent to ¬p ∨ q; that is,
p → q ≡ ¬p ∨ q
In other words, the conditional statement “If p then q” is logically equivalent to the statement
“Not p or q”
Question: How can this English sentence be translated into a logical expression?
“You can access the Internet from campus only if you are a computer science major or you are
not a freshman.”
Solution: There are many ways to translate this sentence into a logical expression. Although it is
possible to represent the sentence by a single propositional variable, such as p, this would not be
useful when analyzing its meaning or reasoning with it. Instead, we will use propositional
variables to represent each sentence part and determine the appropriate logical connectives
between them. In particular, we let a, c, and f represent “You can access the Internet from
campus,” “You are a computer science major,” and “You are a freshman,” respectively. Noting
that “only if” is one way a conditional statement can be expressed, this sentence can be
represented as
a → (c ∨¬f ).
Question: How can this English sentence be translated into a logical expression?
“You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years
old.”
Solution: Let q, r, and s represent “You can ride the roller coaster,” “You are under 4 feet tall,”
and “You are older than 16 years old,” respectively. Then the sentence can be translated to
(r ∧¬s)→¬q.
ARGUMENTS
An argument is an assertion that a given set of propositions P1, P2, . . . , Pn, called premises,
yields (has a consequence) another proposition Q, called the conclusion. Such an argument is
denoted by
P1, P2, . . . , Pn ->Q
An argument in propositional logic is a sequence of propositions. All but the final proposition in
the argument are called premises and the final proposition is called the conclusion. An argument
is valid if the truth of all its premises implies that the conclusion is true.
The notion of a “logical argument” or “valid argument” is formalized as follows:
An argument P1, P2, . . . , Pn ->Q is said to be valid if Q is true whenever all the premises
P1, P2, . . . , Pn are true.
The definition of a valid argument form we see that the argument form with premises p1, p2, .
……,pn and conclusion q is valid, when (p1 ∧ p2 ∧ · · · ∧ pn) → q is a tautology. An argument
which is not valid is called fallacy.
Consider the following argument involving propositions (which, by definition, is a sequence of
propositions):
“If you have a current password, then you can log onto the network.”
“You have a current password.”
Therefore,
“You can log onto the network.”
We would like to determine whether this is a valid argument. That is, we would like to determine
whether the conclusion “You can log onto the network” must be true when the premises “If you
have a current password, then you can log onto the network” and “You have a current password”
are both true.
Use p to represent “You have a current password” and q to represent “You can log onto the
network.”
Then, the argument has the form
p→q
p
∴q
where ∴ is the symbol that denotes “therefore.”
We know that when p and q are propositional variables, the statement ((p → q) ∧ p) → q is a
tautology. In particular, when both p → q and p are true, we know that q must also be true. We
say this form of argument is valid because whenever all its premises (all statements in the
argument other than the final one, the conclusion) are true, the conclusion must also be true.
Rules of Inference for Propositional Logic