Tutorials › Topology (Undergraduate) › Rational Intervals as a Basis for the Real Line

Bases and Subbases · Tutorial 132 of 799

Rational Intervals as a Basis for the Real Line

Learn why rational endpoints suffice to build every usual open set on the real line, and why the resulting basis is countable.

Intermediate 11 min read

What You'll Learn

  • State the basis test for a collection of intervals in the usual topology on the real line
  • Use density of the rationals to find a rational interval inside a given open neighborhood
  • Prove that the family of rational-endpoint open intervals is countable
  • Express a usual open set as a union of rational-endpoint intervals
  • Identify and correct a common endpoint error in basis arguments

Why Rational Endpoints Are Enough

An open interval in \(\mathbb{R}\) can have any real numbers as its endpoints. Yet, to describe the usual topology, it is enough to use intervals whose endpoints are rational. The reason is local: whenever a point lies in an open set, there is a smaller interval around that point whose two endpoints are rational and which still lies inside the open set. This tutorial proves that fact, checks that there are only countably many such intervals, and uses them to describe usual open sets.

Throughout, \(\mathbb{R}\) has its usual topology, whose open sets are unions of open intervals. A collection \(\mathcal{B}\) of open subsets of \(\mathbb{R}\) is a basis for this topology if, for every open set \(U\) and every \(x\in U\), some \(B\in\mathcal{B}\) satisfies \(x\in B\subseteq U\). Equivalently, each usual open set is a union of members of \(\mathcal{B}\). We will use the density of \(\mathbb{Q}\): between any two distinct real numbers there is a rational number.

Definition: The rational-interval family is \(\mathcal{B}_{\mathbb{Q}}=\{(p,q):p,q\in\mathbb{Q},\ p<q\}\). Each member is an open interval in the usual topology on \(\mathbb{R}\). We will show that this family is countable and is a basis for that topology.

Rational Density Gives Local Basis Intervals

Here is the specific use of density. Suppose \(U\) is usual open and \(x\in U\). Since \(U\) is open, there is an \(\varepsilon>0\) such that \((x-\varepsilon,x+\varepsilon)\subseteq U\). Density supplies a rational \(p\) between \(x-\varepsilon\) and \(x\), and a rational \(q\) between \(x\) and \(x+\varepsilon\). The inequalities give \(p<x<q\), so \(x\in(p,q)\). They also give \((p,q)\subseteq(x-\varepsilon,x+\varepsilon)\subseteq U\). Both endpoints are rational, as required.

Theorem (Rational intervals form a basis): The family \(\mathcal{B}_{\mathbb{Q}}\) is a basis for the usual topology on \(\mathbb{R}\).

Proof. Every member \((p,q)\) of \(\mathcal{B}_{\mathbb{Q}}\) is usual open because \(p<q\). Let \(U\) be any usual open set and let \(x\in U\). By openness, there is \(\varepsilon>0\) with \((x-\varepsilon,x+\varepsilon)\subseteq U\). By density of \(\mathbb{Q}\), choose \(p,q\in\mathbb{Q}\) with \(x-\varepsilon<p<x\) and \(x<q<x+\varepsilon\). Then \(x\in(p,q)\subseteq U\). Thus every point of every usual open set lies in a rational-endpoint interval contained in that set, which is the basis test. The empty open set is the union of no basis elements, so it also satisfies the union description. \(\square\)

The density statement used here follows from the Archimedean property of the real numbers. To make explicit how it enters, take \(a,b\in\mathbb{R}\) with \(a<b\). Choose \(n\in\mathbb{N}\) so that \(n(b-a)>1\). Let \(m=\lfloor na\rfloor+1\), where \(\lfloor na\rfloor\) is the greatest integer at most \(na\). Then \(na<m\leq na+1<nb\). Dividing by the positive integer \(n\) gives \(a<m/n<b\), and \(m/n\in\mathbb{Q}\). This proves that at least one rational lies strictly between any two distinct real numbers.

Why the Basis Is Countable

Countability concerns the number of intervals in the family, not the number of points in any one interval. Each interval is specified by an ordered pair \((p,q)\) of rationals with \(p<q\). The rationals are countable: for example, each rational can be written as a reduced fraction \(m/n\) with \(m\in\mathbb{Z}\) and \(n\in\mathbb{N}\), and integer pairs can be listed in order of increasing \(|m|+n\), resolving the finitely many ties in any fixed order. Each level contains finitely many such pairs, and every rational occurs in this list.

For completeness, pairs from any countable list can also be listed: write the first list as \(r_1,r_2,\ldots\), and list \((r_i,r_j)\) in order of increasing \(i+j\), resolving ties by increasing \(i\). For each fixed sum there are finitely many pairs, and every pair appears. Therefore \(\mathbb{Q}\times\mathbb{Q}\) is countable. The rational-interval family is the image of the subset of these pairs satisfying \(p<q\) under the assignment \((p,q)\mapsto(p,q)\). Hence \(\mathcal{B}_{\mathbb{Q}}\) is countable. Different pairs specify different intervals: if \((p,q)=(r,s)\), their left endpoints and right endpoints agree, so \(p=r\) and \(q=s\).

Theorem (Countable basis): The usual topology on \(\mathbb{R}\) has a countable basis, namely \(\mathcal{B}_{\mathbb{Q}}\).

Proof. The rational-interval theorem shows that \(\mathcal{B}_{\mathbb{Q}}\) is a basis for the usual topology. The countability argument above shows that its members can be listed using a countable list of rational pairs. Thus it is a countable basis. \(\square\)

Worked Applications

Worked Example: A Rational Interval Around an Irrational Point

