The rational number 48/19 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/19 = (48-0)/19 = {

( 48, 0, 19 ),

( 96, 0, 38 ), ( 96, 48, 19 ),

( 144, 0, 57 ), ( 144, 48, 38 ), ( 144, 96, 19 ),

( 192, 0, 76 ), ( 192, 48, 57 ), ( 192, 96, 38 ), ( 192, 144, 19 ),

( 240, 0, 95 ), ( 240, 48, 76 ), ( 240, 96, 57 ), ( 240, 144, 38 ), ( 240, 192, 19 ),

( 288, 0, 114 ), ( 288, 48, 95 ), ( 288, 96, 76 ), ( 288, 144, 57 ), ( 288, 192, 38 ), ( 288, 240, 19 ),

( 336, 0, 133 ), ( 336, 48, 114 ), ( 336, 96, 95 ), ( 336, 144, 76 ), ( 336, 192, 57 ), ( 336, 240, 38 ), ( 336, 288, 19 ),

( 384, 0, 152 ), ( 384, 48, 133 ), ( 384, 96, 114 ), ( 384, 144, 95 ), ( 384, 192, 76 ), ( 384, 240, 57 ), ( 384, 288, 38 ), ( 384, 336, 19 ),

( 432, 0, 171 ), ( 432, 48, 152 ), ( 432, 96, 133 ), ( 432, 144, 114 ), ( 432, 192, 95 ), ( 432, 240, 76 ), ( 432, 288, 57 ), ( 432, 336, 38 ), ( 432, 384, 19 ),

( 480, 0, 190 ), ( 480, 48, 171 ), ( 480, 96, 152 ), ( 480, 144, 133 ), ( 480, 192, 114 ), ( 480, 240, 95 ), ( 480, 288, 76 ), ( 480, 336, 57 ), ( 480, 384, 38 ), ( 480, 432, 19 ),

( 528, 0, 209 ), ( 528, 48, 190 ), ( 528, 96, 171 ), ( 528, 144, 152 ), ( 528, 192, 133 ), ( 528, 240, 114 ), ( 528, 288, 95 ), ( 528, 336, 76 ), ( 528, 384, 57 ), ( 528, 432, 38 ), ( 528, 480, 19 ),

( 576, 0, 228 ), ( 576, 48, 209 ), ( 576, 96, 190 ), ( 576, 144, 171 ), ( 576, 192, 152 ), ( 576, 240, 133 ), ( 576, 288, 114 ), ( 576, 336, 95 ), ( 576, 384, 76 ), ( 576, 432, 57 ), ( 576, 480, 38 ), ( 576, 528, 19 ),

( 624, 0, 247 ), ( 624, 48, 228 ), ( 624, 96, 209 ), ( 624, 144, 190 ), ( 624, 192, 171 ), ( 624, 240, 152 ), ( 624, 288, 133 ), ( 624, 336, 114 ), ( 624, 384, 95 ), ( 624, 432, 76 ), ( 624, 480, 57 ), ( 624, 528, 38 ), ( 624, 576, 19 ),

( 672, 0, 266 ), ( 672, 48, 247 ), ( 672, 96, 228 ), ( 672, 144, 209 ), ( 672, 192, 190 ), ( 672, 240, 171 ), ( 672, 288, 152 ), ( 672, 336, 133 ), ( 672, 384, 114 ), ( 672, 432, 95 ), ( 672, 480, 76 ), ( 672, 528, 57 ), ( 672, 576, 38 ), ( 672, 624, 19 ),

...

}

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)