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

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

( 49, 0, 1 ),

( 98, 0, 2 ), ( 98, 49, 1 ),

( 147, 0, 3 ), ( 147, 49, 2 ), ( 147, 98, 1 ),

( 196, 0, 4 ), ( 196, 49, 3 ), ( 196, 98, 2 ), ( 196, 147, 1 ),

( 245, 0, 5 ), ( 245, 49, 4 ), ( 245, 98, 3 ), ( 245, 147, 2 ), ( 245, 196, 1 ),

( 294, 0, 6 ), ( 294, 49, 5 ), ( 294, 98, 4 ), ( 294, 147, 3 ), ( 294, 196, 2 ), ( 294, 245, 1 ),

( 343, 0, 7 ), ( 343, 49, 6 ), ( 343, 98, 5 ), ( 343, 147, 4 ), ( 343, 196, 3 ), ( 343, 245, 2 ), ( 343, 294, 1 ),

( 392, 0, 8 ), ( 392, 49, 7 ), ( 392, 98, 6 ), ( 392, 147, 5 ), ( 392, 196, 4 ), ( 392, 245, 3 ), ( 392, 294, 2 ), ( 392, 343, 1 ),

( 441, 0, 9 ), ( 441, 49, 8 ), ( 441, 98, 7 ), ( 441, 147, 6 ), ( 441, 196, 5 ), ( 441, 245, 4 ), ( 441, 294, 3 ), ( 441, 343, 2 ), ( 441, 392, 1 ),

( 490, 0, 10 ), ( 490, 49, 9 ), ( 490, 98, 8 ), ( 490, 147, 7 ), ( 490, 196, 6 ), ( 490, 245, 5 ), ( 490, 294, 4 ), ( 490, 343, 3 ), ( 490, 392, 2 ), ( 490, 441, 1 ),

( 539, 0, 11 ), ( 539, 49, 10 ), ( 539, 98, 9 ), ( 539, 147, 8 ), ( 539, 196, 7 ), ( 539, 245, 6 ), ( 539, 294, 5 ), ( 539, 343, 4 ), ( 539, 392, 3 ), ( 539, 441, 2 ), ( 539, 490, 1 ),

( 588, 0, 12 ), ( 588, 49, 11 ), ( 588, 98, 10 ), ( 588, 147, 9 ), ( 588, 196, 8 ), ( 588, 245, 7 ), ( 588, 294, 6 ), ( 588, 343, 5 ), ( 588, 392, 4 ), ( 588, 441, 3 ), ( 588, 490, 2 ), ( 588, 539, 1 ),

( 637, 0, 13 ), ( 637, 49, 12 ), ( 637, 98, 11 ), ( 637, 147, 10 ), ( 637, 196, 9 ), ( 637, 245, 8 ), ( 637, 294, 7 ), ( 637, 343, 6 ), ( 637, 392, 5 ), ( 637, 441, 4 ), ( 637, 490, 3 ), ( 637, 539, 2 ), ( 637, 588, 1 ),

( 686, 0, 14 ), ( 686, 49, 13 ), ( 686, 98, 12 ), ( 686, 147, 11 ), ( 686, 196, 10 ), ( 686, 245, 9 ), ( 686, 294, 8 ), ( 686, 343, 7 ), ( 686, 392, 6 ), ( 686, 441, 5 ), ( 686, 490, 4 ), ( 686, 539, 3 ), ( 686, 588, 2 ), ( 686, 637, 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)