Logic and Sets
Logic and Sets
Logic and Sets
1 Logic elements
A proposition (or an assertion) P is the content of a declarative sentence. It is
either true or false, but cannot be both true and false at the same time. We
attribute to P the value 1 when P is true and the value 0 when it is false.
Example 1
The …rst three sentences are propositions but the last three ones are not.
1
Example 2
P x odd x2Q x 0
P x even x2
=Q x>0
Example 3
P Q P ^Q
x 0 x 0 x=0
n odd n 3 n 2 f1; 3g
P Q P _Q
1 1 1
1 0 1
0 1 1
0 0 0
2
5. The biconditional (equivalence) from P to Q, denoted P , Q, is de…ned
to be the proposition (P ) Q) ^ (Q ) P ); its truth table is
P Q P () Q
1 1 1
1 0 0
0 1 0
0 0 1
1. P () P:
2. P ^ Q () Q ^ P:
3. P _ Q () Q _ P:
4. P ^ (Q ^ R) () (P ^ Q) ^ R:
5. P _ (Q _ R) () (P _ Q) _ R:
6. P ^ (Q _ R) () (P ^ Q) _ (P ^ R):
7. P _ (Q ^ R) () (P _ Q) ^ (P _ R):
8. (P ) Q) () (P _ Q):
9. (P ) Q) () (Q ) P ):
10. (P ) Q) () (P ^ Q):
11. (P ^ Q) () (P _ Q):
3
12. (P _ Q) () (P ^ Q):
We have also
(P ) Q) ^ (Q ) R) ) (Q ) R).
(P () Q) ^ (Q () R) ) (Q () R).
Example 6
4
3. The set of points in the plane belonging to the circle of center O and radius
1.
4. The set of all functions de…ned on R and with positive values.
5. The set of students of Algiers university.
2.2 Quanti…ers
Let S be a set, x a variable and P (x) a predicate whose statement depends on
the elements x of S.
8x 2 S; P (x)
which is true if P (x) is true for any element x of S. The symbol 8 reads
"for all" and is called the universal quanti…er.
2. "There exists an element x of S; P (x)" is denoted
9x 2 S; P (x)
which is true if P (x) is true for at least one element x of S. The symbol
9 reads "it exists" and is called the existential quanti…er. When we want
to specify that x is unique such that P (x) true we write
9 ! x 2 S; P (x):
Example 7
5
Let P be the statement
(8x 2 Q) x2 + x + 1 0
and Q the statement
(9x 2 Q) x2 + x + 1 < 0
2
Note that x2 + x +1 = x + 21 + 34 0; 8x 2 Q therefore P is true, and Q is
false. Consider the following proposition R:
(8x 2 Q) (9y 2 Q) (x + y = 0)
The proposition R is true. In fact, for x0 2 Q, x0 + y = 0 , y = x0 therefore
9y0 2 Q such that : x0 + y0 = 0: Now let us consider the proposition S:
(9y 2 Q) (8x 2 Q) (x + y = 0)
Assume that S is true. Let yb in Q verifying S, then S is true 8x 2 Q, it
must be true for x = 1, and x = 2 i.e.
8
< 1 + yb = 0
and
:
2 + yb = 0
8
< yb = 1
and
:
yb = 2
This is absurd. So S is false. We conclude that the order of the quanti…ers is an
essential part of a proposition, and changing the order can completely change
the proposition.
When S and T are two sets, x; y variables and P (x; y) a predicate de-
pending on x; y then: (9x 2 S; 8y 2 T; P (x; y)) =) (8y 2 T; 9x 2 S;
P (x; y)) (it is enough to take the previous example to see that the converse
is true) But the converse is not true and we have 8x 2 S; 9y 2 T; P (x; y)
is 9x 2 S; 8y 2 T; P (x; y) and 9x 2 S; 8y 2 T; P (x; y) is 8x 2 S; 9y 2 T;
P (x; y):
The statements (8x 2 S; P (x)) and (8y 2 S; P (y)) are equivalent and the
assertions (9x 2 S; P (x)) and (9y 2 S; P (y)) are also equivalent. We say
that x and y are mute.
8x 2 S; 8 y 2 T; P (x; y) and 8 y 2 T; 8x 2 S; P (x; y) are the equivalent.
6
The statement (8x 2 S; P (x) and Q(x)) is equivalent to the the statement
(8x 2 S; P (x)) and (8x 2 S; P (x)):
We have (8x 2 S; P (x) or 8x 2 S; Q(x)) =) (8x 2 S; P (x) or Q(x)) but
the converse is not true.
(S = R; P (x) : x < 3 Q(x) : x 3 we have 8x 2 R : x < 3 or x 3: But
we have not 8x 2 R : x < 3 or 8x 2 R : x 3):
We have (9x 2 S; P (x) and Q(x)) =) (9x 2 S; P (x)) and (9x 2 S; Q(x)):
But the converse is not true.
(9x 2 N; x even and 9x 2 N; x odd) does not imply 9x 2 N; x even and
odd).
The statement (9x 2 S; P (x) or Q(x)) is equivalent to (9x 2 S; P (x) or
9x 2 S; Q(x)):
8x 2 A; x 2 B:
In this case we write A B; which reads "A is included in B "
(A B) ^ (B A) :
A \ B = fx 2 S : (x 2 A) ^ (x 2 B)g :
A [ B = fx 2 S : (x 2 A) _ (x 2 B)g
7
The collection of all elements x of S that satisfy the condition: (x 2 A) ^
(x 2
= B) true forms a set denoted AnB. It reads "A less B "
AnB = fx 2 S : (x 2 A) ^ (x 2
= B)g :
For any set S we have ; S: Such a set cannot contain elements and it is
unique.The set ; is called the empty set.
Indeed, let A = fag and B = fbg be two sets, a and b being distinct. Assume
that ; has elements, then at least one element, denoted z is in ; . Since ; A;
so z 2 A; necessarily z = a: Since ; B, so z 2 B, necessarily z = b then a = b.
Contradiction. Then (8x) (x 2 = ;) : Hence ; is empty. Let us now show that if
such a set exists, then it must be unique. Suppose there are two sets ;1 ; ;2 that
verify: (;1 S) (8S) and (;2 S) (8S) : This leads for S = ;1 and for S = ;2
to ;1 ;2 and ;2 ;1 : We deduce then ;1 = ;2 : We can prove directly the
following:
1. S \ ; = ;:
2. S [ ; = S:
3. S \ S = S:
4. S [ S = S:
5. Sn; = S:
6. S \ F = F \ F:
7. S [ F = F [ S:
8. (S [ F ) [ G = S [ (F [ G):
9. S \ (F \ G) = (S \ F ) \ G:
10. S \ (F [ G) = (S \ F ) [ (F \ G):
11. S [ (F \ G) = (S [ F ) \ (S [ G):
12. S = S:
13. (S [ F ) = S \ F :
8
14. S \ F = S [ F :
Let S be a set. The set of all subsets of S is denoted P(S) and called
power set of S. We obviously have
X 2 P(S) if an only if X S:
It is clear that P(S) is never empty since it contains ; and S:
Example 9
1. Let S = ;: Then P(;) = f;g ; P(P(;)) = f;; f;gg ; P(P(P(;))) = f;; f;g ; ff;gg ; f;; f;ggg :
2. Let S = f1; 2; 3g : Then P(S) = f;; f1g ; f2g ; f3g ; f1; 2g ; f1; 3g ; f2; 3g ; f1; 2; 3gg :
3 Methods of proof
In mathematics, the proof of a proposition consists in deducing its truth from
a set of mathematical statements (called hypotheses) that are assumed to be
true at the time of proof. This process is based on logic, but generally includes
elements of natural language and the use of axioms, theorems, propositions,
lemmas, corollaries, etc. Note that hypotheses are generally written explicitly
in the statement to be proved, which is not the case for the axioms, theorems,
propositions, lemmas, corollaries... used in the course of this proof. In general
to prove a proposition Q; we have to prove an implication P =) Q where P is
the hypothesis and we want to get Q true. To get a proof we have to:
i) respect the logic rules,
ii) know the di¤erent manners of proofs,
iii) have good sense, rigor.
In this section, we outline the main strategies for proving a mathematical
statement.
9
3.1 Proof by Deduction (direct proof)
Deductive reasoning is the most common type of proof. Starting with a hy-
pothesis, a logical line of reasoning is constructed, leading to a conclusion. This
method is based on the tautology
P ^ (P =) Q) =) Q:
The proposition P represents the set of hypotheses and Q the conclusion to
be reached, given that the implication P =) Q is true.
Example 10
1. Let us show that if a and b are odd integers, then a + b is an even integer.
Assume that a and b are odd integers. Then there are integers k and k 0
such that a = 2k+1 and b = 2k 0 +1: Then we have a+b = 2k+1+2k 0 +1 =
2(k + k 0 + 1), which shows that x + y is an even integer.
2. Let us show that any positive integer that is a square has an odd number
of divisors. Let a be a square integer. Then among the divisors of a we
have 1 and itself a. As a = b2 then a admits b as a divisor. This already
gives three divisors 1; a and b. On the other hand for any other c di¤ erent
from 1; a and b, divisor of a , there must be an integer d such that a = cd:
The integer d is also divisor of a and must also be di¤ erent from 1; a; b,
and c. So if there are divisors other than a and b, they must be di¤ erent
and exist in pairs. The total number of divisors is therefore odd.
Example 11
10
3.3 Proof by Contradiction
This method is based on the mathematical equivalence (P =) Q) () P ^ Q.
In this case, we assume Q to be false and P to be true; if in the course of
reasoning we get a contradiction, P ^ Q cannot be true, then P =) Q is true,
we deduce that Q is true.
Example 12
p
1. Let us show that p 2 = Q for any prime p: Assume for contradiction
p p1 p2
p = q1 with p1 ; q1 2 Q and gcd(p1 ; q1 ) = 1. Hence q21 = p, it means
1
p21 = pq12 and, consequently, p1 is divisible by p. Let p1 = pr; r 2 N. Then
p21 = p2 r2 = pq12 , which gives pp2 = q12 then q1 is also divisible by p. This
contradicts the hypothesis on p1 ; q1 being coprime. So, the assumption that
p p
p can be expressed as pq11 with p1 ; q1 2 Q is false, then p 2= Q when p is
a prime:
2. Let us show that there is an in…nity of prime numbers. Suppose there is
only a …nite number of prime numbers say p1 ; p2 ; :::; pk . Put n = 1 +
p1 p2 pk . Since any positive integer di¤ erent from 1 is divisible by at
least one prime number, then n is divisible by some pi where 1 i k;
this is impossible, as otherwise pi = 1. Consequently, there is an in…nity
of prime numbers.
11
2. Let us show that for any n 2 N and for any positive real x, (1 + x)n
1 + nx: For n = 1: P (1) is true since (1 + x)1 1 + x: Assume that
(1 + x)k 1 + kx and prove that (1 + x)k+1 1 + (k + 1)x: Multiplying
the induction hypothesis (1 + x)k 1 + kx by (1 + x) we obtain
Then P (k + 1) is valid. Thus, for any n 2 N and for any positive real x,
(1 + x)n 1 + nx:
Example 14
1. If x and y are two real numbers such that x2 < y 2 then x < y. This
assertion is false. Counter-example: for x = 2 and y = 3 we have
22 < ( 3)2 but 2 > 3:
2. It is well-known that if 2n 1 is prime, then n is prime. The converse
of this statement is false. Counter-examples: for n = 11 or n = 23 which
are primes we have
211 1 = 2047 = 23 89
and
223 1 = 8388607 = 47 178481:
12