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

47/26 = (47-0)/26 = {

( 47, 0, 26 ),

( 94, 0, 52 ), ( 94, 47, 26 ),

( 141, 0, 78 ), ( 141, 47, 52 ), ( 141, 94, 26 ),

( 188, 0, 104 ), ( 188, 47, 78 ), ( 188, 94, 52 ), ( 188, 141, 26 ),

( 235, 0, 130 ), ( 235, 47, 104 ), ( 235, 94, 78 ), ( 235, 141, 52 ), ( 235, 188, 26 ),

( 282, 0, 156 ), ( 282, 47, 130 ), ( 282, 94, 104 ), ( 282, 141, 78 ), ( 282, 188, 52 ), ( 282, 235, 26 ),

( 329, 0, 182 ), ( 329, 47, 156 ), ( 329, 94, 130 ), ( 329, 141, 104 ), ( 329, 188, 78 ), ( 329, 235, 52 ), ( 329, 282, 26 ),

( 376, 0, 208 ), ( 376, 47, 182 ), ( 376, 94, 156 ), ( 376, 141, 130 ), ( 376, 188, 104 ), ( 376, 235, 78 ), ( 376, 282, 52 ), ( 376, 329, 26 ),

( 423, 0, 234 ), ( 423, 47, 208 ), ( 423, 94, 182 ), ( 423, 141, 156 ), ( 423, 188, 130 ), ( 423, 235, 104 ), ( 423, 282, 78 ), ( 423, 329, 52 ), ( 423, 376, 26 ),

( 470, 0, 260 ), ( 470, 47, 234 ), ( 470, 94, 208 ), ( 470, 141, 182 ), ( 470, 188, 156 ), ( 470, 235, 130 ), ( 470, 282, 104 ), ( 470, 329, 78 ), ( 470, 376, 52 ), ( 470, 423, 26 ),

( 517, 0, 286 ), ( 517, 47, 260 ), ( 517, 94, 234 ), ( 517, 141, 208 ), ( 517, 188, 182 ), ( 517, 235, 156 ), ( 517, 282, 130 ), ( 517, 329, 104 ), ( 517, 376, 78 ), ( 517, 423, 52 ), ( 517, 470, 26 ),

( 564, 0, 312 ), ( 564, 47, 286 ), ( 564, 94, 260 ), ( 564, 141, 234 ), ( 564, 188, 208 ), ( 564, 235, 182 ), ( 564, 282, 156 ), ( 564, 329, 130 ), ( 564, 376, 104 ), ( 564, 423, 78 ), ( 564, 470, 52 ), ( 564, 517, 26 ),

( 611, 0, 338 ), ( 611, 47, 312 ), ( 611, 94, 286 ), ( 611, 141, 260 ), ( 611, 188, 234 ), ( 611, 235, 208 ), ( 611, 282, 182 ), ( 611, 329, 156 ), ( 611, 376, 130 ), ( 611, 423, 104 ), ( 611, 470, 78 ), ( 611, 517, 52 ), ( 611, 564, 26 ),

( 658, 0, 364 ), ( 658, 47, 338 ), ( 658, 94, 312 ), ( 658, 141, 286 ), ( 658, 188, 260 ), ( 658, 235, 234 ), ( 658, 282, 208 ), ( 658, 329, 182 ), ( 658, 376, 156 ), ( 658, 423, 130 ), ( 658, 470, 104 ), ( 658, 517, 78 ), ( 658, 564, 52 ), ( 658, 611, 26 ),

...

}

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)