Lesson 1.4 Logic and Proofs
Lesson 1.4 Logic and Proofs
What is Logic?
Logic is the basis of all mathematical reasoning, and of all automated reasoning. The rules of
logic specify the meaning of mathematical statements. These rules help us understand and
reason with statements such as :
Which means “There exists an integer that is not the sum of two squares”.
Propositional Logic
What is a proposition?
A proposition is the basic building block of logic. It is defined as a declarative sentence that
is either True or False, but not both.
Example:
1. The sun rise in the East and sets in the West.
2. Elephants can fly.
3. 1+1=2
4. ‘b’ is a vowel.
Some sentences that do not have a truth value or may have more than one truth value are
not propositions.
Example:
1. What time is it?
2. Go out and play.
3. Give me a pen.
4. x + 1 = 3
5. x < 20
1
propositions is called propositional calculus or propositional logic.
It also includes producing new propositions using existing ones. Propositions constructed
using one or more propositions are called compound propositions. The propositions are
combined together using Logical Connectives or Logical Operators.
Characteristics of a proposition
A compound statement is in either one of these groups:
valid: the statement is true for all value assignments of its components (tautology)
contradiction: it is false for all such assignments
consistent: it is true for some assignment and false for others
P Q p⋀q
T T T
T F F
F T F
F F F
Disjunction. For any two propositions p and q, their disjunction is denoted by p⋁q , which
means “p or q”. The disjunction p⋁q is True when either p or q is true otherwise False. The
truth table p⋁q:
P q p⋁q
T T T
T F T
F T T
F F F
2
F T
Exclusive OR. For any two propositions p and q, their exclusive or is denoted by p⊕q , which
means “either p or q but not both”. The exclusive p⊕q is True when either p or q is true
and False when both are true or both are false. The truth table p⊕q:
P q p⊕q
T T F
T F T
F T T
F F F
Implication. For any two propositions p and q, the statement “ if p then q” is called an
implication of and is denoted by p⟶q.In the implication p⟶q , p is called the hypothesis or
antecedent or premise and q is called the conclusion or consequence. The implication p⟶q
is is also called a conditional statement.
The implication is false when p is true and q is false otherwise it is true. The truth table of
p⟶q :
P q p⟶q
T T T
T F F
F T T
F F T
Conditional statements play a very important role in mathematical reasoning, thus a variety
of terminology is used to express p⟶q, some of which are listed below:
“if p, then q”
“p is sufficient for q”
“ q when p”
“ a necessary condition for p is q”
“p only if q”
“q unless ⇁p”
“ q follows from p”
Biconditional or Double Implication. For any two propositions p and q, the statement “ p if
and only if (iff) q” is called a biconditional and is denoted by p↔q. The statement p↔q is
called a bi-implication. p↔q has the same truth value as (p⟶q) ^ (q⟶p) . The implication is
true when p and q have the same truth values, and is false otherwise.. The truth table of
p↔q:
P q p↔q
T T T
T F F
F T F
F F T
3
“p iff q”
“ if 3 is smaller than 8 then 3 is smaller than 14”
“if 3 is smaller than 8 then 3 is smaller than 2”
Order of Precedence
parenthesis
¬
^
v
→
↔
Example:
1. If it is sunny outside then I walk to work; otherwise I drive, and if it is raining then I carry
my umbrella.
Primitive propositions:
p= “It is sunny outside.”
q = “I walk to work.”
r = “I drive.”
s= “It is raining.”
t= “ I carry my umbrella.”
Connectives : “if … then”; “ otherwise”; “ and”
Compound Propositions:
o If p then q; otherwise r and if s then t.
o If p then q and (if not p then (r and (if s then t)))
o p implies q and ((not p) implies (r and (s implies t))).
Compound Propositions in Symbols: (p →q) ^ (⇁p → (r ^ (s →t)))
2. if p= “You eat your dinner tonight” and q=”you get dessert”. Then
not p (¬p) : = “You don’t eat your dinner tonight”.
p and q ( p ^ q ): = “You eat your dinner tonight and you get dessert”.
p or q (p V q ): = “You eat your dinner tonight or you get dessert”.
If p then q (p iff q): = “if you eat your dinner tonight then you get dessert”
3.
s: Ali goes out for a walk.
t: The moon is out.
u: It is snowing.
Provide a possible translation for the given compound statements:
(t ∧ ¬u) → s
t → (¬u → s)
¬(s ↔ (u ∨ t))
4
More Problems
a. (⇁ 𝑝⋁𝑞) ⋀(𝑝⋁ ⇁ 𝑞)
b. (⇁ 𝑝⋁𝑞) ⋀(𝑞 ⟶p)
c. (⇁ 𝑝⋀𝑞) ⋁(𝑝⋀ ⇁ 𝑞)
d. (⇁ 𝑝⋀ ⇁ 𝑞) ⋁ (𝑝⋀𝑞)