You are on page 1of 5

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 :

∃𝑥 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑥 ≠ 𝑎2 + 𝑏 2 , 𝑤ℎ𝑒𝑟𝑒 𝑥, 𝑎 , 𝑏 𝜖𝑍

Which means “There exists an integer that is not the sum of two squares”.

Importance of Mathematical Logic


The rules of logic give precise meaning to mathematical statements. These rules are used to
distinguish between valid and invalid mathematical arguments. Apart from its importance in
understanding mathematical reasoning, logic has numerous applications in Computer
Science, varying from design of digital circuits, to the construction of computer programs
and verification of correctness of programs.

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.

The Truth Value of a proposition is True(denoted as T) if it is a true statement, and


False(denoted as F) if it is a false statement.

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

Language of Propositional Logic


 Syntax. What are the rules in creating compound statement?
 Semantic.
o Evaluation: calculating the truth values of a compound statement by
assigning values to its component statements
o Truth table. A table built considering smaller parts of the compound
statements.

To represent propositions, propositional variables are used. By Convention, these variables


are represented by small alphabets such as 𝒑, 𝒒, 𝒓, 𝒔. The area of logic which deals with

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.

Logical Connectives. It is used to form compound propositions from primitive ones.


English name Math name symbol
“and” Conjunction ⋀
“or” Disjunction ⋁
“not” Negation ⇁
“or … but not both” Xor ⊕
“if … then” Implication ⟹
“if & and only if” equivalence ⟺

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

Truth Table. This is a compilation of all possible scenarios in tabular format.


Conjunction. For any two propositions p and q, their conjunction is denoted by p⋀q , which
means “p and q”. The conjunction p⋀q is True when both “p and q” are true otherwise
False. The truth table p^q :

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

Negation. If p is a proposition then the negation of p is denoted by ⇁ 𝑝, which means not p


P ⇁𝑝
T 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

Some other common ways of expressing p↔q:


 “p is necessary and sufficient for q”
 if p then q , and conversely”

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

1. Consider the following statements:


P: Good mobile phones are not cheap.
Q: Cheap mobile phones are not good.
L: P implies Q
M: Q implies P<>
N: P is equivalent to Q

Which one of the following about L, M, and N is CORRECT?(Gate 2014)


a. Only L is TRUE.
b. Only M is TRUE.
c. Only N is TRUE.
d. L, M and N are TRUE.

2. Which one of the following is not equivalent to p↔q

a. (⇁ 𝑝⋁𝑞) ⋀(𝑝⋁ ⇁ 𝑞)
b. (⇁ 𝑝⋁𝑞) ⋀(𝑞 ⟶p)
c. (⇁ 𝑝⋀𝑞) ⋁(𝑝⋀ ⇁ 𝑞)
d. (⇁ 𝑝⋀ ⇁ 𝑞) ⋁ (𝑝⋀𝑞)

You might also like