# The real number √2 as a set

In set theory, all kinds of mathematical objects are hereditary sets: Numbers, relations, functions, etc.

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 other).

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.

√2 = {

2/1,

3/1, 3/2,

4/1,

5/1, 5/2, 5/3,

6/1,

7/1, 7/2, 7/3, 7/4,

8/1, 8/3, 8/5,

9/1, 9/2, 9/4, 9/5,

10/1, 10/3, 10/7,

11/1, 11/2, 11/3, 11/4, 11/5, 11/6, 11/7,

12/1, 12/5, 12/7,

13/1, 13/2, 13/3, 13/4, 13/5, 13/6, 13/7, 13/8, 13/9,

14/1, 14/3, 14/5, 14/9,

15/1, 15/2, 15/4, 15/7, 15/8,

...

}

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 of √2:

```Let a be 2
Repeat:
Let c be 1
While a·a > 2·c·c:
Enumerate a/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 listed.

The enumeration as Python function with a limiting parameter k:

```def print_sqrt2(k):
dedekind=set()
for a in range(2,k+1):
c=1
while a*a > 2*c*c:
found=False
for a1,c1 in dedekind:
if a*c1 == a1*c:
found=True
break