The rational number 44/1 as a set

One way to define a rational number (a-b)/c is to define it as the (infinite) set of all 3-tuples of natural numbers (a1, b1, c1) for which (a-b)/c = (a1-b1)/c1 (b is needed for negative numbers).

Klick on a 3-tuple to see how it may be defined as a set.

44/1 = (44-0)/1 = {

( 44, 0, 1 ),

( 88, 0, 2 ), ( 88, 44, 1 ),

( 132, 0, 3 ), ( 132, 44, 2 ), ( 132, 88, 1 ),

( 176, 0, 4 ), ( 176, 44, 3 ), ( 176, 88, 2 ), ( 176, 132, 1 ),

( 220, 0, 5 ), ( 220, 44, 4 ), ( 220, 88, 3 ), ( 220, 132, 2 ), ( 220, 176, 1 ),

( 264, 0, 6 ), ( 264, 44, 5 ), ( 264, 88, 4 ), ( 264, 132, 3 ), ( 264, 176, 2 ), ( 264, 220, 1 ),

( 308, 0, 7 ), ( 308, 44, 6 ), ( 308, 88, 5 ), ( 308, 132, 4 ), ( 308, 176, 3 ), ( 308, 220, 2 ), ( 308, 264, 1 ),

( 352, 0, 8 ), ( 352, 44, 7 ), ( 352, 88, 6 ), ( 352, 132, 5 ), ( 352, 176, 4 ), ( 352, 220, 3 ), ( 352, 264, 2 ), ( 352, 308, 1 ),

( 396, 0, 9 ), ( 396, 44, 8 ), ( 396, 88, 7 ), ( 396, 132, 6 ), ( 396, 176, 5 ), ( 396, 220, 4 ), ( 396, 264, 3 ), ( 396, 308, 2 ), ( 396, 352, 1 ),

( 440, 0, 10 ), ( 440, 44, 9 ), ( 440, 88, 8 ), ( 440, 132, 7 ), ( 440, 176, 6 ), ( 440, 220, 5 ), ( 440, 264, 4 ), ( 440, 308, 3 ), ( 440, 352, 2 ), ( 440, 396, 1 ),

( 484, 0, 11 ), ( 484, 44, 10 ), ( 484, 88, 9 ), ( 484, 132, 8 ), ( 484, 176, 7 ), ( 484, 220, 6 ), ( 484, 264, 5 ), ( 484, 308, 4 ), ( 484, 352, 3 ), ( 484, 396, 2 ), ( 484, 440, 1 ),

( 528, 0, 12 ), ( 528, 44, 11 ), ( 528, 88, 10 ), ( 528, 132, 9 ), ( 528, 176, 8 ), ( 528, 220, 7 ), ( 528, 264, 6 ), ( 528, 308, 5 ), ( 528, 352, 4 ), ( 528, 396, 3 ), ( 528, 440, 2 ), ( 528, 484, 1 ),

( 572, 0, 13 ), ( 572, 44, 12 ), ( 572, 88, 11 ), ( 572, 132, 10 ), ( 572, 176, 9 ), ( 572, 220, 8 ), ( 572, 264, 7 ), ( 572, 308, 6 ), ( 572, 352, 5 ), ( 572, 396, 4 ), ( 572, 440, 3 ), ( 572, 484, 2 ), ( 572, 528, 1 ),

( 616, 0, 14 ), ( 616, 44, 13 ), ( 616, 88, 12 ), ( 616, 132, 11 ), ( 616, 176, 10 ), ( 616, 220, 9 ), ( 616, 264, 8 ), ( 616, 308, 7 ), ( 616, 352, 6 ), ( 616, 396, 5 ), ( 616, 440, 4 ), ( 616, 484, 3 ), ( 616, 528, 2 ), ( 616, 572, 1 ),

...

}

The equation (a-b)/c = (a1-b1)/c1 is equivalent to a·c1 + b1·c = a1·c + b·c1 - so only addition and multiplication of natural numbers are needed to define the rational numbers.

For rational numbers Q, Q1 as defined above, Q < Q1 is defined as a·c1 + b1·c < a1·c + b·c1 for one/all (a, b, c) ∈ Q, (a1, b1, c1) ∈ Q1.

Q + Q1 is defined as (a2-b2)/c2, where a2 = a·c1 + a1·c, b2 = b·c1 + b1·c, c2 = c·c1 for one/all (a, b, c) ∈ Q, (a1, b1, c1) ∈ Q1.

Be aware that (a2-b2)/c2 is simply a notation for the set determined by a2, b2 and c2 here - not an expression using subtraction and division.

The definition for Q + Q1 above simply is a transformation of the expression (a-b)/c + (a1-b1)/c1.

Assuming that a,c is minimal for a positive rational number a/c or (a-0)/c, we can enumerate all members of the set by doing this:

Let n be 1
Repeat:
  For all n1 from 0 to n-1:
    Let a1 be n·a
    Let b1 be n1·a
    Let c1 be (n-n1)·c
    Enumerate (a1,b1,c1)
  Increase n by 1

The enumeration as Python function with a limiting parameter k which will cause the function to enumerate (k·(k+1))/2 elements of a/c:

def print_rational_number(a,c,k):
    print str(a)+'/'+str(c)+' = ('+str(a)+'-0)/'+str(c)+' = {'
    for n in range(1,k+1):
        for n1 in range(n):
            a1=n*a
            b1=n1*a
            c1=(n-n1)*c
            print '( '+str(a1)+', '+str(b1)+', '+str(c1)+' ),'
        print
    print "..."
    print "}"

(back to √2)