nLab rational number

Rational numbers

Context

Arithmetic

Algebra

Rational numbers

Definition

A rational number is a fraction of two integer numbers.

As a field

The field of rational numbers, \mathbb{Q}, is the field of fractions of the commutative ring of integers, \mathbb{Z}, hence the field consisting of formal fractions (“ratios”) of integers.

As a commutative ring

Let ( +,1: +,s: + +)(\mathbb{N}^+,1:\mathbb{N}^+,s:\mathbb{N}^+\to \mathbb{N}^+) be the set of positive integers. The positive integers are embedded into every commutative ring RR: there is an injection inj: +Rinj:\mathbb{N}^+\to\R such that inj(1)=1inj(1) = 1 and inj(s(n))=inj(n)+1inj(s(n)) = inj(n) + 1 for all n: +n:\mathbb{N}^+.

Suppose RR has an injection inv: +Rinv:\mathbb{N}^+\to\R such that inj(n)inv(n)=1inj(n) \cdot inv(n) = 1 and inv(n)inj(n)=1\inv(n) \cdot \inj(n) = 1 for all n: +n:\mathbb{N}^+. Then RR is called a \mathbb{Q} -algebra, and the commutative ring of rational numbers \mathbb{Q} is the initial commutative \mathbb{Q}-algebra.

It can then be proven from the ring axioms and the properties of the integers that every rational number apart from zero and has a multiplicative inverse, making \mathbb{Q} a field.

As an directed colimit in CRing

Let (,)(\mathbb{N},\leq) be the directed set of positive integers, and let A:CRingA:\mathbb{N}\to CRing be a family of commutative rings where A nA_n is defined to be [1/n!]\mathbb{Z}[1/n!], the localization of the integers \mathbb{Z} away from the factorial n!n!, and for i,j:i, j:\mathbb{N}, iji\leq j, there is a commutative ring homomorphism from f ij:[1/i!][1/j!]f_{ij}:\mathbb{Z}[1/i!]\to\mathbb{Z}[1/j!], with f iif_{ii} being the identity commutative ring homomorphism on [1/i!]\mathbb{Z}[1/i!]. Then the commutative ring of rational numbers \mathbb{Q} is the directed colimit lim iA i\underset{\to}\lim_i A_i of the system.

As an abelian group

Let ( +,1: +,s: + +)(\mathbb{N}^+,1:\mathbb{N}^+,s:\mathbb{N}^+\to \mathbb{N}^+) be the set of positive integers and let (,0,+,,1)(\mathbb{Z},0,+,-,1) be the free abelian group on the set 1{1}.

Let AA be an abelian group containing \mathbb{Z} as an abelian subgroup. The positive integers are embedded into the function abelian group AAA \to A, with id A:AAid_A:A \to A being the identity function on AA; i.e. there is an injection inj: +(AA)inj:\mathbb{N}^+\to (A \to A) such that inj(1)=id Ainj(1) = id_A and inj(s(n))=inj(n)+id Ainj(s(n)) = inj(n) + id_A for all n: +n:\mathbb{N}^+.

Suppose AA has an injection inv: +(AA)inv:\mathbb{N}^+\to (A \to A) such that for all n: +n:\mathbb{N}^+, inj(n)inv(n)=id Ainj(n) \circ inv(n) = id_A and inv(n)inj(n)=id Ainv(n) \circ inj(n) = id_A. Then the abelian group of rational numbers \mathbb{Q} is the initial such abelian group.

As an initial object in a category

Let \mathbb{Z} be the integers and let

#0{a|a<00<a}\mathbb{Z}_{#0} \coloneqq \{a \in \mathbb{Z} \vert a \lt 0 \vee 0 \lt a \}

be the set of integers apart from zero.

For lack of a better name, let us define a set with rational numbers to be a set AA with a function ι× #0A\iota \in \mathbb{Z} \times \mathbb{Z}_{#0} \to A with domain the Cartesian product × #0\mathbb{Z} \times \mathbb{Z}_{#0} and codomain AA, such that

a.b #0.c.d #0.(ad=cb)(ι(a,b)=ι(c,d))\forall a \in \mathbb{Z}. \forall b \in \mathbb{Z}_{#0}. \forall c \in \mathbb{Z}. \forall d \in \mathbb{Z}_{#0}. (a \cdot d = c \cdot b) \implies (\iota(a, b) = \iota(c, d))

A homomorphism of sets with rational numbers between two sets with rational numbers AA and BB is a function fB Af \in B^A such that

a.b #0.f(ι A(a,b))=ι B(a,b)\forall a \in \mathbb{Z}. \forall b \in \mathbb{Z}_{#0}. f(\iota_A(a, b)) = \iota_B(a, b)

