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

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

( 50, 0, 1 ),

( 100, 0, 2 ), ( 100, 50, 1 ),

( 150, 0, 3 ), ( 150, 50, 2 ), ( 150, 100, 1 ),

( 200, 0, 4 ), ( 200, 50, 3 ), ( 200, 100, 2 ), ( 200, 150, 1 ),

( 250, 0, 5 ), ( 250, 50, 4 ), ( 250, 100, 3 ), ( 250, 150, 2 ), ( 250, 200, 1 ),

( 300, 0, 6 ), ( 300, 50, 5 ), ( 300, 100, 4 ), ( 300, 150, 3 ), ( 300, 200, 2 ), ( 300, 250, 1 ),

( 350, 0, 7 ), ( 350, 50, 6 ), ( 350, 100, 5 ), ( 350, 150, 4 ), ( 350, 200, 3 ), ( 350, 250, 2 ), ( 350, 300, 1 ),

( 400, 0, 8 ), ( 400, 50, 7 ), ( 400, 100, 6 ), ( 400, 150, 5 ), ( 400, 200, 4 ), ( 400, 250, 3 ), ( 400, 300, 2 ), ( 400, 350, 1 ),

( 450, 0, 9 ), ( 450, 50, 8 ), ( 450, 100, 7 ), ( 450, 150, 6 ), ( 450, 200, 5 ), ( 450, 250, 4 ), ( 450, 300, 3 ), ( 450, 350, 2 ), ( 450, 400, 1 ),

( 500, 0, 10 ), ( 500, 50, 9 ), ( 500, 100, 8 ), ( 500, 150, 7 ), ( 500, 200, 6 ), ( 500, 250, 5 ), ( 500, 300, 4 ), ( 500, 350, 3 ), ( 500, 400, 2 ), ( 500, 450, 1 ),

( 550, 0, 11 ), ( 550, 50, 10 ), ( 550, 100, 9 ), ( 550, 150, 8 ), ( 550, 200, 7 ), ( 550, 250, 6 ), ( 550, 300, 5 ), ( 550, 350, 4 ), ( 550, 400, 3 ), ( 550, 450, 2 ), ( 550, 500, 1 ),

( 600, 0, 12 ), ( 600, 50, 11 ), ( 600, 100, 10 ), ( 600, 150, 9 ), ( 600, 200, 8 ), ( 600, 250, 7 ), ( 600, 300, 6 ), ( 600, 350, 5 ), ( 600, 400, 4 ), ( 600, 450, 3 ), ( 600, 500, 2 ), ( 600, 550, 1 ),

( 650, 0, 13 ), ( 650, 50, 12 ), ( 650, 100, 11 ), ( 650, 150, 10 ), ( 650, 200, 9 ), ( 650, 250, 8 ), ( 650, 300, 7 ), ( 650, 350, 6 ), ( 650, 400, 5 ), ( 650, 450, 4 ), ( 650, 500, 3 ), ( 650, 550, 2 ), ( 650, 600, 1 ),

( 700, 0, 14 ), ( 700, 50, 13 ), ( 700, 100, 12 ), ( 700, 150, 11 ), ( 700, 200, 10 ), ( 700, 250, 9 ), ( 700, 300, 8 ), ( 700, 350, 7 ), ( 700, 400, 6 ), ( 700, 450, 5 ), ( 700, 500, 4 ), ( 700, 550, 3 ), ( 700, 600, 2 ), ( 700, 650, 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)