Part1 Logic and Part2 Function
Part1 Logic and Part2 Function
Part I
Introduction to mathematical logic
1 Propositional Calculus
1.1 Definition
Definition: A proposition is a declarative sentence (or statement) that can be true (T) or false
(F) but not both at the same time.
Examples
1. "2 is a natural number": is a proposition (simple).
1
2. " is an irrational number": is proposition.
2
3. " Where are you?": is not a proposition.
4. "Close the door": is not a proposition.
1
1.2.2 Logical Disjunction
P ∨ Q is read P or Q.
P ∧ Q is read P and Q.
P Q P =⇒ Q
T T T
T F F
F T T
F F T
Remark
1. P =⇒ Q is read "if P then Q ".
2. P is called assumption ; Q is called conclusion.
Definition:
2
1.2.5 Logical equivalence
P Q P ⇐⇒ Q
T T T
T F F
F T F
F F T
1.3 Tautology
Definition: Tautology is a compound proposition which is true for every truth value of the
individual propositions.
1. (P ⇐⇒ Q) ⇐⇒ ((P =⇒ Q) ∧ (Q =⇒ P ))
Denote this proposition α; then construct its truth table.
P Q P =⇒ Q Q =⇒ P (P =⇒ Q) ∧ (Q =⇒ P ) P ⇐⇒ Q α
T T T T T T T
T F F T F F T
F T T F F F T
F F T T T T T
2. (P =⇒ Q) ⇐⇒ (Q =⇒ P )
Denote this proposition β; construct its truth table.
P Q P =⇒ Q Q =⇒ P β
T T T T T
T F F F T
F T T T T
F F T T T
1.4 Exercice
Prove that these propositions are tautologies:
1. P ⇐⇒ P
3
2. (P =⇒ Q) ⇐⇒ (Q =⇒ P )
3. (P =⇒ Q) ⇐⇒ P ∨Q .
4. P =⇒ Q ⇐⇒ P ∧Q .
5. P ∧ Q ⇐⇒ P ∨Q . De Morgan’s laws
6. P ∨ Q ⇐⇒ P ∧Q . De Morgan’s laws
7. (P ⇐⇒ Q) ⇐⇒ ((P =⇒ Q) ∧ (Q =⇒ P ))
8. (P ∧ Q) ⇐⇒ (Q ∧ P ), ∧ is commutative
9. (P ∨ Q) ⇐⇒ (Q ∨ P ) , ∨ is commutative
Remark
1. Warning : ≡ is not a connective.
2. We can prove that P ≡ Q if and only if P ⇐⇒ Q is a tautology.
2 Quantified expression
2.1 Introduction to Predicate calculus
Definition: In literature, a predicate is the part of sentence that tells us something about
the subject. It contains the verb.
Exemple
1. The lighthouse was damaged in the storm.
"was damaged in the storm" is the prédicat".
2. Birds are chirping outside the windows .
"are chirping outside the windows" is the predicat.
4
Examples
2.2 Quantifiers
2.2.1 Universal quantifier
The universal quantifier is denoted ∀ , it is read "for all" or "for every" or "for each" .
Let D be a non empty set, and a predicate P (x)
∀x ∈ D P (x)
is a proposition which is true if and only if P (x) is true for all values of x in D.
∀x ∈ D P (x) means every x in D has property P .
Example
D=R.
Remark
1. (∀x ∈ D P (x)) is false if and only if we find a value of x in D that P (x) is false.
Existential quantifier is denoted ∃ , it is read "there exists" or "there is" or "for at least
one" .
Let D be a non empty set, and a predicate P (x)
∃x ∈ D P (x)
is a proposition which is true if and only if there is an x for which P (x) is true .
Example
5
1. D = R.
P (x) :" x > 0".
∃x ∈ R P (x) is true proposition.
2. E = N
Q(x, y) :" x divides y".
∃x ∈ N∗ ∀y ∈ N∗ Q(x, y) is a true proposition.
Remark
∃x ∈ D P (x) is false if and only if P (x) is false for every x in D.
6
3.3 Proof by contradiction
assume P is false.
√
Example Prove that 2 is irrational.
2. Induction step: Show that if the statement is true for n = k , where k denotes any value
of n , then it must be true for n = k + 1.
3. Conclusion: The statement is true for all integral values of n equal to or greater than n0 .
Part II
function
4 Functions
4.1 Definition and Notations
Let E and F be non empty sets, a function from E to F is a rule that assigns for each
element x in E exactly one element y in F .
We write
f : E −→ F
x 7−→ f (x) = y
• if y = f (x) then
7
∗ y is called image of x by f .
∗ x is called preimage of y by f .
1. The set {f (x) | x ∈ E} is called the range of f .
Example
Example
√
x
(a) Let h be a function defined by h(x) = . Give the domain of h .
−1 x2
Dh = {x ∈ R | x ≥ 0 et (x − 1) 6= 0} = R+ − {1}
2
8
Definition Let E be a non empty set.
The identity function on the set E , denoted idE or iE , is defined by:
idE : E −→ E
x 7−→ idE (x) = x
Gf = {(x, y) ∈ E × F | y = f (x)} .
Example
9
(a) f −1 ({0}) = {2}; f −1 ({1}) = {3}
(b) g −1 ({0, 7}) = {1, 2}; g −1 ({0, 7}) = ∅
2. Let f be the function defined by f : R −→ R such that f (x) = x2
Give: f −1 ({0}); f −1 ({1}); f −1 ({−1}).
f|E 0 : E 0 −→ F
x 7−→ f|E0 (x) = f (x)
g ◦ f : E −→ G
x 7−→ g ◦ f (x) = g(f (x))
Example
f : R∗ −→ R∗+ f (x) = |x|
g : R∗+ −→ R g(x) = lnx
We have
g ◦ f : R∗ −→ R
x 7−→ g ◦ f (x) = g(f (x)) = ln(|x|)
10
5 Bijection
5.1 Injectivity
equivalently:
∀x, x0 ∈ E (f (x) = f (x0 ) =⇒ x = x0 )
that means: Two different elements in E have two different images by f in F .
Example
therefore f is injective.
Example
11
5.2 Surjectivity
Remarque
1. f is surjective if and only if each element of F is at least an image of an element of E.
2. f is not surjective if and only if
∃y ∈ F such that ∀x ∈ E y 6= f (x).
Example
1. Prove that the function f : R −→ R defined by f (x) = 2x + 1 is surjective.
Given y in R , we want to find x ∈ R | y = f (x)
Therefore we resolve the equation y = f (x) :
y−1
y = f (x) ⇐⇒ 2x + 1 = y ⇐⇒ x =
2
y−1
x= ∈ R is a solution, therefore f is surjective.
2
Theoreme 5.2.1 Let f : E −→ F a function
f is surjective ⇐⇒ f (E) = F.
Proof 5.2.1 We prove that
f is surjective =⇒ f (E) = F (1)
and
f (E) = F =⇒ f is surjective (2)
Let us prove (1) :
Suppose that f is surjective and prove that f (E) = F
It is clear that f (E) ⊂ F , it remains to prove that F ⊂ f (E) :
Suppose y ∈ F , we search x ∈ E such that y = f (x)
f surjective =⇒ ∃x ∈ E such that y = f (x)
=⇒ F ⊂ f (E)
Conclusion 1: F ⊂ f (E) and f (E) ⊂ F therefore f (E) = F .
Let us prove (2) :
Suppose that f (E) = F and prove that f is surjective
Let y be in F , we search x in E such that y = f (x)
y∈F and f (E) = F =⇒ y ∈ f (E)
=⇒ ∃x ∈ E such that y = f (x)
=⇒ f is surjective.
Conclusion 2: f (E) = F =⇒ f surjective
12
5.3 Bijectivity
13
Prove that f is injective: Let’s use proof by contradiction:
Suppose f is not injective:
∃x, x0 ∈ E | f (x) = f (x0 ) et x 6= x0
Let’s put y = f (x):
y have two ifferent preimages x and x0
By the hypothesis ∃!x ∈ E | y = f (x) which means that x is unique. Therefore
x = x0 .
We conclude that x = x0 and x 6= x0 ; this contradiction proves that f is injective.
Conclusion: f is injective and surjective therefore f is bijective.
14
Prove (6) Let y ∈ F and prove that f ◦ f −1 (y) = idF (y) = y
therefore
f ◦ f −1 (y) = f (f −1 (y))
= f (x)
=y
Remark
Consider f : E −→ F a bijective function, and F 0 non empty subset of F .
the preimage of F 0 by f is equal to the image of F 0 by f −1 .
In other words: n o
f −1 (F 0 ) = f −1 (y) | y ∈ F 0
15