The category of sets with rational numbers is the category SwRNSwRN whose objects Ob(SwRN)Ob(SwRN) are sets with rational numbers and whose morphisms Mor(A,B)Mor(A,B) for sets with rational numbers AOb(SwDF)A \in Ob(SwDF), BOb(SwRN)B \in Ob(SwRN) are homomorphisms of sets with rational numbers. The set of rational numbers, denoted \mathbb{Q}, is defined as the initial object in the category of sets with rational numbers.

As a higher inductive type

In homotopy type theory, the type of rational numbers, denoted \mathbb{Q}, is defined (UBP13, §11.1) as the higher inductive type generated by:

  • A function ()/():× 0(-)/(-) : \mathbb{Z} \times \mathbb{Z}_{\neq 0} \rightarrow \mathbb{Q}, where

    0 a:max(a,a)>0\mathbb{Z}_{\neq 0} \coloneqq \sum_{a:\mathbb{Z}} \max(a,-a) \gt 0
  • A dependent product of functions between identities representing that equivalent fractions are equal:

    equivfrac: a: b: 0 c: d: 0(ai(d)=ci(b))(a/b=c/d),equivfrac : \prod_{a:\mathbb{Z}} \prod_{b:\mathbb{Z}_{\neq 0}} \prod_{c:\mathbb{Z}} \prod_{d:\mathbb{Z}_{\neq 0}} (a \cdot i(d) = c \cdot i(b)) \to (a/b = c/d)\,,

    where i: 0i: \mathbb{Z}_{\neq 0} \to \mathbb{Z} is the inclusion of the nonzero integers in the integers.

  • A set-truncator

    τ 0: a: b:isProp(a=b)\tau_0: \prod_{a:\mathbb{Q}} \prod_{b:\mathbb{Q}} isProp(a=b)

Properties

Commutative ring structure on the rational numbers

Definition

The rational number zero 00 \in \mathbb{Q} is defined as

00/10 \coloneqq 0/1
Definition

The binary operation addition ()+():×(-)+(-):\mathbb{Q} \times \mathbb{Q} \to \mathbb{Q} is defined as

a/b+c/d(ai(d)+ci(b))/(bd)a/b + c/d \coloneqq (a \cdot i(d) + c \cdot i(b))/(b \cdot d)

for aina \ in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}, cc \in \mathbb{Z}, d #0d \in \mathbb{Z}_{#0}.

Proposition

For any qq \in \mathbb{Q} and rr \in \mathbb{Q}, q+r=r+qq + r = r + q.

Proof

TODO

Definition

The unary operation negation ():-(-):\mathbb{Q} \to \mathbb{Q} is defined as

(a/b)(a)/b-(a/b) \coloneqq (-a)/b

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}

Definition

The binary operation subtraction ()():×(-)-(-):\mathbb{Q} \times \mathbb{Q} \to \mathbb{Q} is defined as

a/bc/d(ai(d)ci(b))/(bd)a/b - c/d \coloneqq (a \cdot i(d) - c \cdot i(b))/(b \cdot d)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}, cc \in \mathbb{Z}, d #0d \in \mathbb{Z}_{#0}

Definition

The rational number one 11 \in \mathbb{Q} is defined as

11/11 \coloneqq 1/1
Definition

The binary operation multiplication ()():×(-)\cdot(-):\mathbb{Q} \times \mathbb{Q} \to \mathbb{Q} is defined as

a/bc/d(ac)/(bd)a/b \cdot c/d \coloneqq (a \cdot c)/(b \cdot d)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}, cc \in \mathbb{Z}, d #0d \in \mathbb{Z}_{#0}

Definition

The right \mathbb{N}-action exponentiation () ():×(-)^{(-)}:\mathbb{Q} \times \mathbb{N} \to \mathbb{Q} is defined as

(a/b) n(a n)/(b n)(a/b)^n \coloneqq (a^n)/(b^n)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}, nn \in \mathbb{N}.

This makes the rational numbers into a commutative ring.

Order structure on the rational numbers

Definition

The predicate is positive, denoted as isPositive(a/b)isPositive(a/b), is defined as

isPositive(a/b)(a>0)(i(b)>0)(a<0)(i(b)<0)isPositive(a/b) \coloneqq (a \gt 0) \wedge (i(b) \gt 0) \vee (a \lt 0) \wedge (i(b) \lt 0)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}.

Definition

The predicate is negative, denoted as isNegative(a/b)isNegative(a/b), is defined as

isNegative(a/b)(a>0)(i(b)<0)(a<0)(i(b)>0)isNegative(a/b) \coloneqq (a \gt 0) \wedge (i(b) \lt 0) \vee (a \lt 0) \wedge (i(b) \gt 0)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}.

Definition

The predicate is zero, denoted as isZero(a/b)isZero(a/b), is defined as

isZero(a/b)a=0isZero(a/b) \coloneqq a = 0

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}.

Definition

The predicate is non-positive, denoted as isNonPositive(a/b)isNonPositive(a/b) is defined as

