Sets, logic and real numbers: the foundations of calculus
Sets and operations, quantifiers and implications, why the square root of 2 is irrational, supremum and completeness of the reals, absolute value and the triangle inequality.
The first chapter of calculus looks like the easiest one: sets, logical symbols, real numbers. In fact it sets the language for the rest of the course. Students who rush through it later struggle to read the definitions of limit and continuity, which are written with exactly these tools.
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 | in | |
| Intersection | in both | |
| Difference | in | |
| Complement | not in | |
| Cartesian product | ordered pairs |
Two rules that come in handy are De Morgan’s laws:
and
. Anyone who has studied logic circuits will recognise them: they are the same laws that turn a NAND gate into an OR of inverted inputs.
A little logic: quantifiers and implications
The definitions of calculus use two quantifiers:
(“for every”) and
(“there exists”). Their order matters a great deal. “
” 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).
To negate a statement with quantifiers, swap
and
and negate the final property. The negation of “for every
there exists
such that…” is “there exists
such that for every
…” the property fails. This is exactly how you prove that a limit is not a given number.
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, just think of
at 0.
From natural numbers to real numbers
: each step adds something that was missing. Integers allow subtraction, rationals allow division. The rationals are already “dense” (between two rationals there is always another one), and yet they have holes:
is not rational.
The classic proof is by contradiction. Suppose
with the fraction in lowest terms. Then
, so
is even and
is even too:
. Substituting,
, that is
, so
is even as well. 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 upper bound. If it belongs to
it is also called the maximum.
Example:
. Every number
is an upper bound, and no number below 1 is, because
gets as close to 1 as we like. So
, but 1 does not belong to
: the set has no maximum.
The completeness axiom says that in
every non-empty set that is bounded above has a supremum. In the rationals this fails:
is bounded, but its supremum would be
, which is missing. This apparently technical property is what makes the most important theorems of the course work: the intermediate zero 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 worth knowing by heart:
means
: the neighbourhood of
with radius
;- the triangle inequality
, which is needed in almost every epsilon-delta proof.
With these tools the definition of limit, “for every
there exists
such that
“, reads without effort: it is a sentence with two quantifiers, two neighbourhoods and an implication.





