Professional Documents
Culture Documents
silvio.mercadante@polito.it
v1.5.1
Disclaimer
I wrote these Lecture Notes as a support for the lectures of the Mathematical
Analysis 1 I give at Politecnico di Torino. They are freely available to Students who,
aware that they can’t be considered exhaustive, nevertheless find them useful.
A big, warm, thank you to all Students and Collegues kindly contributing to correct
all sort of mistakes (in particular English ones): you’re also contributing to make me
better.
silvio mercadante
Index 2/59
Index
Propositions
Logic predicates
Logic connectives
Quantifiers
Index 3/59
Section Index
Propositions
Index 4/59
Propositions
One of the reasons why we said that Mathematics is a logic-formal system is that it
contains only propositions, i.e. statement the truth or falsehood of which (in a well
specified context) can be established with precision.
Example 1:
Index 5/59
Section Index
Logic predicates
Index 6/59
Logic predicates
A statement depending on one or more parameters (or arguments) (x1 , . . . , xn )
belonging to a given set of domains (D1 , . . . , Dn ), which results to be a proposition
( T / F ) for each particular choice (x̄1 ∈ D1 , . . . , x̄n ∈ Dn ) of these parameters, is
called a logic predicate.
Example 2:
The statement “x is a natural number,” that can be denoted as p(x ), is a logic
predicate: it’s in fact clear that p(x ) = T for each x ∈ N, and p(x ) = F in all
other cases (i.e. for each x ∈/ N).
Observation 3:
Note that in order for a logic predicate p(x ) to be a proposition, x must be
specified. In other words, p(x ) doesn’t own a truth value until x is specified.
Observation 4:
Using an elegant mathematical language, we might say that a logical predicate is
a function with values into the set of propositions.
Index 7/59
Section Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Logic coimplication (Logic equivalence)
Index 8/59
Logic connectives
Propositions may be linked together, to produce more complex propositions, by
means of the so called logic connectives:
▸ ¬ negation,
▸ ∧ conjunction,
▸ ∨ disjunction,
▸ ⇒ implication,
▸ ⇔ coimplication.
The logic negation ¬ applies to exaclty one proposition at a time, and is then said
unary. All other logic connectives connect two propositions, and are then said
binary connectives.
Furthermore, we can use parentheses, in the usual way, to group connected
propositions.
Index 9/59
SubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Logic coimplication (Logic equivalence)
Index 10/59
Logic negation
Let p be a proposition. Then ¬p, read “not-p”, denotes its logic negation, defined
as the proposition having the opposite truth value of p (i.e. ¬p is T when p is F
, and vice versa).
In other words, we have the following truth table:
p ¬p
T F
F T
Example 5:
Let p(x ) be the logic predicate “x is an even number.” Then
▸ p(4) is T ,
▸ ¬p(4) is F .
Index 11/59
Logic negation
Observation 6:
Logic negation has clearly something to do with the set complementation:
p∶ x ∈P ⇒ ¬p ∶ x ∈/ P (i.e. x ∈ CP) .
Observation 7:
Truth tables aren’t just a way to represent how a particular logic connective
works: the right way of thinking to them is in term of the definition of the logic
connective itself. In other words, a logic connective is defined by its truth table.
Index 12/59
SubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Logic coimplication (Logic equivalence)
Index 13/59
Logic conjunction
Let p and q be two propositions. Their logic conjunction is denoted as p ∧ q, read
“p and q”, and results to be T if p and q are both T , and F in all other
cases:
p q p∧q
T T T
T F F
F T F
F F F
Example 8:
Let
▸ p(x ) be “x is an even number;”
▸ q(x ) be “x is a number < 10.”
Then:
▸ p(5) ∧ q(5) is F , because q(5) is T , but p(5) is F ;
▸ p(6) ∧ q(6) is T , because p(6) and q(5) are both T .
Index 14/59
Logic conjunction
Observation 9:
Logic conjunction has clearly something to do with the set intersection:
⎧
⎪
⎪p ∶ x ∈ P
⎨ ⇒ p∧q ∶ x ∈P ∩Q .
⎪
⎪ q∶ x ∈Q
⎩
Observation 10:
The proposition p ∧ (¬p) is clearly F whatever p.
Index 15/59
Logic conjunction
Exercise 11:
A Indeed we have:
p q p∧q q∧p
T T T T
T F F F
F T F F
F F F F
Exercise 12:
Index 16/59
SubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Logic coimplication (Logic equivalence)
Index 17/59
Logic disjunction
Let p and q be two propositions. Their logic disjunction is denoted as p ∨ q, read
“p or q” (OR, vel), and results to be F if and only if p and q are both F , and
T in all other cases:
p q p∨q
T T T
T F T
F T T
F F F
Example 13:
Let
▸ p(x ) be “x is an even number;”
▸ q(x ) be “x is a number < 10.”
Then:
▸ p(5) ∨ q(5) is T , because is T q(5);
▸ p(6) ∨ q(6) is T , because p(6) and q(5) are both T ;
▸ p(11) ∨ q(11) is F , because are F both p(11) and q(11).
Index 18/59
Logic disjunction
Observation 14:
Logic disjunction has clearly something to do with the set union:
⎧
⎪
⎪p ∶ x ∈ P
⎨ ⇒ p∨q ∶ x ∈P ∪Q .
⎪
⎪ q∶ x ∈Q
⎩
Observation 15:
The proposition p ∨ (¬p) is clearly T whatever p.
Index 19/59
Logic disjunction
Exercise 16:
A Indeed we have:
p q p∨q q∨p
T T T T
T F T T
F T T T
F F F F
Exercise 17:
Index 20/59
SubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Logic coimplication (Logic equivalence)
Index 21/59
Conjunction-Disjunction
Exercise 18:
Index 22/59
SubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Modifications of the logic implication
Logic coimplication (Logic equivalence)
Index 23/59
Observation 19:
It’s important to observe that the material logic implications doesn’t corresponds
exactly to the idea of implication used in the natural language, in particular
because it doesn’t imply any causal relationship between the antecedent
proposition p and the consequent proposition q. This relationship is instead
taken into account by the so-called semantic logic implication, which in turn is
out of our interest.
Index 24/59
(Formal or material) Logic implication
Example 20:
Let
▸ Let p be “3 is odd;”
▸ Let q be “all squares have 4 sides”
Then we’ll say that p ⇒ q is T even if we wouldn’t do so if we were using the
natural language (because the truth of q appears to be completely independent
of the truth of p).
Index 25/59
Example 21:
The implication “if you’ll study hard you’ll pass the exam” is T . If you’ll study
just a bit (not hard), you might pass the exam or not. In none of these cases the
implication can be considered F .
Index 26/59
Logic implication
Example 22:
Let
▸ p(x ) be “x < 20;”
▸ q(x ) be “x < 10.”
Observation 23:
In this particular Example, the proof is very easy: the < operator induces onto
R a total ordering relation; and as such, in particular, the transitive property
holds: (x < 10) ∧ (10 < 20) ⇒ x < 20.
But in other cases the proof is waaaay more difficult! That’s why we’ll be
spending some time later to learn about proof methods.
Index 27/59
Logic implication
The proposition p ⇒ q is read some more (important) equivalent ways:
▸ p is a sufficient condition for q (if p is T , then q is T as well);
▸ q is a necessary condition for p (p can’t be T unless q is T ).
Index 28/59
Logic implication
The logic implication p ⇒ q is particularly important in Mathematics, especially
when p is T , because it’s the basis of logic inference (see later). But it’s not
strictly necessary, because the proposition p ⇒ q is perfectly equivalent to ¬p ∨ q.
In facts, they have the same truth table:
p q ¬p p⇒q ¬p ∨ q
T T F T T
T F F F F
F T T T T
F F T T T
Hence the logic connective ⇒, although very popular and convenient, is not
considered fundamental.
Index 29/59
Logic implication
Exercise 24:
Q Prove that the logic implication ⇒ doesn’t enjoy the commutative property.
Exercise 25:
Q Prove that the logic implication ⇒ doesn’t enjoy the idempotence property.
Index 30/59
SubSubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Modifications of the logic implication
Logic coimplication (Logic equivalence)
Index 31/59
Example 26:
p: 2 is the rightmost digit of the whole number n
q: n is even
direct: 2 is the rightmost digit of the whole number n, therefore n is even
- T
negated: 2 is the rightmost digit of the whole number n, therefore n is not
even - F
converse: n is even, therefore 2 is the rightmost digit of the whole number n
- F
contrapositive: n is not even, therefore 2 is not the rightmost digit of the whole
number n - T
inverse: 2 is not the rightmost digit of the whole number n, therefore n is
not even - F
Index 32/59
Modifications of the logic implication
Exercise 27:
Exercise 28:
Exercise 29:
Q Prove that, e.g., the direct proposition is not logically equivalent to the inverse.
Exercise 30:
Q Can we conlcude, e.g., that if the direct proposition is T , then the inverse is F
?
Index 33/59
SubSection Index
Logic connectives
Logic negation
Logic conjunction
Logic disjunction
Conjunction-Disjunction
Logic implication
Logic coimplication (Logic equivalence)
Index 34/59
Logic coimplication (Logic equivalence)
Let p and q two propositions. Then we call logic coimplication or logic
equivalence of p and q, denoted as p ⇔ q or as q ⇔ p, the proposition which
results T when p and q are both T or both F , and F in all other cases:
p q p⇔q
T T T
T F F
F T F
F F T
Index 35/59
Example 31:
Proposition: a natural number n ∈ N is odd iff is odd n2 .
Observation 32:
If we were able to find one odd number n ∈ N such that n2 was even, then this
would be enough to invalidate the proposition. But to prove it, a billion
favourable examples wouldn’t be enough: we need a genuine mathematical
proof. And since it can be (easily) found, the proposition is actually a
theorem.
Index 36/59
Logic coimplication (Logic equivalence)
It’s easy to recognise that the proposition p ⇔ q is equivalent to
(p ⇒ q) ∧ (q ⇒ p) .
Then it’s clear that the logic connective ⇔ is not a fundamental one (although very
popular and convenient!).
Exercise 33:
Index 37/59
Section Index
Quantifiers
Index 38/59
Quantifiers
Given a logic predicate p(x ) (with x variable in a certain set X ), one may ask if
▸ p(x ) is T for all x ∈ X ;
▸ there exists at least one element x ∈ X such that p(x ) be T .
The symbol ∀ (“for all”) is called universal quantifier, while the symbol ∃ (“it
exists at least one”) is called existential quantifier.
Sometimes is used a third quantifier, ∃!, whose meaning is “there exists exactly one
element” or “there exists and is unique.”
Index 39/59
Quantifiers
Observation 34:
The application of a quantifier onto a logic predicate trasforms it in a
proposition. Which can be called a quantified predicate.
Example 35:
Let p(x ) be the logic predicate x < 7. Then:
▸ the proposition “∀x ∈ N, p(x )” is F (because, e.g., p(8) is F );
▸ the proposition “∃x ∈ N ∣ p(x )” is T (e.g. x = 6 satisfies it).
Index 40/59
Logic negation of a quantified predicate
Exercise 36:
A Not that all students at PoliTO are foreign, but that “there exists at least one foreign
student at PoliTO”!
Analogously, it’s easy to understand that the following logic equivalence holds true:
Index 42/59
Section Index
Index 43/59
SubSection Index
Index 44/59
Logic inference
Logic inference (after the Latin in ferre, to put inside) is the process of drawing
conlcusions from some premises, in a logical way. Is then a very important part of
logical reasoning.
Index 45/59
Index 46/59
SubSection Index
Index 47/59
Direct proof
From a conceptual point of view, the most simple deductive strategy is the direct
one (a.k.a modus ponens):
p ∧ (p ⇒ q) ⇒ q .
Example 37:
p: n is an even number;
q: n2 is an even number.
The implication p ⇒ q may easily be proved directly :
Index 48/59
Direct proof
Exercise 38:
p ∧ (p ⇒ q) ⇒ q
is a tautology (i.e. that it’s always T , independently of the truth of p and q).
Index 49/59
Proof by contraposition
As we already said, sometimes the direct proof is arduous. Often it’s much easier to
prove the (equivalent) contrapositive condition: ¬q ⇒ ¬p.
This strategy is called proof by contraposition, a.k.a. modus tollens:
¬q ∧ (p ⇒ q) ⇒ ¬p .
Example 39:
p: n2 is an even number;
q: n is an even number.
The implication p ⇒ q may easily be proved by contraposition:
n odd ⇒ n = 2m + 1, m ∈ N ⇒ n2 = 4m2 + 4m +1 .
´¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¸¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹¶
even
´¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¸¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¹ ¶
odd
Index 50/59
Proof by contraposition
Exercise 40:
¬q ∧ (p ⇒ q) ⇒ ¬p
is a tautology (i.e. that it’s always T , independently of the truth of p and q).
Index 51/59
Proof by contradiction
Example 41:
√
A famous example of proof by contradiction is the irrationality of 2. Suppose
√ √ a
that 2 ∈ Q. In that case, it would be 2 = for some a, b ∈ Z, with b = / 0 and
b
(a, b) coprime. Thus: √
b 2 = a ⇔ 2b 2 = a2 .
Now, being 2b 2 clearly even, so must be a2 . Then so must be a. So we can write
a = 2c, for some c ∈ Z, and also
2b 2 = (2c)2 = 4c 2 ⇔ b 2 = 2c 2 .
Index 52/59
Proof by induction
It’s a very interesting technique, based on the principle of induction.
▸ Let p(n) be a logic predicate that becomes a proposition ∀n ∈ N ∣ n ≥ n0 .
▸ Let p(n0 ) be T .
▸ Inductive hypothesis: let be T that p(n) ⇒ p(n + 1), for any n ≥ n1 ∈ N.
▸ Then we may conclude that p(n) is T ∀n ∈ N ∣ n > n1 .
Index 53/59
Proof by induction
Exercise 42:
> 2(m + 1) ⋅ 2 ∀m ≥ 2 ,
m+1 m
3
aquivalent to
> (m + 1) ⋅ 2 ∀m ≥ 2 .
m+1 m+1
3
Index Then the inductive property is proven. It’s also clear that induction “ignites” at n = 2. 54/59
Proof by induction
Exercise 42 (continuing):
In conclusion:
▸ n = 0: T by direct verification;
▸ n = 1: T by direct verification;
▸ n = 2: T by direct verification;
▸ n = 3, . . . : T by induction.
Index 55/59
Example 43:
Index 57/59
SubSection Index
Index 58/59
Logic fallacies
Subtle and always luring are the logic fallacies, i.e. uncorrect ways to prove a logic
implication p ⇒ q.
Among the many possible logic fallacies (sistematically used by politicians and
advertisers. . . ), we list:
▸ q ⇒ p is equivalent to p ⇒ q ( F !);
▸ ¬p ⇒ ¬q is equivalent to p ⇒ q ( F !).
Example 44:
Let:
p: Antonio is European;
q: Antonio is Italian.
Then:
▸ It’s T that q ⇒ p, but it’s F that p ⇒ q (Antonio could be Spanish).
Index 59/59