isNonPositive(a/b)¬isPositive(a/b)isNonPositive(a/b) \coloneqq \neg isPositive(a/b)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}.

Definition

The predicate is non-negative, denoted as isNonNegative(a/b)isNonNegative(a/b), is defined as

isNonNegative(a/b)¬isNegative(a/b)isNonNegative(a/b) \coloneqq \neg isNegative(a/b)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}.

Definition

The predicate is non-zero, denoted as isNonZero(a/b)isNonZero(a/b), is defined as

isNonZero(a/b)isPositive(a/b)isNegative(a/b)isNonZero(a/b) \coloneqq isPositive(a/b) \vee isNegative(a/b)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}.

Definition

The relation is less than, denoted as p<qp \lt q, is defined as

p<qisPositive(qp)p \lt q \coloneqq isPositive(q - p)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Definition

The dependent type is greater than, denoted as p>qp \gt q, is defined as

p<qisNegative(qp)p \lt q \coloneqq isNegative(q - p)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Definition

The dependent type is apart from, denoted as p#qp \# q, is defined as

p<qisNonZero(qp)p \lt q \coloneqq isNonZero(q - p)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Definition

The dependent type is less than or equal to, denoted as pqp \leq q, is defined as

p<qisNonNegative(qp)p \lt q \coloneqq isNonNegative(q - p)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Definition

The dependent type is greater than or equal to, denoted as pqp \leq q, is defined as

p<qisNonPositive(qp)p \lt q \coloneqq isNonPositive(q - p)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Pseudolattice structure on the rational numbers

Definition

The ramp function ramp:ramp:\mathbb{Q} \to \mathbb{Q} is defined as

ramp(a/b)(ramp(a)ramp(i(b))+ramp(a)ramp(i(b)))/(bb)ramp(a/b) \coloneqq (ramp(a) \cdot ramp(i(b)) + ramp(-a) \cdot ramp(i(-b)))/(b \cdot b)

for aa \in \mathbb{Z}, b #0b \in \mathbb{Z}_{#0}, ramp:ramp:\mathbb{Z} \to \mathbb{Z}.

Definition

The minimum min:×min:\mathbb{Q} \times \mathbb{Q} \to \mathbb{Q} is defined as

min(p,q)pramp(pq)min(p,q) \coloneqq p - ramp(p - q)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Definition

The maximum max:×max:\mathbb{Q} \times \mathbb{Q} \to \mathbb{Q} is defined as

max(p,q)p+ramp(qp)max(p, q) \coloneqq p + ramp(q - p)

for p:p:\mathbb{Q}, q:q:\mathbb{Q}.

Definition

The absolute value |()|:\vert(-)\vert:\mathbb{Q} \to \mathbb{Q} is defined as

|p|max(p,p)\vert p \vert \coloneqq max(p, -p)

for p:p:\mathbb{Q}.

Algebraic closure

The algebraic closure ¯\overline{\mathbb{Q}} of the rational numbers is called the field of algebraic numbers. The absolute Galois group Gal(¯|)Gal(\overline{\mathbb{Q}}\vert \mathbb{Q}) has some curious properties, see there.

Topologies

There are several interesting topologies on \mathbb{Q} that make \mathbb{Q} into a topological group under addition, allowing us to define interesting fields by taking the completion with respect to this topology:

  1. The discrete topology is the most obvious, which is already complete.

  2. The absolute-value topology is defined by the metric d(x,y)|xy|d(x,y) \coloneqq {|x - y|}; the completion is the field of real numbers. The rational numbers are thus a Hausdorff space.

    (This topology is totally disconnected (this exmpl.))

  3. Fixing a prime number pp, the pp-adic topology is defined by the ultrametric d(x,y)1/nd(x,y) \coloneqq 1/n where nn is the highest exponent on pp in the prime factorization of |xy|{|x - y|}; the completion is the field of pp-adic numbers.

According to Ostrowski's theorem this are the only possibilities.

Interestingly, (2) cannot be interpreted as a localic group, although the completion \mathbb{R} can. (Probably the same holds for (3); I need to check.)

Analysis

One could analytically define the concepts of limit of a function and continuous function with respect to the absolute-value topology, and prove that the limit of a function satisfy the algebraic limit theorem. Since the reciprocal function on the rational numbers is well defined for non-zero rational numbers 0\mathbb{Q}_{\neq 0}, given a continuous function f:If:I \to \mathbb{Q} for open interval II \subseteq \mathbb{Q} the difference quotient function exists and thus the derivative is well-defined for continuous functions. One could thus define smooth functions on the rational numbers, and because the rational numbers are a Hausdorff space, analytic functions on the rational numbers, despite the fact that the rational numbers are a totally disconnected space.

References

Discussion in homotopy type theory:

See also:

Last revised on June 16, 2022 at 17:47:05. See the history of this page for a list of all contributions to it.