Number Systems: Construction of N, Z, and Q
The hierarchy of number systems is the primary scaffold of mathematics. While we often take natural numbers, integers, and rationals for granted, their formal construction reveals the deep interplay between set theory and arithmetic. We build these systems through a process of extension: solving equations that are unsolvable in the previous system.
1. The Natural Numbers ()
We begin with the most primitive set. In pure mathematics, we define using the Von Neumann construction:
The properties of are governed by the Peano Axioms. The most critical features are the existence of a unique successor for every number and the Principle of Mathematical Induction. In , we can perform addition and multiplication, and the set is closed under these operations. However, is not closed under subtraction (e.g., has no solution in ).
2. The Integers ()
To allow for subtraction, we extend to the Integers. Formally, we define as the set of equivalence classes of ordered pairs of natural numbers.
- An ordered pair represents the integer .
- We define an equivalence relation if .
- For example, and both represent the integer .
The set forms an Integral Domain—a commutative ring with identity and no zero divisors. It is closed under addition, multiplication, and subtraction. However, it is not closed under division (e.g., has no solution in ).
3. The Rational Numbers ()
To allow for division, we extend to the Rational Numbers. This is a specific instance of a “Field of Fractions.”
- We define as the set of equivalence classes of ordered pairs where and .
- An ordered pair represents the fraction .
- The equivalence relation holds if .
The set is a Field, meaning it supports addition, subtraction, multiplication, and division by non-zero elements.
Properties of Number Fields
Number systems are characterized by their algebraic and topological properties:
- Algebraic Closure: is not algebraically closed. For example, the equation has no solution in , leading to the necessity of the Real numbers.
- Archimedean Property: For any rational number , there exists an integer such that .
- Density: is dense in itself. Between any two distinct rational numbers and , there infinitely many other rational numbers (e.g., ).
- Countability: despite being dense, is countably infinite (). There are no more rational numbers than there are natural numbers.
The Euclidean Algorithm and Number Theory
A fundamental tool in the study of is the Euclidean Algorithm, which finds the Greatest Common Divisor (GCD) of two integers. This algorithm is the basis for:
- Bézout’s Identity: For any , there exist such that .
- The Fundamental Theorem of Arithmetic: Every integer is uniquely factorable into primes.
- Modular Arithmetic: The study of cycles and remainders, foundational for cryptography.
Computational Representation: Arbitrary Precision
In standard computation, integers are often limited to 32 or 64 bits. However, in pure mathematics and cryptography, we use Arbitrary Precision Arithmetic (BigInts) to represent numbers of any size.
/**
* Implementing a Fraction (Rational) class in Typescript
*/
class Rational {
readonly num: bigint;
readonly den: bigint;
constructor(n: bigint, d: bigint) {
if (d === 0n) throw new Error("Division by zero");
const common = Rational.gcd(n, d);
const sign = d < 0n ? -1n : 1n;
this.num = (n / common) * sign;
this.den = (d / common) * sign;
}
private static gcd(a: bigint, b: bigint): bigint {
a = a < 0n ? -a : a;
b = b < 0n ? -b : b;
while (b > 0n) {
a %= b;
[a, b] = [b, a];
}
return a;
}
add(other: Rational): Rational {
return new Rational(this.num * other.den + other.num * this.den, this.den * other.den);
}
}
Knowledge Check
In the formal construction of the integers (ℤ) from natural numbers (ℕ), what mathematical structure is used to represent an integer?
By understanding the construction of these systems, we see that numbers are not arbitrary symbols but formal objects derived from set-theoretic operations. This structural perspective allows us to expand our systems further into Reals, Complex numbers, and beyond, ensuring that each step is logically sound.