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

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

( 43, 0, 11 ),

( 86, 0, 22 ), ( 86, 43, 11 ),

( 129, 0, 33 ), ( 129, 43, 22 ), ( 129, 86, 11 ),

( 172, 0, 44 ), ( 172, 43, 33 ), ( 172, 86, 22 ), ( 172, 129, 11 ),

( 215, 0, 55 ), ( 215, 43, 44 ), ( 215, 86, 33 ), ( 215, 129, 22 ), ( 215, 172, 11 ),

( 258, 0, 66 ), ( 258, 43, 55 ), ( 258, 86, 44 ), ( 258, 129, 33 ), ( 258, 172, 22 ), ( 258, 215, 11 ),

( 301, 0, 77 ), ( 301, 43, 66 ), ( 301, 86, 55 ), ( 301, 129, 44 ), ( 301, 172, 33 ), ( 301, 215, 22 ), ( 301, 258, 11 ),

( 344, 0, 88 ), ( 344, 43, 77 ), ( 344, 86, 66 ), ( 344, 129, 55 ), ( 344, 172, 44 ), ( 344, 215, 33 ), ( 344, 258, 22 ), ( 344, 301, 11 ),

( 387, 0, 99 ), ( 387, 43, 88 ), ( 387, 86, 77 ), ( 387, 129, 66 ), ( 387, 172, 55 ), ( 387, 215, 44 ), ( 387, 258, 33 ), ( 387, 301, 22 ), ( 387, 344, 11 ),

( 430, 0, 110 ), ( 430, 43, 99 ), ( 430, 86, 88 ), ( 430, 129, 77 ), ( 430, 172, 66 ), ( 430, 215, 55 ), ( 430, 258, 44 ), ( 430, 301, 33 ), ( 430, 344, 22 ), ( 430, 387, 11 ),

( 473, 0, 121 ), ( 473, 43, 110 ), ( 473, 86, 99 ), ( 473, 129, 88 ), ( 473, 172, 77 ), ( 473, 215, 66 ), ( 473, 258, 55 ), ( 473, 301, 44 ), ( 473, 344, 33 ), ( 473, 387, 22 ), ( 473, 430, 11 ),

( 516, 0, 132 ), ( 516, 43, 121 ), ( 516, 86, 110 ), ( 516, 129, 99 ), ( 516, 172, 88 ), ( 516, 215, 77 ), ( 516, 258, 66 ), ( 516, 301, 55 ), ( 516, 344, 44 ), ( 516, 387, 33 ), ( 516, 430, 22 ), ( 516, 473, 11 ),

( 559, 0, 143 ), ( 559, 43, 132 ), ( 559, 86, 121 ), ( 559, 129, 110 ), ( 559, 172, 99 ), ( 559, 215, 88 ), ( 559, 258, 77 ), ( 559, 301, 66 ), ( 559, 344, 55 ), ( 559, 387, 44 ), ( 559, 430, 33 ), ( 559, 473, 22 ), ( 559, 516, 11 ),

( 602, 0, 154 ), ( 602, 43, 143 ), ( 602, 86, 132 ), ( 602, 129, 121 ), ( 602, 172, 110 ), ( 602, 215, 99 ), ( 602, 258, 88 ), ( 602, 301, 77 ), ( 602, 344, 66 ), ( 602, 387, 55 ), ( 602, 430, 44 ), ( 602, 473, 33 ), ( 602, 516, 22 ), ( 602, 559, 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)