Logic
Logic
Logic
Introduction to Logic
What is logic?
Logic is the study of valid reasoning.
That is, logic tries to establish criteria to
decide whether some piece of reasoning is
valid or invalid.
OK, so then what do we mean by valid
reasoning?
Reasoning
A piece of reasoning consists of a sequence of
statements, some of which are claimed to follow
from previous ones. That is, some are claimed to
be inferred from others.
Example: Either the housemaid or the butler
killed Mr. X. However, if the housemaid would
have done it, the alarm would have gone off, and
the alarm did not go off. Therefore, the butler did
it.
Valid Reasoning
While in every piece of reasoning certain statements are
claimed to follow from others, this may in fact not be
the case.
Example: If I win the lottery, then Im happy. However,
I did not win the lottery. Therefore, I am not happy.
A piece of reasoning is valid if the statements that are
claimed to follow from previous ones do indeed follow
from those. Otherwise, the reasoning is said to be
invalid.
Sound Reasoning
Not all valid reasoning is good reasoning.
Example: If I win the lottery, then Ill be poor.
So, since I did win the lottery, I am poor.
This piece of reasoning is valid, but not very
good, since it assumed an absurd claim (If I
win the lottery, Ill be poor. Huh??)
Sound reasoning is valid reasoning based on
acceptable assumptions.
Deductive Validity vs
Inductive Validity
An argument is said to be deductively valid if,
assuming the premises to be true, the conclusion
must be true as well.
An argument is said to be inductively valid if,
assuming the premises to be true, the conclusion is
likely to be true as well.
Argument Forms
If I win the lottery, then I am poor. I win the lottery.
Hence, I am poor.
This argument has the following abstract structure or
form: If P then Q. P. Hence, Q
Any argument of the above form is valid, including If
flubbers are gook, then trugs are brig. Flubbers are gook.
Hence, trugs are brig.!
Hence, we can look at the abstract form of an argument,
and tell whether it is valid without even knowing what
the argument is about!!
Formal Logic
Formal logic studies the validity of arguments
by looking at the abstract form of arguments.
Formal logic always works in 2 steps:
Step 1: Use certain symbols to express the abstract
form of premises and conclusion.
Step 2: Use a certain procedure to figure out
whether the conclusion follows from the premises
based on their symbolized form alone.
HB
A.
2.
HA
A.
3.
~A
A.
4.
~H
2, 3 MT
5.
1, 4 DS
Propositional Logic
Propositional Logic studies validity at the level of
simple and compound propositions.
Simple proposition: An expression that has a truth
value (a claim or a statement). E.g. John is tall
Compound proposition: An expression that
combines simple propositions using truthfunctional connectives like and, or, not, and
if then. E.g. John is tall and Mary is smart
Predicate Logic
Predicate Logic extends Propositional Logic
by adding individuals, predicates, and
quantifiers
Individuals: John, Mary
Predicates: tall, smart
Quantifiers: all, some
Clarification/Specification:
Formal logic can be used to express things in a precise and
unambiguous way.
Demonstration/Proof:
Formal logic can be used to figure out what follows from a set
of assumptions.
Computation/Automated Reasoning:
Formal logic can be used for machine reasoning.
FOL
FOL (the language of First-Order Logic):
The formal language that we use to
symbolize statements
Individual Constants
An individual constant is a name for an
existing object.
Examples: john, marie, a, b
Each name is assumed to refer to a unique
individual, i.e. we will not have two objects
with the same name.
However, each individual object may have
more than one name.
Predicates
Predicates are used to express properties of
objects or relations between objects.
Examples: Tall, Cube, LeftOf, =
Arity: the number of arguments of a
predicate (E.g. Tall: 1, LeftOf: 2)
Atomic Sentences
Combining one predicate with the proper
number of individual constants yields an
atomic sentence.
Examples: Tall(john), LeftOf(a,b), a=a
Prefix notation: the predicate precedes the
individual constant(s). E.g. Tall(marie)
Infix notation: the predicate is in between the
individual constants. E.g. a=b
Demonstrating Invalidity
An argument is valid if it is impossible for the
conclusion to be false while the premises are true.
Thus, to demonstrate invalidity, all we have to do
is to demonstrate that it is possible for the
conclusion to be false while the premises are true.
The easiest way to do this is to come up with a
scenario (or possible world) in which all premises
are true and the conclusion false.
Demonstrating Validity
To demonstrate validity, we have to show that there is no
possible way for all premises to be true and the conclusion
false all at the same time.
Showing a scenario in which all premises are true, and in
which the conclusion is true as well, does not demonstrate
validity, b/c there may still be a different scenario in which all
premises are true and the conclusion false.
Obviously, this holds true in general. Hence, showing one
possible scenario cannot demonstrate validity!
Of course, we could try and generate all relevant possible
worlds, but this method is either impractical (there are too
many), or simply impossible (there are infinitely many).
Step-by-step Reasoning
OK, so what do we do? Well, we can do what we
do in everyday reasoning: we start with the
premises, and we gradually work our way to the
conclusion: Either the housemaid or the butler
killed Mr. X. Now, we know that if the housemaid
would have done it, the alarm would have gone
off. But, the alarm did not go off. Therefore, the
housemaid did not do it. So, since it was either the
housemaid or the butler, it must have been the
butler.
Intermediate Results
In the previous proof, claim 4 (the housemaid did
not do it) is called an intermediate result (or subconclusion).
Intermediate results reflect steps in our reasoning.
Intermediate results are important, b/c:
If each of the steps is valid, then the reasoning as a
whole is valid as well (i.e. conclusion validly follows
from the premises).
The step-by-step reasoning counts as a proof if each of
the steps is obviously valid.
Proofs
A proof is a sequence of statements, starting
with premises, followed by intermediate
conclusions, and ended by the conclusion,
where each of the intermediate conclusions,
and the conclusion itself, is an obvious
consequence from (some of) the premises
and previously established intermediate
conclusions.
Formal Proofs
Formal proofs try to formalize proofs by:
Symbolizing the statements in a proof (again,
we will use FOL for this)
Spelling out what we count as an obvious
consequence based on this symbolization
Inference Rules
Inference rules formalize these baby inferences.
Example: An inference rule may indicate that if you have a
statement of the form a=b then you can infer a statement of
the form b=a. Notice:
This inference rule is purely symbolic/syntactic/formal
This inference rule reflects an obvious inference
Formal Systems
There are many formal systems of logic, each with
their own predefined set of inference rules:
First of all, the nature of the inference rules depends on
the symbols that the system uses to express statements.
Moreover, even if two systems use the same symbols,
they may still have different inference rules.
Propositional Logic
Propositional Logic is the logic involving
complex claims as constructed from atomic
claims and boolean connectives.
Truth-Functional Connectives
Boolean Connectives are usually called
truth-functional connectives.
The truth value of a complex claim that has
been constructed using a truth-functional
connective is a function of the truth value of
the claims that are being connected by that
connective.
Negation
The claim a is not to the right of b is a complex
claim. It consists of the atomic claim a is to the right
of b and the truth-functional connective not.
We will call the above statement a negation.
To express negations, we use the symbol
should be put in front of what you want to be
negated.
Thus, the above statement will be symbolized as:
RightOf(a,b)
Conjunction
The claim a is to the right of b, and a is in front of
b is called a conjunction.
The two claims that are being conjuncted in a
conjunction are called its conjuncts.
To express conjunctions, we will use the symbol
should be put between the two claims.
Thus, the above statement will be symbolized as:
RightOf(a,b) FrontOf(a,b)
Q PQ
T
T
F
F
T
F
F
F
Disjunction
The claim a is to the right of b, or a is in front of b
is called a disjunction.
The two claims that are being disjuncted in a
disjunction are called its disjuncts.
To express disjunctions, we will use the symbol
should be put between the two claims.
Thus, the above statement will be symbolized as:
RightOf(a,b) FrontOf(a,b)
Q PQ
T
T
F
T
T
T
F
F
Exclusive Disjunction vs
Inclusive Disjunction
Notice that the disjunction as defined by is
considered to be true if both disjuncts are
true. This is called an inclusive disjunction.
However, when I say a natural number is
either even or odd, I mean to make a claim
that would be considered false if a number
turned out to be both even and odd. Thus, I
am trying to express an exclusive disjunction.
Q (P Q) (PQ)
T
T F F T
F
T T T F
T
T T T F
F
F F T F
!
PP
DeMorgan:
(P Q) P Q
(P Q) P Q
Distribution:
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)
Association:
P (Q R) (P Q) R
P (Q R) (P Q) R
Idempotence:
PPP
PPP
Tautologies
A tautology is a statement that is necessarily
true.
Example: P P
Any statement that evaluates to True in
every row of its truth-table is a tautology.
Contradictions
A contradiction is a statement that is
necessarily false.
Example: P P
Any statement that evaluates to False in
every row of its truth-table is a
contradiction.
Equivalences
Two statements are equivalent if they have
the exact same truth-conditions.
Example: P and P
In every row of their combined truth-table,
two equivalent statements are either both
true or both false.
Implication
One statement implies a second statement if
it is impossible for the second statement to
be false whenever the first statement is true.
Example: P implies P Q
In the combined truth-table, there is not a
single row where the implying statement is
true and the implies statement is false
Consistency
A set of statements is consistent if it is
possible for all of them to be true at the
same time.
Example: {P, P Q, Q}
In the combined truth-table of a consistent
set of statements there is at least one row
where they all evaluate to True.
Validity
An argument is valid if it is impossible for
the conclusion to be false whenever all of
its premises are true.
Example: P, P Q Q
In the combined truth-table of a valid
argument, there is not a single row where all
premises are true and the conclusion is
false.
Simplifying Statements
Using the principle of substitution of logical
equivalents, and using the logical
equivalences that we saw before (Double
Negation, Association, Commutation,
Idempotence, DeMorgan, and Distibution),
we can often simplify statements.
Example: (A B) A (Commutation)
(B A) A (Association)
B (A A) (Idempotence)
BA
((A B) C) (DeMorgan)
(A B) C (Double Neg, DeM)
(A B) C
Truth-Functional Connectives
So far, we have seen one unary truth-functional connective
(), and two binary truth-functional connectives (,
).
Later, we will see two more binary connectives (, )
However, there are many more truth-functional connectives
possible:
First of all, a connective can take any number of arguments: 3
(ternary), 4, 5, etc.
Second, there are unary and binary connectives other than the
ones listed above.
Truth-Functional Expressive
Completeness
Since I can express any truth function using , , and
, we say that the set of operators {, , } is (truthfunctionally) expressively complete.
DeMorgan Laws:
(P Q) P Q
(P Q) P Q
Proofs
Proof: A sequence of statements,
starting with zero or more assumptions,
where each of the statements is either
an assumption, or an obvious logical
consequence from (some of) the
assumptions and previously inferred
statements.
Proof by Contradiction
Assuming P to be the case, then I get some
kind of impossibility or contradiction.
Hence, contrary to my assumption, P cannot
be the case.
This pattern of reasoning is called Proof by
Contradiction (or Indirect Proof or
Reductio ad Absurdum or simply Reductio).
The symbol is used to express a logical
contradiction.
Theorem: A statement is a logical
contradiction iff
Theorem: A set of statements is logically
inconsistent iff {1, , n}
Soundness of Proof by
Contradiction
Theorem:
{1, , n} iff {1, , n, } .
P
T
T
F
F
Q PQ
T
T
F
F
T
T
F
T
If then Statements
The conditional is used to capture if then
statements.
Although the match isnt perfect, most uses of if
then are captured fine with the conditional.
In particular, any if then statement will be
false if the if part is true, but the then part false,
and the conditional captures this important truthfunctional aspect of any if then statement.
Q PQ
T
T
F
F
T
F
F
T
Transposition:
P Q Q P
Exportation:
P (Q R) (P Q) R
Equivalence:
P Q (P Q) (Q P)
P Q (P Q) (P Q)
Quantifiers
Introduction to Logic
Parts of a Quantificational
Statement
A quantificational statement such as
x(Human(x) Mortal(x)) has the
following parts:
Quantifier: In this case
Variable: In this case x
Well-formed formula, or wff: In this case
Human(x) Mortal(x)
Universe of Discourse
When we quantify, we usually have some
universe of discourse in mind. E.g. when I say
Everyone did well on the homework, I am
limiting myself to all students in this class.
When this is understood, I can simply write:
x (PerformedWell(x)).
If not, I can always limit myself as follows:
x (Student(x) PerformedWell(x)).