Sets, logic and real numbers: the basics of Analysis 1
Sets and logic for Analysis 1: operations and De Morgan's laws, quantifiers, the irrationality of the square root of 2, supremum, completeness and absolute value, with examples.
https://www.electronics-engineering.com/en/sets-logic-real-numbers-analysis-1-basics/
The first chapter of Analysis 1 looks like the easiest: sets, logical symbols, real numbers. In fact it fixes the language of the whole rest of the course. Anyone who tackles it in a hurry later struggles to read the definitions of limit and continuity, which are written with exactly these tools.
In this lesson you will learn: the operations between sets and De Morgan’s laws; how quantifiers are used and negated; why
is not rational; what the supremum and infimum are and why the completeness of the reals matters; how to solve inequalities with the absolute value and how to prove the triangle inequality.
Sets and operations
A set is a collection of objects, called elements. It can be described by listing the elements,
, or by a property,
, which is the interval
. We write
if
belongs to
, and
if every element of
is also in
. Two sets are equal when each is contained in the other: order and repetitions do not matter.
| Operation | Symbol | Elements |
|---|---|---|
| Union | are in | |
| Intersection | are in both | |
| Difference | are in | |
| Complement | are not in | |
| Cartesian product | ordered pairs |
Example
With
and
:
,
,
,
. The Cartesian product
has
pairs, from
to
; note that
, because the pairs are ordered.
De Morgan’s laws
Two rules that are often useful are De Morgan’s laws:
and
. Anyone who has studied logic circuits recognises them: they are the same ones that turn a NAND gate into an OR of negated inputs.
A little logic: quantifiers and implications
The order of quantifiers
The definitions of Analysis use two quantifiers:
(“for every”) and
(“there exists”). The order matters enormously. “
” is true in the reals (for every number there is a larger one), while “
” is false (there is no number larger than all the others).
Negating a statement
To negate a statement with quantifiers, one swaps
and
and negates the final property. The negation of “for every
there exists
such that…” is “there exists
such that for every
… the property does not hold”. It is exactly the way to show that a limit does not equal a given number.
Implication and contrapositive
An implication
is equivalent to its contrapositive
, but not to its converse
. “If a function is differentiable then it is continuous” is true; “if it is continuous then it is differentiable” is false, think of
at 0.
The contrapositive is often the most convenient way to prove: “if
is even then
is even” is equivalent to “if
is odd then
is odd”, which is immediate:
gives
, which is odd. This fact is used in the proof that follows.
From the naturals to the reals
: each step adds something that was missing. The integers allow subtraction, the rationals division. The rationals are already “dense” (between two rationals there is always another one), and yet they have gaps:
is not rational.
Why the square root of 2 is not rational
The classic proof is by contradiction. Suppose
with the fraction in lowest terms. Then
, so
is even and therefore
is even:
. Substituting,
, that is
, so
is even too. But then the fraction was not in lowest terms: contradiction. ∎
Supremum and completeness
A set
is bounded above if there is a number
greater than or equal to all its elements (an upper bound). The supremum
is the smallest of the upper bounds. If it belongs to
it is also called the maximum. Symmetrically, the infimum
is the largest of the lower bounds, and if it belongs to
it is the minimum.
Examples
Example:
. Every number
is an upper bound, and no number smaller than 1 is, because
gets as close to 1 as one likes. So
, but 1 does not belong to
: the set has no maximum.
The same set does have a minimum:
, obtained for
, so
. Conversely,
has maximum
but no minimum:
, which is not an element of
.
The completeness axiom
The completeness axiom says that in
every non-empty set bounded above has a supremum. It is not true in the rationals:
is bounded, but its supremum would be
, which is missing. This property, apparently technical, is what makes the most important theorems of the course work: the intermediate value theorem, Bolzano-Weierstrass, the existence of the limit of monotone sequences.
Absolute value and the triangle inequality
is the distance of
from 0, and
the distance between two numbers. Two facts to know by heart:
means
: the neighbourhood of
of radius
;- the triangle inequality
, which is used in almost every epsilon and delta proof.
Inequalities with the absolute value
First example:
means
, that is the interval
, centred at 3 with radius 2. Second example:
holds when
or
, that is
or
: the solution is
. Check:
gives
, not a solution, and indeed 0 lies between
and 2.
Proof of the triangle inequality
For every real number
, and the same for
. Adding the inequalities term by term gives
, which by the neighbourhood rule seen above means exactly
. ∎ Applying it to
one also obtains the “reversed” form
, useful to estimate from below.
Reading the definition of limit
With these tools the definition of limit, “for every
there exists
such that
“, can be read without effort: it is a sentence with two quantifiers, two neighbourhoods and an implication.
In summary
- Union, intersection, difference, complement and Cartesian product are the basic operations; De Morgan swaps union and intersection when passing to complements.
- The order of the quantifiers changes the meaning; to negate, one swaps
and
and negates the property. - An implication is equivalent to its contrapositive, not to its converse.
is not rational: the rationals have gaps, which the completeness of the reals closes (every non-empty set bounded above has a supremum).
describes a neighbourhood; the triangle inequality is the basic tool for epsilon and delta estimates.






Sono l'autore di questa pagina su «Insiemi, logica e numeri reali: le basi di Analisi 1». Se qualcosa non è chiaro, se vi serve un esempio in più o volete approfondire un punto, scrivetelo qui sotto nei commenti: rispondo personalmente. Se la pagina vi è stata utile, lasciate un voto con le stelle in cima all'articolo.I am the author of this page on “Sets, logic and real numbers: the foundations of calculus”. If something is unclear, if you need another example or want to go deeper into a point, write it in the comments below: I answer personally. If the page was useful, leave a star rating at the top of the article.