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

22/15 = (22-0)/15 = {

( 22, 0, 15 ),

( 44, 0, 30 ), ( 44, 22, 15 ),

( 66, 0, 45 ), ( 66, 22, 30 ), ( 66, 44, 15 ),

( 88, 0, 60 ), ( 88, 22, 45 ), ( 88, 44, 30 ), ( 88, 66, 15 ),

( 110, 0, 75 ), ( 110, 22, 60 ), ( 110, 44, 45 ), ( 110, 66, 30 ), ( 110, 88, 15 ),

( 132, 0, 90 ), ( 132, 22, 75 ), ( 132, 44, 60 ), ( 132, 66, 45 ), ( 132, 88, 30 ), ( 132, 110, 15 ),

( 154, 0, 105 ), ( 154, 22, 90 ), ( 154, 44, 75 ), ( 154, 66, 60 ), ( 154, 88, 45 ), ( 154, 110, 30 ), ( 154, 132, 15 ),

( 176, 0, 120 ), ( 176, 22, 105 ), ( 176, 44, 90 ), ( 176, 66, 75 ), ( 176, 88, 60 ), ( 176, 110, 45 ), ( 176, 132, 30 ), ( 176, 154, 15 ),

( 198, 0, 135 ), ( 198, 22, 120 ), ( 198, 44, 105 ), ( 198, 66, 90 ), ( 198, 88, 75 ), ( 198, 110, 60 ), ( 198, 132, 45 ), ( 198, 154, 30 ), ( 198, 176, 15 ),

( 220, 0, 150 ), ( 220, 22, 135 ), ( 220, 44, 120 ), ( 220, 66, 105 ), ( 220, 88, 90 ), ( 220, 110, 75 ), ( 220, 132, 60 ), ( 220, 154, 45 ), ( 220, 176, 30 ), ( 220, 198, 15 ),

( 242, 0, 165 ), ( 242, 22, 150 ), ( 242, 44, 135 ), ( 242, 66, 120 ), ( 242, 88, 105 ), ( 242, 110, 90 ), ( 242, 132, 75 ), ( 242, 154, 60 ), ( 242, 176, 45 ), ( 242, 198, 30 ), ( 242, 220, 15 ),

( 264, 0, 180 ), ( 264, 22, 165 ), ( 264, 44, 150 ), ( 264, 66, 135 ), ( 264, 88, 120 ), ( 264, 110, 105 ), ( 264, 132, 90 ), ( 264, 154, 75 ), ( 264, 176, 60 ), ( 264, 198, 45 ), ( 264, 220, 30 ), ( 264, 242, 15 ),

( 286, 0, 195 ), ( 286, 22, 180 ), ( 286, 44, 165 ), ( 286, 66, 150 ), ( 286, 88, 135 ), ( 286, 110, 120 ), ( 286, 132, 105 ), ( 286, 154, 90 ), ( 286, 176, 75 ), ( 286, 198, 60 ), ( 286, 220, 45 ), ( 286, 242, 30 ), ( 286, 264, 15 ),

( 308, 0, 210 ), ( 308, 22, 195 ), ( 308, 44, 180 ), ( 308, 66, 165 ), ( 308, 88, 150 ), ( 308, 110, 135 ), ( 308, 132, 120 ), ( 308, 154, 105 ), ( 308, 176, 90 ), ( 308, 198, 75 ), ( 308, 220, 60 ), ( 308, 242, 45 ), ( 308, 264, 30 ), ( 308, 286, 15 ),

...

}

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)