Chapter1- Logic and reasoning patterns
Chapter1- Logic and reasoning patterns
7 octobre 2023
Table des matières
1
Chapitre 1
1.1 Recall
I. Logic concepts
De…nition 1 Any relation P that is either true or false is called a "logical proposition".
- When a proposition is true, its value is equal to 1.
- When the proposition is false, its value is 0.
P P
1 0
0 1
2. Conjunction "^"
Let P and Q be two logical propositions, we call the "conjunction" of P and Q the proposition
"P ^ Q", which is true when both P and Q are true and false otherwise.
2
Chapter1 : Logic and reasoning patterns
P Q P _Q
1 1 1
0 0 0
1 0 1
0 1 1
4. Involvement "=)"
Consider two logical propositions P and Q. "P ) Q" is the logical proposition that is false if
P is true and Q is false. The proposition P ) Q reads "P implies Q".
P Q P =) Q
1 1 1
0 0 1
1 0 0
0 1 1
Given two logical propositions P and Q, then the truth table of P _ Q is as follows :
P Q P P _Q
1 1 0 1
0 0 1 1
1 0 0 0
0 1 1 1
3
Chapter1 : Logic and reasoning patterns
We see that this table is identical to that of P ) Q, so we say that the proposition P ) Q is
equivalent to the proposition P _ Q.
5. Equivalence "()"
The two logical propositions P and Q are said to be logically equivalent, if they are simulta-
neously true or simultaneously false, and we note "P , Q", its truth table is
P Q P () Q
1 1 1
0 0 1
1 0 0
0 1 0
Demorgan rules :
If P and Q are two logical propositions, then :
1. P ^ Q () P _ Q:
2. P _ Q () P ^ Q:
Quanti…ers
The quanti…er 8 or "for everything".
A proposition P can depend on a parameter x, for example "x2 1", the assertion P (x) is
true or false depending on the value of x.
The proposition
8x 2 E; P (x)
is a true proposition when the propositions P (x) are true for all elements x of the set E. We
read "For all x belonging to E, P (x)".
Example : «8x 2 [1; +1[ ; x2 1» is a true proposition.
«8x 2 R; x2 1 » is a false proposition.
« 8n 2 N; n(n + 1) est divisible par 2 » is true.
The quanti…er 9, or "it exists"
The proposition
9x 2 E; P (x)
is a true proposition when we can …nd at least one x of E for which P (x) is true. We read
"there exists x belonging to E such that P (x) is true".
4
Chapter1 : Logic and reasoning patterns
Remark 1 The order of quanti…ers is very important. For example, the two logical propositions
are di¤erent. The …rst is true, the second false. In fact, the …rst sentence states that "For any
real x, there exists a real y (which can therefore depend on x) such that x + y > 0." (e.g. for a
given x; y = x + 1). This is a true sentence.
On the other hand, the second sentence reads : "There exists a real y, such that for any real x,
x + y > 0." This sentence is false : it can’t be the same y that …ts all x.
1. Direct reasoning : We want to show that the proposition "P ) Q" is true,
Assume that P is true and show that Q is true.
x+y
Example : Show that "8x, y 2 R+ ; x y =) x y
2
Proof : x y =) x + x x+y
=) 2x x+y
x+y
=) x ..............(1)
2
y x =) x + y y + y
x+y
=) y.............(2)
2
x+y
From (1) and (2) we have : x y
2
x+y
Then 8x, y 2 R+ ; x y =) x y is true
2
5
Chapter1 : Logic and reasoning patterns
2. Case by case : If we want to verify a proposition P (x) for all x in a set E, we show the
proposition P (x) for x 2 A E, then for x 2
= A.
Example show that :8x 2 R; jx 1j x2 x + 1:
Proof If x 1 : jx 1j = x 1, so x2 x+1 jx 1j = x2 x+1 x + 1 = x2 2x + 2 =
(x 1)2 + 1 0.
Hence x2 x+1 jx 1j :
If x 1 : jx 1j = x + 1, So x2 x+1 jx 1j = x2 x+1+x 1 = x2 0.
Hence x2 x+1 jx 1j :
Conclusion : In all cases jx 1j x2 x + 1:
3. Contraposed : Contraposition" reasoning is based on the following equivalence :
(P =) Q) () Q =) P
So if we wish to show the assertion "P ) Q" we are in fact showing that if Q is true then P
is true.
Example : Show that : 8n 2 N; n2 is even then n is even.
Proof : we want to show that if n is odd=) n2 is odd.
n is odd, then there exists k 2 N such that n = 2k + 1, so n2 = 4k 2 + 4k + 1 = 2 (2k 2 + 2k) + 1 =
2 + 1, so n2 is odd.
4. Absurd : Reasoning by "the absurd" to show that "P ) Q" is based on the following
principle
"we assume both that P is true and that Q is false, and look for a contradiction. So if P is
true then Q must be true and so "P ) Q" is true.
x y
Example : Show that : 8x; y 2 R+ ;if = so x = y:
1+y 1+x
x y
Proof : we assume that = and x 6= y.
1+y 1+x
x y
Since = so x (1 + x) = y (1 + y) then x + x2 = y + y 2 where x2 y2 = x + y so
1+y 1+x
(x y) (x + y) = (x y) :
Since x 6= y then x y 6= 0 so,we divid by x y we obtain x + y = 1 it’s a contradiction (the
sum of two positive numbers is positive)
x y
Conclusion : 8x; y 2 R+ , if = so x = y.
1+y 1+x
6
Chapter1 : Logic and reasoning patterns
5.Counter example : To show that "8x 2 E; P (x)" is false, we need only …nd x 2 E such
that P (x) is false.
Example : Montrer que "tout entier positif est somme de trois carrés"
Proof : Consider the integer n = 7, squares smaller than 7 are 0; 1; 4 but 0 + 1 + 4 6= 7:
6. Recurrence : The principle of "recurrence" is used to show that a proposition P (n) de-
pends on n, is true for all n 2 N. Demonstration by recurrence takes place in three stages :
1) "Initialization : we check that P (0) is true,
2) "Heredity" : we assume n > 0 given with P (n) true, and then demonstrate that the propo-
sition P (n + 1) at the next rank is true.
3) "The conclusion" : recall that by the principle of recurrence P (n) is true for all n 2 N.
Example : Let the suite (xn ), n 2 N de…ned by
2x2n 3
x0 = 4 et xn+1 =
xn + 2
(Hn ) : xn > 3
By hypothesis of recurrence xn > 3, so xn + 2 > 0 and 2x2n 3xn 9 > 0 (this parietude of the
function x 7 ! 2x2 3x 9 for x > 3). then xn+1 3 and Hn+1 is true.
We show 8n 2 N , Hn =) Hn+1 and as H0 is true then Hn is true whatever n. This completes the
demonstration.