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

46/11 = (46-0)/11 = {

( 46, 0, 11 ),

( 92, 0, 22 ), ( 92, 46, 11 ),

( 138, 0, 33 ), ( 138, 46, 22 ), ( 138, 92, 11 ),

( 184, 0, 44 ), ( 184, 46, 33 ), ( 184, 92, 22 ), ( 184, 138, 11 ),

( 230, 0, 55 ), ( 230, 46, 44 ), ( 230, 92, 33 ), ( 230, 138, 22 ), ( 230, 184, 11 ),

( 276, 0, 66 ), ( 276, 46, 55 ), ( 276, 92, 44 ), ( 276, 138, 33 ), ( 276, 184, 22 ), ( 276, 230, 11 ),

( 322, 0, 77 ), ( 322, 46, 66 ), ( 322, 92, 55 ), ( 322, 138, 44 ), ( 322, 184, 33 ), ( 322, 230, 22 ), ( 322, 276, 11 ),

( 368, 0, 88 ), ( 368, 46, 77 ), ( 368, 92, 66 ), ( 368, 138, 55 ), ( 368, 184, 44 ), ( 368, 230, 33 ), ( 368, 276, 22 ), ( 368, 322, 11 ),

( 414, 0, 99 ), ( 414, 46, 88 ), ( 414, 92, 77 ), ( 414, 138, 66 ), ( 414, 184, 55 ), ( 414, 230, 44 ), ( 414, 276, 33 ), ( 414, 322, 22 ), ( 414, 368, 11 ),

( 460, 0, 110 ), ( 460, 46, 99 ), ( 460, 92, 88 ), ( 460, 138, 77 ), ( 460, 184, 66 ), ( 460, 230, 55 ), ( 460, 276, 44 ), ( 460, 322, 33 ), ( 460, 368, 22 ), ( 460, 414, 11 ),

( 506, 0, 121 ), ( 506, 46, 110 ), ( 506, 92, 99 ), ( 506, 138, 88 ), ( 506, 184, 77 ), ( 506, 230, 66 ), ( 506, 276, 55 ), ( 506, 322, 44 ), ( 506, 368, 33 ), ( 506, 414, 22 ), ( 506, 460, 11 ),

( 552, 0, 132 ), ( 552, 46, 121 ), ( 552, 92, 110 ), ( 552, 138, 99 ), ( 552, 184, 88 ), ( 552, 230, 77 ), ( 552, 276, 66 ), ( 552, 322, 55 ), ( 552, 368, 44 ), ( 552, 414, 33 ), ( 552, 460, 22 ), ( 552, 506, 11 ),

( 598, 0, 143 ), ( 598, 46, 132 ), ( 598, 92, 121 ), ( 598, 138, 110 ), ( 598, 184, 99 ), ( 598, 230, 88 ), ( 598, 276, 77 ), ( 598, 322, 66 ), ( 598, 368, 55 ), ( 598, 414, 44 ), ( 598, 460, 33 ), ( 598, 506, 22 ), ( 598, 552, 11 ),

( 644, 0, 154 ), ( 644, 46, 143 ), ( 644, 92, 132 ), ( 644, 138, 121 ), ( 644, 184, 110 ), ( 644, 230, 99 ), ( 644, 276, 88 ), ( 644, 322, 77 ), ( 644, 368, 66 ), ( 644, 414, 55 ), ( 644, 460, 44 ), ( 644, 506, 33 ), ( 644, 552, 22 ), ( 644, 598, 11 ),

...

}

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)