Often, these mathematical objects can be constructed with sets in different
ways and there is no canonical way to do it - so you may encounter different
definitions in different textbooks.
If you wonder how √2 may look like as a set, here is one example.
One of the ways to contruct the real numbers are
Dedekind cuts of
the rational numbers, so that a real number is defined as the (infinite) set
of all rational numbers on one half of a Dedekind cut (one half determines the
We are using the right half of a Dedekind cut where the left half may have a
biggest element and the right half does never have a smallest element. This
can be understood as the set of all rational numbers that are bigger than the
real number in question.
The set of all such cuts then is the set of all real numbers.
Klick on a rational number to see how it may be defined as a set.
For real numbers R1, R2 as defined above,
R1 < R2 is defined as (R2 ⊂
R1 and R1 != R2).
R1 + R2 is reduced to addition of rational numbers
by defining it as the set of all
Q1 + Q2 with Q1 ∈ R1 and
Q2 ∈ R2.
Here is a way to enumerate all rational numbers a/c that are elements of
Let a be 2
Let c be 1
While a·a > 2·c·c:
Increase c by 1.
Increase a by 1
This enumeration may list the same rational number several times. To avoid
this, you can compare the new number a/c with all already enumerated numbers
a1/c1. If a/c = a1/c1 (or easier:
a·c1 = a1·c), then the number was already
The enumeration as Python function with a limiting parameter k:
for a in range(2,k+1):
while a*a > 2*c*c:
for a1,c1 in dedekind:
if a*c1 == a1*c:
if not found:
print str(a)+'/'+str(c)+', '