Find a rational-endpoint interval that contains \(\sqrt{2}\) and is contained in the open neighborhood \(U=(1,3/2)\) of \(\sqrt{2}\).

First verify that the point is in the neighborhood. Since \(1^2=1<2\), we have \(1<\sqrt{2}\). Also \(2<9/4=(3/2)^2\), so \(\sqrt{2}<3/2\). Now choose rational endpoints \(7/5\) and \(3/2\). The first is less than \(\sqrt{2}\), because \((7/5)^2=49/25<50/25=2\); the second is greater than \(\sqrt{2}\), as just shown. Therefore \(\sqrt{2}\in(7/5,3/2)\). Since \(1<7/5\), every point of \((7/5,3/2)\) also lies in \((1,3/2)\). Thus \((7/5,3/2)\) is the required basis interval. The strict upper endpoint causes no problem: neither interval includes \(3/2\).

Check: \(7/5\) and \(3/2\) are rational, \(7/5<\sqrt{2}<3/2\), and \((7/5,3/2)\subseteq(1,3/2)\).

Worked Example: Finding a Basis Interval Inside an Open Set

Let \(O=(\sqrt{2},2)\) and \(x=11/7\). Verify that \(x\in O\), then find a rational-endpoint interval containing \(x\) and contained in \(O\).

The inequality \(3/2<11/7\) follows from \(21/14<22/14\). Also \(11/7<2\), since \(11<14\). As \(3/2>\sqrt{2}\) (because \((3/2)^2=9/4>2\)), these inequalities show \(\sqrt{2}<x<2\). Choose \((3/2,8/5)\). Its endpoints are rational, and \(3/2<11/7\) as checked. For the other side, \(11/7<8/5\) because \(55/35<56/35\). Thus \(x\in(3/2,8/5)\). Every point in that interval is greater than \(3/2>\sqrt{2}\) and less than \(8/5<2\). Hence \((3/2,8/5)\subseteq O\).

Check: The interval contains \(11/7\), its lower endpoint is greater than \(\sqrt{2}\), and its upper endpoint satisfies \(8/5<2\). It therefore meets both the containment and the membership requirements.

Worked Example: Writing an Open Interval as a Union

Show that \((0,1)\) is the union of the rational-endpoint intervals that it contains. Then locate one such interval around \(x=\sqrt{2}/2\).

Let \(\mathcal{C}=\{(p,q):p,q\in\mathbb{Q},\ 0\leq p<q\leq1\}\). Every interval in \(\mathcal{C}\) is contained in \((0,1)\): any point \(y\in(p,q)\) satisfies \(0\leq p<y<q\leq1\), and hence \(0<y<1\). This proves \(\bigcup_{J\in\mathcal{C}}J\subseteq(0,1)\).

Conversely, take any \(x\in(0,1)\). The basis theorem applied to the open set \((0,1)\) gives a rational-endpoint interval \((p,q)\) with \(x\in(p,q)\subseteq(0,1)\). Its containment in \((0,1)\) implies \(0\leq p<q\leq1\), so \((p,q)\in\mathcal{C}\). Thus \(x\in\bigcup_{J\in\mathcal{C}}J\), proving the reverse inclusion and the claimed equality.

For the particular point \(x=\sqrt{2}/2\), compare squares: \(2/3<\sqrt{2}/2\) because \(4/9<1/2\), equivalently \(8<9\); and \(\sqrt{2}/2<3/4\) because \(1/2<9/16\), equivalently \(8<9\). Therefore \(\sqrt{2}/2\in(2/3,3/4)\), and this interval is contained in \((0,1)\).

Check: Both endpoints \(2/3\) and \(3/4\) are rational, and \(0<2/3<\sqrt{2}/2<3/4<1\). The chosen interval is one of the intervals in \(\mathcal{C}\).

The Union Description and a Common Pitfall

The basis property gives a precise description of every usual open set. If \(U\) is usual open, then \(U=\bigcup\{(p,q)\in\mathcal{B}_{\mathbb{Q}}:(p,q)\subseteq U\}\). Every interval in this union is contained in \(U\), so the union is contained in \(U\). For the reverse inclusion, each \(x\in U\) belongs to some rational-endpoint interval contained in \(U\), by the basis theorem. When \(U=\varnothing\), the displayed union is empty, as required.

Common pitfall. A basis interval must be contained in the given open set, not merely contain the point under consideration. For example, for \(U=(0,1)\) and \(x=1/2\), the interval \((-1,2)\) contains \(x\) and has rational endpoints, but \((-1,2)\not\subseteq(0,1)\). It does not establish the basis condition. The interval \((1/3,2/3)\) does work: \(1/3<1/2<2/3\), and \(0<1/3<2/3<1\), so \((1/3,2/3)\subseteq(0,1)\).

The countability of the basis does not mean that an open set is necessarily a finite union of rational intervals. It means that all usual open sets can be assembled from members of one countable family. The key local step is always the same: first use openness to obtain room around the point, then use rational density to put one rational endpoint on either side while staying within that room.

Check Your Understanding

For each question, distinguish the requirement that a rational interval contain the point from the separate requirement that the interval lie inside the open set.

  1. Find a rational-endpoint interval containing \(1/3\) and contained in \((0,1)\).
  2. Explain why density of \(\mathbb{Q}\) lets you choose one rational endpoint below \(x\) and another above \(x\) inside any open interval around \(x\).
  3. Is \((0,1)\) a member of \(\mathcal{B}_{\mathbb{Q}}\)? Give the reason.
  4. Describe \((1,2)\) as a union of rational-endpoint intervals contained in it.
  5. In the basis test, why does an interval with rational endpoints that contains \(x\) fail to suffice unless it is also contained in \(U\)?