Logic and Set Theory
Logic and Set Theory
COURSE DESCRIPTION: The course is a study of mathematical logic which covers topics such
as proportions, logical operators, rules of replacement, rules of inference, algebra of logic and
quantifiers. It also includes a discussion of elementary theory of sets such as fundamental
concepts of sets, set theorems and set operations.
PROGRAM OUTCOMES:
2
Table of Contents
Page
Proposition 4
Algebra of Proposition 7
Negation 8
Disjunction 9
Conjunction 10
Conditional 12
Biconditional 14
Truth Table 17
Set Theory 20
Set 21
Operation of Sets 22
Relations 28
Interval Notation 33
Functions 36
Function and Its types 37
Composition o f Functions 39
3
LESSON 1
PROPOSITIONS
Objectives:
1. To define proposition logically
2. To differentiate proposition and not proposition
4
Lesson 1: Propositions
What is Proposition
Examples of Propositions
1. 3 is an odd number.
2. Manila is the capital of the Philippines.
3. 12 ÷ 4 = 5.
4. x + 4 = 10, iff x is an integer
5. President Duterte is the youngest among all Philippine presidents.
4. 3 + x = 5.
Although it is declarative sentence, x has no prescribed value hence, we don’t know
what x represents.
5
Exercises
1 Today is Wednesday.
2 5 + 9 = 3.
3 Are you going to church this Sunday?
4 He is our class president.
5 PUP is a top performing school.
6 Please pay your bill on time.
7 3x + 4 = 6
8 Next month is April.
9 Can I join the group?
10. The sun rises in the west.
11. How far is it to the next town?
12. x + 2 = 2x when x = −2
13. 3 + (5 x 4) ÷ 12 = 15.
14. It will rain anytime next week.
15. x + 2 = 2x.
6
LESSON 2
ALGEBRA OF PROPOSITION
(Logical Operators/Sentential Connectives)
Negation
Disjunction
Conjunction
Conditional
Bi-conditional
Objectives:
7
Lesson 2.1: Negation
Logical operators
Negation
Let p be a proposition. The statement “it is not the case of p” is another proposition called
negation of p denoted by ~p also read as “not p”
Examples
Proposition Negation
~𝑝: It is not the case that 5 is
positive
1. 𝑝: 5 is positive ~𝑝: 5 is not positive
~𝑝: It is not true that 5 is positive
~𝑞:It is not true that Paris is the
capital of Australia
~𝑞: Paris is not the capital of
𝑞: Paris is the capital of Australia
Australia
~𝑞:It is not the case that Paris is
the capital of Australia
𝒑 ~𝒑
T F
F T
8
Lesson 2.2: Conjunction
What is Conjunction
Let p and q be propositions “p and q” denoted by p ˄ q, is the proposition that is true when both
p and q are true and false otherwise
The proposition p ˄ q is called the conjunction of p and q.
Examples:
Propositions Conjunction
p q p˄q
T T T
T F F
F T F
F F F
9
Lesson 2.3: Disjunction
What is disjunction
Let p and q be propositions “p or q” denoted by p v q, is the proposition that is false when p and
q are false and true otherwise
The proposition p v q is called the disjunction of p and q.
Examples:
Propositions Disjunction
p q pvq
T T T
T F T
F T T
F F F
10
Exercises
1. p: 3x – 6 = 5
_________________________________________________
2. Every real number has a multiplicative inverse.
_________________________________________________
3. Quezon City is the capital of the Philippines
_________________________________________________
4. Trigonometry deals with the relation between the sides lengths and angles of
triangles.
__________________________________________________
5. 4x + 2y = 8
p v q: ____________________________________________
p ˄ q: ____________________________________________
~p v r: ___________________________________________
~(p v q):__________________________________________
~(r ˄ q): _________________________________________
~(q ˄ ~p): ________________________________________
(p v ~q): _________________________________________
~(p ˄ q): _________________________________________
11
Lesson 2.4: Conditional
What is Conditional
Examples:
p: √5 is irrational.
q: 2 is composite number.
r: Every real number has an additive inverse.
s: x2 + 2x +5 has an integral solution.
t: Whale is a mammal.
p → q: if √5 is irrational then 2 is
composite number.
12
Converse, Inverse, and Contrapositive
Converse
The converse of a conditional statement is created when the hypothesis and conclusion are
reversed
Examples
Propositions Converse
p: three points are on the same q → p: If three points are collinear,
line, then they are on the same
q: three points on the same line
line.
are collinear.
Inverse
The inverse of a conditional statement is when both the hypothesis and conclusion are negated.
Examples
Propositions Inverse
p: three points are on the same ~p → ~q: If three points are
line,
collinear, then they are on the
q: three points on the same line
are collinear. same line.
13
Contrapositive
Examples
Propositions Contrapositive
p: three points are on the same ~q → ~p: If three points are not
line,
collinear, then they do not lie on
q: three points on the same line
are collinear. same line.
~q → ~p: If I do not get my
p: I do errands . allowance, then I will not do
q: I get my allowance.
errands
p q p→q
T T T
T F F
F T T
F F T
14
Lesson 2.5: Biconditional
Biconditional
Let p and q be propositions. The statement “p if and only if q” denoted by,p iff q is known as a
biconditional proposition. It is true whenever its components p and q have the same truth values
denoted by p ↔ q.
Examples:
p: √5 is irrational.
q: 2 is composite number.
r: Every real number has an additive inverse.
s: x2 + 2x +5 has an integral solution.
t: Whale is a mammal.
p ↔ q: √5 is irrational iff 2 is
composite number.
15
Exercises
A. Give the converse, inverse and contrapositive of the following conditional proposition.
2. If two angles are not adjacent, then they do not form a linear pair.
converse :
inverse :
contrapositive :
3. If Regie does well in life, then he will succeed in his chosen career.
converse :
inverse :
contrapositive :
B. Let all declarative statement be propositions. Find the truth value of the following statement.
Write T for truth and F for false
1. c → ~r ˄ s).
2. y ↔ c.
16
3. y ˄ (c v r).
4. (y → r ) v c.
5. (c ↔ (r ˄ ~s) v y.
E. Suppose the statement P,Q, R and S are assigned the truth values T,F, F, and T,
respectively. Find the truth value of each of the propositions
1. r → (s ˄ p). 6. p v r ↔ r ˄ ~s.
2. p → (r→s). 7. s ↔ p → ( ~p v s).
3. s ↔ (s v p). 8. q ˄ ~s → (p ↔ s).
4. (p→q) → r. 9. r ˄ s → (p → ~q v s )
5. p → (r v s). 10. (p v ~q ) v r → (s ˄ ~s).
LIFE is like a CAMERA. FOCUS on what’s important, CAPTURE the good things in life,
DEVELOP good qualities and DELETE negative thoughts. Then, don’t forget to smile despite
hardships….and if things don’t work out fine, just take another SHOT.
17
Lesson 2.6: Truth Tables
A truth table provide the basic method of describing a Boolean function. It contains a row for
every combination of the variables and prescribes the value of the function (0 or 1) for each of
these combinations.
When constructing a truth table, you have to consider all possible assignment of True (T) and
False (F) to the component statements. For example, suppose the component statements are
P,Q, and R. each of these statements can either true or false so there are 2 3 = 8 possibilities.
The easiest approach is to use lexicographic ordering.
A proposition is said to be a tautology iff its sentential form (symbolic form) always
generates a true truth table.
p q p→q q→p (p → q) v (q → p)
T T T T T
T F F T T
F T T F T
F F T T T
A proposition is said to be a contradiction iff its sentential form (symbolic form) always
generates a false truth table.
p q pvq ~p ~q ~p ˄ ~q (p v q) ˄ (~p ˄
~q)
T T T F F F T
T F T F T F T
F T T T F F T
F F F T T F T
18
CONTINGENCY IN TRUTH TABLE
A proposition is said to be a contradiction iff its sentential form (symbolic form) always
generates a combination of true and false truth table.
p q p ˄q ~p (p ˄ q) → ~p)
T T T T F
T F F T T
F T F F T
F F F T T
LOGICAL EQUIVALENCES
19
Exercises
Construct the truth table of the following then identify whether it is tautology, contradiction or
contingency.
2. [(p v q) ˄ ~p] ↔ q.
3. (~p v q) ˄ (p ˄ ~q).
5. (w v r) ˄ (~w v r).
6. p → (p → q)
7. p →~(q ˄ r).
8. (p → q) ↔ ~p v q).
9. (p → q ˄ r) (~p ˄ q).
10. p ˄ q → (q ˄ ~q → r ˄ q).
20
LESSON 3
SET THEORY
Objectives:
1. Define basic terminologies on sets
2. Perform set operation
3. Give relationship between and among kinds of sets
4. Explain and use the notation in sets
5. Identify the different relations and how they differ with one another
6. Tell whether the relation is reflexive, symmetric, transitive or equivalence
21
Lesson 3: Sets
What is Set
A set is a well defined collection of objects. This means that if S is a set and a is some object,
then either a is definitely not in S denoted by a S or a is definitely not in S denoted as a S.
We may describe a set either by giving a characterizing properly of the elements such as :
SUBSET
If every element of a given set C is also an elements of another set D, then C is also a subset
of D denoted as C ⸦ D.
Proper Subset
Improper Subsets
PROPER SUBSET
A proper subset is one that contains few elements of the original set whereas an
improper subset, contains every element of the original set along with the null set.
22
Proper Subset: {2}, {4}, {6}, {2,4}, {4,6}, {2,6}
Example:
If set A has elements as {12, 24} and set B has elements as {12, 24, 36}, then set A is the
proper subset of B, because 36 is not present in the set A. To be noticed here, set B is not a
subset of set B.
IMPROPER SUBSET
A subset which contains all the elements of the original set is called an improper subset.
Basically, the improper set includes the null set and the original set itself. It is denoted by ⊆.
For example: Set P ={2,4,6}
Then, the subsets of P are;
{}, {2}, {4}, {6}, {2,4}, {4,6}, {2,6} and {2,4,6}.
Where, {2}, {4}, {6}, {2,4}, {4,6}, {2,6} are the proper subsets and {}, {2,4,6} are the improper
subsets. Therefore, we can write, {} ⊆ P and {2,4,6} ⊆ P.
POWER SET
The power set is said to be the collection of all the subsets. It is represented by P(A).
If A is set having elements{a,b}. Then the power set of A will be;
P(A) = {∅ , {a}, {b}, {a, b}}
UNION OF SETS
A B={x|x∈A x∈B}
23
Example 2: If A = {1, 2, 3} and B = {1, 2, 4, 5} , then A B = {1, 2, 3, 4, 5} .
INTERSECTION OF SETS
A B={x|x∈A x∈B}
DIFFERENCE OF SETS
A-B={x|x∈A x∉B}
24
COMPLEMENT OF SETS
The complement of a set, denoted A', is the set of all elements in the given
universal set U that are not in A. In set- builder notation, A' = {x ∈ U : x ∉ A}. The
Venn diagram for the complement of set A is shown below where the shaded region
represents A'.
The fourth set operation is the Cartesian product We first define an ordered pair and
Cartesian product of two sets using it. Then the Cartesian product of multiple sets is
defined using the concept of n-tuple.
ORDERED PAIR
An ordered pair is a pair of objects with an order associated with them. For more
rigorous definition of ordered pair click here.
If objects are represented by x and y, then we write the ordered pair as <x, y>.
Two ordered pairs <a, b> and <c, d> are equal if and only if a = c and b = d. For
example the ordered pair <1, 2> is not equal to the ordered pair <2, 1>.
CARTESIAN PRODUCT
The set of all ordered pairs <a, b>, where a is an element of A and b is an element
of B, is called the Cartesian product of A and B and is denoted by A x B. The
concept of Cartesian product can be extended to that of more than two sets. First we
are going to define the concept of ordered n-tuple.
ORDERED n-TUPLE
25
An ordered n-tuple is a set of n objects with an order associated with them (rigorous
definition to be filled in). If n objects are represented by x1, x2, ..., xn, then we write the
ordered n-tuple as <x1, x2, ..., xn> .
Definition (Cartesian product): Let A1, ..., An be n sets. Then the set of all ordered n-
tuples <x1, ..., xn> , where xi ∈ Ai for all i, 1 ≤ i ≤ n , is called the Cartesian
product of A1, ..., An, and is denoted by A1 x ... x An .
EQUALITY OF n-TUPLE
Two ordered n-tuples <x1, ..., xn> and <y1, ..., yn> are equal if and only if xi = yi for
all i, 1 ≤ i ≤ n .
For example the ordered 3-tuple <1, 2, 3> is not equal to the ordered n-tuple <2, 3, 1>.
SET OF NUMBERS
REAL NUMBERS, R
One of the most important properties of the real numbers is that they can be represented
by points ona straight line called number line
26
INTEGERS, Z
Integers are also referred to as the “whole numbers”. One important property of the integers is
that they are closed under operations of addition,multiplication and subtraction. That is the sum,
product and difference of two integers is again an integer. It is denoted as:
RATIONAL NUMBERS, Q
It can be expressed as the ratio of two integers (but not dividing by zero). It is closed under
addition, subtraction, multiplication and division. It is denoted as:
IRRATIONAL NUMBERS, Q’
Q’ = { √2 , √3, 𝜋 }
NATURAL NUMBERS, N
The first number system developed and were used primarily at one time for counting. They are
part of the number system which includes all the positive integers from 1 till infinity and are used
for counting purpose. It does not include zero (0). Therefore, they are also called counting
numbers.
N = {1,2,34,5,…}
27
Exercises
A. Do as required
Let V = { d }
W = { c,d }
X = {a,b,c }
Y = { a,b }
Z = { a,b,d }
1. Y ⊂ X 6. V ⊂ X
2. W ⊅ X 7. Z ⊅ X
3. W ≠ Z 8.Y ⊄ Z
4. Z ⊃ V 9.X = W
5. V ⊄ Y 10.W ⊂ Y
A = {x|x2 = 4}
B = {x|x-2 = 5}
C = {x|x is positive, x is negative}
D = {x|x is a letter in the word MISSISSIPPI}
√9⁄4 ∈ Q’
2 √2 ∈ Q’ 7 11 ∈ P 12
3 4∈Z 8 ½ ∈Z 13 -2 ∈ Z
4 9 ∈P 9 √−5 ∈ Q’ 14 𝜋2 ∈ R
5 3𝜋∈Q 10 1 ∈ R 15 √−4 ∈ R
28
LESSON 4
RELATIONS
OBJECTIVES:
1. Identify the different relations and how they differ with one another
2. Tell whether the relation is reflexive, symmetric, transitive or equivalence
29
tghghfghgf
Lesson 4 : Relation
What is Relation
1. A set A
2. A set B
3. An open sentence P(x,y) in which P(a,b) is either true or false for any ordered pair (a,b)
belonging to A x B
R = (A,B, P(x,y))
1. x is less than y
2. x is the wife of y
3. x divides y
4. x is a multiple of y
5. x loves y
Relations or not?
Yes or
Relations Remarks P(a,b) if relation
No
Let R = (R,R, P(x,y)) where P(x,y) read as “x P(2,12), 2R12
Yes
is less than y” P(4,1), 4R1
Let R = (A,B, P(x,y)) where A is the set of People
men, B is the set of women reads as “x No cannot be
divides y” divided
Let R = (N,N, P(x,y) where P(x,y) read as “x 3R12,2R7,
Yes
is divides y” 5R15, 6R13
30
KINDS OF RELATIONS
Reflexive Relations
Examples:
1. Let A be the set of the triangles in the Euclidean plane. The relation R in A defined by
the open sentence “x is similar to y” is a reflexive relation since every triangle is similar
to itself.
2. Let R be the relation in the real numbers defined by the open sentence “x is less than y”.
Then R is not reflexive since a≮ a for any real number a.
3. Let A be a family of sets and let R be the relation in A defined by “x is a subset of y”.
Then R is a reflexive relation since every set is a subset of itself.
Symmetric Relations
Examples
1. The set A of natural numbers. If a relation A be defined by “x + y = 5”, then this relation is
symmetric in A, for a + b = 5 ⇒ b + a = 5
2. Let A be the set of triangles in the Euclidean plane and let R be the relation in A which is
defined by the open sentence “x is similar to y”. Then R is symmetric, since if triangle a is
similar to triangle b then b is also similar to a.
3. Let R be the relation in the natural numbers N which is defined by “x divides y” Then R is
not symmetric since 2 divides 4 but 4 does not divides 2 (2,4) ϵ R but (4,2) ∉ R
31
Transitive Relation
R is said to be transitive, if
Examples:
1. In the set A of natural numbers if the relation R be defined by ‘x less than y’ then a < b
and b < c imply a < c, that is, aRb and bRc ⇒ aRc. Hence this relation is transitive.
2. Let A be the set of people on earth. Let R be the relation in A defined by the open
sentence “y loves y”, if a loves and b loves c, it does not necessarily follow that a loves c.
therefore, R is not a transitive relation
3. Let A be a family of sets and let R be the relation in A defined by “x is a subset of y”.
Then R is a transitive relation since: A ⊂ B and B ⊂ C implies A ⊂ C
Equivalence Relations
1. R is reflexive, ∀ a ∈ A, (a,a) ∈ R
Examples:
1. Let A be the set of triangles in the Euclidean plane. Let R be the relation on A defined by “x
is similar to y”. R is reflexive, symmetric and transitive therefore, R is an equivalence
relation
32
Exercises
A. From the given open sentence, identify whether it is reflexive or not reflexive, symmetric or
not symmetric or transitive or nor transitive. Write your answers on the space provided.
Reflexive
______________________
______________________
______________________
______________________
Symmetric
______________________
______________________
______________________
______________________
Transitive
______________________
______________________
______________________
______________________
33
LESSON 5
INTERVAL NOTATION
OBJECTIVES
34
Lesson 5: Interval Notation
An algebraic inequality, such as x≥2, is read “x is greater than or equal to 2.” This inequality
has infinitely many solutions for x. Some of the solutions are 2, 3, 3.5, 5, 20, and 20.001. Since
it is impossible to list all of the solutions, a system is needed that allows a clear communication
of this infinite set. Two common ways of expressing solutions to an inequality are by graphing
them on a number line and using interval notation.
A closed interval is one that includes its endpoints: for example, the
set {x | −3≤x≤1}{x | −3≤x≤1} .
An open interval is one that does not include its endpoints, for
example, {x | −3<x<1}{x | −3<x<1} .
You can also have intervals which are half-open and half-closed:
It is written as [-2, 4)
A compound inequality is actually two or more inequalities in one statement joined by the
word “and” or by the word “or.” Compound inequalities with the logical “or” require that either
condition must be satisfied. Therefore, the solution set of this type of compound inequality
35
consists of all the elements of the solution sets of each inequality. When we join these individual
solution sets it is called the union, denoted ∪.
Infinite Intervals
B = {x|x ≥ 2} B = [2,∞)
D = {x|x ≤ 4} D = (-∞, 4]
E = {x|x ϵ R} E = (-∞, 4]
Exercises
1. M = [-3,5)
2. S = (3,8)
3. T = [0,4]
4. W = (-7, -2)
5. X = [-3, 1)
B. In each case, graph on a real line and write the resultant set in interval notation.
36
LESSON 6
Functions
OBJECTIVES
37
Lesson 6: Function and Its Types
What is a function
Suppose that to each element in a set A, there is assigned, by some manner or other a unique
element of a set B. This can be denoted as:
The set A is called the domain of the function f and B is called the co-domain of f. Furthermore,
If a ∈ A then the element in B which is assigned to a is called the image of a denoted by :
F(a) (reads as f of a)
It is also known as a type of relation that assigns exactly one output in each input
38
Examples:
1. Let f assign to each real numbers its square that is for every real number x, let f(x) =
x2
The domain and the co domain are both real numbers; f: R R
The image of -3 is 9, hence f(-3) = 9
Types of Functions
In terms of relations, we can define the types of functions as:
Example
1. Let f: R R be defined by the formula f(x) = x 3. The f is a one – one mapping since the
cubes of two different real numbers are themselves different.
2. The function f which assigns to each country in the world in its capiotal city is one-
one.
3. Let the function f: R R be defined by the formula f(x) = x2. The f is not a one-one
function since f(2) = f(-2) = 4. That is, since the image of two different real numbers 2
& -2 is the same 4.
39
Many to one function: A function which maps two or more elements of P to the same
element of set Q.
Onto Function or Surjective function: A function for which every element of set Q
there is pre-image in set P
Let f be a function of A into B. Then the range (A) of the function f is a subset of B,
that is, f(A) ⊂ B. If f(a) = B, that is, if every member of B appears as the image of at
least one element of A, then we say F is a function of A onto B of f maps A onto B
One-one and Onto function or Bijective function: The function f matches with each
element of P with a discrete element of Q and every element of Q has a pre-image in P.
40
Lesson 6.1: Composition of Function
f g
A B C
Let a ∈ A, then its image f(a) is in B which is the domain of g. Accordingly, we can find the
image of f(a) under the mapping g, that is, g(f(a)). Thus, we have a rule which assigns to each
element g(f(a)) ∈ C. On other words, we have a functyion of A into C. This new function is called
function or composition function of f and g and is denoted by (g ◦ f) .
f g
A B C
g◦f
Examples
1. To each real number, let f assign its square (f: R R ) be defined by the function f(x) = x 2.
To each real number, let g assign the number plus 3.
a) (f ο g)(x)
b) (g ο f)(x)
41
Solution:
a) (f ο g)(x)
= f(2x – 1)
= (2x – 1)2 + 6
= 4 x2 – 4x + 1 + 6
= 4 x2 – 4x + 7
b) (g ο f)(x)
= g(x2 + 6)
= 2(x2 + 6) – 1
= 2x2 + 12 – 1
= 2x2 + 11
Exercises
f(1) = 3 g(1) = 4
f(2) = 5 g(2) = 1
f(3) = 3 g(3) = 1
f(4)= 1 g(4) = 2
f(5) = 2 g(5) = 3
42
C. Let the function f: R → R and g: R → R be defined by:
f(x) = x2 + 3x + 2
g(x) = 2x - 3
Every situation in life is temporary. So, when life is good, make sure you
enjoy it and receive it fully. And when life is not good, remember that it
will not last forever and better days are on the way
43
REMINDERS:
1. Answer all the exercises reflected in this module for class standing
2. Answer the following exercises below for your Midterm/Final Exam
I. Write the following open sentence/s under the correct heading. Write only the letter.
RIGHT MINUS WRONG to achieve the purpose of this evaluation.
a. “x is parallel to y” e. “ x loves y”
b. “ x is a multiple of y” f. “ x is a subset of y”
c. “ x is a cousin of y” g. “ x is a similar triangle of y”
d. “ x has the same height with y” h. “ x is less than y”
II. Graph and write what is being asked using interval notation . Let A = [-4,2), B= (-1, 6), C
= (-∞, 1]
1. A∪B = 6. A∩C =
2. A∩B = 7. C-B=
3. A-B= 8. C-A=
4. B-A= 9. B∪C =
. III. List down the elements of the following set using the roster(listing) method
1. {x ∈ R ∣ x2 = 3}
44
2. {m ∈ Z+ ∣ mn = 60 for some n ∈ Z+}
3. {m ∈ Z ∣ m2 = 3}
4. {m ∈ Z ∣ m2 < 115}
5. {n ∈ Z+ ∣ 39 < n3 < 85}
2. (g ◦ f )(x)
3. (h ◦ g)(5)
G
A C
g h
f F
B
Determine whether the following is a product function or not product function. If product function,
determine the domain and the co-domain using the correct notation. Example: G ◦ h: C → C
1.g ◦ f: 4. F ◦ h:
2.F ◦ f: 5. h ◦ G:
3. g ◦ h:
V. Put a check () on the blank if it is a function being represented and crossmark (x) if not.
Equal function 1. If R → R defined by the formula f(x) = x + 1 & g(x) = 2x
Onto function 2. If R → R defined by the formula f(a) = 3a3 - 4
Inverse function 3. If A → A be people defined by their DNA
One-to-one
function 4. If R → R defined by the formula f(x) = x2 - 2
45
Onto function 5. If N → N defined by the formula f(x) = √𝑥
References:
Lipschutz, S. (1981) Shaum’s Outline Series of Theory and Problems of Set Theory and related topics
Stoll, R.R. (1979). Set Theory and Logic. Dover Publications, Inc. New York
https://www.cs.odu.edu/~toida/nerzic/level-a/set/set_operations.html
46