The rational number 48/7 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.

48/7 = (48-0)/7 = {

( 48, 0, 7 ),

( 96, 0, 14 ), ( 96, 48, 7 ),

( 144, 0, 21 ), ( 144, 48, 14 ), ( 144, 96, 7 ),

( 192, 0, 28 ), ( 192, 48, 21 ), ( 192, 96, 14 ), ( 192, 144, 7 ),

( 240, 0, 35 ), ( 240, 48, 28 ), ( 240, 96, 21 ), ( 240, 144, 14 ), ( 240, 192, 7 ),

( 288, 0, 42 ), ( 288, 48, 35 ), ( 288, 96, 28 ), ( 288, 144, 21 ), ( 288, 192, 14 ), ( 288, 240, 7 ),

( 336, 0, 49 ), ( 336, 48, 42 ), ( 336, 96, 35 ), ( 336, 144, 28 ), ( 336, 192, 21 ), ( 336, 240, 14 ), ( 336, 288, 7 ),

( 384, 0, 56 ), ( 384, 48, 49 ), ( 384, 96, 42 ), ( 384, 144, 35 ), ( 384, 192, 28 ), ( 384, 240, 21 ), ( 384, 288, 14 ), ( 384, 336, 7 ),

( 432, 0, 63 ), ( 432, 48, 56 ), ( 432, 96, 49 ), ( 432, 144, 42 ), ( 432, 192, 35 ), ( 432, 240, 28 ), ( 432, 288, 21 ), ( 432, 336, 14 ), ( 432, 384, 7 ),

( 480, 0, 70 ), ( 480, 48, 63 ), ( 480, 96, 56 ), ( 480, 144, 49 ), ( 480, 192, 42 ), ( 480, 240, 35 ), ( 480, 288, 28 ), ( 480, 336, 21 ), ( 480, 384, 14 ), ( 480, 432, 7 ),

( 528, 0, 77 ), ( 528, 48, 70 ), ( 528, 96, 63 ), ( 528, 144, 56 ), ( 528, 192, 49 ), ( 528, 240, 42 ), ( 528, 288, 35 ), ( 528, 336, 28 ), ( 528, 384, 21 ), ( 528, 432, 14 ), ( 528, 480, 7 ),

( 576, 0, 84 ), ( 576, 48, 77 ), ( 576, 96, 70 ), ( 576, 144, 63 ), ( 576, 192, 56 ), ( 576, 240, 49 ), ( 576, 288, 42 ), ( 576, 336, 35 ), ( 576, 384, 28 ), ( 576, 432, 21 ), ( 576, 480, 14 ), ( 576, 528, 7 ),

( 624, 0, 91 ), ( 624, 48, 84 ), ( 624, 96, 77 ), ( 624, 144, 70 ), ( 624, 192, 63 ), ( 624, 240, 56 ), ( 624, 288, 49 ), ( 624, 336, 42 ), ( 624, 384, 35 ), ( 624, 432, 28 ), ( 624, 480, 21 ), ( 624, 528, 14 ), ( 624, 576, 7 ),

( 672, 0, 98 ), ( 672, 48, 91 ), ( 672, 96, 84 ), ( 672, 144, 77 ), ( 672, 192, 70 ), ( 672, 240, 63 ), ( 672, 288, 56 ), ( 672, 336, 49 ), ( 672, 384, 42 ), ( 672, 432, 35 ), ( 672, 480, 28 ), ( 672, 528, 21 ), ( 672, 576, 14 ), ( 672, 624, 7 ),

...

}

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)