Integers and Rationals

Build negative numbers and fractions by bundling pairs. Pairs naming the same number form one bundle.

Integers are bundles of pairs of naturals. Fractions are bundles of pairs of integers. Different pairs can name the same number. This bundle trick returns when the reals are built.

For example, think of 💰 money and debt. Five coins in hand and three owed is a net of two. Seven in hand and five owed is also two. Different pairs, same value.

(a,b)∼(c,d)  ⟺  a+d=b+c(a,b)\sim(c,d)\iff a+d=b+c
(a,b)∼(c,d)  ⟺  ad=bc(a,b)\sim(c,d)\iff ad=bc
p<q  ⟹  p<p+q2<qp<q \implies p<\frac{p+q}{2}<q

Part of these learning paths

Examples & Exercises

Assume (a,b)∼(a′,b′)(a,b)\sim(a',b') and (c,d)∼(c′,d′)(c,d)\sim(c',d').

Prove that (a+c,b+d)∼(a′+c′,b′+d′)(a+c,b+d)\sim(a'+c',b'+d').

(This says the addition [(a,b)]+[(c,d)]=[(a+c,b+d)][(a,b)]+[(c,d)]=[(a+c,b+d)] is well-defined, independent of the chosen representatives.)

(a,b)∼(a′,b′), (c,d)∼(c′,d′)(a,b)\sim(a',b'),\ (c,d)\sim(c',d')
(a+c,b+d)∼(a′+c′,b′+d′)(a+c,b+d)\sim(a'+c',b'+d')
Integers mode — each dot is a class of pairs, and addition is the same whichever representatives are chosen.
Show proof
  1. By definition of the relation, (a,b)∼(a′,b′)(a,b)\sim(a',b') means a+b′=a′+ba+b'=a'+b and (c,d)∼(c′,d′)(c,d)\sim(c',d') means c+d′=c′+dc+d'=c'+d.

  2. Adding the two equations side by side gives (a+b′)+(c+d′)=(a′+b)+(c′+d)(a+b')+(c+d')=(a'+b)+(c'+d). Rearranging with the associativity and commutativity of natural-number addition yields (a+c)+(b′+d′)=(a′+c′)+(b+d)(a+c)+(b'+d')=(a'+c')+(b+d).

  3. This is exactly the definition of (a+c,b+d)∼(a′+c′,b′+d′)(a+c,b+d)\sim(a'+c',b'+d'). So the value of [(a,b)]+[(c,d)][(a,b)]+[(c,d)] never depends on which representatives of the two classes are chosen — addition on Z\mathbb{Z} is well-defined.

For rationals p<qp<q, prove that m=p+q2m=\frac{p+q}{2} is rational and p<m<qp<m<q.

p<q  ⟹  p<p+q2<qp<q \implies p<\frac{p+q}{2}<q
Rationals mode, max denominator 4 — between any two rationals sits another dot.
Show proof
  1. Write p=abp=\frac{a}{b} and q=cdq=\frac{c}{d} with b>0, d>0b>0,\ d>0. Then m=p+q2=ad+bc2bdm=\frac{p+q}{2}=\frac{ad+bc}{2bd}: numerator and denominator are integers and the denominator is nonzero, so mm is rational.

  2. Since p<qp<q, adding pp to both sides gives 2p<p+q2p<p+q; dividing by the positive 22 preserves the inequality, so p<p+q2=mp<\frac{p+q}{2}=m.

  3. Likewise, adding qq to both sides of p<qp<q gives p+q<2qp+q<2q, i.e. m<qm<q.

    Hence p<m<qp<m<q — between any two rationals there is always another rational, so the rationals are dense.

    Integers lack this property (no integer lies strictly between consecutive integers).

For a nonzero rational ab\frac{a}{b}, prove that ba\frac{b}{a} is its multiplicative inverse.

ab⋅ba=1(a≠0)\frac{a}{b}\cdot\frac{b}{a}=1\qquad(a\ne 0)
Rationals mode, max denominator 4 — every nonzero dot has a multiplicative inverse.
Show proof
  1. ab≠0\frac{a}{b}\ne 0 means a≠0a\ne 0 (and b≠0b\ne 0 is part of being a rational). So the fraction ba\frac{b}{a}, whose denominator a≠0a\ne 0, is a legitimate rational.

  2. By the definition of fraction multiplication, abâ‹…ba=abba\frac{a}{b}\cdot\frac{b}{a}=\frac{ab}{ba}.

    Commutativity gives ab=baab=ba, so this fraction equals abab=1\frac{ab}{ab}=1.

    Hence ba\frac{b}{a} is the multiplicative inverse of ab\frac{a}{b}.

  3. This proves exactly the claimed statement: every nonzero rational has a multiplicative inverse, so division by a nonzero rational is always possible in Q\mathbb{Q}. The remaining field axioms (well-defined addition and multiplication, associativity, commutativity, distributivity) are not proved here; they are verified in the groups-fields scene, and only together with them does Q\mathbb{Q} become a field.

2. Number Systems